diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-07-21 14:34:33 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-09-16 13:08:02 -0400 |
commit | 663e131090dd10bac9dc0b4f5b624dd3211b20f6 (patch) | |
tree | 88a47a1b26fe1af6a4c57a8e8bbee231b331c56d /kernel/rcu | |
parent | 417e8d26557c4264a484d78a7491316751afa46f (diff) |
rcu: Don't track sysidle state if no nohz_full= CPUs
If there are no nohz_full= CPUs, then there is currently no reason to
track sysidle state. This commit therefore short-circuits this state
tracking if !tick_nohz_full_enabled().
Note that these checks will need to be revisited if nohz_full= state
can ever be changed at runtime.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/tree_plugin.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 3ddad4fb11a8..d5aec549558d 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -2707,6 +2707,10 @@ static void rcu_sysidle_enter(struct rcu_dynticks *rdtp, int irq) | |||
2707 | { | 2707 | { |
2708 | unsigned long j; | 2708 | unsigned long j; |
2709 | 2709 | ||
2710 | /* If there are no nohz_full= CPUs, no need to track this. */ | ||
2711 | if (!tick_nohz_full_enabled()) | ||
2712 | return; | ||
2713 | |||
2710 | /* Adjust nesting, check for fully idle. */ | 2714 | /* Adjust nesting, check for fully idle. */ |
2711 | if (irq) { | 2715 | if (irq) { |
2712 | rdtp->dynticks_idle_nesting--; | 2716 | rdtp->dynticks_idle_nesting--; |
@@ -2772,6 +2776,10 @@ void rcu_sysidle_force_exit(void) | |||
2772 | */ | 2776 | */ |
2773 | static void rcu_sysidle_exit(struct rcu_dynticks *rdtp, int irq) | 2777 | static void rcu_sysidle_exit(struct rcu_dynticks *rdtp, int irq) |
2774 | { | 2778 | { |
2779 | /* If there are no nohz_full= CPUs, no need to track this. */ | ||
2780 | if (!tick_nohz_full_enabled()) | ||
2781 | return; | ||
2782 | |||
2775 | /* Adjust nesting, check for already non-idle. */ | 2783 | /* Adjust nesting, check for already non-idle. */ |
2776 | if (irq) { | 2784 | if (irq) { |
2777 | rdtp->dynticks_idle_nesting++; | 2785 | rdtp->dynticks_idle_nesting++; |
@@ -2826,6 +2834,10 @@ static void rcu_sysidle_check_cpu(struct rcu_data *rdp, bool *isidle, | |||
2826 | unsigned long j; | 2834 | unsigned long j; |
2827 | struct rcu_dynticks *rdtp = rdp->dynticks; | 2835 | struct rcu_dynticks *rdtp = rdp->dynticks; |
2828 | 2836 | ||
2837 | /* If there are no nohz_full= CPUs, don't check system-wide idleness. */ | ||
2838 | if (!tick_nohz_full_enabled()) | ||
2839 | return; | ||
2840 | |||
2829 | /* | 2841 | /* |
2830 | * If some other CPU has already reported non-idle, if this is | 2842 | * If some other CPU has already reported non-idle, if this is |
2831 | * not the flavor of RCU that tracks sysidle state, or if this | 2843 | * not the flavor of RCU that tracks sysidle state, or if this |
@@ -2952,6 +2964,10 @@ static void rcu_sysidle_report(struct rcu_state *rsp, int isidle, | |||
2952 | static void rcu_sysidle_report_gp(struct rcu_state *rsp, int isidle, | 2964 | static void rcu_sysidle_report_gp(struct rcu_state *rsp, int isidle, |
2953 | unsigned long maxj) | 2965 | unsigned long maxj) |
2954 | { | 2966 | { |
2967 | /* If there are no nohz_full= CPUs, no need to track this. */ | ||
2968 | if (!tick_nohz_full_enabled()) | ||
2969 | return; | ||
2970 | |||
2955 | rcu_sysidle_report(rsp, isidle, maxj, true); | 2971 | rcu_sysidle_report(rsp, isidle, maxj, true); |
2956 | } | 2972 | } |
2957 | 2973 | ||
@@ -2978,7 +2994,8 @@ static void rcu_sysidle_cb(struct rcu_head *rhp) | |||
2978 | 2994 | ||
2979 | /* | 2995 | /* |
2980 | * Check to see if the system is fully idle, other than the timekeeping CPU. | 2996 | * Check to see if the system is fully idle, other than the timekeeping CPU. |
2981 | * The caller must have disabled interrupts. | 2997 | * The caller must have disabled interrupts. This is not intended to be |
2998 | * called unless tick_nohz_full_enabled(). | ||
2982 | */ | 2999 | */ |
2983 | bool rcu_sys_is_idle(void) | 3000 | bool rcu_sys_is_idle(void) |
2984 | { | 3001 | { |