diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-15 12:36:06 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-03-24 10:26:48 -0500 |
commit | 94e0b2336ec2ddf0c5b2cc7a522a72f07a99f474 (patch) | |
tree | fa5151ef664a3d5f1675f9960db998378a650bfe /include | |
parent | 4542ec610da5870e3076572492d0e3c427d21c2e (diff) |
hotplug: Lightweight get online cpus
get_online_cpus() is a heavy weight function which involves a global
mutex. migrate_disable() wants a simpler construct which prevents only
a CPU from going doing while a task is in a migrate disabled section.
Implement a per cpu lockless mechanism, which serializes only in the
real unplug case on a global mutex. That serialization affects only
tasks on the cpu which should be brought down.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpu.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 6cb60fd2ea84..c46ec3ecd661 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -167,6 +167,8 @@ extern struct sysdev_class cpu_sysdev_class; extern void get_online_cpus(void); extern void put_online_cpus(void); +extern void pin_current_cpu(void); +extern void unpin_current_cpu(void); #define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) @@ -189,6 +191,8 @@ static inline void cpu_hotplug_driver_unlock(void) #define get_online_cpus() do { } while (0) #define put_online_cpus() do { } while (0) +static inline void pin_current_cpu(void) { } +static inline void unpin_current_cpu(void) { } #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) /* These aren't inline functions due to a GCC bug. */ #define register_hotcpu_notifier(nb) ({ (void)(nb); 0; }) |