On 7/25/26 00:29, Rik van Riel wrote: > follow_page_mask() now batches a PTE-mapped large folio (mTHP) into one > contiguous run for the slow get_user_pages() path. A mis-batched run would > hand back the wrong pages or a stale COW copy, which the existing tests do > not catch: gup_test checks only pin/unpin integrity, and cow exercises COW > mostly at PMD size. > > Add mthp_gup_cow_test. It forces 64kB-only mTHP, writes a per-page-distinct > pattern, then pins the region on the slow path (PIN_LONGTERM without > USE_FAST) and compares the bytes the kernel copies back from the pinned > pages against that pattern. > > The test covers a read pin, a write pin, and COW after fork(): a child > write-pins to force per-page unshare and checks the copied contents, then > rewrites its copy while the parent verifies its own contents are intact. > > It also reports how many pages sit in contiguous large-folio runs, so a > kernel without mTHP shows light coverage rather than passing vacuously. > > Assisted-by: Claude:claude-opus-4.8
I'm sorry, I cannot be convinced to review this AI slop here. You should have known better to no send such a ... patch ... out. It completely violates to how we are supposed to write mm selftests in 2026. Also, testing some implementation details is not really what we want. Extend other tests to just naturally test mthp as well, please, if they don't already do that. Having a separate selftest just for this is just extremely ... odd. -- Cheers, David

