Re: [PATCH v14 3/8] mm: rust: add vm_insert_page

From: Alice Ryhl
Date: Tue Feb 25 2025 - 11:17:01 EST


On Tue, Feb 25, 2025 at 5:06 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> On Thu, 13 Feb 2025 11:04:02 +0000
> Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> > The vm_insert_page method is only usable on vmas with the VM_MIXEDMAP
> > flag, so we introduce a new type to keep track of such vmas.
> >
> > The approach used in this patch assumes that we will not need to encode
> > many flag combinations in the type. I don't think we need to encode more
> > than VM_MIXEDMAP and VM_PFNMAP as things are now. However, if that
> > becomes necessary, using generic parameters in a single type would scale
> > better as the number of flags increases.
> >
> > Acked-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> > Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
> > Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>
> LGTM, so:
>
> Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
>
> BTW, any reason that this specialised type is called
> `VmaMixedMap` but the base type is called `VmaRef` rather than just
> `Vma`?

I used to have a VmaMut type, which motivated the VmaRef name. Then, I
removed VmaMut and later I added VmaMixedMap.

Alice