public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Zqiang <qiang.zhang1211@gmail.com>,
	quic_neeraju@quicinc.com, joel@joelfernandes.org,
	rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu/nocb: Check rdp_gp->nocb_timer in __call_rcu_nocb_wake()
Date: Fri, 19 Jan 2024 22:47:23 +0100	[thread overview]
Message-ID: <Zart693B-klrEF5I@pavilion.home> (raw)
In-Reply-To: <3b63cf39-3805-4c1d-b79b-fdd5aeb17db3@paulmck-laptop>

Le Thu, Jan 18, 2024 at 06:51:57AM -0800, Paul E. McKenney a écrit :
> On Wed, Jan 17, 2024 at 01:07:25PM +0100, Frederic Weisbecker wrote:
> > Le Wed, Jan 17, 2024 at 06:26:16PM +0800, Zqiang a écrit :
> > > Currently, only rdp_gp->nocb_timer is used, for nocb_timer of
> > > no-rdp_gp structure, the timer_pending() is always return false,
> > > this commit therefore need to check rdp_gp->nocb_timer in
> > > __call_rcu_nocb_wake().
> > > 
> > > Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
> > > ---
> > >  kernel/rcu/tree_nocb.h | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
> > > index 54971afc3a9b..3f85577bddd4 100644
> > > --- a/kernel/rcu/tree_nocb.h
> > > +++ b/kernel/rcu/tree_nocb.h
> > > @@ -564,6 +564,7 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
> > >  	long lazy_len;
> > >  	long len;
> > >  	struct task_struct *t;
> > > +	struct rcu_data *rdp_gp = rdp->nocb_gp_rdp;
> > >  
> > >  	// If we are being polled or there is no kthread, just leave.
> > >  	t = READ_ONCE(rdp->nocb_gp_kthread);
> > > @@ -608,7 +609,7 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
> > >  		smp_mb(); /* Enqueue before timer_pending(). */
> > >  		if ((rdp->nocb_cb_sleep ||
> > >  		     !rcu_segcblist_ready_cbs(&rdp->cblist)) &&
> > > -		    !timer_pending(&rdp->nocb_timer)) {
> > > +		    !timer_pending(&rdp_gp->nocb_timer)) {
> > 
> > Hehe, good eyes ;-)
> > 
> > I had that change in mind but while checking that area further I actually
> > wondered what is the actual purpose of this RCU_NOCB_WAKE_FORCE thing. If
> > we reach that place, it means that the nocb_gp kthread should be awaken
> > already (or the timer pending), so what does a force wake up solve in that
> > case?
> > 
> > Paul, any recollection of that?
> 
> Huh.  We never actually do RCU_NOCB_WAKE_FORCE in v6.7, if I followed
> all the code paths correctly.
> 
> Historically, I have been worried about lost wakeups.  Also, there
> used to be code paths in which a wakeup was not needed, for example,
> because we knew that the ending of the current grace period would take
> care of things.  Unless there was some huge pile of callbacks, in which
> case an immediate wakeup could avoid falling behind a callback flood.

Ok then looks like it's time for me to add RCU_NOCB_WAKE_FORCE removal in
my TODO list...unless Zqiang would like to give it a try? :-)

> 
> Given that rcutorture does test callback flooding, we appear to be OK,
> but maybe it is time to crank up the flooding more.
> 
> On the other hand, I have started seeing the (very) occasional OOM
> on TREE03.
> (In addition to those that show up from time to time on the
> single-CPU TREE09 scenario.)

Interesting, are those recent? Bisectable?

Thanks!

  parent reply	other threads:[~2024-01-19 21:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 10:26 [PATCH] rcu/nocb: Check rdp_gp->nocb_timer in __call_rcu_nocb_wake() Zqiang
2024-01-17 12:07 ` Frederic Weisbecker
2024-01-18 14:51   ` Paul E. McKenney
2024-01-18 14:54     ` Paul E. McKenney
2024-01-19 21:47     ` Frederic Weisbecker [this message]
2024-01-20  0:29       ` Paul E. McKenney
2024-01-22 12:07         ` Paul E. McKenney
2024-01-22 12:11           ` Paul E. McKenney
2024-01-22 21:41             ` Frederic Weisbecker
2024-01-23 10:48               ` Paul E. McKenney
2024-01-23 12:31                 ` Paul E. McKenney
2024-01-24  4:44       ` Z qiang

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=Zart693B-klrEF5I@pavilion.home \
    --to=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=quic_neeraju@quicinc.com \
    --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