diff options
author | Jason Baron <jbaron@redhat.com> | 2008-02-28 11:33:03 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-07-27 22:16:28 -0400 |
commit | 5c2aed622571ac7c3c6ec182d6d3c318e4b45c8b (patch) | |
tree | 0a3b422b16cd0725eebbe5047fd5482583279d8a /include/linux | |
parent | 15bba37d62351749c3915add81f673b256952ee1 (diff) |
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')
-rw-r--r-- | include/linux/stop_machine.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 5bfc553bdb21..18af011c13af 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -8,11 +8,17 @@ | |||
8 | #include <asm/system.h> | 8 | #include <asm/system.h> |
9 | 9 | ||
10 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 10 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
11 | |||
12 | #define ALL_CPUS ~0U | ||
13 | |||
11 | /** | 14 | /** |
12 | * stop_machine_run: freeze the machine on all CPUs and run this function | 15 | * stop_machine_run: freeze the machine on all CPUs and run this function |
13 | * @fn: the function to run | 16 | * @fn: the function to run |
14 | * @data: the data ptr for the @fn() | 17 | * @data: the data ptr for the @fn() |
15 | * @cpu: the cpu to run @fn() on (or any, if @cpu == NR_CPUS. | 18 | * @cpu: if @cpu == n, run @fn() on cpu n |
19 | * if @cpu == NR_CPUS, run @fn() on any cpu | ||
20 | * if @cpu == ALL_CPUS, run @fn() first on the calling cpu, and then | ||
21 | * concurrently on all the other cpus | ||
16 | * | 22 | * |
17 | * Description: This causes a thread to be scheduled on every other cpu, | 23 | * Description: This causes a thread to be scheduled on every other cpu, |
18 | * each of which disables interrupts, and finally interrupts are disabled | 24 | * each of which disables interrupts, and finally interrupts are disabled |