|
|
Subscribe / Log in / New account

Duplicate the DMA in Rust

Duplicate the DMA in Rust

Posted Jan 31, 2025 9:51 UTC (Fri) by LtWorf (subscriber, #124958)
Parent article: Resistance to Rust abstractions for DMA mapping

> Over time, "I don't want to deal with more than one language" will be an increasingly weak argument against a contribution written in Rust.

You can't force people. If you reach the point where you tell them "my way or the highway" they might chose the highway. And the whole goal of Rust in the kernel is to have more maintainers, not fewer.

I think the DMA maintainers would be satisfied if Rust had its own independent DMA code that does no calls to the C DMA code but implements everything from scratch. In that way a change of the C API would not require them to go and fix any rust code.

I presume this road hasn't been considered because it's complicated. But it would avoid offloading more work onto people who don't want to do this extra work, and keep it on the shoulders of people who claim they do want to do the work. So to me that would seem the fairest solution here.


to post comments

Duplicate the DMA in Rust

Posted Jan 31, 2025 10:51 UTC (Fri) by josh (subscriber, #17465) [Link]

I doubt that that's feasible, because DMA is a system resource and having two competing systems would still require those systems to cooperate.

There isn't a genuine technical objection here, and this isn't something that a technical solution will fix. Christoph is attempting to block Rust in the kernel, calling it a "cancer" and saying "I will do everything I can do to stop this.". The correct response to such an escalation is to get him overruled and told that his "nack" will be ignored; nothing short of that is likely to work.

Duplicate the DMA in Rust

Posted Jan 31, 2025 11:37 UTC (Fri) by Wol (subscriber, #4433) [Link] (4 responses)

> I presume this road hasn't been considered because it's complicated. But it would avoid offloading more work onto people who don't want to do this extra work, and keep it on the shoulders of people who claim they do want to do the work. So to me that would seem the fairest solution here.

I was thinking that. Do a "swap management" type stunt that Linus pulled ages ago.

I strongly suspect the result would be this huge blob of C legacy code would be replaced by a much smaller Rust blob, and Christoph would cease to be maintainer because the code would become an ex-Parrot.

Cheers,
Wol

Duplicate the DMA in Rust

Posted Jan 31, 2025 11:50 UTC (Fri) by intelfx (subscriber, #130118) [Link] (3 responses)

Unfortunately, this would also introduce a pretty much hard Rust dependency into non-driver code, and it's likely too early for that (architecture support concerns are one of the real, if temporary, issues with Rust).

Duplicate the DMA in Rust

Posted Jan 31, 2025 14:47 UTC (Fri) by Wol (subscriber, #4433) [Link] (2 responses)

If the Rust code (a) is cleaner to work with, and (b) other maintainers decide it's more reliable to work with, then you're actively harming Linux by trying to keep it out.

Cheers,
Wol

Duplicate the DMA in Rust

Posted Jan 31, 2025 15:03 UTC (Fri) by dralley (subscriber, #143766) [Link] (1 responses)

With respect to the bindings code discussed here, I agree.

With respect to Rust in core kernel infrastructure, I don't think the architecture support concerns can be handwaved away like that. rustc_codegen_gcc is getting closer and closer to maturity every month, so this won't be a problem forever, but for the time being it still is.

Duplicate the DMA in Rust

Posted Feb 1, 2025 13:45 UTC (Sat) by tialaramex (subscriber, #21167) [Link]

Right, "We'll just write the DMA subsystem in Rust" is not viable so long as there are platforms Linus wants for Linux that don't have a reasonable Rust story.

It would be very disappointing if that's what it takes, that somehow "Everything" is the lowest acceptable bar for "Anything" but I'd guess in the short term the only consequence is that the Rust priorities for 2025H1 get shorter by one item, no need to get Rust-for-Linux on stable Rust closer if in fact Rust-for-Linux is blocked until we can just rewrite everything in Rust anyway.

Duplicate the DMA in Rust

Posted Jan 31, 2025 14:43 UTC (Fri) by Wol (subscriber, #4433) [Link]

> You can't force people. If you reach the point where you tell them "my way or the highway" they might chose the highway. And the whole goal of Rust in the kernel is to have more maintainers, not fewer.

Do we want one maintainer jealously guarding his fiefdom, or four or five working as a team?

People who can't work as a team are a liability and single-handedly do a damn good job of discouraging newcomers.

Cheers,
Wol


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds