flush_cpu_workqueue: don't flush an empty ->worklist
commit83c22520c51bf67529367e8237f95c03fe44e2da
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 9 May 2007 09:33:54 +0000 (9 02:33 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:30:51 +0000 (9 12:30 -0700)
treed9798e4f60551bdad0f7d8f1f1d5c69d7c4214c1
parentedab2516a6c1752e8e5e3d55727cabf12346e5df
flush_cpu_workqueue: don't flush an empty ->worklist

Now when we have ->current_work we can avoid adding a barrier and waiting
for its completition when cwq's queue is empty.

Note: this change is also useful if we change flush_workqueue() to also
check the dead CPUs.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Gautham Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/workqueue.c