]> git.baikalelectronics.ru Git - kernel.git/commit
reimplement flush_workqueue()
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 9 May 2007 09:33:51 +0000 (02:33 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:30:50 +0000 (12:30 -0700)
commitce0a6a199782175205c14289f99e4772b955661a
treeb8253b7e42245c9b21b959a77c8070ddcbc9359e
parentc654f7e17919845e3802d696802d53ae80eabbc8
reimplement flush_workqueue()

Remove ->remove_sequence, ->insert_sequence, and ->work_done from struct
cpu_workqueue_struct.  To implement flush_workqueue() we can queue a
barrier work on each CPU and wait for its completition.

The barrier is queued under workqueue_mutex to ensure that per cpu
wq->cpu_wq is alive, we drop this mutex before going to sleep.  If CPU goes
down while we are waiting for completition, take_over_work() will move the
barrier on another CPU, and the handler will wake up us eventually.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/workqueue.c