diff options
Diffstat (limited to 'kernel/rcu/update.c')
| -rw-r--r-- | kernel/rcu/update.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 4c0a9b0af469..a2aeb4df0f60 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c | |||
| @@ -320,6 +320,18 @@ int rcu_jiffies_till_stall_check(void) | |||
| 320 | return till_stall_check * HZ + RCU_STALL_DELAY_DELTA; | 320 | return till_stall_check * HZ + RCU_STALL_DELAY_DELTA; |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | void rcu_sysrq_start(void) | ||
| 324 | { | ||
| 325 | if (!rcu_cpu_stall_suppress) | ||
| 326 | rcu_cpu_stall_suppress = 2; | ||
| 327 | } | ||
| 328 | |||
| 329 | void rcu_sysrq_end(void) | ||
| 330 | { | ||
| 331 | if (rcu_cpu_stall_suppress == 2) | ||
| 332 | rcu_cpu_stall_suppress = 0; | ||
| 333 | } | ||
| 334 | |||
| 323 | static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr) | 335 | static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr) |
| 324 | { | 336 | { |
| 325 | rcu_cpu_stall_suppress = 1; | 337 | rcu_cpu_stall_suppress = 1; |
| @@ -338,3 +350,21 @@ static int __init check_cpu_stall_init(void) | |||
| 338 | early_initcall(check_cpu_stall_init); | 350 | early_initcall(check_cpu_stall_init); |
| 339 | 351 | ||
| 340 | #endif /* #ifdef CONFIG_RCU_STALL_COMMON */ | 352 | #endif /* #ifdef CONFIG_RCU_STALL_COMMON */ |
| 353 | |||
| 354 | /* | ||
| 355 | * Hooks for cond_resched() and friends to avoid RCU CPU stall warnings. | ||
| 356 | */ | ||
| 357 | |||
| 358 | DEFINE_PER_CPU(int, rcu_cond_resched_count); | ||
| 359 | |||
| 360 | /* | ||
| 361 | * Report a set of RCU quiescent states, for use by cond_resched() | ||
| 362 | * and friends. Out of line due to being called infrequently. | ||
| 363 | */ | ||
| 364 | void rcu_resched(void) | ||
| 365 | { | ||
| 366 | preempt_disable(); | ||
| 367 | __this_cpu_write(rcu_cond_resched_count, 0); | ||
| 368 | rcu_note_context_switch(smp_processor_id()); | ||
| 369 | preempt_enable(); | ||
| 370 | } | ||
