Clean up some leftover cilk boogers

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