I know you can change a process niceness with
However, does Linux automatically adjust/change a process niceness without user input?
I have a process for which I use
setpriority in C, like so:
setpriority(PRIO_PROCESS, 0, -1)
When the process is running, I can see its niceness value is now -1 by running htop.
While investigating a crash on a remote machine, the output of htop was provided to me. I noticed that the niceness value for this process had changed on one instance to 0 and on another instance to 6. I'd like to know if this was changed by the kernel or if the only way to change this value is by having a user or script deliberately make the change.