diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-04-04 01:14:11 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-06-10 16:44:56 -0400 |
commit | 026ad2835ce6202069e7aa0b11f5f1be4de34550 (patch) | |
tree | 2fbf39aa59eee409d892dbd99b82b31e1261f366 /kernel/rcutree.h | |
parent | 9a5739d73f9369ba1cdba3889ee4e2f87be25a46 (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.h')
-rw-r--r-- | kernel/rcutree.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 4df503470e42..4a39d364493c 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h | |||
@@ -343,12 +343,17 @@ struct rcu_data { | |||
343 | #define RCU_FORCE_QS 3 /* Need to force quiescent state. */ | 343 | #define RCU_FORCE_QS 3 /* Need to force quiescent state. */ |
344 | #define RCU_SIGNAL_INIT RCU_SAVE_DYNTICK | 344 | #define RCU_SIGNAL_INIT RCU_SAVE_DYNTICK |
345 | 345 | ||
346 | #define RCU_JIFFIES_TILL_FORCE_QS 3 /* for rsp->jiffies_force_qs */ | 346 | #define RCU_JIFFIES_TILL_FORCE_QS (1 + (HZ > 250) + (HZ > 500)) |
347 | /* For jiffies_till_first_fqs and */ | ||
348 | /* and jiffies_till_next_fqs. */ | ||
347 | 349 | ||
348 | #define RCU_STALL_RAT_DELAY 2 /* Allow other CPUs time */ | 350 | #define RCU_JIFFIES_FQS_DIV 256 /* Very large systems need more */ |
349 | /* to take at least one */ | 351 | /* delay between bouts of */ |
350 | /* scheduling clock irq */ | 352 | /* quiescent-state forcing. */ |
351 | /* before ratting on them. */ | 353 | |
354 | #define RCU_STALL_RAT_DELAY 2 /* Allow other CPUs time to take */ | ||
355 | /* at least one scheduling clock */ | ||
356 | /* irq before ratting on them. */ | ||
352 | 357 | ||
353 | #define rcu_wait(cond) \ | 358 | #define rcu_wait(cond) \ |
354 | do { \ | 359 | do { \ |