linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: paulmck@kernel.org
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	kernel-team@fb.com, Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH RFC cpumask 3/5] cpumask: Add a "none" alias to complement "all"
Date: Tue, 5 Jan 2021 22:59:52 -0800	[thread overview]
Message-ID: <CAAH8bW_-TVmfXspHXgW8MkcacZUiVYA+RTC72R0WookJUW=1SA@mail.gmail.com> (raw)
In-Reply-To: <20210106004956.11961-3-paulmck@kernel.org>

On Tue, Jan 5, 2021 at 4:49 PM <paulmck@kernel.org> wrote:
>
> From: Paul Gortmaker <paul.gortmaker@windriver.com>
>
> With global support for a CPU list alias of "all", it seems to just make
> sense to also trivially extend support for an opposite "none" specifier.
>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> ---
>  Documentation/admin-guide/kernel-parameters.rst | 6 ++++++
>  lib/cpumask.c                                   | 5 +++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst
> index cdf4e81..7dd1224 100644
> --- a/Documentation/admin-guide/kernel-parameters.rst
> +++ b/Documentation/admin-guide/kernel-parameters.rst
> @@ -76,6 +76,12 @@ is equivalent to "foo_cpus=0-N" -- where "N" is the numerically last CPU on
>  the system, thus avoiding looking up the value in "/sys/devices/system/cpu"
>  in advance on each deployed system.
>
> +        foo_cpus=none
> +
> +will provide an empty/cleared cpu mask for the associated boot argument.
> +
> +Note that "all" and "none" are not necessarily valid/sensible input values
> +for each available parameter expecting a CPU list.
>
>  This document may not be entirely up to date and comprehensive. The command
>  "modinfo -p ${modulename}" shows a current list of all parameters of a loadable
> diff --git a/lib/cpumask.c b/lib/cpumask.c
> index 9f8ff72..7fbcab8 100644
> --- a/lib/cpumask.c
> +++ b/lib/cpumask.c
> @@ -110,6 +110,11 @@ int cpulist_parse(const char *buf, struct cpumask *dstp)
>                 return 0;
>         }
>
> +       if (!strcmp(buf, "none")) {
> +               cpumask_clear(dstp);
> +               return 0;
> +       }

Same comment as to the patch 2. Also, what if a user wants to stack ranges
like 'all, 1-3, none'? As far as I understand current implementation,
cpu_parselist
will pass new keywords to bitmap_parselist() which will fail to parse it.

If you think of new extensions as special case keywords which should not be
mixed with traditional region descriptors, I'm OK with that. But it should be
explained in documentation. I think it's better to handle 'all' and 'none' in
bitmap_parse_region().

The parselist() supports partially used groups with the notation like:
0-1023:2/256 ==> 0,1,256,257,512,513,768,769
I think it's worth making sure that new keywords work with groups smoothly,
otherwise mention in documentation that they don't.

>         return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits);
>  }
>  EXPORT_SYMBOL(cpulist_parse);
> --
> 2.9.5
>

  reply	other threads:[~2021-01-06  7:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  0:48 [PATCH RFC cpumask] Allow "all", "none", and "last" in cpumask strings Paul E. McKenney
2021-01-06  0:49 ` [PATCH RFC cpumask 1/5] cpumask: Un-inline cpulist_parse for SMP; prepare for ascii helpers paulmck
2021-01-06  0:49 ` [PATCH RFC cpumask 2/5] cpumask: Make "all" alias global and not just RCU paulmck
2021-01-06  6:32   ` Yury Norov
2021-01-06  0:49 ` [PATCH RFC cpumask 3/5] cpumask: Add a "none" alias to complement "all" paulmck
2021-01-06  6:59   ` Yury Norov [this message]
2021-01-06  0:49 ` [PATCH RFC cpumask 4/5] cpumask: Add "last" alias for cpu list specifications paulmck
2021-01-06  8:41   ` Yury Norov
2021-01-06  9:49   ` Peter Zijlstra
2021-01-06 17:45     ` Paul Gortmaker
2021-01-06 21:16     ` Yury Norov
2021-01-07 14:18       ` Peter Zijlstra
2021-01-07 14:47         ` Paul E. McKenney
2021-01-07 14:59           ` Peter Zijlstra
2021-01-07 15:32             ` Paul E. McKenney
2021-01-07 15:05         ` Paul E. McKenney
2021-01-06  0:49 ` [PATCH RFC cpumask 5/5] rcutorture: Use "all" and "last" in "nohz_full" and "rcu_nocbs" paulmck
2021-01-06  8:49 ` [PATCH RFC cpumask] Allow "all", "none", and "last" in cpumask strings Yury Norov
2021-01-21  7:11   ` Yury Norov
2021-01-21 16:57     ` Paul E. McKenney
2021-01-21 21:39       ` Paul E. McKenney
2021-01-21 22:42     ` Paul Gortmaker

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='CAAH8bW_-TVmfXspHXgW8MkcacZUiVYA+RTC72R0WookJUW=1SA@mail.gmail.com' \
    --to=yury.norov@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).