[PATCH v2 3/4] riscv/mm: fix missing destructor for hotplug PUD tables

Björn Töpel bjorn at kernel.org
Mon Oct 12 08:35:53 PDT 2026


Muchun Song <songmuchun at bytedance.com> writes:

> Commit 8472cc4503eb ("riscv: mm: call PUD/P4D ctor in special kernel
> pgtable alloc") made alloc_pud_late() run the PUD page-table constructor.
> However, free_pud_table() still frees non-reserved PUD tables directly
> without decrementing NR_PAGETABLE.
>
> Free PUD tables through the common free_pgtable_page() helper so that
> constructor-backed tables run the matching destructor before being
> freed.
>
> Fixes: 8472cc4503eb ("riscv: mm: call PUD/P4D ctor in special kernel pgtable alloc")
> Cc: stable at vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Muchun Song <songmuchun at bytedance.com>
> Acked-by: David Hildenbrand (Arm) <david at kernel.org>

Reviewed-by: Björn Töpel <bjorn at kernel.org>



More information about the linux-arm-kernel mailing list