Lucas Zampieri from Red Hat has published a humorous task scheduler scx_horoscope, allocating CPU resources based on astrological principles, considering zodiac signs and the current positions of planets. The project is being developed for educational and entertainment purposes. The key purpose of scx_horoscope is to teach and demonstrate the use of the 'sched_ext' (SCX) mechanism, which allows using eBPF to create CPU schedulers.
The scheduler is fully operational and quite stable, but it is not recommended for production use, as it does indeed consider retrograde planetary motion and lunar phases when calculating process priorities. The astro package is employed for accurately determining the positions of the planets.
Tasks are classified based on zodiac signs and celestial bodies, for example, the sun is linked to critical processes (PID 1, init), the moon with interactive tasks (editors, command shells, terminal emulators), mercury with network tasks and input/output, venus with desktop tasks, mars with resource-heavy applications (compilers, video encoders), jupiter with memory-intensive processes (DBMS, browsers), and saturn with system background processes and kernel threads.
In the presence of negative astrological factors regarding the planetary positions calculated for the current day, a 50% priority reduction is applied for the class of tasks associated with the planet. For example, under retrograde mercury, the priority is reduced for network and interactive tasks, for retrograde mars — for resource-intensive tasks, and for retrograde venus — for desktop tasks.
The current phase of the moon also affects priority — during a full moon, interactive tasks receive 1.4 times more time. Fire and air zodiac signs increase the priority of CPU-consuming tasks by 1.5 times, but decrease the priority of memory-intensive tasks by 0.7 times. Water signs reduce the priority of CPU tasks by 0.6 times, but increase the priority of memory-consuming tasks by 1.3 times.
Tuleviku plaanides on mainitud protsesside ajakaarte loomist nende loomise aja põhjal, protsesside lõpetamise aja prognoosimist horoskoobi järgi ja astronoomilise ühilduvuse arvesse võtmist protsesside seondamisel CPU tuumadega.
Allikas: opennet.ru
