public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Byungchul Park <byungchul.park@lge.com>
Cc: jiangshanlai@gmail.com, josh@joshtriplett.org,
	rostedt@goodmis.org, mathieu.desnoyers@efficios.com,
	linux-kernel@vger.kernel.org, kernel-team@lge.com
Subject: Re: [PATCH] rcu: Clean up rcu_init_nohz() by removing unnecessary statements
Date: Thu, 1 Mar 2018 17:00:48 -0800	[thread overview]
Message-ID: <20180302010048.GM3777@linux.vnet.ibm.com> (raw)
In-Reply-To: <166b5b47-8b6f-4b35-df4c-b42b47a173da@lge.com>

On Fri, Mar 02, 2018 at 09:01:19AM +0900, Byungchul Park wrote:
> On 3/1/2018 3:41 AM, Paul E. McKenney wrote:
> >On Wed, Feb 28, 2018 at 06:04:55PM +0900, Byungchul Park wrote:
> >>Since the commit 44c65ff2e3b0(rcu: Eliminate NOCBs CPU-state Kconfig
> >>options) made nocb-cpus identified only through the rcu_nocbs= boot
> >>parameter, we don't have to care NOCBs CPU-state Kconfig options
> >>anymore, which means now we can just rely on rcu_nocb_mask to
> >>decide whether going ahead in rcu_init_nohz().
> >>
> >>Remove the deprecated code.
> >>
> >>Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> >
> >Good catch!  However, you missed a (relatively harmless) bug in my commit
> >44c65ff2e3b0, namely that if neither the nohz_full= nor the rcu_nocbs=
> >kernel boot parameters specify any CPUs, we don't need to allocate
> >rcu_nocb_mask.  (That is, when both of those parameters are omitted.)
> >
> >Now, if the rcu_nocbs= kernel boot parameter was specified, we know that
> >rcu_nocb_mask was already allocated in rcu_nocb_setup().  So in
> >rcu_init_nohz() we only need to do the allocation if NO_HZ_FULL needs
> >some NOCBs CPUs, that is, when tick_nohz_full_running and when there
> >is at least one CPU specified in tick_nohz_full_mask.
> 
> Why didn't I catch it in advance? :)

I guess that sentiment goes well with my "why didn't I avoid that bug
in the first place?"  ;-)

> >So the change that is actually needed is to reverse the initialization
> >of need_rcu_nocb_mask, that is, to initialize it to false rather than
> >to true.  I annotated your patch with my reasoning and have a patch
> >below with your Reported-by.  Please take a look and let me know what
> >you think.
> 
> No doubt. I agree with you.
> 
> Acked-by: Byungchul Park <byungchul.park@lge.com>

Applied, thank you!

							Thanx, Paul

> >If I am not too confused, the only effect of this bug was to needlessly
> >allocate rcu_nocb_mask and to initialize it to all zeros bits, but please
> >let me know if I missed something.
> 
> I think so as you.
> 
> -- 
> Thanks,
> Byungchul
> 

      reply	other threads:[~2018-03-02  1:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  9:04 [PATCH] rcu: Clean up rcu_init_nohz() by removing unnecessary statements Byungchul Park
2018-02-28 18:41 ` Paul E. McKenney
2018-03-02  0:01   ` Byungchul Park
2018-03-02  1:00     ` Paul E. McKenney [this message]

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=20180302010048.GM3777@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=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