Re: [PATCH v2] mm/khugepaged: Don't install PMDs in uffd-minor-registered VMAs

From: Andrew Morton

Date: Fri Aug 28 2026 - 21:38:58 EST


On Fri, 28 Aug 2026 18:18:11 -0700 James Houghton <jthoughton@xxxxxxxxxx> wrote:

> On Fri, Aug 28, 2026 at 6:09 PM James Houghton <jthoughton@xxxxxxxxxx> wrote:
> >
> > On Fri, Aug 28, 2026 at 5:33 PM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > Wondering what Lance tested. Was he able to reproduce the bug?
> >
> > I assume he just re-ran my repro, but yeah I'm not sure, heh. Lance,
> > what did you test?
>
> Ah, just to be clear, I linked a repro on v1. Here[1] is that repro.
> Sorry, slipped my mind to also include it in the notes for this v2.
>
> [1] https://gist.github.com/48ca/d399bf534158e80241fb4937ef1ff664

Cool thanks, I'll slap this into the changelog.

# ./a.out
TAP version 13
1..1
madvise(MADV_COLLAPSE) succeeded
ioctl(UFFDIO_CONTINUE) failed: File exists (errno=17)
not ok 1 - memfd userfaultfd MINOR continue test


We do have a ton of uffd selftesting code in there. Adding this case
to uffd-unit-tests.c would presumably be pretty simple. We don't
really have a policy on adding a test-case after fixing something -
it's common practice but why? We already fixed it!