Re: [PATCH v6 12/19] selftests/mm: parameterize the mixed-source collapse case by source order

From: Baolin Wang

Date: Wed Sep 23 2026 - 02:59:14 EST




On 9/19/26 8:24 AM, Kiryl Shutsemau wrote:
From: "Kiryl Shutsemau (Meta)" <kas@xxxxxxxxxx>

collapse_order_mixed_sources() faults its region as order-2 folios and
collapses them to the -c target. Order 2 is below the contpte size on
every arm64 page size, so nothing in this suite collapses a contpte-mapped
source on purpose.

Let -s name the source order alongside -c. The case then faults at that
order, keeping order 2 when -s is absent, and the source order has to be a
supported mTHP order below the target. The other mTHP cases are
unaffected: mthp_push_target_order() enables only the target order.

A -c at or below -s is refused before any case runs: the sources would
already be the size being asked for. Without the check the generic cases
fail on that one by one instead of saying why.

"-s 5 -c 7" on arm64/64K then collapses contpte-mapped sources into a
larger mTHP.

Assisted-by: LLM
Acked-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
Tested-by: Muhammad Usama Anjum <usama.anjum@xxxxxxx>
Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
---

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
Tested-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>