mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Byungchul Park <max.byungchul.park@gmail.com>
Cc: Byungchul Park <byungchul.park@lge.com>,
	rostedt@goodmis.org, josh@joshtriplett.org,
	jiangshanlai@gmail.com, kernel-team@lge.com,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] rcu: Prevent expedite reporting within RCU read-side section
Date: Tue, 6 Mar 2018 09:24:35 -0800	[thread overview]
Message-ID: <20180306172435.GV3918@linux.vnet.ibm.com> (raw)
In-Reply-To: <CANrsvROu6fOu8vOubS2Z4m9nHYQtxw4+WTwz1UqeaLJ66_bQ1g@mail.gmail.com>

On Tue, Mar 06, 2018 at 09:43:19PM +0900, Byungchul Park wrote:
> On Mar 6, 2018 2:34 PM, "Byungchul Park" <byungchul.park@lge.com> wrote:
> >
> > Hello Paul and RCU folks,
> >
> > I am afraid I correctly understand and fix it. But I really wonder why
> > sync_rcu_exp_handler() reports the quiescent state even in the case that
> > current task is within a RCU read-side section. Do I miss something?
> 
> Hello,
> 
> I missed the fact that the original code is anyway safe because
> the case is gonna be handled properly in rcu_read_unlock().
> 
> This patch just makes unnecessary spin lock/unlock within *report*()
> avoided. Please ignore this if you don't think it's that worthy. I am
> also not sure if it is.
> 
> Sorry bothering you. And thanks.

Not a problem, especially given that you figured it out before I got
to your email.  And thank you for your review of RCU!

							Thanx, Paul

> > If I correctly understand it and you agree with it, I can add more logic
> > which make it more expedited by boosting current or making it urgent
> > when we fail to report the quiescent state on the IPI.
> >
> > ----->8-----
> > From 0b0191f506c19ce331a1fdb7c2c5a00fb23fbcf2 Mon Sep 17 00:00:00 2001
> > From: Byungchul Park <byungchul.park@lge.com>
> > Date: Tue, 6 Mar 2018 13:54:41 +0900
> > Subject: [RFC] rcu: Prevent expedite reporting within RCU read-side section
> >
> > We report the quiescent state for this cpu if it's out of RCU read-side
> > section at the moment IPI was just fired during the expedite process.
> >
> > However, current code reports the quiescent state even in the case:
> >
> >    1) the current task is still within a RCU read-side section
> >    2) the current task has been blocked within the RCU read-side section
> >
> > Since we don't get to the quiescent state yet in the case, we shouldn't
> > report it but check it another time.
> >
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  kernel/rcu/tree_exp.h | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
> > index 73e1d3d..cc69d14 100644
> > --- a/kernel/rcu/tree_exp.h
> > +++ b/kernel/rcu/tree_exp.h
> > @@ -731,13 +731,13 @@ static void sync_rcu_exp_handler(void *info)
> >         /*
> >          * We are either exiting an RCU read-side critical section (negative
> >          * values of t->rcu_read_lock_nesting) or are not in one at all
> > -        * (zero value of t->rcu_read_lock_nesting).  Or we are in an RCU
> > -        * read-side critical section that blocked before this expedited
> > -        * grace period started.  Either way, we can immediately report
> > -        * the quiescent state.
> > +        * (zero value of t->rcu_read_lock_nesting). We can immediately
> > +        * report the quiescent state.
> >          */
> > -       rdp = this_cpu_ptr(rsp->rda);
> > -       rcu_report_exp_rdp(rsp, rdp, true);
> > +       if (t->rcu_read_lock_nesting <= 0) {
> > +               rdp = this_cpu_ptr(rsp->rda);
> > +               rcu_report_exp_rdp(rsp, rdp, true);
> > +       }
> >  }
> >
> >  /**
> > --
> > 1.9.1
> >
> 

  reply	other threads:[~2018-03-06 17:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  5:31 Byungchul Park
     [not found] ` <CANrsvRO-QUS0p_2KMgNJN5h64mN49J37uh7KSYm7Fo5csi_t1w@mail.gmail.com>
2018-03-06 12:43   ` Byungchul Park
2018-03-06 17:24     ` Paul E. McKenney [this message]
2018-03-06 13:42 ` Boqun Feng
2018-03-06 17:25   ` Paul E. McKenney
2018-03-07  5:55   ` Byungchul Park
2018-03-07  6:25     ` Byungchul Park
2018-03-07 15:03       ` Paul E. McKenney
2018-03-08 10:08         ` Byungchul Park
2018-03-08 18:01           ` Paul E. McKenney
2018-03-09  8:41             ` Byungchul Park
2018-03-09  8:53               ` Byungchul Park

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=20180306172435.GV3918@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=byungchul.park@lge.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=max.byungchul.park@gmail.com \
    --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

Powered by JetHome