From: "Paul E. McKenney" <paulmck@kernel.org>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: boqun.feng@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: One potential issue with concurrent execution of RCU callbacks...
Date: Tue, 8 Dec 2020 16:03:06 -0800 [thread overview]
Message-ID: <20201209000306.GZ2657@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20201208220438.GC3916@lothringen>
On Tue, Dec 08, 2020 at 11:04:38PM +0100, Frederic Weisbecker wrote:
> On Tue, Dec 08, 2020 at 10:24:09AM -0800, Paul E. McKenney wrote:
> > > It reduces the code scope running with BH disabled.
> > > Also narrowing down helps to understand what it actually protects.
> >
> > I thought that you would call out unnecessarily delaying other softirq
> > handlers. ;-)
> >
> > But if such delays are a problem (and they might well be), then to
> > avoid them on non-rcu_nocb CPUs would instead/also require changing the
> > early-exit checks to check for other pending softirqs to the existing
> > checks involving time, need_resched, and idle. At which point, entering and
> > exiting BH-disabled again doesn't help, other than your point about the
> > difference in BH-disabled scopes on rcu_nocb and non-rcu_nocb CPUs.
>
> Wise observation!
>
> > Would it make sense to exit rcu_do_batch() if more than some amount
> > of time had elapsed and there was some non-RCU softirq pending?
> >
> > My guess is that the current tlimit checks in rcu_do_batch() make this
> > unnecessary.
>
> Right and nobody has complained about it so far.
If they did, my thought would be to add another early-exit check,
but under the tlimit check, so that pending non-RCU softirqs might
set a shorter time limit. For example, instead of allowing up to the
current one second in rcu_do_batch(), allow only up to 100 milliseconds
or whatever. But there are lots of choices, which is one reason to wait
until it becomes a problem.
> But I should add a comment explaining the reason for the BH-disabled
> section in my series.
That sounds like a most excellent idea, please do!
Thanx, Paul
next prev parent reply other threads:[~2020-12-09 0:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 14:58 One potential issue with concurrent execution of RCU callbacks Paul E. McKenney
2020-12-08 15:54 ` Frederic Weisbecker
2020-12-08 17:19 ` Paul E. McKenney
2020-12-08 17:52 ` Frederic Weisbecker
2020-12-08 18:24 ` Paul E. McKenney
2020-12-08 22:04 ` Frederic Weisbecker
2020-12-09 0:03 ` Paul E. McKenney [this message]
2020-12-09 2:14 ` Boqun Feng
2020-12-10 0:50 ` 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=20201209000306.GZ2657@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rcu@vger.kernel.org \
/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