]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 13:10:56 +0000 (14:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 13:10:56 +0000 (14:10 +0100)
added patches:
sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch

queue-5.4/sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch b/queue-5.4/sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch
new file mode 100644 (file)
index 0000000..a404341
--- /dev/null
@@ -0,0 +1,44 @@
+From c1fc6484e1fb7cc2481d169bfef129a1b0676abe Mon Sep 17 00:00:00 2001
+From: Cyril Hrubis <chrubis@suse.cz>
+Date: Wed, 2 Aug 2023 17:19:06 +0200
+Subject: sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset
+
+From: Cyril Hrubis <chrubis@suse.cz>
+
+commit c1fc6484e1fb7cc2481d169bfef129a1b0676abe upstream.
+
+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@suse.cz>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Reviewed-by: Petr Vorel <pvorel@suse.cz>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Tested-by: Petr Vorel <pvorel@suse.cz>
+Cc: Mahmoud Adam <mngyadam@amazon.com>
+Link: https://lore.kernel.org/r/20230802151906.25258-3-chrubis@suse.cz
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/sched/rt.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/kernel/sched/rt.c
++++ b/kernel/sched/rt.c
+@@ -2738,6 +2738,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);
index d97558d11df6d92521cbd3906b98531757f1a71a..bd7723f51791be0dc2d8f101b8da3af830b7859a 100644 (file)
@@ -1,3 +1,4 @@
 net-sched-retire-cbq-qdisc.patch
 net-sched-retire-atm-qdisc.patch
 net-sched-retire-dsmark-qdisc.patch
+sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch