On Wed, Oct 21, 2026 at 10:36:03PM +0200, Konstantin Khorenko wrote:
> +     /* The child's exit took the parent's share off the counter. */
> +     if (*after < own || *before - *after >= own)
> +             return FAIL_COUNTER;
> +     if (*after != *before)
> +             return CHANGED;
> +     if (mem[pmdsize] != (shared ? 'c' : 2) || !data_ok(mem, size, pmdsize) 
> ||
> +         !check_huge_shmem(mem, size - pmdsize, NR_PMDS - 1, pmdsize))
> +             return FAIL_PARENT;

ShmemPmdMapped is system-wide. A drop of 'own' or more from another
process between the two reads fails the test instead of being retried
as CHANGED.

The parent's THPs can also lose their PMDs during the test: reclaim can
swap one out, and NUMA balancing can migrate one, which leaves the
counter low while the migration entry is in place. That gives
FAIL_COUNTER, or FAIL_PARENT from the exact count in check_huge_shmem().

-- 
  Kiryl Shutsemau / Kirill A. Shutemov

Reply via email to