Skip to content

Commit 3ebb1b6

Browse files
t-8chPeter Zijlstra
authored andcommitted
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: 8bdc5da ("sched: Add a generic function to return the preemption string") Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Sebastian Andrzej Siewior <[email protected]> Tested-by: Shrikanth Hegde <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent d0b3b7b commit 3ebb1b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7663,7 +7663,7 @@ const char *preempt_model_str(void)
76637663

76647664
if (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC)) {
76657665
seq_buf_printf(&s, "(%s)%s",
7666-
preempt_dynamic_mode > 0 ?
7666+
preempt_dynamic_mode >= 0 ?
76677667
preempt_modes[preempt_dynamic_mode] : "undef",
76687668
brace ? "}" : "");
76697669
return seq_buf_str(&s);

0 commit comments

Comments
 (0)