Announcement

Collapse
No announcement yet.

LPC 2022: Rust Linux Drivers Capable Of Achieving Performance Comparable To C Code

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

  • LPC 2022: Rust Linux Drivers Capable Of Achieving Performance Comparable To C Code

    Phoronix: LPC 2022: Rust Linux Drivers Capable Of Achieving Performance Comparable To C Code

    Held today during the first day of Linux Plumbers Conference 2022 in Dublin was a Rust mini-conference about the ongoing work on making Rust a suitable systems programming language and integrating support for Rust within the mainline Linux kernel. There were many interesting talks from the status of the Rust integration from the Linux kernel to a Rust-written NVMe driver that can perform as well as the C written driver...

    https://www.phoronix.com/news/LPC-2022-Rust-Linux

  • #2
    That looks impressive for non-production code.

    Comment


    • #3
      FreeBSD is starting to look at using Rust for kernel drivers too:

      https://wiki.freebsd.org/Rust#Rust_i...FreeBSD_Kernel

      Comment


      • #4
        Originally posted by jacob View Post
        FreeBSD is starting to look at using Rust for kernel drivers too:

        https://wiki.freebsd.org/Rust#Rust_i...FreeBSD_Kernel
        That might be overstating the case. The most recent update in this blog which minimally refreshes the existing example code, states that

        "For FreeBSD, there doesn’t seem to be any active work in this space"

        Do you know something more?

        Comment


        • #5
          I'm not sure why anyone would be surprised by this. The rust driver does essentially the same job, while rust itself accomplishes all it's checks at compile-time. There's no runtime overhead. As bugs in various systems of tagging get worked out in LLVM, it's quite possible that rust will pull ahead of C/C++ thanks to optimizations that currently can't be deployed upon C/C++ code.

          Comment


          • #6
            Originally posted by kneekoo View Post
            That looks impressive for non-production code.
            The numbers should not (really) surprise anyone. Like most any language one can write good, bad, or ugly code in rust. And compiler optimization matters. But rust compilers now produce results that are essentially the same performance as C for equivalently good code.

            It seems unlikely that a significant percentage of the linux kernel would ever be (re)written in rust, but for the cases where rust is a good fit, it should be allowed.

            Comment


            • #7
              Originally posted by CommunityMember View Post

              The numbers should not (really) surprise anyone. Like most any language one can write good, bad, or ugly code in rust. And compiler optimization matters. But rust compilers now produce results that are essentially the same performance as C for equivalently good code.

              It seems unlikely that a significant percentage of the linux kernel would ever be (re)written in rust, but for the cases where rust is a good fit, it should be allowed.
              Actually significant parts of the Linux kernel do get rewritten every now and then. For now Rust will be used for "leaf" modules only, so not in the core kernel, but if Rust is successful there, then it may change. Of course for various reasons the rewritters may not necessarily always use Rust even when it's available, but I wouldn't be surprised if by the end of the decade we have some Rust code in the process scheduler or memory manager.

              Comment


              • #8
                Originally posted by RahulSundaram View Post

                That might be overstating the case. The most recent update in this blog which minimally refreshes the existing example code, states that

                "For FreeBSD, there doesn’t seem to be any active work in this space"

                Do you know something more?
                I don't know anything more, except that there seems to be a discussion going on about it. It looks like it's at the "I wonder if it would make sense for us" stage. Obviously no concrete code exists except some "hello world" module but this is how it started in Linux too.

                Comment


                • #9
                  Is modern Cpp bad for memory handling ?

                  Comment


                  • #10
                    Rust Linux drivers capable of achieving performance comparable to C code
                    Hooray! Rust has got it made in reinventing the wheel.

                    Comment

                    Working...
                    X