Re: [TECH TOPIC] Rust for Linux

Linus Walleij
2021-07-06T09:56:00Z

On Tue, Jul 6, 2021 at 6:30 AM Leon Romanovsky <leon@kernel.org> wrote:

> 1. The addition of another language to the mix will hurt a lot our
> ability to refactor code for cross-subsystem changes.
>
> Just as an example, there are many changes in DMA/SG areas that are
> applicable for many drivers. Even simple grep->replace pattern will
> be harder and longer if it is needed for the drivers that are written
> in different languages.

This is a fair point.

> 2. Testing matrix will be duplicated, both in compilation tests and in
> verification coverage. Even now, there are some kernel subsystems that
> so much in-love with CONFIG_* options that their combination is slightly
> tested or not tested at all. So imagine, we will need to recompile
> everything with Rust too and execute same coverage tests again.

AFAIU the idea is to replace an entire piece of code in C with the
same piece in Rust, it's not like we are going to develop a second
kernel in Rust inside the kernel in C. So both/and not either/or.
I.e. you have to compile some pieces of the kernel written in
Rust to even get to a working kernel.

Yours,
Linus Walleij