• C
    [PATCH] add schedule_on_each_cpu() · 15316ba8
    Christoph Lameter 提交于
    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: NChristoph Lameter <clameter@sgi.com>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    15316ba8
workqueue.h 2.6 KB