Announcement

Collapse
No announcement yet.

Rust-Written Linux Scheduler Showing Promising Results For Gaming Performance

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

  • Rust-Written Linux Scheduler Showing Promising Results For Gaming Performance

    Phoronix: Rust-Written Linux Scheduler Showing Promising Results For Gaming Performance

    A Canonical engineer has been experimenting with implementing a Linux scheduler within the Rust programming language. His early results are interesting and hopeful around the potential of a Rust-based scheduler that works via sched_ext for implementing a scheduler using eBPF that can be loaded during run-time...

    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

  • #2
    Schedulers seem to be hard to get right, given there's dozens and they mostly all seem to be a janky hack mate. So another one in the mix sounds good to me, maybe eventually the good bits of each can be merged into something even bigger and jankier.

    Comment


    • #3
      Originally posted by geerge View Post
      Schedulers seem to be hard to get right, given there's dozens and they mostly all seem to be a janky hack mate. So another one in the mix sounds good to me, maybe eventually the good bits of each can be merged into something even bigger and jankier.
      The problems with schedulers are:

      (1) they need to make informed and intelligent decisions ( no, we cannot put a neural net into there, otherwise 90% of CPU time would be spent running the neural net )
      (2) sometimes they need to predict the future ( but Nostradamus wasn't a scheduler of course )

      So we try to hack something that works good when the hardware has plenty of resources available. After all our computers are overpowered for most use cases and for the few use cases that need a lot of power we offload them to GPUs, FGPAs, etc... Sad story but this is the state of the art.

      Comment


      • #4
        Wait a minute... Performance went from 25-30 FPS to 60 FPS? I'd be more suspicious that something important is being overlooked here. I'd also be interested to know how long the compile takes in each benchmark while the game is running.

        Comment


        • #5
          This is super cool, I run high loads all the time and my PC becomes nearly useless, the new scheduler is pretty good, a certain improvement, but these gains look massive, ill have to try this for sure. not looking forwards to compiling my own zen kernel, but it is what it is.

          EDIT: have the kernel related patches for sched_ext stuff been posted yet?

          Comment


          • #6
            Am I wrong to think it's not surprising at all that someone can fart out some random scheduler that benchmarks better at "certain workloads" ?

            Comment


            • #7
              He shared a YouTube video showing a game with the "scx_rustland" scheduler outperforming the default Linux kernel scheduler while running a parallel kernel build in the background
              Kinda interesting environment to test gaming performance.

              Comment


              • #8
                It would be useful if the time to compile the kernel was posted.

                Wouldn't shock me if that performance increase for the game slows down the kernel build, but if so I still think its better for the desktop.

                it's worth noting that Windows automatically prioritises the thread of windows in the foreground, and then further to the window that's currently got focus. I don't think Linux does anything similar the moment and probably explains why Windows still feels more responsive.
                Last edited by Britoid; 16 January 2024, 08:51 AM.

                Comment


                • #9
                  Originally posted by geerge View Post
                  Schedulers seem to be hard to get right, given there's dozens and they mostly all seem to be a janky hack mate. So another one in the mix sounds good to me, maybe eventually the good bits of each can be merged into something even bigger and jankier.
                  The perfect scheduler is probably impossible to build. You need one that handles powersaving/performance profiles and low latency for soft real-time stuff and maximum bandwidth as well as foreground/background tasks.
                  All this while the CPU could drop from 100 % performance to 50 % any time because it runs out of boost/thermal headroom. And different core types have just recently become a thing.
                  And the scheduler needs to be ultra fast so complexity schould stay very low to achieve this.

                  So we typically see schedulers doing well in certain workloads and loosing with others.

                  Originally posted by Chugworth View Post
                  Wait a minute... Performance went from 25-30 FPS to 60 FPS? I'd be more suspicious that something important is being overlooked here. I'd also be interested to know how long the compile takes in each benchmark while the game is running.
                  Yes most likely the compilation lasted longer there, a comparison to "no compilation FPS" would give a much bigger hint.

                  Comment


                  • #10
                    I am not sure what happens with that scheduler but the effect looks to me the same as applying schedtool and ionice. On my 5950X doing nice by only 1 makes a huge difference in responsiveness. Confirmed multiple times by compiling kernel or mesa and doing casual internet surfing at the same time - impact becomes almost unnoticeable. Didn't try to game ofc since all my games are very demanding.

                    Comment

                    Working...
                    X