Tejun Heo 9398180097 workqueue: fix race condition in schedule_on_each_cpu()
Commit 65a64464349883891e21e74af16c05d6e1eeb4e9 ("HWPOISON: Allow
schedule_on_each_cpu() from keventd") which allows schedule_on_each_cpu()
to be called from keventd added a race condition.  schedule_on_each_cpu()
may race with cpu hotplug and end up executing the function twice on a
cpu.

Fix it by moving direct execution into the section protected with
get/put_online_cpus().  While at it, update code such that direct
execution is done after works have been scheduled for all other cpus and
drop unnecessary cpu != orig test from flush loop.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-11-17 17:40:33 -08:00
..
2009-09-21 14:29:21 +02:00
2009-06-24 00:02:38 -04:00
2009-10-29 07:39:25 -07:00
2009-09-18 09:48:52 -07:00
2008-10-16 11:21:30 -07:00
2009-06-16 19:47:48 -07:00
2009-08-29 14:10:07 +02:00
2008-07-28 14:37:38 +02:00
2009-09-19 13:13:17 -07:00
2009-05-15 07:56:24 -05:00
2009-07-24 10:53:29 +02:00
2009-01-14 18:09:02 +01:00
2009-06-18 13:03:56 -07:00
2009-10-29 08:56:20 +10:30
2008-09-02 19:21:40 -07:00
2009-10-07 08:11:20 +02:00
2009-09-23 07:39:41 -07:00
2009-07-12 14:03:27 -07:00
2009-09-23 18:13:10 -07:00
2009-11-02 16:02:39 +01:00
2009-06-18 13:03:55 -07:00