Clean up some leftover cilk boogers

上级 275a8c9f
......@@ -302,7 +302,6 @@ void initbio(void);
void initinode(void);
void initdisk(void);
void inituser(void);
void initcilk(void);
void initsamp(void);
void initpci(void);
void initnet(void);
......
// cilk style run queue
// A work queue is built from NCPU per-core wqueues.
// A core pushes work to the head of its per-core wqueue.
// A core pops work from the head of its per-core wqueue.
// A core pops work from the tail of another core's per-core wqueue.
// cilk style run queue built on wq.cc:
// A core pushes work to the head of its per-core wq.
// A core pops work from the head of its per-core wq.
// A core pops work from the tail of another core's per-core wqueue.
//
// Usage:
// void goo(uptr a0, uptr a1) {
......@@ -37,35 +36,14 @@
#include "proc.hh"
#include "mtrace.h"
#include "wq.hh"
#define NSLOTS (1 << CILKSHIFT)
struct cilkqueue {
struct cilkthread *thread[NSLOTS];
volatile int head __mpalign__;
struct spinlock lock;
volatile int tail;
__padout__;
} __mpalign__;
struct cilkthread {
u64 rip;
u64 arg0;
u64 arg1;
struct cilkframe *frame; // parent cilkframe
__padout__;
} __mpalign__;
#include "percpu.hh"
struct cilkstat {
u64 push;
u64 full;
u64 steal;
__padout__;
} __mpalign__;
static struct cilkqueue queue[NCPU] __mpalign__;
static struct cilkstat stat[NCPU] __mpalign__;
};
static percpu<cilkstat> stat;
static struct cilkframe *
cilk_frame(void)
......@@ -73,12 +51,6 @@ cilk_frame(void)
return mycpu()->cilkframe;
}
static struct cilkstat *
cilk_stat(void)
{
return &stat[mycpu()->id];
}
static void
__cilk_run(struct work *w, void *xfn, void *arg0, void *arg1, void *xframe)
{
......@@ -87,7 +59,7 @@ __cilk_run(struct work *w, void *xfn, void *arg0, void *arg1, void *xframe)
struct cilkframe *old = mycpu()->cilkframe;
if (old != frame)
cilk_stat()->steal++;
stat->steal++;
mycpu()->cilkframe = frame;
fn((uptr)arg0, (uptr)arg1);
......@@ -117,10 +89,10 @@ cilk_push(void (*fn)(uptr, uptr), u64 arg0, u64 arg1)
if (wq_push(w)) {
freework(w);
fn(arg0, arg1);
cilk_stat()->full++;
stat->full++;
} else {
cilk_frame()->ref++;
cilk_stat()->push++;
stat->push++;
}
}
......@@ -195,13 +167,4 @@ initcilkframe(struct cilkframe *cilk)
{
memset(cilk, 0, sizeof(*cilk));
}
void
initcilk(void)
{
int i;
for (i = 0; i < NCPU; i++)
initlock(&queue[i].lock, "queue lock", LOCKSTAT_CILK);
}
#endif // CILKENABLE
......@@ -89,9 +89,6 @@ cmain(u64 mbmagic, u64 mbaddr)
initinode(); // inode cache
initdisk(); // disk
initwq();
#if CILKENABLE
initcilk();
#endif
initsamp();
initlockstat();
initpci();
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论