hamadmarri / TT-CPU-Scheduler

Task Type (TT) is an alternative CPU Scheduler for linux.
107 stars 12 forks source link

high-hz.patch info #18

Closed antonellocaroli closed 2 years ago

antonellocaroli commented 2 years ago

Hi,

if I want to add more frequencies, do I just have to edit this?

config HZ
@@ -53,7 +90,13 @@ config HZ
    default 100 if HZ_100
    default 250 if HZ_250
    default 300 if HZ_300
+   default 417 if HZ_417
+   default 833 if HZ_833
    default 1000 if HZ_1000
+   default 1666 if HZ_1666
+   default 3333 if HZ_3333
+   default 5000 if HZ_5000
+   default 10000 if HZ_10000

in for example

config HZ
@@ -53,7 +90,13 @@ config HZ
    default 100 if HZ_100
    default 250 if HZ_250
    default 300 if HZ_300
+   default 417 if HZ_417
+   default 833 if HZ_833
    default 1000 if HZ_1000
+   default 1666 if HZ_1666
+   default 3333 if HZ_3333
+   default 5000 if HZ_5000
+   default 10000 if HZ_10000
+   default 44100 if HZ_44100
+   default 88200 if HZ_88200
+   default 176400 if HZ_176400
hamadmarri commented 2 years ago

yes

antonellocaroli commented 2 years ago

@hamadmarri thanks!!!

antonellocaroli commented 2 years ago

PS: isn't there a version for the 5.10.x kernel?

ptr1337 commented 2 years ago

@antonellocaroli

Currently it should be better, if you add these values also to the choices also, example you can see here:

https://github.com/hamadmarri/TT-CPU-Scheduler/blob/76ec5f5f017f120214a723785bb9ff55cb72940b/patches/5.15/high-hz.patch#L876

ptr1337 commented 2 years ago

There, added your values.

https://github.com/ptr1337/kernel-patches/blob/master/5.15/TT/0001-high-hz.patch

antonellocaroli commented 2 years ago

@ptr1337 thanks! probably also need to be changed?

diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 5e13f80..b427f8a 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -40,6 +40,14 @@
 # define SHIFT_HZ  12
 #elif HZ >= 6144 && HZ < 12288
 # define SHIFT_HZ  13
+#elif HZ >= 12288 && HZ < 24576
+# define SHIFT_HZ  14
+#elif HZ >= 24576 && HZ < 49152
+# define SHIFT_HZ  15
+#elif HZ >= 49152 && HZ < 98304
+# define SHIFT_HZ  16
+#elif HZ >= 98304 && HZ < 196608
+# define SHIFT_HZ  17
 #else
 # error Invalid value of HZ.
 #endif
ptr1337 commented 2 years ago

@antonellocaroli

Yes, should also be added. But i dont think that that high values would help anymore. Already at 10k+ the kernel/your hardware wont be able to handle this. But you can test it out and show your results :)