Re: [PATCH] mm/khugepaged: Don't collapse uffd-minor-registered VMAs
From: James Houghton
Date: Wed Sep 02 2026 - 16:43:31 EST
On Wed, Sep 2, 2026 at 3:27 AM Kiryl Shutsemau <kas@xxxxxxxxxx> wrote:
> On Mon, Aug 31, 2026 at 09:51:33AM -0700, James Houghton wrote:
> > WRT the semantics of process_madvise(MADV_COLLAPSE) and normal
> > madvise(MADV_COLLAPSE), I think it makes sense to always disallow
> > collapsing of UFFD-minor VMAs, whether MADV_COLLAPSE comes from our
> > own process or another. UFFD-minor faults are intended to be resolved
> > only with UFFDIO_CONTINUE, and until someone asks for it, I don't
> > really see a need to make MADV_COLLAPSE actually work to resolve minor
> > faults. I don't think userspace can *rely* on MADV_COLLAPSE resolving
> > minor faults either.
>
> It is safer to go with stricter policy: reject always. We can always
> relax it later if there is a use-case and reasoning about the interface
> is solid. We don't have it yet.
Thanks, Kiryl. Sounds like there is still value in this patch then.
Unless Lance disagrees, I'm happy to send a v3 with the same diff but
a rewritten changelog (and no cc:stable) reflecting that this isn't
actually currently an issue. And I'll include the uffd selftest change
as a separate patch.