diff options
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 3623f8e10220..595fb83e9b7d 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -449,6 +449,8 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) | |||
449 | 449 | ||
450 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | 450 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR |
451 | 451 | ||
452 | int rcu_cpu_stall_panicking __read_mostly; | ||
453 | |||
452 | static void record_gp_stall_check_time(struct rcu_state *rsp) | 454 | static void record_gp_stall_check_time(struct rcu_state *rsp) |
453 | { | 455 | { |
454 | rsp->gp_start = jiffies; | 456 | rsp->gp_start = jiffies; |
@@ -526,6 +528,8 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp) | |||
526 | long delta; | 528 | long delta; |
527 | struct rcu_node *rnp; | 529 | struct rcu_node *rnp; |
528 | 530 | ||
531 | if (rcu_cpu_stall_panicking) | ||
532 | return; | ||
529 | delta = jiffies - rsp->jiffies_stall; | 533 | delta = jiffies - rsp->jiffies_stall; |
530 | rnp = rdp->mynode; | 534 | rnp = rdp->mynode; |
531 | if ((rnp->qsmask & rdp->grpmask) && delta >= 0) { | 535 | if ((rnp->qsmask & rdp->grpmask) && delta >= 0) { |
@@ -540,6 +544,21 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp) | |||
540 | } | 544 | } |
541 | } | 545 | } |
542 | 546 | ||
547 | static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr) | ||
548 | { | ||
549 | rcu_cpu_stall_panicking = 1; | ||
550 | return NOTIFY_DONE; | ||
551 | } | ||
552 | |||
553 | static struct notifier_block rcu_panic_block = { | ||
554 | .notifier_call = rcu_panic, | ||
555 | }; | ||
556 | |||
557 | static void __init check_cpu_stall_init(void) | ||
558 | { | ||
559 | atomic_notifier_chain_register(&panic_notifier_list, &rcu_panic_block); | ||
560 | } | ||
561 | |||
543 | #else /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | 562 | #else /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ |
544 | 563 | ||
545 | static void record_gp_stall_check_time(struct rcu_state *rsp) | 564 | static void record_gp_stall_check_time(struct rcu_state *rsp) |
@@ -550,6 +569,10 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp) | |||
550 | { | 569 | { |
551 | } | 570 | } |
552 | 571 | ||
572 | static void __init check_cpu_stall_init(void) | ||
573 | { | ||
574 | } | ||
575 | |||
553 | #endif /* #else #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | 576 | #endif /* #else #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ |
554 | 577 | ||
555 | /* | 578 | /* |
@@ -1934,6 +1957,7 @@ void __init rcu_init(void) | |||
1934 | cpu_notifier(rcu_cpu_notify, 0); | 1957 | cpu_notifier(rcu_cpu_notify, 0); |
1935 | for_each_online_cpu(cpu) | 1958 | for_each_online_cpu(cpu) |
1936 | rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)cpu); | 1959 | rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)cpu); |
1960 | check_cpu_stall_init(); | ||
1937 | } | 1961 | } |
1938 | 1962 | ||
1939 | #include "rcutree_plugin.h" | 1963 | #include "rcutree_plugin.h" |