Skip to content

Commit ac1c02f

Browse files
fweisbecgregkh
authored andcommitted
m32r: Add missing RCU idle APIs on idle loop
commit 48ae077 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 <paulmck@linux.vnet.ibm.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ce47daf commit ac1c02f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/m32r/kernel/process.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/ptrace.h>
2727
#include <linux/unistd.h>
2828
#include <linux/hardirq.h>
29+
#include <linux/rcupdate.h>
2930

3031
#include <asm/io.h>
3132
#include <asm/uaccess.h>
@@ -82,6 +83,7 @@ void cpu_idle (void)
8283
{
8384
/* endless idle loop with no priority at all */
8485
while (1) {
86+
rcu_idle_enter();
8587
while (!need_resched()) {
8688
void (*idle)(void) = pm_idle;
8789

@@ -90,6 +92,7 @@ void cpu_idle (void)
9092

9193
idle();
9294
}
95+
rcu_idle_exit();
9396
schedule_preempt_disabled();
9497
}
9598
}

0 commit comments

Comments
 (0)