* [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus=
@ 2024-12-01 18:42 Aaron Tomlin
2025-01-08 21:10 ` Aaron Tomlin
2025-01-08 21:14 ` Aaron Tomlin
0 siblings, 2 replies; 3+ messages in thread
From: Aaron Tomlin @ 2024-12-01 18:42 UTC (permalink / raw)
To: oleg, frederic, peterz; +Cc: atomlin, nick.lange, seun.ewulomi, linux-kernel
[-- 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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus=
2024-12-01 18:42 [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus= Aaron Tomlin
@ 2025-01-08 21:10 ` Aaron Tomlin
2025-01-08 21:14 ` Aaron Tomlin
1 sibling, 0 replies; 3+ messages in thread
From: Aaron Tomlin @ 2025-01-08 21:10 UTC (permalink / raw)
To: Aaron Tomlin
Cc: oleg, frederic, peterz, nick.lange, seun.ewulomi, mtosatti,
atomlin, linux-kernel
On Sun, 1 Dec 2024, Aaron Tomlin wrote:
> 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
Hi Oleg, Frederic, Peter,
Any thoughts?
--
Aaron Tomlin
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus=
2024-12-01 18:42 [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus= Aaron Tomlin
2025-01-08 21:10 ` Aaron Tomlin
@ 2025-01-08 21:14 ` Aaron Tomlin
1 sibling, 0 replies; 3+ messages in thread
From: Aaron Tomlin @ 2025-01-08 21:14 UTC (permalink / raw)
To: oleg, frederic, peterz; +Cc: nick.lange, seun.ewulomi, mtosatti, linux-kernel
On Sun, 1 Dec 2024, Aaron Tomlin wrote:
> 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
Hi Oleg, Frederic, Peter,
Any thoughts?
--
Aaron Tomlin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-08 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-01 18:42 [RFC PATCH 0/1] sched/isolation: Warn when maxcpus= is specified with nohz_full= or isolcpus= Aaron Tomlin
2025-01-08 21:10 ` Aaron Tomlin
2025-01-08 21:14 ` Aaron Tomlin
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®