summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-12-25 10:04:23 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2016-12-25 10:04:23 -0500
commit851c61bd076075bc185998116db10947a32443a8 (patch)
tree91384ec6325a6c37dbb3ed93fbf4a5f27f760f15
parentcaf831fdc67bd128858650c19eb1354672507677 (diff)
download4.9-rt-patches-851c61bd076075bc185998116db10947a32443a8.tar.gz
stop-machine: import refresh w/ lglock chunk gone; needs revisit
-rw-r--r--patches/stop-machine-raw-lock.patch43
1 files changed, 30 insertions, 13 deletions
diff --git a/patches/stop-machine-raw-lock.patch b/patches/stop-machine-raw-lock.patch
index f52693b1a464d7..412d5bc41d4b72 100644
--- a/patches/stop-machine-raw-lock.patch
+++ b/patches/stop-machine-raw-lock.patch
@@ -6,12 +6,12 @@ Use raw-locks in stomp_machine() to allow locking in irq-off regions.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
- kernel/stop_machine.c | 24 ++++++++++++------------
- 1 file changed, 12 insertions(+), 12 deletions(-)
+ kernel/stop_machine.c | 34 +++++++++++++---------------------
+ 1 file changed, 13 insertions(+), 21 deletions(-)
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
-@@ -37,7 +37,7 @@ struct cpu_stop_done {
+@@ -36,7 +36,7 @@ struct cpu_stop_done {
struct cpu_stopper {
struct task_struct *thread;
@@ -20,7 +20,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
bool enabled; /* is this stopper enabled? */
struct list_head works; /* list of pending works */
-@@ -83,14 +83,14 @@ static bool cpu_stop_queue_work(unsigned
+@@ -78,14 +78,14 @@ static bool cpu_stop_queue_work(unsigned
unsigned long flags;
bool enabled;
@@ -37,10 +37,10 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
return enabled;
}
-@@ -232,8 +232,8 @@ static int cpu_stop_queue_two_works(int
+@@ -231,8 +231,8 @@ static int cpu_stop_queue_two_works(int
+ struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2);
int err;
-
- lg_double_lock(&stop_cpus_lock, cpu1, cpu2);
+ retry:
- spin_lock_irq(&stopper1->lock);
- spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING);
+ raw_spin_lock_irq(&stopper1->lock);
@@ -48,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
err = -ENOENT;
if (!stopper1->enabled || !stopper2->enabled)
-@@ -243,8 +243,8 @@ static int cpu_stop_queue_two_works(int
+@@ -255,8 +255,8 @@ static int cpu_stop_queue_two_works(int
__cpu_stop_queue_work(stopper1, work1);
__cpu_stop_queue_work(stopper2, work2);
unlock:
@@ -56,10 +56,10 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
- spin_unlock_irq(&stopper1->lock);
+ raw_spin_unlock(&stopper2->lock);
+ raw_spin_unlock_irq(&stopper1->lock);
- lg_double_unlock(&stop_cpus_lock, cpu1, cpu2);
- return err;
-@@ -433,9 +433,9 @@ static int cpu_stop_should_run(unsigned
+ if (unlikely(err == -EDEADLK)) {
+ while (stop_cpus_in_progress)
+@@ -448,9 +448,9 @@ static int cpu_stop_should_run(unsigned
unsigned long flags;
int run;
@@ -71,7 +71,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
return run;
}
-@@ -446,13 +446,13 @@ static void cpu_stopper_thread(unsigned
+@@ -461,13 +461,13 @@ static void cpu_stopper_thread(unsigned
repeat:
work = NULL;
@@ -87,7 +87,24 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
if (work) {
cpu_stop_fn_t fn = work->fn;
-@@ -536,7 +536,7 @@ static int __init cpu_stop_init(void)
+@@ -475,15 +475,7 @@ static void cpu_stopper_thread(unsigned
+ struct cpu_stop_done *done = work->done;
+ int ret;
+
+- /*
+- * Wait until the stopper finished scheduling on all
+- * cpus
+- */
+- lg_global_lock(&stop_cpus_lock);
+- /*
+- * Let other cpu threads continue as well
+- */
+- lg_global_unlock(&stop_cpus_lock);
++ /* XXX */
+
+ /* cpu stop callbacks must not sleep, make in_atomic() == T */
+ preempt_count_inc();
+@@ -551,7 +543,7 @@ static int __init cpu_stop_init(void)
for_each_possible_cpu(cpu) {
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);