public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/isolation: Warn about missing isolcpus mask
@ 2024-01-10 11:46 Valentin Schneider
  2024-01-10 14:12 ` Frederic Weisbecker
  0 siblings, 1 reply; 2+ messages in thread
From: Valentin Schneider @ 2024-01-10 11:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Frederic Weisbecker

Since an empty string is a valid cpulist, this cmdline option does not
trigger any warnings:

  isolcpus=domain,

housekeeping_setup() just carries on and we end up with the housekeeping
mask being all CPUs in the system.

Check that there *is* a cpulist and that it isn't empty.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 kernel/sched/isolation.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 373d42c707bc5..aa20cd1702199 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -120,7 +120,8 @@ static int __init housekeeping_setup(char *str, unsigned long flags)
 	}
 
 	alloc_bootmem_cpumask_var(&non_housekeeping_mask);
-	if (cpulist_parse(str, non_housekeeping_mask) < 0) {
+	if (cpulist_parse(str, non_housekeeping_mask) < 0 ||
+	    cpumask_empty(non_housekeeping_mask)) {
 		pr_warn("Housekeeping: nohz_full= or isolcpus= incorrect CPU range\n");
 		goto free_non_housekeeping_mask;
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched/isolation: Warn about missing isolcpus mask
  2024-01-10 11:46 [PATCH] sched/isolation: Warn about missing isolcpus mask Valentin Schneider
@ 2024-01-10 14:12 ` Frederic Weisbecker
  0 siblings, 0 replies; 2+ messages in thread
From: Frederic Weisbecker @ 2024-01-10 14:12 UTC (permalink / raw)
  To: Valentin Schneider
  Cc: linux-kernel, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira

Le Wed, Jan 10, 2024 at 12:46:10PM +0100, Valentin Schneider a écrit :
> Since an empty string is a valid cpulist, this cmdline option does not
> trigger any warnings:
> 
>   isolcpus=domain,
> 
> housekeeping_setup() just carries on and we end up with the housekeeping
> mask being all CPUs in the system.
> 
> Check that there *is* a cpulist and that it isn't empty.
> 
> Signed-off-by: Valentin Schneider <vschneid@redhat.com>

Acked-by: Frederic Weisbecker <frederic@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-10 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-10 11:46 [PATCH] sched/isolation: Warn about missing isolcpus mask Valentin Schneider
2024-01-10 14:12 ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox