stop_machine: add ALL_CPUS option

Previous thread: module: fix build warning with !CONFIG_KALLSYMS by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:05 am. (1 message)

Next thread: Hotplug CPU: don't check cpu_online after take_cpu_down by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:05 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 10:05 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c2aed...
Commit:     5c2aed622571ac7c3c6ec182d6d3c318e4b45c8b
Parent:     15bba37d62351749c3915add81f673b256952ee1
Author:     Jason Baron <jbaron@redhat.com>
AuthorDate: Thu Feb 28 11:33:03 2008 -0500
Committer:  Rusty Russell <rusty@rustcorp.com.au>
CommitDate: Mon Jul 28 12:16:28 2008 +1000

    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
---
 include/linux/stop_machine.h |    8 +++++++-
 kernel/stop_machine.c        |   32 +++++++++++++++++++++++++-------
 2 files changed, 32 insertions(+), 8 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
+ *       ...
Previous thread: module: fix build warning with !CONFIG_KALLSYMS by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:05 am. (1 message)

Next thread: Hotplug CPU: don't check cpu_online after take_cpu_down by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:05 am. (1 message)