From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Li Zefan <lizefan@huawei.com>, Ingo Molnar <mingo@kernel.org>,
Yury Norov <yury.norov@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Josh Triplett <josh@joshtriplett.org>,
Peter Zijlstra <peterz@infradead.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH v4 0/8] support for bitmap (and hence CPU) list "N" abbreviation
Date: Tue, 9 Feb 2021 17:58:59 -0500 [thread overview]
Message-ID: <20210209225907.78405-1-paul.gortmaker@windriver.com> (raw)
The basic objective here was to add support for "nohz_full=8-N" and/or
"rcu_nocbs="4-N" -- essentially introduce "N" as a portable reference
to the last core, evaluated at boot for anything using a CPU list.
The thinking behind this, is that people carve off a few early CPUs to
support housekeeping tasks, and perhaps dedicate one to a busy I/O
peripheral, and then the remaining pool of CPUs out to the end are a
part of a commonly configured pool used for the real work the user
cares about.
Extend that logic out to a fleet of machines - some new, and some
nearing EOL, and you've probably got a wide range of core counts to
contend with - even though the early number of cores dedicated to the
system overhead probably doesn't vary.
This change would enable sysadmins to have a common bootarg across all
such systems, and would also avoid any off-by-one fencepost errors that
happen for users who might briefly forget that core counts start at zero.
Originally I did this at the CPU subsys level, but Yury suggested it
be moved down further to bitmap level itself, which made the core
implementation smaller and less complex, but the series longer.
New self tests are added to better exercise what bitmap range/region
currently supports, and new tests are added for the new "N" support.
Also tested boot arg and the post-boot cgroup use case as per below:
root@hackbox:~# cat /proc/cmdline
BOOT_IMAGE=/boot/bzImage root=/dev/sda1 rcu_nocbs=2,3,8-N:1/2
root@hackbox:~# dmesg|grep Offl
rcu: Offload RCU callbacks from CPUs: 2-3,8,10,12,14.
root@hackbox:/sys/fs/cgroup/cpuset/foo# cat cpuset.cpus
root@hackbox:/sys/fs/cgroup/cpuset/foo# /bin/echo 10-N > cpuset.cpus
root@hackbox:/sys/fs/cgroup/cpuset/foo# cat cpuset.cpus
10-15
root@hackbox:/sys/fs/cgroup/cpuset/foo# /bin/echo N-N:N/N > cpuset.cpus
root@hackbox:/sys/fs/cgroup/cpuset/foo# cat cpuset.cpus
15
This was on a 16 core machine with CONFIG_NR_CPUS=16 in .config file.
Note that "N" is a dynamic quantity, and can change scope if the bitmap
is changed in size. So at the risk of stating the obvious, don't use it
for "burn_eFuse=128-N" or "secure_erase_firmware=32-N" type stuff.
Paul.
---
I've intentionally not gone down the rabbit hole of whether N or Z or
L is the better letter to mark the end of a mathematical set in the
hope that we can stay focused, and get this closed out here in v4.
Aside from that, I believe all other feedback has been responded to
in one way or another. Note that I didn't add Reviewed/Ack tags to
anything that changed significantly from what was reviewed in v3.
[v4: pair nbits with region, instead of inside it. Split EINVAL and
ERANGE tests. Don't handle start/end/offset within a macro to
abstract away nbits usage. Added some Reviwed-by/Ack tags.]
[v3: Allow "N" to be used anywhere in the region spec, i.e. "N-N:N/N" vs.
just being allowed at end of range like "0-N". Add new self-tests. Drop
"all" and "none" aliases as redundant and not worth the extra complication. ]
https://lore.kernel.org/lkml/20210126171141.122639-1-paul.gortmaker@windriver.com
[v2: push code down from cpu subsys to core bitmap code as per
Yury's comments. Change "last" to simply be "N" as per PeterZ.]
https://lore.kernel.org/lkml/20210121223355.59780-1-paul.gortmaker@windriver.com/
[v1: https://lore.kernel.org/lkml/20210106004850.GA11682@paulmck-ThinkPad-P72/
Cc: Li Zefan <lizefan@huawei.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Yury Norov <yury.norov@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Paul Gortmaker (8):
lib: test_bitmap: clearly separate ERANGE from EINVAL tests.
lib: test_bitmap: add tests to trigger ERANGE case.
lib: test_bitmap: add more start-end:offset/len tests
lib: bitmap: move ERANGE check from set_region to check_region
lib: bitmap: pair nbits value with region struct
lib: bitmap: support "N" as an alias for size of bitmap
lib: test_bitmap: add tests for "N" alias
rcu: deprecate "all" option to rcu_nocbs=
.../admin-guide/kernel-parameters.rst | 7 +++
.../admin-guide/kernel-parameters.txt | 4 +-
kernel/rcu/tree_plugin.h | 6 +-
lib/bitmap.c | 62 +++++++++++++------
lib/test_bitmap.c | 46 ++++++++++++--
5 files changed, 93 insertions(+), 32 deletions(-)
--
2.17.1
next reply other threads:[~2021-02-10 2:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 22:58 Paul Gortmaker [this message]
2021-02-09 22:59 ` [PATCH 1/8] lib: test_bitmap: clearly separate ERANGE from EINVAL tests Paul Gortmaker
2021-02-09 22:59 ` [PATCH 2/8] lib: test_bitmap: add tests to trigger ERANGE case Paul Gortmaker
2021-02-10 16:27 ` Andy Shevchenko
2021-02-09 22:59 ` [PATCH 3/8] lib: test_bitmap: add more start-end:offset/len tests Paul Gortmaker
2021-02-09 22:59 ` [PATCH 4/8] lib: bitmap: move ERANGE check from set_region to check_region Paul Gortmaker
2021-02-10 16:28 ` Andy Shevchenko
2021-02-09 22:59 ` [PATCH 5/8] lib: bitmap: pair nbits value with region struct Paul Gortmaker
2021-02-10 16:34 ` Andy Shevchenko
2021-02-09 22:59 ` [PATCH 6/8] lib: bitmap: support "N" as an alias for size of bitmap Paul Gortmaker
2021-02-09 23:16 ` Yury Norov
2021-02-10 15:58 ` Paul Gortmaker
2021-02-10 16:49 ` Andy Shevchenko
2021-02-12 1:24 ` Yury Norov
2021-02-21 8:07 ` Paul Gortmaker
2021-02-09 22:59 ` [PATCH 7/8] lib: test_bitmap: add tests for "N" alias Paul Gortmaker
2021-02-09 22:59 ` [PATCH 8/8] rcu: deprecate "all" option to rcu_nocbs= Paul Gortmaker
2021-02-10 16:26 ` [PATCH v4 0/8] support for bitmap (and hence CPU) list "N" abbreviation Andy Shevchenko
2021-02-10 17:57 ` Paul E. McKenney
2021-02-10 23:50 ` Yury Norov
2021-02-11 0:23 ` Paul E. McKenney
2021-02-12 0:23 ` Yury Norov
2021-02-12 0:38 ` Paul E. McKenney
2021-02-21 8:02 ` Paul Gortmaker
2021-02-11 11:04 ` Rasmus Villemoes
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=20210209225907.78405-1-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=fweisbec@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=yury.norov@gmail.com \
/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).