Re: Can the Kernel Concurrency Sanitizer Own Rust Code?
flat view
From: "Paul E. McKenney" <paulmck@kernel.org>
Date: 2021-10-13 16:07:09
On Wed, Oct 13, 2021 at 01:48:13PM +0200, Miguel Ojeda wrote:
On Mon, Oct 11, 2021 at 9:01 PM Paul E. McKenney [off-list ref] wrote:quoted
The main issue I was calling out was not justifying Rust, but rather making sure that the exact same build could be reproduced a decade later.Yes, but that is quite trivial compared to other issues I was mentioning like adapting and requalifying a testing tool. For instance, if you already had a team maintaining the configuration management (i.e. the versions etc.), adding one more tool is not a big deal.
OK, close enough to fair enough. ;-)
quoted
There are things that concurrent software would like to do that are made quite inconvenient due to large numbers of existing optimizations in the various compiler backends. Yes, we have workarounds. But I do not see how Rust is going to help with these inconveniences.Sure, but C UB is unrelated to Rust UB. Thus, if you think it would be valuable to be able to express particular algorithms in unsafe Rust, then I would contact the Rust teams to let them know your needs -- perhaps we end up with something way better than C for that use case!
Sequence locks and RCU do seem to be posing some challenges. I suppose this should not be too much of a surprise, given that there are people who have been in the Rust community for a long time who do understand both. If it were easy, they would have already come up with a solution. So the trick is to stage things so as to allow people time to work on these sorts of issues.
In any case, Rust does not necessarily need to help there. What is important is whether Rust helps writing the majority of the kernel code. If we need to call into C or use inline assembly for certain bits -- so be it.quoted
But to be fair, much again depends on exactly where Rust is to be applied in the kernel. If a given Linux-kernel feature is not used where Rust needs to be applied, then there is no need to solve the corresponding issues.Exactly.
Thank you for bearing with me.
I will respond to your other email later,. but the focus on memory
safety in particular instead of undefined behavior in general does help
me quite a bit.
My next step is to create a "TL;DR: Memory-Model Recommendations" post
that is more specific, with both short-term ("do what is easy") and
long-term suggestions.
Thanx, Paul