hamadmarri / Baby-CPU-Scheduler

This is a very basic/lightweight yet a very performant CPU scheduler. You can use it for learning purposes as a base ground CPU scheduler on Linux.
31 stars 6 forks source link

[feedback] baby-5.14.patch #1

Open kernelOfTruth opened 2 years ago

kernelOfTruth commented 2 years ago

Thanks for your awesome and continued work on alternative CPU schedulers !

performance and frame consistency is way better with Overwatch through proton-ge-custom (lutris), dxvk than with CacULE before and comparable with ProjectC PDS.

Overwatch seems to be of a corner case and having insane demands on the CPU scheduler (and the GPU).

I've observed decline in performance and of top FPS with PDS when running Overwatch for a longer time (a few matches or even just during one match with one or multiple rounds) but it doesn't seem as pronounced with both Baby Scheduler with sched_normal (for Overwatch) + wineserver (with raised prio, sched_fifo) or raised priority to sched_fifo (for both Overwatch + wineserver with raised prio).

Since baby-scheduler is also relying on mainstream RT scheduling and when not careful and raising prio + niceness in both wineserver + Overwatch - there's several second-long stalls ("RT throttling"), I guess that ProjectC's RT scheduling handling is superior since handling overcomitting of resources is done way more gracefully.

Maybe next step is to replace RT scheduling also with Baby-CPU-scheduler's simplified balancing ?

In any case looking forward and curiously observing your next steps :)

hamadmarri commented 2 years ago

Hello @kernelOfTruth

Thank you so much for your words.

I have to read more about RT in linux and also what RT changes in BMQ scheduler. For the time being, I don't think I am going to change any RT code. However, I am wondering if you have tried RT with SCHED_RR instead of FIFO?

I am also thinking about Baby scheduler to be as simple as possible for educational purposes. I added Round Robin version which is the minimal I can get where is no task priority and no vruntime calculations. However, I have updated the baby-5.14.patch few mins ago with some modifications which can help on wine (such as the yield work) and hrtime. My next steps would be mostly documentation where I explain the code in details for whom need to learn. I might also add another patch to implement HRRN or IS on top of baby.

So far in my testing the throughput of baby is undoubtedly higher than CacULE, but the responsiveness under heavy load is not, and this might stay forever since the only way (I can think of) to overcome this issue is to have autogroup+sched_group to distribute the load evenly. The groups implementation is very complicated and the best implementation is just to use the CFS one. I would recommend baby for normal use where the user has only one thing to do like browsing, gaming, coding, but when compiling or stressing the cpus the interactivity is a bit slower at least on my machine.

Thank you