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: LKML <linux-kernel@vger.kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	rcu <rcu@vger.kernel.org>, Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH RFC] rcu/nocb: Provide default all-CPUs mask for RCU_NOCB_CPU=y
Date: Thu, 14 Apr 2022 15:37:01 -0700	[thread overview]
Message-ID: <20220414223701.GD4285@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <CAEXW_YT0CDp7kqKVeqGRT8YfXiCYuL0ZgRwz05MQrmns2Yp+2Q@mail.gmail.com>

On Thu, Apr 14, 2022 at 05:38:08PM -0400, Joel Fernandes wrote:
> On Thu, Apr 14, 2022 at 5:31 PM Paul E. McKenney <paulmck@kernel.org> wrote:
> >
> > On Thu, Apr 14, 2022 at 09:14:05PM +0000, Joel Fernandes wrote:
> > > On Thu, Apr 14, 2022 at 02:09:33PM -0700, Paul E. McKenney wrote:
> > > > On Thu, Apr 14, 2022 at 03:49:16PM -0400, Joel Fernandes wrote:
> > > > > On Thu, Apr 14, 2022 at 3:42 PM Paul E. McKenney <paulmck@kernel.org> wrote:
> > > > > >
> > > > > > On Thu, Apr 14, 2022 at 07:19:48PM +0000, Joel Fernandes wrote:
> > > > > > > On Mon, Apr 11, 2022 at 08:41:09AM -0700, Paul E. McKenney wrote:
> > > > > > > [..]
> > > > > > > > > > [4]     All CPUs are offloaded at boot, and any CPU can be de-offloaded
> > > > > > > > > >         and offloaded at runtime.  This is the same behavior that
> > > > > > > > > >         you would currently get with CONFIG_RCU_NOCB_CPU_ALL=n and
> > > > > > > > > >         rcu_nocbs=0-N.
> > > > > > > > >
> > > > > > > > > Yes, this is the behavior I intend. So then there would not be a need
> > > > > > > > > to pass a mask (and I suspect for a large number of users, it
> > > > > > > > > simplifies boot params).
> > > > > > > >
> > > > > > > > Very good, and from what I can see, this should work for everyone.
> > > > > > >
> > > > > > > Just to clarify, what I am going to do is, if this new option =y, then
> > > > > > > rcu_nocbs effectively wont do anything. i.e. All CPUs are offloaded at boot.
> > > > > > > Let me know if we are not on the same page about it though. I do feel that is
> > > > > > > a sensible choice given =y. If we are on same page, please ignore my comment.
> > > > > >
> > > > > > I was assuming that the rcu_nocbs=??? for non-empty "???" would override
> > > > > > the CONFIG_RCU_NOCB_CPU_ALL=y.  If you choose not to do that, shouldn't
> > > > > > you at least issue some sort of diagnostic?  After all, the sysadmin
> > > > > > gave a kernel-boot parameter asking the code to do something and the
> > > > > > code is choosing not to do that something.
> > > > > >
> > > > > > Of course, such a sysadmin might want the CONFIG_RCU_NOCB_CPU_ALL=y
> > > > > > Kconfig option to affect only the default, that is, when no rcu_nocbs
> > > > > > kernel boot parameter is specified.  This would change the second "[4]"
> > > > > > in my original table to "[2]".
> > > > > >
> > > > > > Thoughts?
> > > > >
> > > > > I thought about that. I feel that since we are defaulting the new
> > > > > config option to =n , it is a conscious choice by the distro to set it
> > > > > to =y.  In such a case, they should be Ok with offloading all CPUs. If
> > > > > they decide to selectively offload some CPUs in the future, then they
> > > > > could revisit the config option at that time.
> > > > >
> > > > > I feel the kernel config should override the boot parameter behavior.
> > > > > It is the same effect as a sysadmin passing kernel parameter X
> > > > > assuming the kernel does something but the CONFIG option might not
> > > > > even build code corresponding to X.
> > > > >
> > > > > I feel to address your concern, we can document in kernel command line
> > > > > documentation that rcu_nocbs= does not have an effect if
> > > > > CONFIG_RCU_NOCB_CPU_ALL=y, would that work for you?
> > > >
> > > > Not me so much, because I would just set CONFIG_RCU_NOCB_CPU_ALL=n so
> > > > as to not worry about it.
> > > >
> > > > But I am not at all looking forward to complaints about rcu_nocbs not
> > > > working the way people expect.  So let's take some time to think more
> > > > carefully about this.
> > >
> > > That's a fair concern. But we are defaulting it to 'n' so I think if it is
> > > unconsciously enabled without someone reading documentation, then that's a
> > > slightly different issue.
> >
> > Suppose that one group decides to change to CONFIG_RCU_NOCB_CPU_ALL=y,
> > and some other group on some other continent happens to be using the
> > rcu_nocbs boot parameter (having read the documentation).  And suppose
> > that the level of communication between the two groups is typical,
> > that is to say, nonexistent.
> >
> > Sure, we can argue that groups should communicate, but our making that
> > argument won't necessarily prevent the group using rcu_nocbs from taking
> > us to task in the course of their debugging effort.
> >
> > > On the other hand, I can also make it such that if rcu_nocbs= is passed, then
> > > the CONFIG does not take effect. That's quite a bit weird/quirky IMHO.
> >
> > Not at all.  We can simply say that CONFIG_RCU_NOCB_CPU_ALL controls
> > only the default situation, that is, when rcu_nocbs is not specified.
> 
> Then it should be called: CONFIG_RCU_NOCB_CPU_DEFAULT_ALL , or
> something. Otherwise I can tell you that I will be the first one to be
> confused by menuconfig unless I also read the code :-D

I am OK with CONFIG_RCU_NOCB_CPU_DEFAULT_ALL.

							Thanx, Paul

  reply	other threads:[~2022-04-14 22:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 21:07 Joel Fernandes
2022-04-08 14:22 ` Paul E. McKenney
2022-04-08 14:52   ` Joel Fernandes
2022-04-08 15:50     ` Paul E. McKenney
2022-04-08 17:20       ` Joel Fernandes
2022-04-08 17:49         ` Paul E. McKenney
2022-04-08 18:22           ` Joel Fernandes
2022-04-08 18:23             ` Joel Fernandes
2022-04-08 20:54               ` Paul E. McKenney
2022-04-08 21:46                 ` Uladzislau Rezki
2022-04-11 14:08                   ` Paul E. McKenney
2022-04-11 15:20                     ` Uladzislau Rezki
2022-04-11 15:17                 ` Joel Fernandes
2022-04-11 15:41                   ` Paul E. McKenney
2022-04-14 19:19                     ` Joel Fernandes
2022-04-14 19:42                       ` Paul E. McKenney
2022-04-14 19:49                         ` Joel Fernandes
2022-04-14 19:51                           ` Joel Fernandes
2022-04-14 21:10                             ` Paul E. McKenney
2022-04-14 21:09                           ` Paul E. McKenney
2022-04-14 21:14                             ` Joel Fernandes
2022-04-14 21:31                               ` Paul E. McKenney
2022-04-14 21:38                                 ` Joel Fernandes
2022-04-14 22:37                                   ` Paul E. McKenney [this message]
2022-04-20 20:36                                   ` Steven Rostedt
2022-04-11 13:49 ` Uladzislau Rezki
2022-04-11 15:17   ` Joel Fernandes

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=20220414223701.GD4285@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.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®