From: Aaron Tomlin <atomlin@atomlin.com>
To: oleg@redhat.com, frederic@kernel.org, peterz@infradead.org
Cc: atomlin@atomlin.com, nick.lange@gmail.com,
seun.ewulomi@gmail.com, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus=
Date: Sun, 1 Dec 2024 18:42:44 +0000 (GMT) [thread overview]
Message-ID: <b51c2515-8cbc-ac7e-97ea-c6fd0e07cad6@atomlin.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 578 bytes --]
Hi Oleg, Frederic, Peter,
I have seen a case where maxcpus=1 and e.g. nohz_full=1,3-31, was used to
force the CPU affinity of certain unbound or non CPU-specific kernel
threads at boot-time. Albeit, since commit 9cc5b8656892a ("isolcpus: Affine
unbound kernel threads to housekeeping cpus") this is handled entirely via
nohz_full=. I thought it might be worth adding a warning.
Aaron Tomlin (1):
sched/isolation: Warn when maxcpus= is specified with nohz_full= or
isolcpus=
kernel/sched/isolation.c | 2 ++
1 file changed, 2 insertions(+)
--
2.47.1
--
Aaron Tomlin
[-- Attachment #2: Type: text/plain, Size: 1966 bytes --]
From 9d82eb9f9c0010025047c45754ec81c3832547e4 Mon Sep 17 00:00:00 2001
From: Aaron Tomlin <atomlin@atomlin.com>
Date: Sat, 30 Nov 2024 23:31:39 +0000
Subject: [RFC PATCH 1/1] sched/isolation: Warn when maxcpus= is specified with
nohz_full= or isolcpus=
In the context of housekeeping_setup(), the use of maxcpus= does not
dictate how the housekeeping CPU mask is built i.e. only the "possible"
CPU mask and non-housekeeping CPU mask is considered. Indeed the
possible CPU mask is indicative of the CPU(s) that can be brought online
if they are physical present.
Some customers in the past have used maxcpus=1 e.g. with
nohz_full=1,3-31, to force the CPU affinity of certain unbound or non
CPU-specific kernel threads at boot-time. Albeit, since commit
9cc5b8656892a ("isolcpus: Affine unbound kernel threads to housekeeping
cpus") this is handled entirely via nohz_full=.
This patch adds a simple warning when maxcpus= and nohz_full= or
isolcpus= is specified. However, since commit 257bf89d84121
("sched/isolation: Fix boot crash when maxcpus < first housekeeping
CPU") maxcpus=1 and an unsuitable nohz_full= reading is handled
appropriately now.
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
---
kernel/sched/isolation.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 5891e715f00d..27cdc711dcf5 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -138,6 +138,8 @@ static int __init housekeeping_setup(char *str, unsigned long flags)
alloc_bootmem_cpumask_var(&housekeeping_staging);
cpumask_andnot(housekeeping_staging,
cpu_possible_mask, non_housekeeping_mask);
+ if (setup_max_cpus != NR_CPUS)
+ pr_warn("Housekeeping: maxcpus= has been specified too\n");
first_cpu = cpumask_first_and(cpu_present_mask, housekeeping_staging);
if (first_cpu >= nr_cpu_ids || first_cpu >= setup_max_cpus) {
--
2.47.1
next reply other threads:[~2024-12-01 18:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-01 18:42 Aaron Tomlin [this message]
2025-01-08 21:10 ` Aaron Tomlin
2025-01-08 21:14 ` Aaron Tomlin
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=b51c2515-8cbc-ac7e-97ea-c6fd0e07cad6@atomlin.com \
--to=atomlin@atomlin.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick.lange@gmail.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=seun.ewulomi@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
all inboxes | Powered by JetHome®