Re: [PATCH v2 1/4] mm: Introduce vm_uffd_ops API

From: Liam R. Howlett

Date: Thu Sep 18 2025 - 14:33:08 EST


* Mike Rapoport <rppt@xxxxxxxxxx> [250918 14:05]:

...

>
> > I am under the impression that we don't need to return the folio, but
> > may need to do work on it. That is, we can give the mm side what it
> > needs to call the related memory type functions to service the request.
> >
> > For example, one could pass in the inode, pgoff, and memory type and the
> > mm code could then call the fault handler for that memory type?
>
> How calling the fault handler differs conceptually from calling
> uffd_get_folio?
> If you take a look at UFFD_CONTINUE for shmem, this is pretty much what's
> happening. uffd side finds inode and pgoff and calls to a shmem_get_folio()
> that's very much similar to shmem->fault().

I believe the location of the code that handles the folio. One would
decouple the folio processing from the mm while the other would decouple
which processing of the folio is done within the mm.

Does that make sense?