Announcement

Collapse
No announcement yet.

SCHED_DEADLINE To Be Added To Linux 3.14 Kernel

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

  • #11
    Originally posted by TAXI View Post
    Thanks for all the answers. But now I have to ask: I remember some discussions some time ago that realtime scheduling should be good for desktops, especially gaming. Was that just trolling?
    The schedulers themselves are unlikely to be useful however the core work done for realtime (less lock contention etc) has already increased Linux kernel performance for general users and will continue to do so. No other general purpose kernel has merged realtime features to the extend Linux has or is expected to do in the near future so it is taking more time than anticipated earlier to work out the kinks. The merging of DEADLINE is a major move forward however.

    Comment


    • #12
      Maybe I'm naive but with an increasing number of individual cpu cores, couldn't different schedulers run on/manage different cpus? What would be needed to achieve that?

      Comment


      • #13
        Originally posted by ChrisXY View Post
        Maybe I'm naive but with an increasing number of individual cpu cores, couldn't different schedulers run on/manage different cpus? What would be needed to achieve that?
        Well, at a minimum you would need some sort of super-scheduler to divide the jobs up among the schedulers for each CPU.

        Comment


        • #14
          Originally posted by RahulSundaram View Post
          The schedulers themselves are unlikely to be useful however the core work done for realtime (less lock contention etc) has already increased Linux kernel performance for general users and will continue to do so. No other general purpose kernel has merged realtime features to the extend Linux has or is expected to do in the near future so it is taking more time than anticipated earlier to work out the kinks. The merging of DEADLINE is a major move forward however.
          Well osx is able to offer"real-time" guarantees according to their developer docs. The reason is that their scheduler lives on mach.
          Osx, ootb, offers simply phenomenally consistent low latency. Same goes for iOS.

          There was m excellent article about the deadline work on lwn awhile back. The key thing to understand is that it is designed specifically for periodic tasks (say making sure an audio/video buffer remains full during playback, or making sure a heartbeat is processed). This has been cooking for a long time and it's fantastic to see it finally appear outside of academia.

          Comment


          • #15
            Desktop

            There are two main approaches I can see:
            • kernel automagic (mr kolivas and his brainfuckscheduler BFS, DEADLINE, others...)
            • user-space
              • automagic scheduling hacks (based on pam/consolekit - systemd)
              • ULATENCYD


            If I may, I would like to point your atention towards ULATENCYD, which as of now, is feature complete, policy based (with working default policies) userspace scheduler that utilizes CGROUPS and other kernel subsystems (optionally BFS).
            Code is here:

            https://github.com/poelzi/ulatencyd


            == What is ulatency ==

            Ulatency is a daemon that controls how the Linux kernel will spend it's
            resources on the running processes. It uses dynamic cgroups to give the kernel
            hints and limitations on processes.

            It strongly supports the lua scripting language for writing rules and the
            scheduler code.

            == What tries it to fix ==

            The Linux scheduler does a pretty good job to give the available resources to
            all processes, but this may not be the best user experience in the desktop case.
            ulatencyd monitors the system and categorizes the running processes into cgroups.
            Processes that run wild to slow down the system by causing massive swaping will
            be isolated.

            == Isn't CONFIG_SCHED_DESKTOP enough ? ==

            There is a patch for 2.6.38 in pipeline, see http://thread.gmane.org/gmane.linux.kernel/1050575

            I think that this mimimal aproach is good for some circumstances, but does not
            provide enough flexibility required for a true low latency desktop.
            Perfect desktop scheduling needs a lot of heuristics, that don't belong in
            the kernel. For example, the patch won't protect you from swap of death, fork bombs,
            can't detect which process you are actually using and give more cpu shares to them,
            can't give realtime priorities to processes like jackd, etc...

            ulatencyd is designed for fixing exactly that.
            As I am writing this, I'm listening to youtube tracklist and runing kernel AND firefox compilation simultaneously with multiple jobs on laptop i5 while still having very decent responsiveness.
            Ulatency does all the magic as seen here:


            Code:
            $ ulatency --no-processes
            /sys/fs/cgroup/cpu
            └─┬?cpu?                 cpu.shares=1024
              ├─┬?sys_essential?     cpu.shares=3048
              ├─┬?usr_1000?          cpu.shares=3048
              │ ├─┬?grp_28316?       cpu.shares=600
              │ ├─┬?grp_9874?        cpu.shares=600
              │ ├─┬?grp_9186?        cpu.shares=600
              │ ├─┬?grp_9121?        cpu.shares=600
              │ ├─┬?grp_8831?        cpu.shares=600
              │ ├─┬?grp_7783?        cpu.shares=600
              │ ├─┬?grp_7780?        cpu.shares=600
              │ ├─┬?grp_6153?        cpu.shares=600
              │ ├─┬?grp_417?         cpu.shares=600
              │ ├─┬?grp_1000?        cpu.shares=600
              │ ├─┬?grp_998?         cpu.shares=600
              │ ├─┬?grp_21280?       cpu.shares=600
              │ ├─┬?grp_425?         cpu.shares=600
              │ ├─┬?bg_high?         cpu.shares=1000
              │ ├─┬?ui?              cpu.shares=2000
              │ ├─┬?grp_357?         cpu.shares=600
              │ ├─┬?grp_353?         cpu.shares=600
              │ └─┬?grp_23101?       cpu.shares=600
              ├─┬?rt_tasks?          cpu.shares=3048
              ├─┬?sys_daemon?        cpu.shares=800
              ├─┬?iso_firefox?       cpu.shares=1024
              ├─┬?iso_ulatency?      cpu.shares=500
              └─┬?iso_make?          cpu.shares=1024
            Note that cpu shares are devided between several automatically scheduled processes (grp)
            and that my firefox (iso_firefox) and make batch jobs (iso_make) are on the same level as all other tasks in group usr_1000 and realtime tasks (pulseaudio among other things) but with different cpu.shares.

            All this with basic to no configuration (apart from starting the daemon, sysvinit and systemd are supported).

            TL;DR

            I highly recommend ulatencyd, it works well for desktop and it's stable enough for desktop use.

            Comment


            • #16
              Originally posted by tpruzina View Post
              There are two main approaches I can see:
              • kernel automagic (mr kolivas and his brainfuckscheduler BFS, DEADLINE, others...)
              • user-space
                • automagic scheduling hacks (based on pam/consolekit - systemd)
                • ULATENCYD


              If I may, I would like to point your atention towards ULATENCYD, which as of now, is feature complete, policy based (with working default policies) userspace scheduler that utilizes CGROUPS and other kernel subsystems (optionally BFS).
              Code is here:

              https://github.com/poelzi/ulatencyd




              As I am writing this, I'm listening to youtube tracklist and runing kernel AND firefox compilation simultaneously with multiple jobs on laptop i5 while still having very decent responsiveness.
              Ulatency does all the magic as seen here:


              Code:
              $ ulatency --no-processes
              /sys/fs/cgroup/cpu
              └─┬?cpu?                 cpu.shares=1024
                ├─┬?sys_essential?     cpu.shares=3048
                ├─┬?usr_1000?          cpu.shares=3048
                │ ├─┬?grp_28316?       cpu.shares=600
                │ ├─┬?grp_9874?        cpu.shares=600
                │ ├─┬?grp_9186?        cpu.shares=600
                │ ├─┬?grp_9121?        cpu.shares=600
                │ ├─┬?grp_8831?        cpu.shares=600
                │ ├─┬?grp_7783?        cpu.shares=600
                │ ├─┬?grp_7780?        cpu.shares=600
                │ ├─┬?grp_6153?        cpu.shares=600
                │ ├─┬?grp_417?         cpu.shares=600
                │ ├─┬?grp_1000?        cpu.shares=600
                │ ├─┬?grp_998?         cpu.shares=600
                │ ├─┬?grp_21280?       cpu.shares=600
                │ ├─┬?grp_425?         cpu.shares=600
                │ ├─┬?bg_high?         cpu.shares=1000
                │ ├─┬?ui?              cpu.shares=2000
                │ ├─┬?grp_357?         cpu.shares=600
                │ ├─┬?grp_353?         cpu.shares=600
                │ └─┬?grp_23101?       cpu.shares=600
                ├─┬?rt_tasks?          cpu.shares=3048
                ├─┬?sys_daemon?        cpu.shares=800
                ├─┬?iso_firefox?       cpu.shares=1024
                ├─┬?iso_ulatency?      cpu.shares=500
                └─┬?iso_make?          cpu.shares=1024
              Note that cpu shares are devided between several automatically scheduled processes (grp)
              and that my firefox (iso_firefox) and make batch jobs (iso_make) are on the same level as all other tasks in group usr_1000 and realtime tasks (pulseaudio among other things) but with different cpu.shares.

              All this with basic to no configuration (apart from starting the daemon, sysvinit and systemd are supported).

              TL;DR

              I highly recommend ulatencyd, it works well for desktop and it's stable enough for desktop use.
              and what You talk about this? Here only works CFS, Automatic process group scheduling, preempt, HZ = 1000 ... etc. on my kernels. Below MSi X370 with AMD APU E-350:

              Moje rozwiązania: Kernel 3.13.0-rc7-ext73-f1-28.0-brazos-ags-cfs + APM 3.2 + wpisy w Grub oraz Linux-firmware/amd microcode. Tu prezentacja działania kernela...


              Moje rozwiązania: Kernel 3.13.0-rc7-ext73-f1-28.0-brazos-ags-cfs + APM 3.2 + wpisy w Grub oraz Linux-firmware/amd microcode. Tu prezentacja działania kernela...

              Comment

              Working...
              X