From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5B6603F9FB for ; Sat, 7 Feb 2026 07:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770450330; cv=none; b=RCspUqeExKU+MOK/fM8EjEe7rqKVu8mBhqpmw0hlV90mNrfDR3gmedgPLA3tRfm62+Kcsyt4RKYU+7ei/Me0TN0wXagg8CcVxXZolbILSiLUfY/qM7R3nGqzTi6mXVStowar+UjguWupUc7QVZCZMzMsF72miCh9DL1YTbgUVSU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770450330; c=relaxed/simple; bh=jKCIXT2VZx0+bTvy0DK1Nljzhsli0YPyMEbT2BwmVeg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e3Xp5nthCsUGiD0Hrjz0yT0GyIa0VtQomRhRPSV3I3KoXSVZmGO1VDQQ5wdIDsB7UHD+AHG+GOGy5KhPDZhBZUvPvBo7j5IOrawakwnaD1hzyPUc4BLUCAMqgR0FgaTWIeYbKdehzhUb3ima2eOcbGQBRRMu/rxo9Akr22RTUVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tB4L/x2h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tB4L/x2h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE597C116D0; Sat, 7 Feb 2026 07:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770450330; bh=jKCIXT2VZx0+bTvy0DK1Nljzhsli0YPyMEbT2BwmVeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tB4L/x2hGunhDsxnyPs0mnV1dmr0x+yJ+sTQFKaDmxZobI0YcYfjt1ubwcyDVEDhl e1m5qh03hWnaRb4s9ctBtgcOaKYnBYOxWyFdO3i6TBqmA8f0xk0A9di191AbkgUOgL cTkYNFF183xN/cesl8i3i5qPgqbq6nLhKoKzNc/V8q12g9nfT09b6GDId6T4rAEDAp 4I/24AzvnXnhpFo0DT+UEJH51c1c28dFmW9FBlud875qTjANt2VNoULWNR+Gjjj4gE 1ChL25YuzQRnJ4t87hV1gmq6opSNxxB3LHcyi8LN2PuvDUThUqj35WoT+wG3pNmwUg BX4lbhLuYNBwg== Date: Sat, 7 Feb 2026 09:45:22 +0200 From: Mike Rapoport To: "Vishal Moola (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Dave Hansen , akpm@linux-foundation.org, "Matthew Wilcox (Oracle)" , Andy Lutomirski , Peter Zijlstra , Dave Hansen Subject: Re: [PATCH v4 1/4] mm: Add address apis for ptdescs Message-ID: References: <20260205013527.322157-1-vishal.moola@gmail.com> <20260205013527.322157-2-vishal.moola@gmail.com> 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: <20260205013527.322157-2-vishal.moola@gmail.com> Hi Vishal, On Wed, Feb 04, 2026 at 05:35:24PM -0800, Vishal Moola (Oracle) wrote: > Architectures frequently only care about the address associated with a > page table. The current ptdesc api forced callers to acquire a ptdesc to > use them. Add more apis to abstract ptdescs away from architectures that > don't need the descriptor. > > This patch adds pgtable_alloc() and pgtable_free() to operate on the > underlying addresses associated with page table descriptors, similar to > get_free_pages() and free_pages(). The allocations will be zeroed since > theres no reason to want a page table with stale data. > > Suggested-by: Dave Hansen > Signed-off-by: Vishal Moola (Oracle) > --- > include/linux/mm.h | 4 ++++ > mm/memory.c | 34 ++++++++++++++++++++++++++++++++++ > 2 files changed, 38 insertions(+) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index f8a8fd47399c..3f3000567823 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -3419,6 +3419,10 @@ static inline void __pagetable_free(struct ptdesc *pt) > __free_pages(page, compound_order(page)); > } > > +unsigned long pgtable_alloc_addr_noprof(gfp_t gfp, unsigned int order); Why not void *? I don't think it should follow ancient get_zeroed_page() and force all callers to do the casting when they are expecting a pointer anyway. > +#define pgtable_alloc_addr(...) alloc_hooks(pgtable_alloc_addr_noprof(__VA_ARGS__)) > +void pgtable_free_addr(const void *addr); -- Sincerely yours, Mike.