From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: rcu_sched stall detected, but no state dump
Date: Mon, 22 Dec 2014 11:40:11 -0800 [thread overview]
Message-ID: <20141222194011.GV11609@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1412221334060.16432@pobox.suse.cz>
On Mon, Dec 22, 2014 at 01:42:14PM +0100, Miroslav Benes wrote:
> On Fri, 19 Dec 2014, Paul E. McKenney wrote:
> > On Fri, Dec 19, 2014 at 12:09:48PM +0100, Miroslav Benes wrote:
[ . . . ]
> > But what do you do if your test module happens to start spinning when
> > there is no callback?
> >
> > One approach is to do a call_rcu() just after starting your loop.
> > Alternatively, do several just before starting your loop.
>
> Yes, that would be the way if I understand it correctly. Fortunately there
> is always some pending RCU callback during my test. I wonder where it
> comes from (probably module handling. I'll try to find out just to be
> sure.).
>
> So, is the following patch correct? I tested it and it seems ok. And sorry
> for the delay, I took the weekend off. Thank you for your patience.
Good! I forward ported it to -rcu, merged the two "if" statements,
queued it, and have started testing. Thank you!!!
Thanx, Paul
> Miroslav
>
> -- >8 --
> >From 0dccc8e322e1a38016422be8f4af110eb7a405fc Mon Sep 17 00:00:00 2001
> From: Miroslav Benes <mbenes@suse.cz>
> Date: Mon, 22 Dec 2014 13:24:44 +0100
> Subject: [PATCH] rcu: Fix RCU CPU stall detection in tiny implementation
>
> The tiny RCU CPU stall detection depends on *rcp->curtail not being
> NULL. It is however a tail pointer and thus NULL by definition. Instead we
> should check rcp->rcucblist for the presence of pending callbacks which need to
> be processed. With this fix INFO about the stall is printed and jiffies_stall
> (jiffies at next stall) correctly updated.
>
> Note that the check for pending callback is necessary to avoid spurious warnings
> if there are no pendings callbacks.
>
> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
> ---
> kernel/rcu/tiny_plugin.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tiny_plugin.h b/kernel/rcu/tiny_plugin.h
> index 858c565..868e132 100644
> --- a/kernel/rcu/tiny_plugin.h
> +++ b/kernel/rcu/tiny_plugin.h
> @@ -145,13 +145,13 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
> rcp->ticks_this_gp++;
> j = jiffies;
> js = ACCESS_ONCE(rcp->jiffies_stall);
> - if (*rcp->curtail && ULONG_CMP_GE(j, js)) {
> + if (rcp->rcucblist && ULONG_CMP_GE(j, js)) {
> pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n",
> rcp->name, rcp->ticks_this_gp, rcu_dynticks_nesting,
> jiffies - rcp->gp_start, rcp->qlen);
> dump_stack();
> }
> - if (*rcp->curtail && ULONG_CMP_GE(j, js))
> + if (rcp->rcucblist && ULONG_CMP_GE(j, js))
> ACCESS_ONCE(rcp->jiffies_stall) = jiffies +
> 3 * rcu_jiffies_till_stall_check() + 3;
> else if (ULONG_CMP_GE(j, js))
> --
> 2.1.2
>
prev parent reply other threads:[~2014-12-22 19:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-10 12:52 rcu_sched stall detected, but no state dump Miroslav Benes
2014-12-10 16:28 ` Paul E. McKenney
2014-12-11 9:35 ` Miroslav Benes
2014-12-11 16:50 ` Paul E. McKenney
2014-12-11 19:09 ` Paul E. McKenney
2014-12-12 14:06 ` Miroslav Benes
2014-12-12 16:58 ` Paul E. McKenney
2014-12-15 13:26 ` Miroslav Benes
2014-12-16 18:42 ` Paul E. McKenney
2014-12-19 11:09 ` Miroslav Benes
2014-12-19 15:32 ` Paul E. McKenney
2014-12-21 17:46 ` Paul E. McKenney
2014-12-22 12:42 ` Miroslav Benes
2014-12-22 19:40 ` Paul E. McKenney [this message]
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=20141222194011.GV11609@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
/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