Re: [PATCH v7 1/2] rust: mm: add abstractions for mm_struct and vm_area_struct

From: Alice Ryhl
Date: Mon Oct 14 2024 - 06:58:09 EST


On Mon, Oct 14, 2024 at 12:47 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Mon, Oct 14, 2024 at 11:30 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> >
> > +/// #[repr(transparent)]
>
> Line in docs.
>
> > +/// #[repr(transparent)]
> > +#[repr(transparent)]
>
> Ditto here, but in this case also outside the docs.
>
> Some trivial nits I noticed below since I am here.
>
> > + /// during the lifetime 'a.
>
> Backticks (some other instances on lifetimes too).
>
> > + /// Calls `mmget_not_zero` and returns a handle if it succeeds.
>
> I would add `bindings::` since otherwise it may be confusing to say
> the C name without qualifying, since this function is also called the
> same way.
>
> > + // SAFETY: The pointer is valid since self is a reference.
>
> `self`.
>
> > +// Make all VmAreaRef methods available on VmAreaMut.
> > +// Make all VmAreaMut methods available on VmAreaNew.
>
> Backticks.
>
> > + /// Can contain "struct page" and pure PFN pages.
> > + /// MADV_HUGEPAGE marked this vma.
>
> These are copied from C, so it is fine, but we may want to take the
> chance to format them.

Thanks for the docs issues. I'll give others a chance to comment too,
then send a v8 soon.

Alice