Re: [PATCH 00/17] Rust support

Finn Behrens
2021-07-07T21:03:53Z

> On 7. Jul 2021, at 17:02, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Jul 07, 2021 at 03:07:50PM +0100, Wedson Almeida Filho wrote:
>>> Last I looked at this thing, it was not
>>> feature-complete compared to the in-kernel binder code, has that been
>>> resolved and the needed filesystem changes added?
>>
>> It is not feature-complete in comparison to the C one just yet, it is missing a
>> few things but not for any fundamental reason -- we were mostly focusing on the
>> kernel crate and tests.
>
> I love it how you call "binderfs is missing" a "few things" :)
>
>> Miguel's point is that it does implement the vast majority of binder features
>> and is non-trivial, so it could be used as evidence that useful kernel drivers
>> can be built with Rust; not just "transpiled" from C, but written with the Rust
>> safety guarantees.
>
> As Christoph said, and I and others have said before, binder is in no
> way shape or form anything that resembles any sort of "driver" at all.
> It is a crazy IPC mechanism that is tacked onto the side of the kernel.
> Not to say that it doesn't have its usages, but the interactions between
> binder and the rest of the kernel are very small and specific.
> Something that almost no one else will ever write again.
>
> Please work on a real driver to help prove, or disprove, that this all
> is going to be able to work properly. There are huge unanswered
> questions that need to be resolved that you will run into when you do
> such a thing.
>

There is a more general use driver (network dummy) still in the making, It is fully operational, just the documentation of the rust bindings are not finished yet, so it is not merged into the rust tree yet, also I have to rebase it.
I testet the network dummy (dummyrs) driver and for stupid tests like Iperf3 or ping it performed slightly better that the C version. See https://github.com/Kloenk/linux/blob/rust-netdevice/drivers/net/dummy_rs.rs for the actually driver.

Yes this driver is still only virtually, but the network apis are probably more general usage than the binder apis.

> Good luck!
>
> greg k-h

CU,
Finn