summaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorPeter Zijlstra2013-10-07 12:29:15 +0200
committerIngo Molnar2013-10-09 12:40:45 +0200
commit1be0bd77c5dd7c903f46abf52f9a3650face3c1d (patch)
treee8b2a6c742951e8a9f98a53a285ab85b79437e4d /include/linux/sched.h
parentmm: numa: Trap pmd hinting faults only if we would otherwise trap PTE faults (diff)
downloadkernel-qcow2-linux-1be0bd77c5dd7c903f46abf52f9a3650face3c1d.tar.gz
kernel-qcow2-linux-1be0bd77c5dd7c903f46abf52f9a3650face3c1d.tar.xz
kernel-qcow2-linux-1be0bd77c5dd7c903f46abf52f9a3650face3c1d.zip
stop_machine: Introduce stop_two_cpus()
Introduce stop_two_cpus() in order to allow controlled swapping of two tasks. It repurposes the stop_machine() state machine but only stops the two cpus which we can do with on-stack structures and avoid machine wide synchronization issues. The ordering of CPUs is important to avoid deadlocks. If unordered then two cpus calling stop_two_cpus on each other simultaneously would attempt to queue in the opposite order on each CPU causing an AB-BA style deadlock. By always having the lowest number CPU doing the queueing of works, we can guarantee that works are always queued in the same order, and deadlocks are avoided. Signed-off-by: Peter Zijlstra <peterz@infradead.org> [ Implemented deadlock avoidance. ] Signed-off-by: Rik van Riel <riel@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Mel Gorman <mgorman@suse.de> Link: http://lkml.kernel.org/r/1381141781-10992-38-git-send-email-mgorman@suse.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
0 files changed, 0 insertions, 0 deletions