CPU scheduler: correct configuration for desktop Linux

I have had the exact same scenario.

It may be that the desktop crashes or gets completely unresponsive, while the compilation gets all the priority.

The solution should be simple:

the kernel scheduler and the out-of-memory solution need to prioritize the system shell, compositor and main GUI components at all costs. (like nice -18, just the kernel etc running at nice -19).

There were even discussions about the used oomd vs more aggressive tools like earlyoom.


Like the commenter on Lemmy, on Windows this never happened. Programs would freeze but the desktop always stayed responsive, taks manager could always be opened and the process killed.

This requires a working GUI

I am on Kinoite and the KDE Plasma experience has improved drastically since Plasma 6. Not a single freeze, if the shell crashed it always appeared back in place.

But are these issues fixed?

How to test:

  • Use your desktop environment
  • run some low level program: gcc, rust or something else that eats your RAM and CPU time
  • see if the desktop stays responsive

Some comments on Lemmy

I havent had these scenarios in a while but would like to fix this essential problem.

I could even imagine a new goal: Make Fedora work in edge cases like under high load, with limited RAM etc.

This will vary between the desktops.

Problems

CPU scheduler

  • normally processes are spawned with nice 0
  • child processes get the priority of their parent. This breaks the entire concept, as nearly everything is a child process of the desktop?

These very high priority process with have a distorting effect on running of the system.
Better to find a way to lower the compileations then up the GUI components if this is indeed needed.

From what I have read it’s the running out of memory that is the key to stablilty.
I seem to recall there are configurations for OOM that can be used to stop critical processes being killed. I’m sure there was a fix to do with killing off DE critical processes a few months ago. But not sure on the details.

1 Like

I wonder if the upcoming " Extensible Scheduler" would help in defining priorities like that?

Thanks, yes on Lemmy someone commented that some Audio processes run with nice -2 to prevent stuttering, so Desktops could be equally sorted.

The right level needs to be found and I would think having the hierarchy of processes defined somewhere would be very helpful.

This is about 2 things

  • CPU scheduler
  • memory handler