[rt] fix locking when taking down a CPU
svn path=/dists/sid/linux-2.6/; revision=18798
This commit is contained in:
parent
16ea18a2b8
commit
9ebb40a097
|
@ -1,3 +1,9 @@
|
|||
linux-2.6 (3.2.9-2) UNRELEASED; urgency=low
|
||||
|
||||
* [rt] fix locking when taking down a CPU
|
||||
|
||||
-- Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tue, 06 Mar 2012 09:26:00 +0100
|
||||
|
||||
linux-2.6 (3.2.9-1) unstable; urgency=high
|
||||
|
||||
* New upstream stable update:
|
||||
|
|
|
@ -18,8 +18,11 @@ Cc: Clark Williams <clark.williams@gmail.com>
|
|||
Cc: stable-rt@vger.kernel.org
|
||||
Link: http://lkml.kernel.org/r/1330702617.25686.265.camel@gandalf.stny.rr.com
|
||||
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
||||
---
|
||||
[ukleinek: squash in an obvious fix by Steven Rostedt
|
||||
id:1330985640.25686.342.camel@gandalf.stny.rr.com]
|
||||
diff --git a/kernel/cpu.c b/kernel/cpu.c
|
||||
index fa40834..c25b5ff 100644
|
||||
index fa40834..66dfb74 100644
|
||||
--- a/kernel/cpu.c
|
||||
+++ b/kernel/cpu.c
|
||||
@@ -46,7 +46,12 @@ static int cpu_hotplug_disabled;
|
||||
|
@ -35,16 +38,24 @@ index fa40834..c25b5ff 100644
|
|||
/*
|
||||
* Also blocks the new readers during
|
||||
* an ongoing cpu hotplug operation.
|
||||
@@ -58,6 +63,14 @@ static struct {
|
||||
@@ -54,10 +59,22 @@ static struct {
|
||||
int refcount;
|
||||
} cpu_hotplug = {
|
||||
.active_writer = NULL,
|
||||
+#ifdef CONFIG_PREEMPT_RT_FULL
|
||||
+ .lock = __SPIN_LOCK_UNLOCKED(cpu_hotplug.lock),
|
||||
+#else
|
||||
.lock = __MUTEX_INITIALIZER(cpu_hotplug.lock),
|
||||
+#endif
|
||||
.refcount = 0,
|
||||
};
|
||||
|
||||
+#ifdef CONFIG_PREEMPT_RT_FULL
|
||||
+# define hotplug_lock() spin_lock(&cpu_hotplug.lock)
|
||||
+# define hotplug_unlock() spin_unlock(&cpu_hotplug.lock)
|
||||
+# define hotplug_lock() rt_spin_lock(&cpu_hotplug.lock)
|
||||
+# define hotplug_unlock() rt_spin_unlock(&cpu_hotplug.lock)
|
||||
+#else
|
||||
+# define hotplug_lock() mutex_lock(&cpu_hotplug.lock)
|
||||
+# define hotplug_lock() mutex_unlock(&cpu_hotplug.lock)
|
||||
+# define hotplug_unlock() mutex_unlock(&cpu_hotplug.lock)
|
||||
+#endif
|
||||
+
|
||||
struct hotplug_pcp {
|
||||
|
|
Loading…
Reference in New Issue