summaryrefslogtreecommitdiffstats
path: root/include/linux/stop_machine.h
diff options
context:
space:
mode:
authorJason Baron <jbaron@redhat.com>2008-02-28 11:33:03 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-07-28 12:16:28 +1000
commit5c2aed622571ac7c3c6ec182d6d3c318e4b45c8b (patch)
tree0a3b422b16cd0725eebbe5047fd5482583279d8a /include/linux/stop_machine.h
parent15bba37d62351749c3915add81f673b256952ee1 (diff)
downloadop-kernel-dev-5c2aed622571ac7c3c6ec182d6d3c318e4b45c8b.zip
op-kernel-dev-5c2aed622571ac7c3c6ec182d6d3c318e4b45c8b.tar.gz
stop_machine: add ALL_CPUS option
-allow stop_mahcine_run() to call a function on all cpus. Calling stop_machine_run() with a 'ALL_CPUS' invokes this new behavior. stop_machine_run() proceeds as normal until the calling cpu has invoked 'fn'. Then, we tell all the other cpus to call 'fn'. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> CC: Adrian Bunk <bunk@stusta.de> CC: Andi Kleen <andi@firstfloor.org> CC: Alexey Dobriyan <adobriyan@gmail.com> CC: Christoph Hellwig <hch@infradead.org> CC: mingo@elte.hu CC: akpm@osdl.org
Diffstat (limited to 'include/linux/stop_machine.h')
-rw-r--r--include/linux/stop_machine.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 5bfc553..18af011 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -8,11 +8,17 @@
#include <asm/system.h>
#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
+
+#define ALL_CPUS ~0U
+
/**
* stop_machine_run: freeze the machine on all CPUs and run this function
* @fn: the function to run
* @data: the data ptr for the @fn()
- * @cpu: the cpu to run @fn() on (or any, if @cpu == NR_CPUS.
+ * @cpu: if @cpu == n, run @fn() on cpu n
+ * if @cpu == NR_CPUS, run @fn() on any cpu
+ * if @cpu == ALL_CPUS, run @fn() first on the calling cpu, and then
+ * concurrently on all the other cpus
*
* Description: This causes a thread to be scheduled on every other cpu,
* each of which disables interrupts, and finally interrupts are disabled
OpenPOWER on IntegriCloud