On Fri, Jun 17, 2022 at 4:58 PM Huacai Chen <chenhuacai@xxxxxxxxxxx> wrote: > > Add sparse memory vmemmap support for LoongArch. SPARSEMEM_VMEMMAP > uses a virtually mapped memmap to optimise pfn_to_page and page_to_pfn > operations. This is the most efficient option when sufficient kernel > resources are available. I have not looked at this in detail, but from a high-level perspective, it seems very similar to the corresponding code in arch/arm64 and arch/x86. Can you try to merge the three copies into a generic helper and add that to mm/sparse-vmemmap.c? If this does not work, can you describe in the changelog text why these have to be architecture specific? Arnd