Sleep on block requests using kthreads
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 26 Oct 2010 22:02:30 +0000 (15:02 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:56 +0000 (17:35 -0700)
commitc0251e4b62ecb55c6d95c5c8f0711cb61f3409e7
treed367945ea43b6e6d29113429ac7e0d7f95820720
parent5b8ba8913291f8448aaa5dd269a3c7cf0454a3cf
Sleep on block requests using kthreads

There's a bunch of complications, and also note that the page cache's
page_lock doesn't sleep yet - this is just the breq itself.

There will likely be issues with where and on who's core we run
kthreads.  For now, it works.  Likewise, there are potential issues with
schedule returning (the old concern was running off the stack) and how
we wait for IO.  Right now, we have a couple ghetto hacks to prevent us
from being in the monitor when an IO (aka timer interrupt) finishes.

Also, note KVM's sense of time with set_core_timer() seems off.  We
shouldn't have to wait 10s of ms to go through a couple function calls.
It might be using the real core's timer instead of the emulated timer.
Whoever works on the time infrastructure ought to take a look at that.
Documentation/kthreads.txt
kern/include/blockdev.h
kern/include/kthread.h
kern/include/process.h
kern/src/blockdev.c
kern/src/ext2fs.c
kern/src/kthread.c
kern/src/manager.c
kern/src/process.c
kern/src/schedule.c
kern/src/smp.c