Announcement

Collapse
No announcement yet.

An MGLRU Performance Regression Fix Is On The Way Plus Another Optimization

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

  • An MGLRU Performance Regression Fix Is On The Way Plus Another Optimization

    Phoronix: An MGLRU Performance Regression Fix Is On The Way Plus Another Optimization

    While MGLRU is a nice performance win for the Linux kernel now available when enabling it for v6.1+ kernel builds, during my testing I did encounter a regression around the SVT-AV1 video encode performance at least and a fix is working its way toward mainline...

    https://www.phoronix.com/news/MGLRU-SVT-Performance-Fix

  • #2
    Great, but I hope it didn't made other tests to regress as I could've lived just fine with only this test regressing.
    I wonder when will they enable MGLRU by default or at least provide a way to enable it through kernel boot parameters.

    Comment


    • #3
      Good job, Michael and [email protected] !

      Comment


      • #4
        Originally posted by coder View Post
        Good job, Michael and [email protected] !
        Thank you. And happy new year!

        Comment


        • #5
          Originally posted by Danny3 View Post
          Great, but I hope it didn't made other tests to regress as I could've lived just fine with only this test regressing.
          I wonder when will they enable MGLRU by default or at least provide a way to enable it through kernel boot parameters.
          To see if it is enabled use the following:
          Code:
          cat /sys/kernel/mm/lru_gen/enabled
          if this is 0 mglru is disabled 1 up to 7 means it is enabled, 7 is with all features on, for exact specifications, read the documentation. Most users should enable all functions.
          To enable mglru with all functions on use the following as root:
          Code:
          echo y >/sys/kernel/mm/lru_gen/enabled
          To disable substitute y with 0, to limit functionality substitute y with a number between 1 and 7

          Comment


          • #6
            Originally posted by FPScholten View Post

            To see if it is enabled use the following:
            Code:
            cat /sys/kernel/mm/lru_gen/enabled
            if this is 0 mglru is disabled 1 up to 7 means it is enabled, 7 is with all features on, for exact specifications, read the documentation. Most users should enable all functions.
            To enable mglru with all functions on use the following as root:
            Code:
            echo y >/sys/kernel/mm/lru_gen/enabled
            To disable substitute y with 0, to limit functionality substitute y with a number between 1 and 7
            I really hope for your own sanity that you aren't running that command manually upon every (re)boot yourself...

            Just in case, here's how it will automagically run on every start-up, guaranteed:
            cat << EOF | sudo tee /etc/udev/rules.d/99-mglru.rules
            RUN+="/bin/bash -c '/bin/echo 7 > /sys/kernel/mm/lru_gen/enabled'"
            EOF​
            You're welcome!

            And for those who believe that a systemd service file would be more adequate:

            No, because it is unable to reliably set the desired values under /sys/, meaning that on some boot-ups it will be set correctly, while other times it won't (already tried myself).

            Comment


            • #7
              Originally posted by Linuxxx View Post
              And for those who believe that a systemd service file would be more adequate:

              No, because it is unable to reliably set the desired values under /sys/, meaning that on some boot-ups it will be set correctly, while other times it won't (already tried myself).
              Why is this? Is there a race condition vs. another service which also sets it? If so, a dependency would fix that, but it suggests there might actually be another, better way to set it.

              Comment


              • #8
                Originally posted by Linuxxx View Post
                And for those who believe that a systemd service file would be more adequate:

                No, because it is unable to reliably set the desired values under /sys/, meaning that on some boot-ups it will be set correctly, while other times it won't (already tried myself).
                This sounds bogus. There is no reason why systemd (or, more precisely, systemd-launched processes) should be unable to reliably set values in sysfs.

                That said, using tmpfiles is preferable to both custom udev rules and custom systemd services.
                Last edited by intelfx; 08 January 2023, 09:15 AM. Reason: grammar

                Comment


                • #9
                  Originally posted by Linuxxx View Post

                  I really hope for your own sanity that you aren't running that command manually upon every (re)boot yourself...

                  Just in case, here's how it will automagically run on every start-up, guaranteed:


                  You're welcome!

                  And for those who believe that a systemd service file would be more adequate:

                  No, because it is unable to reliably set the desired values under /sys/, meaning that on some boot-ups it will be set correctly, while other times it won't (already tried myself).
                  No much simpler, I have it enabled by default in my kernel parameters
                  Code:
                  CONFIG_LRU_GEN_ENABLED=y
                  If for some reason I want to temporarily disable it, or reduce the features, my commands are useful for that.

                  Comment


                  • #10
                    Originally posted by FPScholten View Post

                    To see if it is enabled use the following:
                    Code:
                    cat /sys/kernel/mm/lru_gen/enabled
                    if this is 0 mglru is disabled 1 up to 7 means it is enabled, 7 is with all features on, for exact specifications, read the documentation. Most users should enable all functions.
                    To enable mglru with all functions on use the following as root:
                    Code:
                    echo y >/sys/kernel/mm/lru_gen/enabled
                    To disable substitute y with 0, to limit functionality substitute y with a number between 1 and 7
                    Wonderful, thank you very much for such a detailed and well explained answer!


                    Originally posted by Linuxxx View Post

                    I really hope for your own sanity that you aren't running that command manually upon every (re)boot yourself...

                    Just in case, here's how it will automagically run on every start-up, guaranteed:


                    You're welcome!

                    And for those who believe that a systemd service file would be more adequate:

                    No, because it is unable to reliably set the desired values under /sys/, meaning that on some boot-ups it will be set correctly, while other times it won't (already tried myself).
                    Thank you very much!
                    Last edited by Danny3; 08 January 2023, 06:31 PM.

                    Comment

                    Working...
                    X