The scheduler doesn't know in advance how much CPU time a given task will use. CPU utilisation percentage is just an average, updated each scheduler tick, of how much of the CPU's time the task actually used. If you know your software will run many threads each doing a tiny amount of work, then you know more than the scheduler does, so to get the behaviour you want you need to set affinity on those threads as they are created, or use a cgroup.
Spreading tasks vs aggregating may not affect power consumption in the way you expect: https://cateee.net/lkddb/web-lkddb/W...T_DEFAULT.html
By default the kernel saves power only where the performance impact is small, and there are daemons to adjust it based on whether your laptop is plugged in.
Announcement
Collapse
No announcement yet.
Linux 5.7 To Improve Spreading Of Utilization, Other Scheduler Work
Collapse
X
-
Originally posted by Etherman View PostIt's trivial to write a user userspace daemon that puts CPU cores offline when CPU utilisation is low.
There are knobs for putting cores offline in sysfs.
Edit: I found this
https://askubuntu.com/questions/8789...lug-for-ubuntuLast edited by birdie; 23 March 2020, 03:54 PM.
- Likes 1
Leave a comment:
-
It's trivial to write a user userspace daemon that puts CPU cores offline when CPU utilisation is low.
There are knobs for putting cores offline in sysfs.
Edit: I found this
Last edited by Etherman; 23 March 2020, 01:02 PM.
- Likes 1
Leave a comment:
-
What I've always been curious about is why the Linux task scheduler given many tasks which consume close to 0% of CPU distributes them across all active cores instead of pinning them to a single core. Granted doing so would mean that L1/L2 caches might not be utilized properly vs when tasks are using different cores but again we are talking about very light tasks which won't be really pessimized much when running on the same core. Modern CPU cores are able to enter deep sleep states when they are not used and it looks like the Linux scheduler actively does everything to make the CPU consume more power instead of preserving it. Maybe there are sysctl tunables to change this behaviour but I've no idea how to even Google for that ;-)
- Likes 1
Leave a comment:
-
Linux 5.7 To Improve Spreading Of Utilization, Other Scheduler Work
Phoronix: Linux 5.7 To Improve Spreading Of Utilization, Other Scheduler Work
More improvements were queued in recent days to sched/core of CPU scheduler improvements on the table for the forthcoming Linux 5.7 kernel cycle...
Tags: None
Leave a comment: