Re:How macOS manages M1 CPU cores
by rbanffy on Monday April 25, 2022 @04:27PM
(#31160152)
In my observations, macOS has a very different behavior with nice than my Linux machines. On my Linux laptop, I can run processor-heavy tasks with `nice -n 19` and browse the web as if the machine was doing nothing else. On my (x86) Mac, if I do that, the machine crawls to a halt, as if the OS were ignoring the nice setting. Maybe there is some connection to this and this elaborate scheduling model - on Linux I'd expect processes with lower nice levels get assigned beefier cores and bump out nicer ones to smaller cores and that would take care of everything.
[ Parent
| on HN ]
> if I do that, the machine crawls to a halt
Most likely some unsolved priority inversion bug doing that. Linux actually bumps up the priority of "nice" tasks when something else is waiting on them, which goes a long way to address this issue.
It's not the nice task that halts - on the Mac, it's everything else, as if the task I started with nice is allowed to hog all resources and isn't bumped out of the CPUs when, say, the browser needs them.