Re: [PATCH 6/6] mm: rename ARCH_ENABLE_THP_MIGRATION to ARCH_SUPPORTS_PMD_SOFTLEAF

From: David Hildenbrand (Arm)

Date: Wed Jul 01 2026 - 16:03:42 EST


On 6/30/26 18:34, Usama Arif wrote:
> CONFIG_ARCH_ENABLE_THP_MIGRATION started life gating just PMD-level
> migration entries, but has grown to gate the entire PMD-level softleaf
> machinery: migration entries, device-private entries, and soon swap
> entries.

device-private really relies on migration support.

See do_huge_pmd_device_private() where we migrate back to CPU memory.

The whole concept is pased on migration. So that's why it currently makes sense.

So "has grown to" is not quite accurate. It's a different story with swap
entries (that can exist even without migration support).


> Rename CONFIG_ARCH_ENABLE_THP_MIGRATION to CONFIG_ARCH_SUPPORTS_PMD
> _SOFTLEAF to make this clear. This is a pure rename: the set of
> selecting architectures (x86, arm64, s390, riscv, loongarch, and
> powerpc on PPC_BOOK3S_64) and the gating semantics are unchanged.

Hm, that makes me wonder what it would take to make this all just be implicitly
supported by CONFIG_TRANSPARENT_HUGEPAGE.

Looks like someone would have the courage to touch stuff like arc, mips and
sparc64 (+arm and x86, but that's less of a concern :) ).

So yeah, renaming the config option makes sense. The config space is the wild west.

We have

PGTABLE_HAS_HUGE_LEAVES

and stuff like

HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
HAVE_ARCH_SOFT_DIRTY
ARCH_HAS_GIGANTIC_PAGE
ARCH_HAS_PTE_SPECIAL

We do have a limited number of "SUPPORTS" (which is longer than HAS), but I
would either use


ARCH_HAS_PMD_SOFTLEAVES

or

HAVE_ARCH_PMD_SOFTLEAVES


Apart from that LGTM.

--
Cheers,

David