public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel•org>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: Catalin Marinas <catalin.marinas@arm•com>,
	Alistair Popple <apopple@nvidia•com>,
	linux-arm-kernel@lists•infradead.org,
	linux-kernel@vger•kernel.org, linux-mm@kvack•org,
	david@kernel•org, kevin.brodsky@arm•com
Subject: Re: [PATCH] arm64: mm: call pagetable dtor when freeing hot-removed page tables
Date: Tue, 2 Jun 2026 14:12:17 +0100	[thread overview]
Message-ID: <ah7WsY02cNAN1LCS@willie-the-truck> (raw)
In-Reply-To: <20260601212225.11f277a85d5ed15083b08cc2@linux-foundation.org>

On Mon, Jun 01, 2026 at 09:22:25PM -0700, Andrew Morton wrote:
> On Fri, 22 May 2026 08:15:09 +0100 Catalin Marinas <catalin.marinas@arm•com> wrote:
> 
> > > > --- a/arch/arm64/mm/mmu.c
> > > > +++ b/arch/arm64/mm/mmu.c
> > > > @@ -1422,6 +1422,7 @@ static void free_hotplug_page_range(struct page *page, size_t size,
> > > >  
> > > >  static void free_hotplug_pgtable_page(struct page *page)
> > > >  {
> > > > +	pagetable_dtor(page_ptdesc(page));
> > > >  	free_hotplug_page_range(page, PAGE_SIZE, NULL);
> > > >  }
> > > 
> > > I'd of course prefer that arm maintainers handle this.  But
> > > 5e8eb9aeeda3 came via myself so convention kinda-dictates that I get to
> > > fix it.
> > 
> > That's fine but Sashiko has some points:
> > 
> > https://sashiko.dev/#/patchset/20260521032730.2104017-1-apopple@nvidia.com
> > 
> > The __remove_pgd_mapping() path is fine but we also have the
> > vmemmap_free() path where the constructor was never called.
> > 
> > We could pass around a bool dtor argument but I wonder whether we could
> > just check it's a pgtable page:
> > 
> > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> > index 4c8959153ac4..9d42cbddce27 100644
> > --- a/arch/arm64/mm/mmu.c
> > +++ b/arch/arm64/mm/mmu.c
> > @@ -1441,6 +1441,9 @@ static void free_hotplug_page_range(struct page *page, size_t size,
> >  
> >  static void free_hotplug_pgtable_page(struct page *page)
> >  {
> > +	if (folio_test_pgtable(page_folio(page)))
> > +		pagetable_dtor(page_ptdesc(page));
> > +
> >  	free_hotplug_page_range(page, PAGE_SIZE, NULL);
> >  }
> 
> This patch is still floating around in mm.git awaiting some
> finalization.  What to do?

From what I can tell (assuming I've been following along correctly!):

1. This patch improves the situation, so makes sense in its own right
2. There is additional work to be more consistent with the constructors
   for page-table pages, which Kevin is going to look at but is probably
   a little more long-term.
3. I'm happy to take this via arm64 but also have no issues with you taking
   it via mm (so please shout if you want me to pick it up).

Will


  reply	other threads:[~2026-06-02 13:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  3:27 [PATCH] arm64: mm: call pagetable dtor when freeing hot-removed page tables Alistair Popple
2026-05-21 22:31 ` Andrew Morton
2026-05-21 23:50   ` Alistair Popple
2026-05-22  7:15   ` Catalin Marinas
2026-05-22  7:32     ` Catalin Marinas
2026-05-22  9:36     ` Vishal Moola
2026-05-26 11:54       ` Kevin Brodsky
2026-05-26 12:31         ` David Hildenbrand (Arm)
2026-05-27  7:34           ` Kevin Brodsky
2026-05-27  9:22             ` Vishal Moola
2026-05-31 19:29             ` David Hildenbrand (Arm)
2026-05-26 15:07         ` Will Deacon
2026-05-27  7:35           ` Kevin Brodsky
2026-05-27  9:30             ` Vishal Moola
2026-05-28  8:05               ` Kevin Brodsky
2026-05-29 10:16                 ` Vishal Moola
2026-06-02  4:22     ` Andrew Morton
2026-06-02 13:12       ` Will Deacon [this message]
2026-06-02 17:06         ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ah7WsY02cNAN1LCS@willie-the-truck \
    --to=will@kernel$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=apopple@nvidia$(echo .)com \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=david@kernel$(echo .)org \
    --cc=kevin.brodsky@arm$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox