diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-15 12:36:06 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-04-10 16:40:36 -0500 |
commit | 2d24fb8cb73d91719a04c718349a366a4f00d220 (patch) | |
tree | ad8257df1f9779ca93c2dadb316890d29acc65a5 /include | |
parent | 1dc9a74825c15c3d488f4224882cb3b90675476b (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 ee28844ae68e..00d2f6f8d43a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -176,6 +176,8 @@ extern struct bus_type cpu_subsys; 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) @@ -198,6 +200,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; }) |