From: Frank Rowand <frank.rowand@am.sony.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>,
"dipankar@in.ibm.com" <dipankar@in.ibm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH RT 2/2][RFC] let RCU stall messages escape with CONFIG_PREEMPT_RT_FULL
Date: Tue, 4 Dec 2012 20:52:21 -0800 [thread overview]
Message-ID: <50BED305.9090308@am.sony.com> (raw)
In-Reply-To: <50BED1DA.7070907@am.sony.com>
The printk()s in RCU stall warnings do not get flushed to the console
on ARM. Add the oops_in_progress flag back into the special trylock case in
console_trylock_for_printk(), and set the flag using "bust_spinlocks(1)".
This allows the printk() output to be flushed to the console.
Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
kernel/printk.c | 5 3 + 2 - 0 !
kernel/rcutree.c | 14 14 + 0 - 0 !
2 files changed, 17 insertions(+), 2 deletions(-)
Index: b/kernel/printk.c
===================================================================
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1390,8 +1390,9 @@ static int console_trylock_for_printk(un
{
int retval = 0, wake = 0;
#ifdef CONFIG_PREEMPT_RT_FULL
- int lock = !early_boot_irqs_disabled && !irqs_disabled_flags(flags) &&
- (preempt_count() <= 1);
+ int lock = oops_in_progress || (
+ !early_boot_irqs_disabled && !irqs_disabled_flags(flags) &&
+ (preempt_count() <= 1));
#else
int lock = 1;
#endif
Index: b/kernel/rcutree.c
===================================================================
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -758,6 +758,11 @@ static void print_other_cpu_stall(struct
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/*
+ * Allow printk() to flush to device
+ */
+ bust_spinlocks(1);
+
+ /*
* OK, time to rat on our buddy...
* See Documentation/RCU/stallwarn.txt for info on how to debug
* RCU CPU stall warnings.
@@ -799,6 +804,8 @@ static void print_other_cpu_stall(struct
rcu_print_detail_task_stall(rsp);
+ bust_spinlocks(0);
+
force_quiescent_state(rsp, 0); /* Kick them all. */
}
@@ -808,6 +815,11 @@ static void print_cpu_stall(struct rcu_s
struct rcu_node *rnp = rcu_get_root(rsp);
/*
+ * Allow printk() to flush to device
+ */
+ bust_spinlocks(1);
+
+ /*
* OK, time to rat on ourselves...
* See Documentation/RCU/stallwarn.txt for info on how to debug
* RCU CPU stall warnings.
@@ -820,6 +832,8 @@ static void print_cpu_stall(struct rcu_s
if (!trigger_all_cpu_backtrace())
dump_stack();
+ bust_spinlocks(0);
+
raw_spin_lock_irqsave(&rnp->lock, flags);
if (ULONG_CMP_GE(jiffies, rsp->jiffies_stall))
rsp->jiffies_stall = jiffies +
WARNING: multiple messages have this Message-ID (diff)
From: frank.rowand@am.sony.com (Frank Rowand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RT 2/2][RFC] let RCU stall messages escape with CONFIG_PREEMPT_RT_FULL
Date: Tue, 4 Dec 2012 20:52:21 -0800 [thread overview]
Message-ID: <50BED305.9090308@am.sony.com> (raw)
In-Reply-To: <50BED1DA.7070907@am.sony.com>
The printk()s in RCU stall warnings do not get flushed to the console
on ARM. Add the oops_in_progress flag back into the special trylock case in
console_trylock_for_printk(), and set the flag using "bust_spinlocks(1)".
This allows the printk() output to be flushed to the console.
Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
kernel/printk.c | 5 3 + 2 - 0 !
kernel/rcutree.c | 14 14 + 0 - 0 !
2 files changed, 17 insertions(+), 2 deletions(-)
Index: b/kernel/printk.c
===================================================================
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1390,8 +1390,9 @@ static int console_trylock_for_printk(un
{
int retval = 0, wake = 0;
#ifdef CONFIG_PREEMPT_RT_FULL
- int lock = !early_boot_irqs_disabled && !irqs_disabled_flags(flags) &&
- (preempt_count() <= 1);
+ int lock = oops_in_progress || (
+ !early_boot_irqs_disabled && !irqs_disabled_flags(flags) &&
+ (preempt_count() <= 1));
#else
int lock = 1;
#endif
Index: b/kernel/rcutree.c
===================================================================
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -758,6 +758,11 @@ static void print_other_cpu_stall(struct
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/*
+ * Allow printk() to flush to device
+ */
+ bust_spinlocks(1);
+
+ /*
* OK, time to rat on our buddy...
* See Documentation/RCU/stallwarn.txt for info on how to debug
* RCU CPU stall warnings.
@@ -799,6 +804,8 @@ static void print_other_cpu_stall(struct
rcu_print_detail_task_stall(rsp);
+ bust_spinlocks(0);
+
force_quiescent_state(rsp, 0); /* Kick them all. */
}
@@ -808,6 +815,11 @@ static void print_cpu_stall(struct rcu_s
struct rcu_node *rnp = rcu_get_root(rsp);
/*
+ * Allow printk() to flush to device
+ */
+ bust_spinlocks(1);
+
+ /*
* OK, time to rat on ourselves...
* See Documentation/RCU/stallwarn.txt for info on how to debug
* RCU CPU stall warnings.
@@ -820,6 +832,8 @@ static void print_cpu_stall(struct rcu_s
if (!trigger_all_cpu_backtrace())
dump_stack();
+ bust_spinlocks(0);
+
raw_spin_lock_irqsave(&rnp->lock, flags);
if (ULONG_CMP_GE(jiffies, rsp->jiffies_stall))
rsp->jiffies_stall = jiffies +
next prev parent reply other threads:[~2012-12-05 4:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 4:47 [PATCH RT 0/2][RFC] fix RCU stall warning on ARM Frank Rowand
2012-12-05 4:47 ` Frank Rowand
2012-12-05 4:52 ` [PATCH RT 1/2][RFC] ARM version of arch_trigger_all_cpu_backtrace() Frank Rowand
2012-12-05 4:52 ` Frank Rowand
2012-12-05 4:52 ` Frank Rowand [this message]
2012-12-05 4:52 ` [PATCH RT 2/2][RFC] let RCU stall messages escape with CONFIG_PREEMPT_RT_FULL Frank Rowand
2012-12-10 14:29 ` Paul E. McKenney
2012-12-10 14:29 ` Paul E. McKenney
2012-12-10 19:08 ` Frank Rowand
2012-12-10 19:08 ` Frank Rowand
2012-12-05 4:52 ` [PATCH RT 0/2][RFC] fix RCU stall warning on ARM Frank Rowand
2012-12-05 4:52 ` Frank Rowand
2012-12-05 5:05 ` Frank Rowand
2012-12-05 5:05 ` Frank Rowand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50BED305.9090308@am.sony.com \
--to=frank.rowand@am.sony.com \
--cc=dipankar@in.ibm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.