RCU, RCU-bh, and RCU-sched read-side critical sections are forbidden in the inner idle loop, that is, between the rcu_idle_enter() and the rcu_idle_exit() -- RCU will happily ignore any such read-side critical sections. However, things like powertop need tracepoints in the inner idle loop. This commit therefore provides an RCU_NONIDLE() macro that can be used to wrap code in the idle loop that requires RCU read-side critical sections.
Showing the changes to kernel (2 of 3 files). Show all
Unified · Split
| @@ -97,6 +97,7 @@ void rcu_idle_enter(void) · 96 unmodified lines | |||
| 97 | rcu_idle_enter_common(oldval); | 97 | rcu_idle_enter_common(oldval); |
| 98 | local_irq_restore(flags); | 98 | local_irq_restore(flags); |
| 99 | } | 99 | } |
| 100 | EXPORT_SYMBOL_GPL(rcu_idle_enter); | ||
| 100 | 101 | ||
| 101 | /* | 102 | /* |
| 102 | * Exit an interrupt handler towards idle. | 103 | * Exit an interrupt handler towards idle. |
| @@ -153,6 +154,7 @@ void rcu_idle_exit(void) · 50 unmodified lines | |||
| 153 | rcu_idle_exit_common(oldval); | 154 | rcu_idle_exit_common(oldval); |
| 154 | local_irq_restore(flags); | 155 | local_irq_restore(flags); |
| 155 | } | 156 | } |
| 157 | EXPORT_SYMBOL_GPL(rcu_idle_exit); | ||
| 156 | 158 | ||
| 157 | /* | 159 | /* |
| 158 | * Enter an interrupt handler, moving away from idle. | 160 | * Enter an interrupt handler, moving away from idle. |
| @@ -402,6 +402,7 @@ void rcu_idle_enter(void) · 401 unmodified lines | |||
| 402 | rcu_idle_enter_common(rdtp, oldval); | 402 | rcu_idle_enter_common(rdtp, oldval); |
| 403 | local_irq_restore(flags); | 403 | local_irq_restore(flags); |
| 404 | } | 404 | } |
| 405 | EXPORT_SYMBOL_GPL(rcu_idle_enter); | ||
| 405 | 406 | ||
| 406 | /** | 407 | /** |
| 407 | * rcu_irq_exit - inform RCU that current CPU is exiting irq towards idle | 408 | * rcu_irq_exit - inform RCU that current CPU is exiting irq towards idle |
| @@ -493,6 +494,7 @@ void rcu_idle_exit(void) · 85 unmodified lines | |||
| 493 | rcu_idle_exit_common(rdtp, oldval); | 494 | rcu_idle_exit_common(rdtp, oldval); |
| 494 | local_irq_restore(flags); | 495 | local_irq_restore(flags); |
| 495 | } | 496 | } |
| 497 | EXPORT_SYMBOL_GPL(rcu_idle_exit); | ||
| 496 | 498 | ||
| 497 | /** | 499 | /** |
| 498 | * rcu_irq_enter - inform RCU that current CPU is entering irq away from idle | 500 | * rcu_irq_enter - inform RCU that current CPU is entering irq away from idle |