From: "Paul E. McKenney" <paulmck@kernel.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: "boqun.feng@gmail.com" <boqun.feng@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
"rcu@vger.kernel.org" <rcu@vger.kernel.org>,
vkuznets <vkuznets@redhat.com>,
Michael Kelley <mikelley@microsoft.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: kdump always hangs in rcu_barrier() -> wait_for_completion()
Date: Thu, 26 Nov 2020 13:42:26 -0800 [thread overview]
Message-ID: <20201126214226.GS1437@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <MW2PR2101MB18014505C01027A9486D45EEBFF91@MW2PR2101MB1801.namprd21.prod.outlook.com>
On Thu, Nov 26, 2020 at 09:25:28PM +0000, Dexuan Cui wrote:
> > From: Paul E. McKenney <paulmck@kernel.org>
> > Sent: Thursday, November 26, 2020 7:47 AM
> > ...
> > The rcu_segcblist_n_cbs() function returns non-zero because something
> > invoked call_rcu() some time previously. The ftrace facility (or just
> > a printk) should help you work out where that call_rcu() is located.
>
> call_rcu() is indeed called multiple times, but as you said, this should
> be normal.
Good to know, thank you!
> > My best guess is that the underlying bug is that you are invoking
> > rcu_barrier() before the RCU grace-period kthread has been created.
> > This means that RCU grace periods cannot complete, which in turn means
> > that if there has been even one invocation of call_rcu() since boot,
> > rcu_barrier() cannot complete, which is what you are in fact seeing.
> > Please note that it is perfectly legal to invoke call_rcu() very early in
> > the boot process, as in even before the call to rcu_init(). Therefore,
> > if this is the case, the bug is the early call to rcu_barrier(), not
> > the early calls to call_rcu().
> >
> > To check this, at the beginning of rcu_barrier(), check the value of
> > rcu_state.gp_kthread. If my guess is correct, it will be NULL.
>
> Unluckily, it's not NULL here. :-)
You can't have everything! ;-)
> > Another possibility is that rcu_state.gp_kthread is non-NULL, but that
> > something else is preventing RCU grace periods from completing, but in
>
> It looks like somehow the scheduling is not working here: in rcu_barrier()
> , if I replace the wait_for_completion() with
> wait_for_completion_timeout(&rcu_state.barrier_completion, 30*HZ), the
> issue persists.
Have you tried using sysreq-t to see what the various tasks are doing?
One way that this can happen is if whatever task is currently running
has managed to enter long loop with interrupts disabled.
> > that case you should see RCU CPU stall warnings. Unless of course they
> > have been disabled.
> > Thanx, Paul
>
> I guess I didn't disable the wanrings (I don't even know how to do that :)
Having interrupts disabled on all CPUs would have the effect of disabling
the RCU CPU stall warnings.
The intended method is in Documentation/admin-guide/kernel-parameters.txt.
Search for rcu_cpu_stall_suppress. Not that it seems important at this
point.
Thanx, Paul
> grep RCU .config
> # RCU Subsystem
> CONFIG_TREE_RCU=y
> # CONFIG_RCU_EXPERT is not set
> CONFIG_SRCU=y
> CONFIG_TREE_SRCU=y
> CONFIG_TASKS_RCU_GENERIC=y
> CONFIG_TASKS_RUDE_RCU=y
> CONFIG_TASKS_TRACE_RCU=y
> CONFIG_RCU_STALL_COMMON=y
> CONFIG_RCU_NEED_SEGCBLIST=y
> CONFIG_RCU_NOCB_CPU=y
> # end of RCU Subsystem
> CONFIG_MMU_GATHER_RCU_TABLE_FREE=y
> # RCU Debugging
> # CONFIG_RCU_SCALE_TEST is not set
> # CONFIG_RCU_TORTURE_TEST is not set
> # CONFIG_RCU_REF_SCALE_TEST is not set
> CONFIG_RCU_CPU_STALL_TIMEOUT=30
> CONFIG_RCU_TRACE=y
> CONFIG_RCU_EQS_DEBUG=y
> # end of RCU Debugging
>
> Thanks,
> -- Dexuan
>
next prev parent reply other threads:[~2020-11-26 21:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 4:56 Dexuan Cui
2020-11-26 15:46 ` Paul E. McKenney
2020-11-26 21:25 ` Dexuan Cui
2020-11-26 21:42 ` Paul E. McKenney [this message]
2020-11-26 22:59 ` Dexuan Cui
2020-11-26 23:54 ` Paul E. McKenney
2021-01-28 7:28 ` Dexuan Cui
2021-01-28 14:58 ` Paul E. McKenney
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=20201126214226.GS1437@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=decui@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=rcu@vger.kernel.org \
--cc=vkuznets@redhat.com \
/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
all inboxes | Powered by JetHome®