Re: [PATCH v2 1/4] mm: Introduce vm_uffd_ops API
From: Mike Rapoport
Date: Wed Sep 17 2025 - 05:25:55 EST
Hi Liam,
On Mon, Sep 08, 2025 at 12:53:37PM -0400, Liam R. Howlett wrote:
>
> Reading through the patches, I'm not entirely sure what you are
> proposing.
>
> What I was hoping to see by a generalization of the memory types is a
> much simpler shared code base until the code hit memory type specific
> areas where a function pointer could be used to keep things from getting
> complicated (or, I guess a switch statement..).
>
> What we don't want is non-mm code specifying values for the function
> pointer and doing what they want, or a function pointer that returns a
> core mm resource (in the old example this was a vma, here it is a
> folio).
>
> From this patch set:
> + * Return: zero if succeeded, negative for errors.
> + */
> + int (*uffd_get_folio)(struct inode *inode, pgoff_t pgoff,
> + struct folio **folio);
>
> This is one of the contention points in the current scenario as the
> folio would be returned.
I don't see a problem with it. It's not any different from
vma_ops->fault(): a callback for a filesystem to get a folio that will be
mapped afterwards by the mm code.
--
Sincerely yours,
Mike.