diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-15 12:36:06 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2011-11-14 11:01:52 -0600 |
commit | 625735eeea2dbebf7b31d21a9c87521e7b867e69 (patch) | |
tree | 11803c6a4982bc9b9264a840b0768931a92a15c7 /include | |
parent | e80f0713af418ab3e37ecbd6c56f525a97554ac5 (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; }) |