firelzrd/bore-scheduler

Move generic tweaks to a separate patch

xalt7x opened this issue · 5 comments

I've noticed that current patch has some tweaks which may conflict with popular custom kernel builds

  1. SCHED_HRTICK disabled
--- a/kernel/Kconfig.hz
+++ b/kernel/Kconfig.hz
@@ -56,4 +56,5 @@ config HZ
 	default 1000 if HZ_1000
 
 config SCHED_HRTICK
+	default n
 	def_bool HIGH_RES_TIMERS

This one definitely conflicts with xanmod's "ck-hrtimer" patches. Also it might drop performance and latency for custom kernels which use CONFIG_HZ < 1000.
Even "linux-cachyos-bore" keeps this option enabled

  1. sysctl_sched_migration_cost value modified
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -90,7 +124,7 @@ unsigned int sysctl_sched_child_runs_first __read_mostly;
 unsigned int sysctl_sched_wakeup_granularity			= 1000000UL;
 static unsigned int normalized_sysctl_sched_wakeup_granularity	= 1000000UL;
 
-const_debug unsigned int sysctl_sched_migration_cost	= 500000UL;
+const_debug unsigned int sysctl_sched_migration_cost	= 200000UL;
 
 int sched_thermal_decay_shift;
 static int __init setup_sched_thermal_decay_shift(char *str)

Similar CFS tweak is used in Liquorix/Zen kernel.

CPU migration cost.............: 0.5 -> 0.25 ms

Thank you very much for your contribution, Alt37.

HRTICK:
Currently BORE lacks HRTICK handling code, because I have not done the mechanism to calculate which entity should be picked next and when.
Therefore, the behavior when you enable the HRTICK feature in sysfs is being undefined and unpredictable at all.
First I'm going to look into HRTICK-related code, and make sure it bypasses the HRTICK path no matter its enabled or not, to prevent this undefined (and probably to result in very bad consequence) behavior, so the compile-time switch CONFIG_HRTICK can safely be left "default y".
After that, at some point in the future I'll work on implementing HRTICK for BORE (which is essentially temporal prediction of the earliest ideal time of next evaluation of preemption).

sysctl_sched_migration_cost:
Since I based BORE on the existing CacULE-r3 code base, anything that CacULE brought is there unless I changed it.
I'll check how it works and consider changing it back to vanilla's.

Thank you.

@Alt37
The HRTTICK patches are generally not used since some kernel versions.

@ptr1337
thanks for information. Now I see that Xan didn't update ck-hrtimer patchset for 5.16.
@firelzrd
sysctl_sched_migration_cost tweak might hurt performance under load (zen/liquorix kernel dropped it recently)

@firelzrd sysctl_sched_migration_cost tweak might hurt performance under load (zen/liquorix kernel dropped it recently)

Thank you for the feedback.
sysctl_sched_migration_cost now defaults to 500000UL (the same as vanilla).

now that BORE was integrated on top of CFS, all the issues are past. Now closing the topic.
Thank you for your feedback!