Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] sched: Fix preemption string of preempt_dynamic_none
@ 2025-06-03  9:52 Thomas Weißschuh
  2025-06-03 10:00 ` Sebastian Andrzej Siewior
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-06-03  9:52 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Shrikanth Hegde, Sebastian Andrzej Siewior
  Cc: linux-kernel, stable, Thomas Weißschuh

Zero is a valid value for "preempt_dynamic_mode", namely
"preempt_dynamic_none".

Fix the off-by-one in preempt_model_str(), so that "preempty_dynamic_none"
is correctly formatted as PREEMPT(none) instead of PREEMPT(undef).

Fixes: 8bdc5daaa01e ("sched: Add a generic function to return the preemption string")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index dce50fa57471dffc4311b9d393ae300a43d38d20..021b0a703d094b3386c5ba50e0e111e3a7c2b3df 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7663,7 +7663,7 @@ const char *preempt_model_str(void)
 
 		if (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC)) {
 			seq_buf_printf(&s, "(%s)%s",
-				       preempt_dynamic_mode > 0 ?
+				       preempt_dynamic_mode >= 0 ?
 				       preempt_modes[preempt_dynamic_mode] : "undef",
 				       brace ? "}" : "");
 			return seq_buf_str(&s);

---
base-commit: 546b1c9e93c2bb8cf5ed24e0be1c86bb089b3253
change-id: 20250603-preempt-str-none-d21231cc2238

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>


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

* Re: [PATCH] sched: Fix preemption string of preempt_dynamic_none
  2025-06-03  9:52 [PATCH] sched: Fix preemption string of preempt_dynamic_none Thomas Weißschuh
@ 2025-06-03 10:00 ` Sebastian Andrzej Siewior
  2025-06-03 11:41 ` Shrikanth Hegde
  2025-06-10 14:01 ` Sebastian Andrzej Siewior
  2 siblings, 0 replies; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-06-03 10:00 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Shrikanth Hegde, linux-kernel, stable

On 2025-06-03 11:52:13 [+0200], Thomas Weißschuh wrote:
> Zero is a valid value for "preempt_dynamic_mode", namely
> "preempt_dynamic_none".
> 
> Fix the off-by-one in preempt_model_str(), so that "preempty_dynamic_none"
> is correctly formatted as PREEMPT(none) instead of PREEMPT(undef).
> 
> Fixes: 8bdc5daaa01e ("sched: Add a generic function to return the preemption string")
> Cc: stable@vger.kernel.org
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Sebastian

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

* Re: [PATCH] sched: Fix preemption string of preempt_dynamic_none
  2025-06-03  9:52 [PATCH] sched: Fix preemption string of preempt_dynamic_none Thomas Weißschuh
  2025-06-03 10:00 ` Sebastian Andrzej Siewior
@ 2025-06-03 11:41 ` Shrikanth Hegde
  2025-06-10 14:01 ` Sebastian Andrzej Siewior
  2 siblings, 0 replies; 4+ messages in thread
From: Shrikanth Hegde @ 2025-06-03 11:41 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: linux-kernel, stable, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, Sebastian Andrzej Siewior



On 6/3/25 15:22, Thomas Weißschuh wrote:
> Zero is a valid value for "preempt_dynamic_mode", namely
> "preempt_dynamic_none".
> 
> Fix the off-by-one in preempt_model_str(), so that "preempty_dynamic_none"
> is correctly formatted as PREEMPT(none) instead of PREEMPT(undef).
> 
> Fixes: 8bdc5daaa01e ("sched: Add a generic function to return the preemption string")
> Cc: stable@vger.kernel.org
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>   kernel/sched/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index dce50fa57471dffc4311b9d393ae300a43d38d20..021b0a703d094b3386c5ba50e0e111e3a7c2b3df 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7663,7 +7663,7 @@ const char *preempt_model_str(void)
>   
>   		if (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC)) {
>   			seq_buf_printf(&s, "(%s)%s",
> -				       preempt_dynamic_mode > 0 ?
> +				       preempt_dynamic_mode >= 0 ?
>   				       preempt_modes[preempt_dynamic_mode] : "undef",
>   				       brace ? "}" : "");
>   			return seq_buf_str(&s);
> 

Yes. It looks correct with patch:
latency: 0 us, #1/1, CPU#0 | (M:PREEMPT(none) VP:0, KP:0, SP:0 HP:0 #P:80)

Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com>


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

* Re: [PATCH] sched: Fix preemption string of preempt_dynamic_none
  2025-06-03  9:52 [PATCH] sched: Fix preemption string of preempt_dynamic_none Thomas Weißschuh
  2025-06-03 10:00 ` Sebastian Andrzej Siewior
  2025-06-03 11:41 ` Shrikanth Hegde
@ 2025-06-10 14:01 ` Sebastian Andrzej Siewior
  2 siblings, 0 replies; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-06-10 14:01 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Shrikanth Hegde, linux-kernel, stable

On 2025-06-03 11:52:13 [+0200], Thomas Weißschuh wrote:
> Zero is a valid value for "preempt_dynamic_mode", namely
> "preempt_dynamic_none".
> 
> Fix the off-by-one in preempt_model_str(), so that "preempty_dynamic_none"
> is correctly formatted as PREEMPT(none) instead of PREEMPT(undef).
> 
> Fixes: 8bdc5daaa01e ("sched: Add a generic function to return the preemption string")
> Cc: stable@vger.kernel.org
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

A gentle ping.

Sebastian

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03  9:52 [PATCH] sched: Fix preemption string of preempt_dynamic_none Thomas Weißschuh
2025-06-03 10:00 ` Sebastian Andrzej Siewior
2025-06-03 11:41 ` Shrikanth Hegde
2025-06-10 14:01 ` Sebastian Andrzej Siewior

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