Re: [PATCH v3 1/3] selftests/mm: allow PUD-level entries in compound testcase of hmm tests

From: Balbir Singh

Date: Sun Jun 14 2026 - 20:17:04 EST


On Thu, Jun 11, 2026 at 09:11:00AM +0530, Aboorva Devarajan wrote:
> From: Sayali Patil <sayalip@xxxxxxxxxxxxx>
>
> The HMM compound testcase currently assumes only PMD-level mappings and
> fails on systems where default_hugepagesz=1G is set, because the region
> is then reported by the device at PUD level.
>
> Determine the mapping level (PMD or PUD) the device reports for the first
> page of the range and require every page to match that level exactly via
> ASSERT_EQ(). This accepts PUD-level mappings while preserving the
> expected/observed protection values printed on failure, and rejects a
> fragmented mapping that mixes PMD- and PUD-level entries within the same
> range (which a per-page OR check would have let pass).
>

PUD is not supported with zone device private folios, the fix should
be really around default_huge_page_size(), using the default pmd size.

Balbir