From: Greg Kroah-Hartman Date: Wed, 10 Oct 2012 00:24:59 +0000 (+0900) Subject: 3.4-stable patches X-Git-Tag: v3.0.46~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba694ab502b2a985dad9bd889a70e03cac88f54d;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: alpha-add-missing-rcu-idle-apis-on-idle-loop.patch cris-add-missing-rcu-idle-apis-on-idle-loop.patch frv-add-missing-rcu-idle-apis-on-idle-loop.patch h8300-add-missing-rcu-idle-apis-on-idle-loop.patch ia64-add-missing-rcu-idle-apis-on-idle-loop.patch m32r-add-missing-rcu-idle-apis-on-idle-loop.patch m68k-add-missing-rcu-idle-apis-on-idle-loop.patch mn10300-add-missing-rcu-idle-apis-on-idle-loop.patch parisc-add-missing-rcu-idle-apis-on-idle-loop.patch rcu-fix-day-one-dyntick-idle-stall-warning-bug.patch score-add-missing-rcu-idle-apis-on-idle-loop.patch xtensa-add-missing-rcu-idle-apis-on-idle-loop.patch --- diff --git a/queue-3.4/alpha-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/alpha-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..fe7b2f759b5 --- /dev/null +++ b/queue-3.4/alpha-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,63 @@ +From 4c94cada48f7c660eca582be6032427a5e367117 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: alpha: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 4c94cada48f7c660eca582be6032427a5e367117 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the Alpha's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Tested-by: Michael Cree +Cc: Richard Henderson +Cc: Ivan Kokshaysky +Cc: Matt Turner +Cc: alpha +Cc: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/alpha/kernel/process.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/alpha/kernel/process.c ++++ b/arch/alpha/kernel/process.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -54,8 +55,11 @@ cpu_idle(void) + /* FIXME -- EV6 and LCA45 know how to power down + the CPU. */ + ++ rcu_idle_enter(); + while (!need_resched()) + cpu_relax(); ++ ++ rcu_idle_exit(); + schedule(); + } + } diff --git a/queue-3.4/cris-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/cris-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..c304d6646ad --- /dev/null +++ b/queue-3.4/cris-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,65 @@ +From c633f9e788928e91ad11f44df29b47bbbe9550b0 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: cris: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit c633f9e788928e91ad11f44df29b47bbbe9550b0 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the Cris's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: Mikael Starvik +Cc: Jesper Nilsson +Cc: Cris +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/cris/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/cris/kernel/process.c ++++ b/arch/cris/kernel/process.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + //#define DEBUG + +@@ -102,6 +103,7 @@ void cpu_idle (void) + { + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) { + void (*idle)(void); + /* +@@ -114,6 +116,7 @@ void cpu_idle (void) + idle = default_idle; + idle(); + } ++ rcu_idle_exit(); + schedule_preempt_disabled(); + } + } diff --git a/queue-3.4/frv-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/frv-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..e70c74ba116 --- /dev/null +++ b/queue-3.4/frv-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,62 @@ +From 41d8fe5bb3cf91ce2716ac8f43e4b40d802a99c8 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: frv: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 41d8fe5bb3cf91ce2716ac8f43e4b40d802a99c8 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the Frv's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: David Howells +Acked-by: David Howells +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/frv/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/frv/kernel/process.c ++++ b/arch/frv/kernel/process.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -84,12 +85,14 @@ void cpu_idle(void) + { + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) { + check_pgt_cache(); + + if (!frv_dma_inprogress && idle) + idle(); + } ++ rcu_idle_exit(); + + schedule_preempt_disabled(); + } diff --git a/queue-3.4/h8300-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/h8300-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..8bf70ce3a51 --- /dev/null +++ b/queue-3.4/h8300-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,58 @@ +From b2fe1430d4115c74d007c825cb9dc3317f28bb16 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: h8300: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit b2fe1430d4115c74d007c825cb9dc3317f28bb16 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the h8300's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: Yoshinori Sato +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/h8300/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/h8300/kernel/process.c ++++ b/arch/h8300/kernel/process.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -78,8 +79,10 @@ void (*idle)(void) = default_idle; + void cpu_idle(void) + { + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) + idle(); ++ rcu_idle_exit(); + schedule_preempt_disabled(); + } + } diff --git a/queue-3.4/ia64-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/ia64-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..8b6060c88d0 --- /dev/null +++ b/queue-3.4/ia64-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,56 @@ +From 93482f4ef1093f5961a63359a34612183d6beea0 Mon Sep 17 00:00:00 2001 +From: "Paul E. McKenney" +Date: Fri, 24 Aug 2012 13:22:13 -0700 +Subject: ia64: Add missing RCU idle APIs on idle loop + +From: "Paul E. McKenney" + +commit 93482f4ef1093f5961a63359a34612183d6beea0 upstream. + +Traditionally, the entire idle task served as an RCU quiescent state. +But when RCU read side critical sections started appearing within the +idle loop, this traditional strategy became untenable. The fix was to +create new RCU APIs named rcu_idle_enter() and rcu_idle_exit(), which +must be called by each architecture's idle loop so that RCU can tell +when it is safe to ignore a given idle CPU. + +Unfortunately, this fix was never applied to ia64, a shortcoming remedied +by this commit. + +Reported by: Tony Luck +Signed-off-by: Paul E. McKenney +Signed-off-by: Paul E. McKenney +Tested by: Tony Luck +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/ia64/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/ia64/kernel/process.c ++++ b/arch/ia64/kernel/process.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -301,6 +302,7 @@ cpu_idle (void) + + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + if (can_do_pal_halt) { + current_thread_info()->status &= ~TS_POLLING; + /* +@@ -331,6 +333,7 @@ cpu_idle (void) + normal_xtp(); + #endif + } ++ rcu_idle_exit(); + schedule_preempt_disabled(); + check_pgt_cache(); + if (cpu_is_offline(cpu)) diff --git a/queue-3.4/m32r-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/m32r-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..7eaaa9293d6 --- /dev/null +++ b/queue-3.4/m32r-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,63 @@ +From 48ae077cfce72591b8fc80e1dcc87806f86fed7f Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: m32r: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 48ae077cfce72591b8fc80e1dcc87806f86fed7f upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the m32r's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: Hirokazu Takata +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/m32r/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/m32r/kernel/process.c ++++ b/arch/m32r/kernel/process.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -82,6 +83,7 @@ void cpu_idle (void) + { + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) { + void (*idle)(void) = pm_idle; + +@@ -90,6 +92,7 @@ void cpu_idle (void) + + idle(); + } ++ rcu_idle_exit(); + schedule_preempt_disabled(); + } + } diff --git a/queue-3.4/m68k-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/m68k-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..c5033ce04ad --- /dev/null +++ b/queue-3.4/m68k-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,59 @@ +From 5b57ba37e82a15f345a6a2eb8c01a2b2d94c5eeb Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: m68k: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 5b57ba37e82a15f345a6a2eb8c01a2b2d94c5eeb upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the m68k's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Acked-by: Geert Uytterhoeven +Cc: m68k +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/m68k/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/m68k/kernel/process.c ++++ b/arch/m68k/kernel/process.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -75,8 +76,10 @@ void cpu_idle(void) + { + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) + idle(); ++ rcu_idle_exit(); + schedule_preempt_disabled(); + } + } diff --git a/queue-3.4/mn10300-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/mn10300-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..891f9b17277 --- /dev/null +++ b/queue-3.4/mn10300-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,65 @@ +From 5b0753a90b7a98bc613c3767e9263a1a76d4f900 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: mn10300: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 5b0753a90b7a98bc613c3767e9263a1a76d4f900 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the mn10300's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: David Howells +Cc: Koichi Yasutake +Signed-off-by: Paul E. McKenney +Acked-by: David Howells +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mn10300/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/mn10300/kernel/process.c ++++ b/arch/mn10300/kernel/process.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -107,6 +108,7 @@ void cpu_idle(void) + { + /* endless idle loop with no priority at all */ + for (;;) { ++ rcu_idle_enter(); + while (!need_resched()) { + void (*idle)(void); + +@@ -121,6 +123,7 @@ void cpu_idle(void) + } + idle(); + } ++ rcu_idle_exit(); + + schedule_preempt_disabled(); + } diff --git a/queue-3.4/parisc-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/parisc-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..3cb16e61507 --- /dev/null +++ b/queue-3.4/parisc-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,60 @@ +From fbe752188d5589e7fcbb8e79824e560f77dccc92 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: parisc: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit fbe752188d5589e7fcbb8e79824e560f77dccc92 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the parisc's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: James E.J. Bottomley +Cc: Helge Deller +Cc: Parisc +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/parisc/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/parisc/kernel/process.c ++++ b/arch/parisc/kernel/process.c +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -69,8 +70,10 @@ void cpu_idle(void) + + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) + barrier(); ++ rcu_idle_exit(); + schedule_preempt_disabled(); + check_pgt_cache(); + } diff --git a/queue-3.4/rcu-fix-day-one-dyntick-idle-stall-warning-bug.patch b/queue-3.4/rcu-fix-day-one-dyntick-idle-stall-warning-bug.patch new file mode 100644 index 00000000000..5016fdd59e2 --- /dev/null +++ b/queue-3.4/rcu-fix-day-one-dyntick-idle-stall-warning-bug.patch @@ -0,0 +1,84 @@ +From a10d206ef1a83121ab7430cb196e0376a7145b22 Mon Sep 17 00:00:00 2001 +From: "Paul E. McKenney" +Date: Sat, 22 Sep 2012 13:55:30 -0700 +Subject: rcu: Fix day-one dyntick-idle stall-warning bug + +From: "Paul E. McKenney" + +commit a10d206ef1a83121ab7430cb196e0376a7145b22 upstream. + +Each grace period is supposed to have at least one callback waiting +for that grace period to complete. However, if CONFIG_NO_HZ=n, an +extra callback-free grace period is no big problem -- it will chew up +a tiny bit of CPU time, but it will complete normally. In contrast, +CONFIG_NO_HZ=y kernels have the potential for all the CPUs to go to +sleep indefinitely, in turn indefinitely delaying completion of the +callback-free grace period. Given that nothing is waiting on this grace +period, this is also not a problem. + +That is, unless RCU CPU stall warnings are also enabled, as they are +in recent kernels. In this case, if a CPU wakes up after at least one +minute of inactivity, an RCU CPU stall warning will result. The reason +that no one noticed until quite recently is that most systems have enough +OS noise that they will never remain absolutely idle for a full minute. +But there are some embedded systems with cut-down userspace configurations +that consistently get into this situation. + +All this begs the question of exactly how a callback-free grace period +gets started in the first place. This can happen due to the fact that +CPUs do not necessarily agree on which grace period is in progress. +If a CPU still believes that the grace period that just completed is +still ongoing, it will believe that it has callbacks that need to wait for +another grace period, never mind the fact that the grace period that they +were waiting for just completed. This CPU can therefore erroneously +decide to start a new grace period. Note that this can happen in +TREE_RCU and TREE_PREEMPT_RCU even on a single-CPU system: Deadlock +considerations mean that the CPU that detected the end of the grace +period is not necessarily officially informed of this fact for some time. + +Once this CPU notices that the earlier grace period completed, it will +invoke its callbacks. It then won't have any callbacks left. If no +other CPU has any callbacks, we now have a callback-free grace period. + +This commit therefore makes CPUs check more carefully before starting a +new grace period. This new check relies on an array of tail pointers +into each CPU's list of callbacks. If the CPU is up to date on which +grace periods have completed, it checks to see if any callbacks follow +the RCU_DONE_TAIL segment, otherwise it checks to see if any callbacks +follow the RCU_WAIT_TAIL segment. The reason that this works is that +the RCU_WAIT_TAIL segment will be promoted to the RCU_DONE_TAIL segment +as soon as the CPU is officially notified that the old grace period +has ended. + +This change is to cpu_needs_another_gp(), which is called in a number +of places. The only one that really matters is in rcu_start_gp(), where +the root rcu_node structure's ->lock is held, which prevents any +other CPU from starting or completing a grace period, so that the +comparison that determines whether the CPU is missing the completion +of a grace period is stable. + +Reported-by: Becky Bruce +Reported-by: Subodh Nijsure +Reported-by: Paul Walmsley +Signed-off-by: Paul E. McKenney +Signed-off-by: Paul E. McKenney +Tested-by: Paul Walmsley # OMAP3730, OMAP4430 +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/rcutree.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/rcutree.c ++++ b/kernel/rcutree.c +@@ -295,7 +295,9 @@ cpu_has_callbacks_ready_to_invoke(struct + static int + cpu_needs_another_gp(struct rcu_state *rsp, struct rcu_data *rdp) + { +- return *rdp->nxttail[RCU_DONE_TAIL] && !rcu_gp_in_progress(rsp); ++ return *rdp->nxttail[RCU_DONE_TAIL + ++ ACCESS_ONCE(rsp->completed) != rdp->completed] && ++ !rcu_gp_in_progress(rsp); + } + + /* diff --git a/queue-3.4/score-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/score-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..a3514b17629 --- /dev/null +++ b/queue-3.4/score-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,60 @@ +From 0ee23fda59740767324b4340247ca41a2f498ca6 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: score: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 0ee23fda59740767324b4340247ca41a2f498ca6 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in scores's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: Chen Liqin +Cc: Lennox Wu +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/score/kernel/process.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/score/kernel/process.c ++++ b/arch/score/kernel/process.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + void (*pm_power_off)(void); + EXPORT_SYMBOL(pm_power_off); +@@ -50,9 +51,10 @@ void __noreturn cpu_idle(void) + { + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) + barrier(); +- ++ rcu_idle_exit(); + schedule_preempt_disabled(); + } + } diff --git a/queue-3.4/series b/queue-3.4/series index a4dbda94a2e..02d66177a48 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -84,3 +84,15 @@ drm-destroy-the-planes-prior-to-destroying-the-associated-crtc.patch drm-radeon-only-adjust-default-clocks-on-ni-gpus.patch drm-radeon-add-msi-quirk-for-gateway-rs690.patch drm-radeon-force-msis-on-rs690-asics.patch +ia64-add-missing-rcu-idle-apis-on-idle-loop.patch +h8300-add-missing-rcu-idle-apis-on-idle-loop.patch +parisc-add-missing-rcu-idle-apis-on-idle-loop.patch +xtensa-add-missing-rcu-idle-apis-on-idle-loop.patch +frv-add-missing-rcu-idle-apis-on-idle-loop.patch +mn10300-add-missing-rcu-idle-apis-on-idle-loop.patch +m68k-add-missing-rcu-idle-apis-on-idle-loop.patch +alpha-add-missing-rcu-idle-apis-on-idle-loop.patch +cris-add-missing-rcu-idle-apis-on-idle-loop.patch +m32r-add-missing-rcu-idle-apis-on-idle-loop.patch +score-add-missing-rcu-idle-apis-on-idle-loop.patch +rcu-fix-day-one-dyntick-idle-stall-warning-bug.patch diff --git a/queue-3.4/xtensa-add-missing-rcu-idle-apis-on-idle-loop.patch b/queue-3.4/xtensa-add-missing-rcu-idle-apis-on-idle-loop.patch new file mode 100644 index 00000000000..28466cac830 --- /dev/null +++ b/queue-3.4/xtensa-add-missing-rcu-idle-apis-on-idle-loop.patch @@ -0,0 +1,58 @@ +From 11ad47a0edbd62bfc0547cfcdf227a911433f207 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Wed, 22 Aug 2012 17:27:34 +0200 +Subject: xtensa: Add missing RCU idle APIs on idle loop + +From: Frederic Weisbecker + +commit 11ad47a0edbd62bfc0547cfcdf227a911433f207 upstream. + +In the old times, the whole idle task was considered +as an RCU quiescent state. But as RCU became more and +more successful overtime, some RCU read side critical +section have been added even in the code of some +architectures idle tasks, for tracing for example. + +So nowadays, rcu_idle_enter() and rcu_idle_exit() must +be called by the architecture to tell RCU about the part +in the idle loop that doesn't make use of rcu read side +critical sections, typically the part that puts the CPU +in low power mode. + +This is necessary for RCU to find the quiescent states in +idle in order to complete grace periods. + +Add this missing pair of calls in the xtensa's idle loop. + +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Cc: Chris Zankel +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + arch/xtensa/kernel/process.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/xtensa/kernel/process.c ++++ b/arch/xtensa/kernel/process.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -110,8 +111,10 @@ void cpu_idle(void) + + /* endless idle loop with no priority at all */ + while (1) { ++ rcu_idle_enter(); + while (!need_resched()) + platform_idle(); ++ rcu_idle_exit(); + schedule_preempt_disabled(); + } + }