]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] add schedule_on_each_cpu()
authorChristoph Lameter <clameter@engr.sgi.com>
Sun, 8 Jan 2006 09:00:43 +0000 (01:00 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 04:12:40 +0000 (20:12 -0800)
commit910b7828c12a2681f1daa0d3ec5b9fa1f89f3815
treec6190bdcc6e15fd8b5657a5932313e296b475577
parent8dec50993c2f6f4d8577ee93ac6dffabd769d849
[PATCH] add schedule_on_each_cpu()

swap migration's isolate_lru_page() currently uses an IPI to notify other
processors that the lru caches need to be drained if the page cannot be
found on the LRU.  The IPI interrupt may interrupt a processor that is just
processing lru requests and cause a race condition.

This patch introduces a new function run_on_each_cpu() that uses the
keventd() to run the LRU draining on each processor.  Processors disable
preemption when dealing the LRU caches (these are per processor) and thus
executing LRU draining from another process is safe.

Thanks to Lee Schermerhorn <lee.schermerhorn@hp.com> for finding this race
condition.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/workqueue.h
kernel/workqueue.c