Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH] sched: Fix preemption string of preempt_dynamic_none
Date: Tue, 3 Jun 2025 17:11:55 +0530	[thread overview]
Message-ID: <4f502647-ceb6-4867-a270-8d86d9a6c700@linux.ibm.com> (raw)
In-Reply-To: <20250603-preempt-str-none-v1-1-f0e9916dcf44@linutronix.de>



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>


  parent reply	other threads:[~2025-06-03 11:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-06-10 14:01 ` Sebastian Andrzej Siewior

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=4f502647-ceb6-4867-a270-8d86d9a6c700@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=bigeasy@linutronix.de \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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