Re: [PATCH] sched: dynamic: Fix preemption model strings
From: Mete Durlu
Date: Sun Sep 06 2026 - 15:28:47 EST
On 02/09/2026 12:16, Mark Rutland wrote:
We recently removed the enum values 'preempt_dynamic_none' andHi,
'preempt_dynamic_voluntary', but forgot to update preempt_modes[]
accordingly. Due to this, preempt_model_str() and sched_dynamic_show()
produce incorrect output, with the wrong preemption model string in
backtraces, and empty output for /sys/kernel/debug/sched/preempt.
Update preempt_modes[] to account for the removed enum values. Given
that CONFIG_PREEMPT_DYNAMIC now depends on CONFIG_ARCH_HAS_PREEMPT_LAZY,
and given that only 'preempt_dynamic_full' and 'preempt_dynamic_lazy'
remain, sched_dynamic_show() no longer needs to skip any model strings.
Reported-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
Fixes: 9650ce11f2e3 ("sched: dynamic: Simplify preempt model accessors")
Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
I did a quick test on s390.
$ echo full > preempt
$ cat preempt
(full) lazy
$ echo lazy > preempt
$ cat preempt
full (lazy)
The sched_dynamic_show() output looks correct now, and the
code looks much nicer without those conditional indices.
Feel free to put my tested by.
Tested-by: Mete Durlu <meted@xxxxxxxxxxxxx>