aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ibmasm/module.c
diff options
context:
space:
mode:
authorOleg Nesterov <[email protected]>2007-07-17 11:03:55 +0000
committerLinus Torvalds <[email protected]>2007-07-17 17:23:03 +0000
commit13c22168b7276dffe49dc66675d5a78f6d288e0d (patch)
tree4062929954f04db9c24be08cba94a0ed6e7fd65f /drivers/misc/ibmasm/module.c
parentKprobes on select architectures no longer EXPERIMENTAL (diff)
downloadkernel-13c22168b7276dffe49dc66675d5a78f6d288e0d.tar.gz
kernel-13c22168b7276dffe49dc66675d5a78f6d288e0d.zip
destroy_workqueue() can livelock
Pointed out by Michal Schmidt <[email protected]>. The bug was introduced in 2.6.22 by me. cleanup_workqueue_thread() does flush_cpu_workqueue(cwq) in a loop until ->worklist becomes empty. This is live-lockable, a re-niced caller can get CPU after wake_up() and insert a new barrier before the lower-priority cwq->thread has a chance to clear ->current_work. Change cleanup_workqueue_thread() to do flush_cpu_workqueue(cwq) only once. We can rely on the fact that run_workqueue() won't return until it flushes all works. So it is safe to call kthread_stop() after that, the "should stop" request won't be noticed until run_workqueue() returns. Signed-off-by: Oleg Nesterov <[email protected]> Cc: Michal Schmidt <[email protected]> Cc: Srivatsa Vaddagiri <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/misc/ibmasm/module.c')
0 files changed, 0 insertions, 0 deletions