mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: "Neeraj Upadhyay (AMD)" <neeraj.iitr10@gmail.com>,
	rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, rostedt@goodmis.org,
	Neeraj.Upadhyay@amd.com,
	Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH rcu 3/3] srcu: Explain why callbacks invocations can't run concurrently
Date: Wed, 13 Dec 2023 09:52:35 -0800	[thread overview]
Message-ID: <2b2c1573-337d-409b-a8ee-daeff096c7f4@paulmck-laptop> (raw)
In-Reply-To: <CAEXW_YRHjdM+NA3CqNuwaRNXkRWbtypmt5Ov=YXnrpn3Eo-==Q@mail.gmail.com>

On Wed, Dec 13, 2023 at 09:27:09AM -0500, Joel Fernandes wrote:
> On Tue, Dec 12, 2023 at 12:48 PM Neeraj Upadhyay (AMD)
> <neeraj.iitr10@gmail.com> wrote:
> >
> > From: Frederic Weisbecker <frederic@kernel.org>
> >
> > If an SRCU barrier is queued while callbacks are running and a new
> > callbacks invocator for the same sdp were to run concurrently, the
> > RCU barrier might execute too early. As this requirement is non-obvious,
> > make sure to keep a record.
> >
> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> > Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.iitr10@gmail.com>
> > ---
> >  kernel/rcu/srcutree.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > index 2bfc8ed1eed2..0351a4e83529 100644
> > --- a/kernel/rcu/srcutree.c
> > +++ b/kernel/rcu/srcutree.c
> > @@ -1715,6 +1715,11 @@ static void srcu_invoke_callbacks(struct work_struct *work)
> >         WARN_ON_ONCE(!rcu_segcblist_segempty(&sdp->srcu_cblist, RCU_NEXT_TAIL));
> >         rcu_segcblist_advance(&sdp->srcu_cblist,
> >                               rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq));
> > +       /*
> > +        * Although this function is theoretically re-entrant, concurrent
> > +        * callbacks invocation is disallowed to avoid executing an SRCU barrier
> > +        * too early.
> > +        */
> 
> Side comment:
> I guess even without the barrier reasoning, it is best not to allow
> concurrent CB execution anyway since it diverges from the behavior of
> straight RCU :)

Good point!

But please do not forget item 12 on the list in checklist.rst.  ;-)
(Which I just updated to include the other call_rcu*() functions.)

							Thanx, Paul

  reply	other threads:[~2023-12-13 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 17:47 [PATCH rcu 0/3] SRCU updates for v6.8 Neeraj Upadhyay (AMD)
2023-12-12 17:48 ` [PATCH rcu 1/3] srcu: Remove superfluous callbacks advancing from srcu_gp_start() Neeraj Upadhyay (AMD)
2023-12-12 17:48 ` [PATCH rcu 2/3] srcu: No need to advance/accelerate if no callback enqueued Neeraj Upadhyay (AMD)
2023-12-12 17:48 ` [PATCH rcu 3/3] srcu: Explain why callbacks invocations can't run concurrently Neeraj Upadhyay (AMD)
2023-12-13 14:27   ` Joel Fernandes
2023-12-13 17:52     ` Paul E. McKenney [this message]
2023-12-13 18:35       ` Joel Fernandes
2023-12-13 18:55         ` Paul E. McKenney
2023-12-13 19:01           ` Joel Fernandes
2023-12-13 18:18 ` [PATCH rcu 4/3] srcu: Use try-lock lockdep annotation for NMI-safe access Neeraj Upadhyay (AMD)

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=2b2c1573-337d-409b-a8ee-daeff096c7f4@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=Neeraj.Upadhyay@amd.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.iitr10@gmail.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®