Re: [PATCH v3 04/18] selftests/mm: skip khugepaged page cache cases without a PMD folio
From: Mike Rapoport
Date: Thu Aug 13 2026 - 11:10:03 EST
> The page cache caps folio order at MAX_PAGECACHE_ORDER, which sits below
> the PMD order where a PMD is 512M -- arm64 with 64K base pages. A
"which is smaller than PMD order on arm64 with 64K pages" reads less
ornately ;-)
> PMD-sized page cache folio is then impossible, so MADV_COLLAPSE answers
> -EINVAL and khugepaged passes over the range. The shmem cases ask for one
> anyway, so four of them fail and the run bails out in the middle.
shmem asks for one who?
> The cap is one global, so it rules out every file mapping, not just shmem:
> shmem_huge_global_enabled() drops the PMD order from what it allows, and
> file_thp_enabled() refuses a regular file whose mapping cannot hold a PMD
> folio.
I had hard time parsing it beyound "the cap is global".
> Skip both mem types when the PMD order has no per-order
> shmem_enabled control, which is the readable form of the cap: that control
> is created for the orders in THP_ORDERS_ALL_FILE_DEFAULT. A run left with
> nothing to collapse into skips outright.
This should be a paragraph on its own IMHO.
--
Sincerely yours,
Mike.