lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4f502647-ceb6-4867-a270-8d86d9a6c700@linux.ibm.com>
Date: Tue, 3 Jun 2025 17:11:55 +0530
From: Shrikanth Hegde <sshegde@...ux.ibm.com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
        Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH] sched: Fix preemption string of preempt_dynamic_none



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@...r.kernel.org
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.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@...ux.ibm.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ