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: Re: [PATCH RT 0/2][RFC] fix RCU stall warning on ARM
Date: Tue, 4 Dec 2012 20:52:48 -0800 [thread overview]
Message-ID: <50BED320.3060204@am.sony.com> (raw)
In-Reply-To: <50BED1DA.7070907@am.sony.com>
This patch should __not__ be committed to the RT_PREEMPT tree.
Test scaffolding to force printing of rcu detected stall. Each time the
specified value is echoed into the proc file, the routine to be tested
will be called one time, from the context it would normally be called from.
# test print_cpu_stall()
echo 1 > /proc/sys/kernel/zzz_debug_print_stall_once
# test print_other_cpu_stall()
echo 2 > /proc/sys/kernel/zzz_debug_print_stall_once
Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
kernel/rcutree.c | 26 26 + 0 - 0 !
kernel/sysctl.c | 11 11 + 0 - 0 !
2 files changed, 37 insertions(+)
Index: b/kernel/rcutree.c
===================================================================
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -738,6 +738,7 @@ static void record_gp_stall_check_time(s
rsp->jiffies_stall = jiffies + jiffies_till_stall_check();
}
+int zzz_debug_print_other_cpu_stall;
static void print_other_cpu_stall(struct rcu_state *rsp)
{
int cpu;
@@ -750,10 +751,12 @@ static void print_other_cpu_stall(struct
raw_spin_lock_irqsave(&rnp->lock, flags);
delta = jiffies - rsp->jiffies_stall;
+if (!zzz_debug_print_other_cpu_stall) {
if (delta < RCU_STALL_RAT_DELAY || !rcu_gp_in_progress(rsp)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
+}
rsp->jiffies_stall = jiffies + 3 * jiffies_till_stall_check() + 3;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
@@ -792,6 +795,10 @@ static void print_other_cpu_stall(struct
ndetected += rcu_print_task_stall(rnp);
raw_spin_unlock_irqrestore(&rnp->lock, flags);
+if (zzz_debug_print_other_cpu_stall) {
+ ndetected += 1;
+}
+
print_cpu_stall_info_end();
printk(KERN_CONT "(detected by %d, t=%ld jiffies)\n",
smp_processor_id(), (long)(jiffies - rsp->gp_start));
@@ -843,6 +850,7 @@ static void print_cpu_stall(struct rcu_s
set_need_resched(); /* kick ourselves to get things going. */
}
+int zzz_debug_print_stall_once;
static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
{
unsigned long j;
@@ -851,6 +859,24 @@ static void check_cpu_stall(struct rcu_s
if (rcu_cpu_stall_suppress)
return;
+
+ if (zzz_debug_print_stall_once) {
+ int tmp = zzz_debug_print_stall_once;
+ zzz_debug_print_stall_once = 0;
+ if (tmp & 0x1) {
+ pr_crit("\n\n***** DEBUG -- test print_cpu_stall():\n\n");
+ print_cpu_stall(rsp);
+ }
+ if (tmp & 0x2) {
+ pr_crit("\n\n***** DEBUG -- test print_other_cpu_stall():\n\n");
+ zzz_debug_print_other_cpu_stall = 1;
+ print_other_cpu_stall(rsp);
+ zzz_debug_print_other_cpu_stall = 0;
+ }
+
+ return;
+ }
+
j = ACCESS_ONCE(jiffies);
js = ACCESS_ONCE(rsp->jiffies_stall);
rnp = rdp->mynode;
Index: b/kernel/sysctl.c
===================================================================
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -132,6 +132,8 @@ static int one_hundred = 100;
static int ten_thousand = 10000;
#endif
+extern int zzz_debug_print_stall_once;
+
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
@@ -1000,6 +1002,15 @@ static struct ctl_table kern_table[] = {
.proc_handler = proc_dointvec,
},
#endif
+#ifdef CONFIG_SMP
+ {
+ .procname = "zzz_debug_print_stall_once",
+ .data = &zzz_debug_print_stall_once,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+#endif
{ }
};
next prev parent reply other threads:[~2012-12-05 4:52 UTC|newest]
Thread overview: 7+ 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:52 ` [PATCH RT 1/2][RFC] ARM version of arch_trigger_all_cpu_backtrace() Frank Rowand
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 19:08 ` Frank Rowand
2012-12-05 4:52 ` Frank Rowand [this message]
2012-12-05 5:05 ` [PATCH RT 0/2][RFC] fix RCU stall warning on ARM 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=50BED320.3060204@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox