Re: [PATCH 2/2] sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset

From: Mel Gorman
Date: Thu Jul 20 2023 - 06:00:13 EST


On Wed, Jul 19, 2023 at 12:37:43PM +0200, Cyril Hrubis wrote:
> 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>
> CC: Jiri Bohac <jbohac@xxxxxxx>

Acked-by: Mel Gorman <mgorman@xxxxxxx>

--
Mel Gorman
SUSE Labs