LoongArch selects ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP but not ARCH_WANT_OPTIMIZE_DAX_VMEMMAP. Its vmemmap_free() implementation is also empty, so it cannot tear down optimized Device DAX mappings. A later change removes the generic Device DAX architecture gate and lets vmemmap_populate() decide whether a section can use optimization. Clear the section compound order in the LoongArch path so Device DAX keeps using unoptimized mappings. This does not affect HugeTLB HVO: LoongArch does not support gigantic pages, so HugeTLB does not use section-based vmemmap optimization there. Signed-off-by: Muchun Song --- v2: - New patch using section_vmemmap_optimization_disable() to keep Device DAX vmemmap optimization disabled on LoongArch (reported by Sashiko) --- arch/loongarch/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/mm/init.c b/arch/loongarch/mm/init.c index f801f7097f03..ea769e479241 100644 --- a/arch/loongarch/mm/init.c +++ b/arch/loongarch/mm/init.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -143,6 +144,7 @@ void __meminit vmemmap_set_pmd(pmd_t *pmd, void *p, int node, int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap) { + section_vmemmap_optimization_disable(start, end); #if CONFIG_PGTABLE_LEVELS == 2 return vmemmap_populate_basepages(start, end, node, NULL); #else -- 2.54.0