This is a note to let you know that I've just added the patch titled sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From stable+bounces-23366-greg=kroah.com@xxxxxxxxxxxxxxx Thu Feb 22 18:06:37 2024 From: Petr Vorel <pvorel@xxxxxxx> Date: Thu, 22 Feb 2024 18:05:39 +0100 Subject: sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset To: stable@xxxxxxxxxxxxxxx Cc: Cyril Hrubis <chrubis@xxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Sasha Levin <sashal@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Petr Vorel <pvorel@xxxxxxx>, Mel Gorman <mgorman@xxxxxxx> Message-ID: <20240222170540.1375962-2-pvorel@xxxxxxx> From: Cyril Hrubis <chrubis@xxxxxxx> [ Upstream commit c1fc6484e1fb7cc2481d169bfef129a1b0676abe ] The sched_rr_timeslice can be reset to default by writing value that is <= 0. However after reading from this file we always got the last value written, which is not useful at all. $ echo -1 > /proc/sys/kernel/sched_rr_timeslice_ms $ cat /proc/sys/kernel/sched_rr_timeslice_ms -1 Fix this by setting the variable that holds the sysctl file value to the jiffies_to_msecs(RR_TIMESLICE) in case that <= 0 value was written. Signed-off-by: Cyril Hrubis <chrubis@xxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Reviewed-by: Petr Vorel <pvorel@xxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxx> Tested-by: Petr Vorel <pvorel@xxxxxxx> Link: https://lore.kernel.org/r/20230802151906.25258-3-chrubis@xxxxxxx Signed-off-by: Petr Vorel <pvorel@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/sched/rt.c | 3 +++ 1 file changed, 3 insertions(+) --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2735,6 +2735,9 @@ int sched_rr_handler(struct ctl_table *t sched_rr_timeslice = sysctl_sched_rr_timeslice <= 0 ? RR_TIMESLICE : msecs_to_jiffies(sysctl_sched_rr_timeslice); + + if (sysctl_sched_rr_timeslice <= 0) + sysctl_sched_rr_timeslice = jiffies_to_msecs(RR_TIMESLICE); } mutex_unlock(&mutex); Patches currently in stable-queue which might be from kroah.com@xxxxxxxxxxxxxxx are queue-4.19/sched-rt-disallow-writing-invalid-values-to-sched_rt_period_us.patch queue-4.19/sched-rt-fix-sysctl_sched_rr_timeslice-intial-value.patch queue-4.19/sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch