diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-06-28 15:33:51 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2012-09-26 09:44:02 -0400 |
commit | 9a0c6fef423528ba5b62aa31b29aabf689eb8f70 (patch) | |
tree | 8560ac17f9a19f2f03c47fed1eb3e02011a6205f /kernel/rcutree_plugin.h | |
parent | 19dd1591fc379f1d89f39cd99cbbe97433baa3c3 (diff) |
rcu: Make RCU_FAST_NO_HZ handle adaptive ticks
The current implementation of RCU_FAST_NO_HZ tries reasonably hard to rid
the current CPU of RCU callbacks. This is appropriate when the CPU is
entering idle, where it doesn't have much useful to do anyway, but is most
definitely not what you want when transitioning to user-mode execution.
This commit therefore detects the adaptive-tick case, and refrains from
burning CPU time getting rid of RCU callbacks in that case.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r-- | kernel/rcutree_plugin.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index 9c71c1b18e03..f92115488187 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -1757,6 +1757,26 @@ static void rcu_prepare_for_idle(int cpu) | |||
1757 | if (!tne) | 1757 | if (!tne) |
1758 | return; | 1758 | return; |
1759 | 1759 | ||
1760 | /* Adaptive-tick mode, where usermode execution is idle to RCU. */ | ||
1761 | if (!is_idle_task(current)) { | ||
1762 | rdtp->dyntick_holdoff = jiffies - 1; | ||
1763 | if (rcu_cpu_has_nonlazy_callbacks(cpu)) { | ||
1764 | trace_rcu_prep_idle("User dyntick with callbacks"); | ||
1765 | rdtp->idle_gp_timer_expires = | ||
1766 | round_up(jiffies + RCU_IDLE_GP_DELAY, | ||
1767 | RCU_IDLE_GP_DELAY); | ||
1768 | } else if (rcu_cpu_has_callbacks(cpu)) { | ||
1769 | rdtp->idle_gp_timer_expires = | ||
1770 | round_jiffies(jiffies + RCU_IDLE_LAZY_GP_DELAY); | ||
1771 | trace_rcu_prep_idle("User dyntick with lazy callbacks"); | ||
1772 | } else { | ||
1773 | return; | ||
1774 | } | ||
1775 | tp = &rdtp->idle_gp_timer; | ||
1776 | mod_timer_pinned(tp, rdtp->idle_gp_timer_expires); | ||
1777 | return; | ||
1778 | } | ||
1779 | |||
1760 | /* | 1780 | /* |
1761 | * If this is an idle re-entry, for example, due to use of | 1781 | * If this is an idle re-entry, for example, due to use of |
1762 | * RCU_NONIDLE() or the new idle-loop tracing API within the idle | 1782 | * RCU_NONIDLE() or the new idle-loop tracing API within the idle |