diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-09 23:32:15 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-01-11 15:33:01 +0100 |
commit | e159489baa717dbae70f9903770a6a4990865887 (patch) | |
tree | 6e2ae803ff6ebed558ebbe03bf3ae5bda1dd6ebc /kernel/sched_clock.c | |
parent | Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/... (diff) | |
download | linux-e159489baa717dbae70f9903770a6a4990865887.tar.xz linux-e159489baa717dbae70f9903770a6a4990865887.zip |
workqueue: relax lockdep annotation on flush_work()
Currently, the lockdep annotation in flush_work() requires exclusive
access on the workqueue the target work is queued on and triggers
warning if a work is trying to flush another work on the same
workqueue; however, this is no longer true as workqueues can now
execute multiple works concurrently.
This patch adds lock_map_acquire_read() and make process_one_work()
hold read access to the workqueue while executing a work and
start_flush_work() check for write access if concurrnecy level is one
or the workqueue has a rescuer (as only one execution resource - the
rescuer - is guaranteed to be available under memory pressure), and
read access if higher.
This better represents what's going on and removes spurious lockdep
warnings which are triggered by fake dependency chain created through
flush_work().
* Peter pointed out that flushing another work from a WQ_MEM_RECLAIM
wq breaks forward progress guarantee under memory pressure.
Condition check accordingly updated.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@kernel.org
Diffstat (limited to 'kernel/sched_clock.c')
0 files changed, 0 insertions, 0 deletions