update.c (249acb5f47df27109d74a0d904a5da56c8bac28f) update.c (10462d6f58fb6dbde7563e9343505d98d5bfba3d)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Read-Copy Update mechanism for mutual exclusion
4 *
5 * Copyright IBM Corporation, 2001
6 *
7 * Authors: Dipankar Sarma <dipankar@in.ibm.com>
8 * Manfred Spraul <manfred@colorfullife.com>

--- 410 unchanged lines hidden (view full) ---

419}
420EXPORT_SYMBOL_GPL(do_trace_rcu_torture_read);
421#else
422#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
423 do { } while (0)
424#endif
425
426#ifdef CONFIG_RCU_STALL_COMMON
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Read-Copy Update mechanism for mutual exclusion
4 *
5 * Copyright IBM Corporation, 2001
6 *
7 * Authors: Dipankar Sarma <dipankar@in.ibm.com>
8 * Manfred Spraul <manfred@colorfullife.com>

--- 410 unchanged lines hidden (view full) ---

419}
420EXPORT_SYMBOL_GPL(do_trace_rcu_torture_read);
421#else
422#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
423 do { } while (0)
424#endif
425
426#ifdef CONFIG_RCU_STALL_COMMON
427
428#ifdef CONFIG_PROVE_RCU
429#define RCU_STALL_DELAY_DELTA (5 * HZ)
430#else
431#define RCU_STALL_DELAY_DELTA 0
432#endif
433
434int rcu_cpu_stall_suppress __read_mostly; /* 1 = suppress stall warnings. */
435EXPORT_SYMBOL_GPL(rcu_cpu_stall_suppress);
427int rcu_cpu_stall_suppress __read_mostly; /* 1 = suppress stall warnings. */
428EXPORT_SYMBOL_GPL(rcu_cpu_stall_suppress);
436static int rcu_cpu_stall_timeout __read_mostly = CONFIG_RCU_CPU_STALL_TIMEOUT;
437
438module_param(rcu_cpu_stall_suppress, int, 0644);
429module_param(rcu_cpu_stall_suppress, int, 0644);
430int rcu_cpu_stall_timeout __read_mostly = CONFIG_RCU_CPU_STALL_TIMEOUT;
439module_param(rcu_cpu_stall_timeout, int, 0644);
431module_param(rcu_cpu_stall_timeout, int, 0644);
440
441int rcu_jiffies_till_stall_check(void)
442{
443 int till_stall_check = READ_ONCE(rcu_cpu_stall_timeout);
444
445 /*
446 * Limit check must be consistent with the Kconfig limits
447 * for CONFIG_RCU_CPU_STALL_TIMEOUT.
448 */
449 if (till_stall_check < 3) {
450 WRITE_ONCE(rcu_cpu_stall_timeout, 3);
451 till_stall_check = 3;
452 } else if (till_stall_check > 300) {
453 WRITE_ONCE(rcu_cpu_stall_timeout, 300);
454 till_stall_check = 300;
455 }
456 return till_stall_check * HZ + RCU_STALL_DELAY_DELTA;
457}
458EXPORT_SYMBOL_GPL(rcu_jiffies_till_stall_check);
459
460void rcu_sysrq_start(void)
461{
462 if (!rcu_cpu_stall_suppress)
463 rcu_cpu_stall_suppress = 2;
464}
465
466void rcu_sysrq_end(void)
467{
468 if (rcu_cpu_stall_suppress == 2)
469 rcu_cpu_stall_suppress = 0;
470}
471
472static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr)
473{
474 rcu_cpu_stall_suppress = 1;
475 return NOTIFY_DONE;
476}
477
478static struct notifier_block rcu_panic_block = {
479 .notifier_call = rcu_panic,
480};
481
482static int __init check_cpu_stall_init(void)
483{
484 atomic_notifier_chain_register(&panic_notifier_list, &rcu_panic_block);
485 return 0;
486}
487early_initcall(check_cpu_stall_init);
488
489#endif /* #ifdef CONFIG_RCU_STALL_COMMON */
490
491#ifdef CONFIG_TASKS_RCU
492
493/*
494 * Simple variant of RCU whose quiescent states are voluntary context
495 * switch, cond_resched_rcu_qs(), user-space execution, and idle.
496 * As such, grace periods can take one good long time. There are no

--- 441 unchanged lines hidden ---
432#endif /* #ifdef CONFIG_RCU_STALL_COMMON */
433
434#ifdef CONFIG_TASKS_RCU
435
436/*
437 * Simple variant of RCU whose quiescent states are voluntary context
438 * switch, cond_resched_rcu_qs(), user-space execution, and idle.
439 * As such, grace periods can take one good long time. There are no

--- 441 unchanged lines hidden ---