diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2012-08-22 11:27:34 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-09-23 10:44:50 -0400 |
commit | 0ee23fda59740767324b4340247ca41a2f498ca6 (patch) | |
tree | ff4a9a795f3b98fc81be46a427f37273a8b9b23c /arch/score | |
parent | fbe752188d5589e7fcbb8e79824e560f77dccc92 (diff) |
score: Add missing RCU idle APIs on idle loop
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 <paulmck@linux.vnet.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: <stable@vger.kernel.org> # 3.3+
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'arch/score')
-rw-r--r-- | arch/score/kernel/process.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c index 2707023c7563..637970cfd3f4 100644 --- a/arch/score/kernel/process.c +++ b/arch/score/kernel/process.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/reboot.h> | 27 | #include <linux/reboot.h> |
28 | #include <linux/elfcore.h> | 28 | #include <linux/elfcore.h> |
29 | #include <linux/pm.h> | 29 | #include <linux/pm.h> |
30 | #include <linux/rcupdate.h> | ||
30 | 31 | ||
31 | void (*pm_power_off)(void); | 32 | void (*pm_power_off)(void); |
32 | EXPORT_SYMBOL(pm_power_off); | 33 | EXPORT_SYMBOL(pm_power_off); |
@@ -50,9 +51,10 @@ void __noreturn cpu_idle(void) | |||
50 | { | 51 | { |
51 | /* endless idle loop with no priority at all */ | 52 | /* endless idle loop with no priority at all */ |
52 | while (1) { | 53 | while (1) { |
54 | rcu_idle_enter(); | ||
53 | while (!need_resched()) | 55 | while (!need_resched()) |
54 | barrier(); | 56 | barrier(); |
55 | 57 | rcu_idle_exit(); | |
56 | schedule_preempt_disabled(); | 58 | schedule_preempt_disabled(); |
57 | } | 59 | } |
58 | } | 60 | } |