diff options
author | Tejun Heo <tj@kernel.org> | 2010-07-02 04:03:50 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-07-02 04:03:50 -0400 |
commit | cb444766996395d4370bcc17ec895dd4e13ceb72 (patch) | |
tree | e682bd69dafadae8b27861888ec0802107d5a93a /block/blk-core.c | |
parent | fb0e7beb5c1b6fb4da786ba709d7138373d5fb22 (diff) |
workqueue: use worker_set/clr_flags() only from worker itself
worker_set/clr_flags() assume that if none of NOT_RUNNING flags is set
the worker must be contributing to nr_running which is only true if
the worker is actually running.
As when called from self, it is guaranteed that the worker is running,
those functions can be safely used from the worker itself and they
aren't necessary from other places anyway. Make the following changes
to fix the bug.
* Make worker_set/clr_flags() whine if not called from self.
* Convert all places which called those functions from other tasks to
manipulate flags directly.
* Make trustee_thread() directly clear nr_running after setting
WORKER_ROGUE on all workers. This is the only place where
nr_running manipulation is necessary outside of workers themselves.
* While at it, add sanity check for nr_running in worker_enter_idle().
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-core.c')
0 files changed, 0 insertions, 0 deletions