aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-04-04 01:14:11 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-06-10 16:44:56 -0400
commit026ad2835ce6202069e7aa0b11f5f1be4de34550 (patch)
tree2fbf39aa59eee409d892dbd99b82b31e1261f366 /kernel/rcutree.c
parent9a5739d73f9369ba1cdba3889ee4e2f87be25a46 (diff)
rcu: Drive quiescent-state-forcing delay from HZ
Systems with HZ=100 can have slow bootup times due to the default three-jiffy delays between quiescent-state forcing attempts. This commit therefore auto-tunes the RCU_JIFFIES_TILL_FORCE_QS value based on the value of HZ. However, this would break very large systems that require more time between quiescent-state forcing attempts. This commit therefore also ups the default delay by one jiffy for each 256 CPUs that might be on the system (based off of nr_cpu_ids at runtime, -not- NR_CPUS at build time). Updated to collapse #ifdefs for RCU_JIFFIES_TILL_FORCE_QS into a step-function definition as suggested by Josh Triplett. Reported-by: Paul Mackerras <paulus@au1.ibm.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 1009c0ccd4b1..f344d3c824a4 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -218,8 +218,8 @@ module_param(blimit, long, 0444);
218module_param(qhimark, long, 0444); 218module_param(qhimark, long, 0444);
219module_param(qlowmark, long, 0444); 219module_param(qlowmark, long, 0444);
220 220
221static ulong jiffies_till_first_fqs = RCU_JIFFIES_TILL_FORCE_QS; 221static ulong jiffies_till_first_fqs = ULONG_MAX;
222static ulong jiffies_till_next_fqs = RCU_JIFFIES_TILL_FORCE_QS; 222static ulong jiffies_till_next_fqs = ULONG_MAX;
223 223
224module_param(jiffies_till_first_fqs, ulong, 0644); 224module_param(jiffies_till_first_fqs, ulong, 0644);
225module_param(jiffies_till_next_fqs, ulong, 0644); 225module_param(jiffies_till_next_fqs, ulong, 0644);
@@ -3265,11 +3265,25 @@ static void __init rcu_init_one(struct rcu_state *rsp,
3265 */ 3265 */
3266static void __init rcu_init_geometry(void) 3266static void __init rcu_init_geometry(void)
3267{ 3267{
3268 ulong d;
3268 int i; 3269 int i;
3269 int j; 3270 int j;
3270 int n = nr_cpu_ids; 3271 int n = nr_cpu_ids;
3271 int rcu_capacity[MAX_RCU_LVLS + 1]; 3272 int rcu_capacity[MAX_RCU_LVLS + 1];
3272 3273
3274 /*
3275 * Initialize any unspecified boot parameters.
3276 * The default values of jiffies_till_first_fqs and
3277 * jiffies_till_next_fqs are set to the RCU_JIFFIES_TILL_FORCE_QS
3278 * value, which is a function of HZ, then adding one for each
3279 * RCU_JIFFIES_FQS_DIV CPUs that might be on the system.
3280 */
3281 d = RCU_JIFFIES_TILL_FORCE_QS + nr_cpu_ids / RCU_JIFFIES_FQS_DIV;
3282 if (jiffies_till_first_fqs == ULONG_MAX)
3283 jiffies_till_first_fqs = d;
3284 if (jiffies_till_next_fqs == ULONG_MAX)
3285 jiffies_till_next_fqs = d;
3286
3273 /* If the compile-time values are accurate, just leave. */ 3287 /* If the compile-time values are accurate, just leave. */
3274 if (rcu_fanout_leaf == CONFIG_RCU_FANOUT_LEAF && 3288 if (rcu_fanout_leaf == CONFIG_RCU_FANOUT_LEAF &&
3275 nr_cpu_ids == NR_CPUS) 3289 nr_cpu_ids == NR_CPUS)