From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43F8F3E277E for ; Tue, 2 Jun 2026 13:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780405944; cv=none; b=dYEbYiw/H7TV1BmmUYZTqrxcdCMnYN3JNa1QmpSJQT/QMXV7ay1F/d0r/zfo/swiQtUrN8Kghq6A17uvCDkDr3VxA5E0KraA7iWNlZbG9+ZlJxTY6Kwpk6NLKiLzH24otiH/DKnQXNGhTER3YaBaoHKBXPAfzn0hIMT6olZTEco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780405944; c=relaxed/simple; bh=4Lz+GE0OiYt6OQoMqe1VP+9RsLIsXrfqVQo10V7IC6Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MUfrC5XfVhZSVLRXnM7M5Gh4mHt0sKw0aZxt8vyCvvdOVoJs33IhWLRFtTrdfv0kJYpzR7RX+lDaf57Ra3AP2EuFcSaCirIskNyccKsNpGLbUGnexqZO9ytIuPCQ4W1bZbnmow1EitCYQaxhgedq5rbysKGjiu6Mu2gT5wdP7zg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mR5547fp; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mR5547fp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39BB21F00899; Tue, 2 Jun 2026 13:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780405942; bh=V0KWJlg0Sqr5Z7raeF0KU8zyzsqRO8RTi4QDjPMOW+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=mR5547fpKxCJf0XlTdI9xDkvs66R5fMpuoyFGy3sz+isEcGZKY/mYsjmZY6KBlkKm S12vTHBxWqDDRaeNVwQikJkA9snuJhlZ2zE5KPbrnDnnWOa6XgIzEP/iDb6eSk13qT WBnHDbMvAtHGtyoMHkjDwtmN3ffUNad1alOJNuakUnY0oklWGAfP3lZ3gU89Gqoil2 wk9hpuBDLrtpHOKqX6Y/hI2pvcBDK/YO2F8tIICTaYojkQwOLVNGOOtSdldwj/ThuG XeHRaU8sm5kKPCrlZnPatsIEaaraxxDzznOaCIQ0cyBpyjnhzEfQk3NtiF71zvYj7f HaogrdbefYn0A== Date: Tue, 2 Jun 2026 14:12:17 +0100 From: Will Deacon To: Andrew Morton Cc: Catalin Marinas , Alistair Popple , 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 Message-ID: References: <20260521032730.2104017-1-apopple@nvidia.com> <20260521153130.d7d5cd060f7522f894252333@linux-foundation.org> <20260601212225.11f277a85d5ed15083b08cc2@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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