diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-10-31 10:55:05 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-12-30 20:40:18 -0500 |
commit | ca9558a33f658155c3b69f92897c2e6a848684f5 (patch) | |
tree | 1058dc4ef6248929601468b554da0a0422a005f0 /kernel/rcu/tiny.c | |
parent | 734d16801349fbe951d2f780191d32c5b8a892d1 (diff) |
rcu: Remove redundant rcu_is_cpu_rrupt_from_idle() from tiny RCU
Let's start assuming that something in the idle loop posts a callback,
and scheduling-clock interrupt occurs:
1. The system is idle and stays that way, no runnable tasks.
2. Scheduling-clock interrupt occurs, rcu_check_callbacks() is called
as result, which in turn calls rcu_is_cpu_rrupt_from_idle().
3. rcu_is_cpu_rrupt_from_idle() reports the CPU was interrupted from
idle, which results in rcu_sched_qs() call, which does a
raise_softirq(RCU_SOFTIRQ).
4. Upon return from interrupt, rcu_irq_exit() is invoked, which calls
rcu_idle_enter_common(), which in turn calls rcu_sched_qs() again,
which does another raise_softirq(RCU_SOFTIRQ).
5. The softirq happens shortly and invokes rcu_process_callbacks(),
which invokes __rcu_process_callbacks().
6. So now callbacks can be invoked. At least they can be if
->donetail has been updated. Which it will have been because
rcu_sched_qs() invokes rcu_qsctr_help().
In the described scenario rcu_sched_qs() and raise_softirq(RCU_SOFTIRQ)
get called twice in steps 3 and 4. This redundancy could be eliminated
by removing rcu_is_cpu_rrupt_from_idle() function.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tiny.c')
-rw-r--r-- | kernel/rcu/tiny.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index 0db5649f8817..805b6d59c854 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c | |||
@@ -186,16 +186,6 @@ EXPORT_SYMBOL(__rcu_is_watching); | |||
186 | #endif /* defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ | 186 | #endif /* defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ |
187 | 187 | ||
188 | /* | 188 | /* |
189 | * Test whether the current CPU was interrupted from idle. Nested | ||
190 | * interrupts don't count, we must be running at the first interrupt | ||
191 | * level. | ||
192 | */ | ||
193 | static int rcu_is_cpu_rrupt_from_idle(void) | ||
194 | { | ||
195 | return rcu_dynticks_nesting <= 1; | ||
196 | } | ||
197 | |||
198 | /* | ||
199 | * Helper function for rcu_sched_qs() and rcu_bh_qs(). | 189 | * Helper function for rcu_sched_qs() and rcu_bh_qs(). |
200 | * Also irqs are disabled to avoid confusion due to interrupt handlers | 190 | * Also irqs are disabled to avoid confusion due to interrupt handlers |
201 | * invoking call_rcu(). | 191 | * invoking call_rcu(). |
@@ -250,7 +240,7 @@ void rcu_bh_qs(void) | |||
250 | void rcu_check_callbacks(int user) | 240 | void rcu_check_callbacks(int user) |
251 | { | 241 | { |
252 | RCU_TRACE(check_cpu_stalls()); | 242 | RCU_TRACE(check_cpu_stalls()); |
253 | if (user || rcu_is_cpu_rrupt_from_idle()) | 243 | if (user) |
254 | rcu_sched_qs(); | 244 | rcu_sched_qs(); |
255 | else if (!in_softirq()) | 245 | else if (!in_softirq()) |
256 | rcu_bh_qs(); | 246 | rcu_bh_qs(); |