Re: [PATCH v4 10/20] rust: add `kernel` crate

From: Miguel Ojeda
Date: Mon Feb 14 2022 - 08:37:10 EST


Hi Sergey,

On Mon, Feb 14, 2022 at 6:27 AM Sergey Senozhatsky
<senozhatsky@xxxxxxxxxxxx> wrote:
>
> Is this flexible enough? Why not let user pass bindings::GFP_* bitmask,
> just like what the underlying kernel API does.

For particular kernel abstractions, they may know what they need; but
in general, yeah, we may need to allow for flexibility where needed
(see the `TODO` comment in the quoted code).

For collections that need to allocate, it is an open question how Rust
will handle it upstream, as there are several approaches (if you want
to take a look, see the `allocator_api` feature and the working group
at https://github.com/rust-lang/wg-allocators). But in order to be
able to experiment and see what is best for the kernel, we have an
in-tree fork of the `alloc` standard library crate (see
`rust/alloc/README.md`).

Cheers,
Miguel