From: Zhen Lei <thunder.leizhen@huawei.com>
To: "Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <quic_neeraju@quicinc.com>,
"Josh Triplett" <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>, <rcu@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH v6 0/2] rcu/nocb: Delete local variable 'need_rcu_nocb_mask' in rcu_init_nohz()
Date: Thu, 1 Sep 2022 21:14:34 +0800 [thread overview]
Message-ID: <20220901131436.986-1-thunder.leizhen@huawei.com> (raw)
v5 --> v6:
1. Frist, update patch 1/2, so that, CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y takes
effect only when there are no 'rcu_nocbs=' and 'nohz_full='. Retain the same
semantics as the original.
2. Then, add patch 2/2, so that, CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y takes effect
as long as there is no "rcu_nocbs=" boot parameter. This is suggested by
Frederic Weisbecker.
Test cases and test results as below:
----------------------------------------------------------------------
| CONFIG_NO_HZ_FULL | CONFIG_RCU_NOCB_CPU_DEFAULT_ALL | cmdline |
----------------------------------------------------------------------
1) N | N | none |
2) N | N | rcu_nocbs=1-2 |
3) Y | N | nohz_full=2-3 |
4) Y | N | rcu_nocbs=1 nohz_full=3 |
5) Y | Y | none |
6) Y | Y | rcu_nocbs=1-2 |
7) Y | Y | nohz_full=2-3 |
8) Y | Y | rcu_nocbs=1 nohz_full=3 |
----------------------------------------------------------------------
dmesg | grep "Offload RCU callbacks"
1) none
2) Offload RCU callbacks from CPUs: 1-2.
3) Offload RCU callbacks from CPUs: 2-3.
4) Offload RCU callbacks from CPUs: 1,3.
5) Offload RCU callbacks from CPUs: 0-3.
6) Offload RCU callbacks from CPUs: 1-2.
7) Offload RCU callbacks from CPUs: 0-3.
8) Offload RCU callbacks from CPUs: 1,3.
v4 --> v5:
1. Cancel eliminate rcu_state.nocb_is_setup. It is useful for case 1) below.
Test cases and test results as below:
----------------------------------------------------------------------
| CONFIG_NO_HZ_FULL | CONFIG_RCU_NOCB_CPU_DEFAULT_ALL | cmdline |
----------------------------------------------------------------------
1) N | N | none |
2) N | N | rcu_nocbs=1-2 |
3) Y | N | nohz_full=1-2 |
4) Y | Y | none |
----------------------------------------------------------------------
1)
[ 1018.082417] rcu-torture:--- End of test: SUCCESS (default)
root@genericarmv8:~# dmesg | grep "Offload RCU callbacks"
root@genericarmv8:~# zcat /proc/config.gz | grep NOCB
CONFIG_RCU_NOCB_CPU=y
# CONFIG_RCU_NOCB_CPU_DEFAULT_ALL is not set
root@genericarmv8:~# zcat /proc/config.gz | grep NO_HZ_FULL
# CONFIG_NO_HZ_FULL is not set
root@genericarmv8:~# cat /proc/cmdline
console=ttyS0 earlyprintk=serial root=/dev/sda rw
2) 3) 4)
The same to v4.
v3 --> v4:
Fix a build warning.
- struct cpumask *cpumask = NULL;
+ const struct cpumask *cpumask = NULL;
v2 --> v3:
1. Eliminate rcu_state.nocb_is_setup
2. Update the code based on the above patch and commit b37a667c6242
("rcu/nocb: Add an option to offload all CPUs on boot").
Test cases and test results as below:
----------------------------------------------------------------------
| CONFIG_NO_HZ_FULL | CONFIG_RCU_NOCB_CPU_DEFAULT_ALL | cmdline |
----------------------------------------------------------------------
1) N | N | none |
2) N | N | rcu_nocbs=1-2 |
3) Y | N | nohz_full=1-2 |
4) Y | Y | none |
----------------------------------------------------------------------
1)
[ 1085.691770] rcu-torture:--- End of test: SUCCESS: (default)
root@genericarmv8:~# dmesg | grep "Offload RCU callbacks"
[ 0.000000] rcu: Offload RCU callbacks from CPUs: (none).
root@genericarmv8:~# zcat /proc/config.gz | grep NOCB
CONFIG_RCU_NOCB_CPU=y
# CONFIG_RCU_NOCB_CPU_DEFAULT_ALL is not set
root@genericarmv8:~# zcat /proc/config.gz | grep NO_HZ_FULL
# CONFIG_NO_HZ_FULL is not set
root@genericarmv8:~# cat /proc/cmdline
console=ttyAMA0 root=/dev/vda2 crashkernel=256M@ee000000
2)
[ 1022.532198] rcu-torture:--- End of test: SUCCESS: (default)
root@genericarmv8:~# dmesg | grep "Offload RCU callbacks"
[ 0.000000] rcu: Offload RCU callbacks from CPUs: 1-2.
root@genericarmv8:~# zcat /proc/config.gz | grep NOCB
CONFIG_RCU_NOCB_CPU=y
# CONFIG_RCU_NOCB_CPU_DEFAULT_ALL is not set
root@genericarmv8:~# zcat /proc/config.gz | grep NO_HZ_FULL
# CONFIG_NO_HZ_FULL is not set
root@genericarmv8:~# cat /proc/cmdline
console=ttyAMA0 root=/dev/vda2 crashkernel=256M@ee000000 rcu_nocbs=1-2
3)
[ 1011.714712] rcu-torture:--- End of test: SUCCESS: (default)
root@genericarmv8:~# dmesg | grep "Offload RCU callbacks"
[ 0.000000] rcu: Offload RCU callbacks from CPUs: 1-2.
root@genericarmv8:~# zcat /proc/config.gz | grep NOCB
CONFIG_RCU_NOCB_CPU=y
# CONFIG_RCU_NOCB_CPU_DEFAULT_ALL is not set
root@genericarmv8:~# zcat /proc/config.gz | grep NO_HZ_FULL
CONFIG_NO_HZ_FULL=y
root@genericarmv8:~# cat /proc/cmdline
console=ttyAMA0 root=/dev/vda2 crashkernel=256M@ee000000 nohz_full=1-2
4)
[ 1031.047094] rcu-torture:--- End of test: SUCCESS: (default)
root@genericarmv8:~# dmesg | grep "Offload RCU callbacks"
[ 0.000000] rcu: Offload RCU callbacks from CPUs: 0-3.
root@genericarmv8:~# zcat /proc/config.gz | grep NOCB
CONFIG_RCU_NOCB_CPU=y
CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y
root@genericarmv8:~# zcat /proc/config.gz | grep NO_HZ_FULL
CONFIG_NO_HZ_FULL=y
root@genericarmv8:~# cat /proc/cmdline
console=ttyAMA0 root=/dev/vda2 crashkernel=256M@ee000000
v1 --> v2:
Update commit message.
Zhen Lei (2):
rcu: Simplify rcu_init_nohz() cpumask handling
rcu: Offload callback processing from all CPUs in the absence of
rcu_nocbs=
kernel/rcu/Kconfig | 4 ++--
kernel/rcu/tree_nocb.h | 35 ++++++++++++-----------------------
2 files changed, 14 insertions(+), 25 deletions(-)
--
2.25.1
next reply other threads:[~2022-09-01 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 13:14 Zhen Lei [this message]
2022-09-01 13:14 ` [PATCH v6 1/2] rcu: Simplify rcu_init_nohz() cpumask handling Zhen Lei
2022-09-01 13:25 ` Leizhen (ThunderTown)
2022-09-01 16:54 ` Paul E. McKenney
2022-09-07 11:04 ` Frederic Weisbecker
2022-09-13 1:46 ` Leizhen (ThunderTown)
2022-09-01 13:14 ` [PATCH v6 2/2] rcu: Offload callback processing from all CPUs in the absence of rcu_nocbs= Zhen Lei
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=20220901131436.986-1-thunder.leizhen@huawei.com \
--to=thunder.leizhen@huawei.com \
--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=paulmck@kernel.org \
--cc=quic_neeraju@quicinc.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