Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move generic tweaks to a separate patch #2

Closed
xalt7x opened this issue Jan 3, 2022 · 5 comments
Closed

Move generic tweaks to a separate patch #2

xalt7x opened this issue Jan 3, 2022 · 5 comments

Comments

@xalt7x
Copy link

xalt7x commented Jan 3, 2022

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

@firelzrd
Copy link
Owner

firelzrd commented Jan 6, 2022

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.

@ptr1337
Copy link

ptr1337 commented Jan 6, 2022

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

@xalt7x
Copy link
Author

xalt7x commented Jan 15, 2022

@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
Copy link
Owner

@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).

@firelzrd
Copy link
Owner

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

firelzrd added a commit that referenced this issue Dec 14, 2023
… ensured to be after dequeue_entity (that internally calls update_curr) attempt #2
firelzrd added a commit that referenced this issue Feb 1, 2024
… ensured to be after dequeue_entity (that internally calls update_curr) attempt #2
firelzrd added a commit that referenced this issue Feb 2, 2024
… ensured to be after dequeue_entity (that internally calls update_curr) attempt #2
firelzrd added a commit that referenced this issue Feb 12, 2024
… ensured to be after dequeue_entity (that internally calls update_curr) attempt #2
firelzrd added a commit that referenced this issue Feb 19, 2024
… ensured to be after dequeue_entity (that internally calls update_curr) attempt #2
firelzrd added a commit that referenced this issue Feb 28, 2024
… ensured to be after dequeue_entity (that internally calls update_curr) attempt #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants