diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-10-04 21:48:55 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-12-03 13:10:19 -0500 |
commit | 3a5924052aec266f1035f2ff610b60b7d10dbe7f (patch) | |
tree | f9f51bfef9ed03765bf0c6e711d018ce10d8c071 /kernel/rcu/tree.c | |
parent | 96d3fd0d315a949e30adc80f086031c5cdf070d1 (diff) |
rcu: Allow task-level idle entry/exit nesting
The current task-level idle entry/exit code forces an entry/exit on
each call, regardless of the nesting level. This commit therefore
properly accounts for nesting.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r-- | kernel/rcu/tree.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 264f0284c0bd..518e08428b2e 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -418,11 +418,12 @@ static void rcu_eqs_enter(bool user) | |||
418 | rdtp = this_cpu_ptr(&rcu_dynticks); | 418 | rdtp = this_cpu_ptr(&rcu_dynticks); |
419 | oldval = rdtp->dynticks_nesting; | 419 | oldval = rdtp->dynticks_nesting; |
420 | WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0); | 420 | WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0); |
421 | if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) | 421 | if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) { |
422 | rdtp->dynticks_nesting = 0; | 422 | rdtp->dynticks_nesting = 0; |
423 | else | 423 | rcu_eqs_enter_common(rdtp, oldval, user); |
424 | } else { | ||
424 | rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE; | 425 | rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE; |
425 | rcu_eqs_enter_common(rdtp, oldval, user); | 426 | } |
426 | } | 427 | } |
427 | 428 | ||
428 | /** | 429 | /** |
@@ -540,11 +541,12 @@ static void rcu_eqs_exit(bool user) | |||
540 | rdtp = this_cpu_ptr(&rcu_dynticks); | 541 | rdtp = this_cpu_ptr(&rcu_dynticks); |
541 | oldval = rdtp->dynticks_nesting; | 542 | oldval = rdtp->dynticks_nesting; |
542 | WARN_ON_ONCE(oldval < 0); | 543 | WARN_ON_ONCE(oldval < 0); |
543 | if (oldval & DYNTICK_TASK_NEST_MASK) | 544 | if (oldval & DYNTICK_TASK_NEST_MASK) { |
544 | rdtp->dynticks_nesting += DYNTICK_TASK_NEST_VALUE; | 545 | rdtp->dynticks_nesting += DYNTICK_TASK_NEST_VALUE; |
545 | else | 546 | } else { |
546 | rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE; | 547 | rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE; |
547 | rcu_eqs_exit_common(rdtp, oldval, user); | 548 | rcu_eqs_exit_common(rdtp, oldval, user); |
549 | } | ||
548 | } | 550 | } |
549 | 551 | ||
550 | /** | 552 | /** |