From fff787f52759408cbcd5d4efd549314a498e7af5 Mon Sep 17 00:00:00 2001 From: John Vincent Date: Sun, 3 Jul 2022 18:47:18 +0800 Subject: [PATCH] sched: fair: Reduce runtime allocated for tasks constrained by CFS bandwidth A bunch of kernels for desktop Linux have been reducing this value to improve interactivity. From Zen[1] to CachyOS[2]. There have been attempts to reduce it on Android as well. Experiment with reducing the CFS bandwidth slice to 4 msec, 1 less from the default. This is something I honestly don't want userspace to touch so keep it out from sysfs and modify it from the kernel directly instead. I honestly think that the 'interactivity' benefits (if it does hold water) of this change should be reflected on all performance modes on FreshROMs. Test for performance and battery life. [1]: https://github.com/zen-kernel/zen-kernel/commit/7de2596b35ac1db [2]: https://github.com/CachyOS/linux/blob/base-5.18/kernel/sched/fair.c Signed-off-by: John Vincent --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 989936df6..f796a3522 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -132,7 +132,7 @@ int __weak arch_asym_cpu_priority(int cpu) * * (default: 5 msec, units: microseconds) */ -unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL; +unsigned int sysctl_sched_cfs_bandwidth_slice = 4000UL; #endif static inline void update_load_add(struct load_weight *lw, unsigned long inc)