Re: [PATCH v3 1/4] mm: Introduce vm_uffd_ops API
From: Peter Xu
Date: Tue Sep 30 2025 - 14:39:14 EST
On Tue, Sep 30, 2025 at 12:18:37PM +0200, David Hildenbrand wrote:
> On 30.09.25 12:07, Mike Rapoport wrote:
> > On Tue, Sep 30, 2025 at 11:36:53AM +0200, David Hildenbrand wrote:
> > > On 26.09.25 23:16, Peter Xu wrote:
> > > > + /**
> > > > + * uffd_get_folio: Handler to resolve UFFDIO_CONTINUE request.
> > >
> > > Just wondering if we could incorporate the "continue" / "minor" aspect into
> > > the callback name.
> > >
> > > uffd_minor_get_folio / uffd_continue_get_folio
> > >
> > > Or do you see use of that callback in the context of other uffd features?
> >
> > If someone picks the gauntlet of refactoring the loop in mcopy_atomic()
> > we'd need a similar callback for uffd copy. And as I see it it would be
> > different enough to warrant emphasizing minor/continue in the name here.
Sure, I can go with uffd_minor_get_folio when I repost.
> >
> > I also think we can drop uffd_ prefix for the callback, as it's called as
> > uffd_ops->get_folio() or whatever it's be called.
>
> Agreed. I got annoyed yesterday when typing vma->vm_mm often enough
> (vma->mm! ).
That's also why I kept uffd_ because that's the tradition mm/ uses in many
important data structures like vma and mm. It helps most tagging systems
that most Linux developers use to avoid global name collisions.
So I tend to keep the prefix for now, until we want to switch away from
Hungarian-like notations completely. But let me know if anyone has strong
feelings.
Thanks,
--
Peter Xu