Re: [PATCH 0/5] mm/sparse-vmemmap: provide generic vmemmap_set_pmd() and vmemmap_check_pmd()

From: Muchun Song

Date: Sat Apr 04 2026 - 03:37:36 EST



> On Apr 4, 2026, at 15:17, Muchun Song <songmuchun@xxxxxxxxxxxxx> wrote:
>
> The two weak functions vmemmap_set_pmd() and vmemmap_check_pmd() are
> currently no-ops on every architecture, forcing each platform that needs
> them to duplicate the same handful of lines. Provide a generic implementation:
>
> - vmemmap_set_pmd() simply sets a huge PMD with PAGE_KERNEL protection.
>
> - vmemmap_check_pmd() verifies that the PMD is present and leaf,
> then calls the existing vmemmap_verify() helper.
>
> Architectures that need special handling can continue to override the
> weak symbols; everyone else gets the standard version for free.
>
> This series drops the custom implementations in arm64, riscv, loongarch,
> and sparc, replacing them with the generic implementation introduced
> in the first patch.
>
> Muchun Song (5):
> mm/sparse-vmemmap: provide generic vmemmap_set_pmd() and
> vmemmap_check_pmd()
> arm64/mm: drop vmemmap_pmd helpers and use generic code
> riscv/mm: drop vmemmap_pmd helpers and use generic code
> loongarch/mm: drop vmemmap_check_pmd helper and use generic code
> sparc/mm: drop vmemmap_check_pmd helper and use generic code

Hi all,

Please accept my sincere apologies for the mailing list noise.

Due to an error in my local scripts (failing to clean up the patch
output directory before regenerating the series with an updated commit
range), multiple duplicate and conflicting patches were accidentally
sent to the list simultaneously (10 patches in total instead of the
intended 5).

Sorry again for the inconvenience.

Thanks,
Muchun

>
> arch/arm64/mm/mmu.c | 14 --------------
> arch/loongarch/mm/init.c | 11 -----------
> arch/riscv/mm/init.c | 13 -------------
> arch/sparc/mm/init_64.c | 11 -----------
> mm/sparse-vmemmap.c | 7 ++++++-
> 5 files changed, 6 insertions(+), 50 deletions(-)
>
> --
> 2.20.1
>