lkml.org 
[lkml]   [2022]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 10/20] rust: add `kernel` crate
Hi Sergey,

On Mon, Feb 14, 2022 at 6:27 AM Sergey Senozhatsky
<senozhatsky@chromium.org> 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

\
 
 \ /
  Last update: 2022-02-14 14:37    [W:0.069 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site