The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "tip-bot2 for Thomas Weißschuh" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: thomas.weissschuh@linutronix.de,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	stable@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip: sched/urgent] sched: Fix preemption string of preempt_dynamic_none
Date: Tue, 01 Jul 2025 13:13:35 -0000	[thread overview]
Message-ID: <175137561585.406.15071962076426718884.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250626-preempt-str-none-v2-1-526213b70a89@linutronix.de>

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     3ebb1b6522392f64902b4e96954e35927354aa27
Gitweb:        https://git.kernel.org/tip/3ebb1b6522392f64902b4e96954e35927354aa27
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Thu, 26 Jun 2025 11:23:44 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 01 Jul 2025 15:02:02 +02:00

sched: Fix preemption string of preempt_dynamic_none

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")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20250626-preempt-str-none-v2-1-526213b70a89@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 8988d38..cd80b66 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);

      reply	other threads:[~2025-07-01 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26  9:23 [PATCH v2] sched: Fix preemption string of preempt_dynamic_none Thomas Weißschuh
2025-07-01 13:13 ` tip-bot2 for Thomas Weißschuh [this message]

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=175137561585.406.15071962076426718884.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sshegde@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=x86@kernel.org \
    /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