Check for critical work every swtch

上级 15145902
......@@ -86,6 +86,7 @@ void xfreework(void* ptr, unsigned long nbytes);
#if defined(XV6_KERNEL)
int wqcrit_push(work* w, int c);
void wqcrit_trywork(void);
#endif
#if defined(XV6_USER)
......
......@@ -11,6 +11,7 @@
#include "kmtrace.hh"
#include "sched.hh"
#include "vm.hh"
#include "wq.hh"
enum { sched_debug = 0 };
enum { steal_nonexec = 1 };
......@@ -30,6 +31,7 @@ post_swtch(void)
mycpu()->prev != idleproc())
addrun(mycpu()->prev);
release(&mycpu()->prev->lock);
wqcrit_trywork();
}
void
......
......@@ -33,6 +33,13 @@ wq_push(work *w)
return wq_->push(w, mycpuid());
}
void
wqcrit_trywork(void)
{
while (wqcrit_->trywork(false))
;
}
int
wqcrit_push(work *w, int c)
{
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论