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

  • patrick1946
    replied
    Originally posted by PAUL007 View Post
    Is modern Cpp bad for memory handling ?
    It really depends. You can easily shoot yourself into the foot but you can use smart pointers and a crash handler who sends dumps. Most of our crashes happen in the graphics driver. But this are not the serious bugs.

    Most serious bugs have their root into code which was hacked under time pressure. They are not crashes but strange behavior. And most crashes are simply running into asserts. I don't see how Rust would fix that. I think more test driven development could help but that is hard to enforce. Nobody wants pseudo tests.

    Actually I was surprised that Rust is not stronger on this front. You could do much more on the language level to make testing easier. You can not catch all bugs at compile time. Most input is happening at runtime. So you need tests for that.

    Leave a comment:


  • IActuallyKnowItAll
    replied
    Originally posted by cardich View Post
    Hooray! Rust has got it made in reinventing the wheel.
    I expected to see at least one fist shaker under this article and you didn't disappoint me, thanks.

    Leave a comment:


  • bug77
    replied
    Originally posted by Developer12 View Post
    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.
    Exactly. The discussion should not be centered around performance, it should be about time-to-market. How long does it take to write (and fix) C vs Rust code. That is where C leaves you hanging while Rust's compiler bends over backwards for you.

    Leave a comment:


  • zcansi
    replied
    IMO the main reason why NVMe is an interesting test case is that it is representative of any driver for modern high-speed hardware, with multiple I/O queues to be managed.

    For people asking why C++ is not used, my personal take on C++ is that it has more abstraction capability just like Rust, but the abstractions you build with C++ are leaky, in other words you still need to understand many details of the abstraction to use it correctly. Rust on the other hand is a little less expressive but focuses on allowing you to build watertight abstractions that you can absolutely rely on. That makes the pain/gain ratio much more favorable, at least in my opinion.

    Of course in the end, the reason why C++ is not used is that Linus does not like C++, and he has his own reasons. He is undecided but open minded about Rust.
    Last edited by zcansi; 13 September 2022, 03:31 AM.

    Leave a comment:


  • Quackdoc
    replied
    Originally posted by cardich View Post
    Hooray! Rust has got it made in reinventing the wheel.
    yup, linux is finally begin to accept rubber wheels alongside the wooden ones

    Leave a comment:


  • oleid
    replied
    Originally posted by cardich View Post
    Hooray! Rust has got it made in reinventing the wheel.
    Yes, just a nicer one that - albeit being non production code - rolls as fast as the battle tested C one.

    You understand the term "proof of concept", don't you?

    Leave a comment:


  • jacob
    replied
    Originally posted by PAUL007 View Post
    Is modern Cpp bad for memory handling ?
    Yes. It's less tragic than old cpp but still extremely bad. But most importantly cpp is a very bad language for use with a kernel. And Linus refuses to allow cpp in Linux but he's not opposed to Rust.

    Leave a comment:


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

    Leave a comment:


  • PAUL007
    replied
    Is modern Cpp bad for memory handling ?

    Leave a comment:


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

    Leave a comment:

Working...
X