Skip to content

Commit 8c03273

Browse files
jognesspmladek
authored andcommitted
rcu: Mark emergency sections in rcu stalls
Mark emergency sections wherever multiple lines of rcu stall information are generated. In an emergency section, every printk() call will attempt to directly flush to the consoles using the EMERGENCY priority. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
1 parent 4bdfa0d commit 8c03273

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

kernel/rcu/tree_exp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Authors: Paul E. McKenney <[email protected]>
88
*/
99

10+
#include <linux/console.h>
1011
#include <linux/lockdep.h>
1112

1213
static void rcu_exp_handler(void *unused);
@@ -590,6 +591,9 @@ static void synchronize_rcu_expedited_wait(void)
590591
return;
591592
if (rcu_stall_is_suppressed())
592593
continue;
594+
595+
nbcon_cpu_emergency_enter();
596+
593597
j = jiffies;
594598
rcu_stall_notifier_call_chain(RCU_STALL_NOTIFY_EXP, (void *)(j - jiffies_start));
595599
trace_rcu_stall_warning(rcu_state.name, TPS("ExpeditedStall"));
@@ -643,6 +647,9 @@ static void synchronize_rcu_expedited_wait(void)
643647
rcu_exp_print_detail_task_stall_rnp(rnp);
644648
}
645649
jiffies_stall = 3 * rcu_exp_jiffies_till_stall_check() + 3;
650+
651+
nbcon_cpu_emergency_exit();
652+
646653
panic_on_rcu_stall();
647654
}
648655
}

kernel/rcu/tree_stall.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Author: Paul E. McKenney <[email protected]>
88
*/
99

10+
#include <linux/console.h>
1011
#include <linux/kvm_para.h>
1112
#include <linux/rcu_notifier.h>
1213

@@ -605,6 +606,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps)
605606
if (rcu_stall_is_suppressed())
606607
return;
607608

609+
nbcon_cpu_emergency_enter();
610+
608611
/*
609612
* OK, time to rat on our buddy...
610613
* See Documentation/RCU/stallwarn.rst for info on how to debug
@@ -657,6 +660,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps)
657660
rcu_check_gp_kthread_expired_fqs_timer();
658661
rcu_check_gp_kthread_starvation();
659662

663+
nbcon_cpu_emergency_exit();
664+
660665
panic_on_rcu_stall();
661666

662667
rcu_force_quiescent_state(); /* Kick them all. */
@@ -677,6 +682,8 @@ static void print_cpu_stall(unsigned long gps)
677682
if (rcu_stall_is_suppressed())
678683
return;
679684

685+
nbcon_cpu_emergency_enter();
686+
680687
/*
681688
* OK, time to rat on ourselves...
682689
* See Documentation/RCU/stallwarn.rst for info on how to debug
@@ -706,6 +713,8 @@ static void print_cpu_stall(unsigned long gps)
706713
jiffies + 3 * rcu_jiffies_till_stall_check() + 3);
707714
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
708715

716+
nbcon_cpu_emergency_exit();
717+
709718
panic_on_rcu_stall();
710719

711720
/*

0 commit comments

Comments
 (0)