History

rcu: Add RCU_NONIDLE() for idle-loop RCU read-side critical sections

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.

Paul E. McKenney committed 14 years ago

Commit 8a2ecf41 parent 29e37d83 files · +31 −0Browse files

Showing the changes to kernel (2 of 3 files). Show all

Unified · Split

2 files
  1. kernel/rcutiny.c +2 −0
  2. kernel/rcutree.c +2 −0
kernel/rcutiny.c+2−0
@@ -97,6 +97,7 @@ void rcu_idle_enter(void) · 96 unmodified lines
9797 rcu_idle_enter_common(oldval);
9898 local_irq_restore(flags);
9999 }
100+EXPORT_SYMBOL_GPL(rcu_idle_enter);
100101
101102 /*
102103 * Exit an interrupt handler towards idle.
@@ -153,6 +154,7 @@ void rcu_idle_exit(void) · 50 unmodified lines
153154 rcu_idle_exit_common(oldval);
154155 local_irq_restore(flags);
155156 }
157+EXPORT_SYMBOL_GPL(rcu_idle_exit);
156158
157159 /*
158160 * Enter an interrupt handler, moving away from idle.
kernel/rcutree.c+2−0
@@ -402,6 +402,7 @@ void rcu_idle_enter(void) · 401 unmodified lines
402402 rcu_idle_enter_common(rdtp, oldval);
403403 local_irq_restore(flags);
404404 }
405+EXPORT_SYMBOL_GPL(rcu_idle_enter);
405406
406407 /**
407408 * 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
493494 rcu_idle_exit_common(rdtp, oldval);
494495 local_irq_restore(flags);
495496 }
497+EXPORT_SYMBOL_GPL(rcu_idle_exit);
496498
497499 /**
498500 * rcu_irq_enter - inform RCU that current CPU is entering irq away from idle

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t