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

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

    http://www.phoronix.com/scan.php?pag...oved-Spreading

  • #2
    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 ;-)

    Comment


    • #3
      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
      Last edited by Etherman; 03-23-2020, 01:02 PM.

      Comment


      • #4
        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; 03-23-2020, 03:54 PM.

        Comment


        • #5
          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.

          Comment

          Working...
          X