hamadmarri / cacule-cpu-scheduler

The CacULE CPU scheduler is based on interactivity score mechanism. The interactivity score is inspired by the ULE scheduler (FreeBSD scheduler).
266 stars 32 forks source link

cachy-sched for linux 5.6 #7

Closed ViNi-Arco closed 3 years ago

ViNi-Arco commented 4 years ago

Hello Hamad, could you patch cachy-sched for Kernel 5.6 ?

hamadmarri commented 4 years ago

Hi @ViNi-Arco,

Sure, v5.6-rc7 or just v5.6?

ViNi-Arco commented 4 years ago

I want 5.6, thanks a lot Hamad, have a good night 😊

ViNi-Arco commented 4 years ago

To be more exact Hamad, I am using version 5.6.15 and I intend to patch it, if possible

hamadmarri commented 4 years ago

Ok

hamadmarri commented 4 years ago

https://github.com/hamadmarri/cachy-sched/blob/master/patches/cachy/0001-cachy-5.6.15.patch

ViNi-Arco commented 4 years ago

Thank you very much Hamad for taking the time to fix the patch for Kernel 5.6, I will test, I will report as soon as possible

hamadmarri commented 4 years ago

Hi ViNi-Arco,

Is the patch working?

ViNi-Arco commented 4 years ago

Hi Hamad, I was not lucky it didn't work, the system is not able to start with the cachy-sched IMG_20200905_140156

ViNi-Arco commented 4 years ago

I changed CONFIG_FAIR_GROUP_SCHED=y to CONFIG_FAIR_GROUP_SCHED is not set and CONFIG_NUMA=y to CONFIG_NUMA is not set, as you recommend disabling, and the system only starts without cachy-sched

ViNi-Arco commented 4 years ago

If you use Arch Linux, here is PKGBUILD with the patches I have assembled, so you can check if there is something I am doing wrong kernel56cachy.tar.gz

hamadmarri commented 4 years ago

Could you try it with

CONFIG_CGROUPS
CONFIG_SCHED_AUTOGROUP

disabled?

SCHED_AUTOGROUP is certainly the cause of crash. autogroup is even causing a crash with cachy fair group implementation https://github.com/hamadmarri/linux/tree/FAIR_GROUP_testing

ViNi-Arco commented 4 years ago

Of course I try

ViNi-Arco commented 4 years ago

Even after the change, the system is unable to start 😕

ViNi-Arco commented 4 years ago

I will close this problem, it takes a lot of work to compile the kernel is more than 1 hour to compile here with GCC10

hamadmarri commented 4 years ago

I will test the patch with fresh kernel v5.6.15 code and test it with qemu and my machine. If I got any problem I will re open it with the fix patch

hamadmarri commented 4 years ago

Btw, use ccache which make the repeated compilation faster. Install ccache and then use it as:

make CC="ccache gcc" 
ViNi-Arco commented 4 years ago

I will test the patch with fresh kernel v5.6.15 code and test it with qemu and my machine. If I got any problem I will re open it with the fix patch

Thank you very much Hamad you are an incredible person, I wish you all the best

Btw, use ccache which make the repeated compilation faster. Install ccache and then use it as: make CC="ccache gcc"

Okay, I should have started using ccache to build big code

hamadmarri commented 4 years ago

It worked on qemu, but I got the same error you got when installed it on my machine. I will look on this problem and try to fix it

hamadmarri commented 3 years ago

The problem was cgroup issue. I already implemented cgroups in 5.9 test branch. I will apply the same code for 5.6 soon and hopefully it will fix the issue.

ViNi-Arco commented 3 years ago

This is great! and I want to thank you for taking the time to port your Patch to Kernel 5.6, thank you very much Hamad

hamadmarri commented 3 years ago

Hi ViNi-Arco,

https://github.com/hamadmarri/cachy-sched/blob/master/patches/cachy/v5.6/cachy-5.6.15-r5.patch

Please make sure cgroups are enabled

my .config

cat .config | grep -i cgroup
CONFIG_CGROUPS=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_IOLATENCY=y
# CONFIG_BLK_CGROUP_IOCOST is not set
# CONFIG_BFQ_CGROUP_DEBUG is not set
# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set
# CONFIG_NET_CLS_CGROUP is not set
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y

cat .config | grep -i autogr
# CONFIG_SCHED_AUTOGROUP is not set

I am posting this comment using the patch

make sure that

dmesg | grep -i "cachy cpu"
[    0.078462] Cachy CPU scheduler v5.6.15-r5 by Hamad Al Marri.
hamadmarri commented 3 years ago

Please reopen the issue if it is not working.

ViNi-Arco commented 3 years ago

It worked ! 68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f776174747061642d6d656469612d736572766963652f53746f7279496d6167652f7543594238794976574f70476a773d3d2d3730373333363134362e313538633563383964383234373639663837323439363339313235322e676966

Look: hamadcachy

ViNi-Arco commented 3 years ago

thank you, now i will use the pc normally, then i tell you how my experience with your Sched was, how much i love emulator games it will be an entertaining experience 😁

hamadmarri commented 3 years ago

Sorry I forgot to mention that cachy also support numa now, if your hardware does support numa please enable it

On my machine

numactl --hardware
No NUMA available on this system

My hardware doesn't support NUMA, so I do not see any differences in performance. However, my friend has a NUMA support on his hardware

numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 2 3
node 0 ......
.....
...

And he said it makes a noticeable differences when he enabled NUMA (in a good way).

Thank you

ViNi-Arco commented 3 years ago

In my system reports this information: numasuppot2

I read on the main page you saying that you have NUMA and cgroups support now and I enabled both 😊