From: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Paul Gortmaker
<paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
Subject: [PATCH 3/4] cpumask: add a "none" alias to complement "all"
Date: Sun, 8 Nov 2020 11:08:15 -0500 [thread overview]
Message-ID: <20201108160816.896881-4-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <20201108160816.896881-1-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
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-CWA4WttNNZF54TAoqtyWWQ@public.gmane.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 ef98ca700946..9e1c4522e1f0 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 15599cdf5db6..eb8b1c92501e 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;
+ }
+
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits);
}
EXPORT_SYMBOL(cpulist_parse);
--
2.25.1
next prev parent reply other threads:[~2020-11-08 16:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-08 16:08 [PATCH 0/4] RFC: support for global CPU list abbreviations Paul Gortmaker
2020-11-08 16:08 ` [PATCH 1/4] cpumask: un-inline cpulist_parse; prepare for ascii helpers Paul Gortmaker
[not found] ` <20201108160816.896881-1-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2020-11-08 16:08 ` [PATCH 2/4] cpumask: make "all" alias global and not just RCU Paul Gortmaker
2020-11-08 16:08 ` Paul Gortmaker [this message]
2020-11-08 16:08 ` [PATCH 4/4] cpumask: add "last" alias for cpu list specifications Paul Gortmaker
2020-11-08 18:02 ` [PATCH 0/4] RFC: support for global CPU list abbreviations Paul E. McKenney
2020-11-08 20:21 ` Paul Gortmaker
[not found] ` <ca462940-c81d-d968-c870-e1a991331522-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2020-11-08 21:24 ` Paul E. McKenney
-- strict thread matches above, loose matches on Subject: below --
2020-11-10 4:07 [PATCH v2 0/4] " Paul Gortmaker
2020-11-10 4:07 ` [PATCH 3/4] cpumask: add a "none" alias to complement "all" 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=20201108160816.896881-4-paul.gortmaker@windriver.com \
--to=paul.gortmaker-cwa4wttnnzf54taoqtywwq@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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