this post was submitted on 21 Feb 2025
182 points (96.9% liked)

Linux

6094 readers
498 users here now

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of [email protected] and The GIMP

founded 2 years ago
MODERATORS
 

Hellwig is the maintainer of the DMA subsystem. Hellwig previously blocked rust bindings for DMA code, which in part resulted in Hector Martin from stepping down as a kernel maintainer and eventually Asahi Linux as a whole.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 23 points 1 day ago (2 children)

That now involves fixing Rust drivers, so you're going to need to know Rust.

The R4L approach is that C maintainers never need to touch any Rust code. They can break it all day long without paying any attention to it. This has been an essential part of the project from the start, I don't understand how people talking about this topic still don't understand this.

[–] [email protected] 6 points 21 hours ago (1 children)

Last time around Asahi Lina (major contributor to the Apple Silicon GPU driver) made a very nice writeup on mastodon about her attempts to mainline her work.

Part of the problem was that the C interface was straight-up broken; not only were a bunch of lifetimes undocumented, but freeing the kernel objects properly was impossible, but GCC doesn't care and neither did anyone because GPU drivers are expected to just... never exit (IIRC). So she refactored it to be saner.

Anyway apparently it was rejected for much the same reasons, aka Rust bashing thinly disguised as concerns over maintainability.

Technically the R4L project did have an impact. But what's the worst case? Spending some time on improving the C interface for an edge case? The ignominy! NAK.

[–] FizzyOrange 1 points 20 hours ago

To be clear I fully support Rust in Linux. I just think it's going to rapidly be impractical to work on Linux without learning Rust.

The solution isn't to pretend that isn't the case; it's to learn Rust!

[–] FizzyOrange 2 points 21 hours ago (1 children)

I do understand that that's what they claim. I just don't believe them. Because it requires either

  1. magical Rust maintainers who are always on call to help, or
  2. people to be on with the Rust code breaking all the time.

Neither seems likely.

[–] [email protected] 1 points 14 hours ago (1 children)

What's there not to believe? If Rust gets broken, either someone will fix it, or the kernel releases with broken Rust. Where's the issue?

It's such a strange position to take.

[–] FizzyOrange 1 points 10 hours ago (1 children)

or the kernel releases with broken Rust

This is what I don't believe. I think what will actually happen (or could at least), is:

C dev that refuses the learn Rust: "Hi, here's a change to the DMA API."

Linus: "Can you fix the Rust code before I merge this?"

C dev: "Ok, Rust devs it's your job - can you fix it?"

Rust devs: ""

C dev: "Hello? Where are you?"

...

C dev: "Can we just merge it now?"

Linus: "No we need to fix the Rust."

Again, to be 100% clear, I think that this shouldn't block Rust. We should just expect the C devs to learn a bit of Rust (seriously if they're writing Linux DMA systems they are easily bright enough to do it). But pretending that they won't have to to keep them happy seems disingenuous.

[–] [email protected] 3 points 10 hours ago* (last edited 9 hours ago) (1 children)

Okay? And why are you imagining things would go down like that, when the policy is specifically not doing it this way? When this issue hasn't occurred so far?

Rust is disabled by default, so it's not like it would be harder to build a kernel when it's broken. Seriously, I just don't get why you're imagining these things.

[–] FizzyOrange 1 points 4 hours ago (1 children)

And why are you imagining things would go down like that

Because I am familiar with human behaviour.

Rust is disabled by default

I'm not too familiar with Linux's CI system but I assume they at least test that it compiles, even if it is disabled by default.

[–] [email protected] 1 points 1 hour ago

Because I am familiar with human behaviour.

Human behavior doesn't dictate that a Linux kernel with failing Rust builds wouldn't get published.

I’m not too familiar with Linux’s CI system but I assume they at least test that it compiles, even if it is disabled by default.

Yes, the systems would notice that something broke. Those systems have no say in whether something gets released.