Announcement

Collapse
No announcement yet.

Linux 5.7 To Improve Spreading Of Utilization, Other Scheduler Work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bones_was_here
    replied
    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.

    Leave a comment:


  • birdie
    replied
    Originally posted by Etherman View Post
    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
    https://askubuntu.com/questions/8789...lug-for-ubuntu
    This is complicated, and requires to run things manually. I was thinking about some tunable which simply instructs the kernel to aggregate low intensity tasks on a single core.
    Last edited by birdie; 23 March 2020, 03:54 PM.

    Leave a comment:


  • Etherman
    replied
    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
    by doing for file in /sys/devices/system/cpu/cpu*/online; do echo 0 > $file; done we set the cpus offline. is there a script to do the hotplug work, detect cpu usage and above a % set cpus on...
    Last edited by Etherman; 23 March 2020, 01:02 PM.

    Leave a comment:


  • birdie
    replied
    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 ;-)

    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...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite
Working...
X