From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 529C5310763 for ; Sat, 7 Feb 2026 10:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770459926; cv=none; b=ezBz5Q1Db9bQqNPf83uDr0o8ZEWWJVHUDC9kiUDFzCsuIHSEC1DFz5XE5zQ8gx9xyLhCAcIy6xjo/8o/KCddsytZTFjZ3cEUkZCGd+Q0QOlgh1dyamDORWLjiOdAgVyNxoFjxxNYE/8U3h/a/D2yLfz3OcZS3cnVGNOYJHZkJ64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770459926; c=relaxed/simple; bh=2aMG9GwrYzBrlPmEs/wRelrxOHlKMvAUE2TV7Pyep6g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m53ezj13CWpQgT/ruxCEgqsm3USbT9zO//NfpMn+LQQ1DXSsgLv0XijAxGENV2FTeHCo9nR5Rjp0awuHHPj9umP7IQj6KTfqhIF79RWs4X2uRMuNHXHuJVNrY1fGaN55A+NJgDbJtfZl+9ZT7IrzmenOKAWvQvk2/6Cp8yDvGnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CqGgdjGD; arc=none smtp.client-ip=74.125.82.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CqGgdjGD" Received: by mail-dl1-f46.google.com with SMTP id a92af1059eb24-12460a7caa2so1813115c88.1 for ; Sat, 07 Feb 2026 02:25:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770459925; x=1771064725; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6Odl28KlSdb0L5OKjz7cptT0uXHWW3LaaMZc26EvJu4=; b=CqGgdjGDP37+ppenkagGmWg2Z5cN534LtUG1xDJn0UEGw6iM08UChGaE1YKL1k6Dx4 fiorcRUi8NcMecX3zshfq9FqwP3G0sLtrZO5ad9R1IxmH4lyQpgxZnz2VbxAlCpza4BA Jw6U+Jr29HBjKLHZBJ45WVUOaUvUUiuZ+SpykMQ7ifcFlg4+uKFvEwh9RQEzYfnkY4h0 c+Y8AF0Bq+Sj9XpN0Gcv0fIwXfeIGBi2UKv3+oiiKiHkifFhCR9C9AK8EfQkVEtaLe/5 Sdike9NlVG9HsS9k4PLOWsbVHbKxduBeXDlT3PDOyxwMug2uhz1ndzx2s9M1VwoXqGeA RyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770459925; x=1771064725; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Odl28KlSdb0L5OKjz7cptT0uXHWW3LaaMZc26EvJu4=; b=J163oCKt1+nGWSY5/Y2CcUAQcphpNTCm/hQd4fwnnhsQQYJ+m8EfXqtcpM/3VSqUJ8 dqY/iN3Qb91HWTwjXeAzv7d31D6KNRye/d+ogfrXenpFbh0Ph4w9O5r/tq9yXEWvi1HE yFSXNkkpFQ1LqiUdOVCXyZfX+mYVCcBa+E+C0yx2iXqZatKno6Xe072eBnBCXyI88T5Z SGCF+RPZdRNwvbTATY6EKTnDzGKeW3HcSTX4+8iKR35xLYIcssbEgNCGTZ2K9gwdJWgk fYsqv3ADzp7OTPIQTbU7Te2tokmRN2c+Zl009cLPUBbX5BA952Yqt/kSCC4U2+tdDX+g j2xw== X-Gm-Message-State: AOJu0YwMy9TON3yRmmrCHtSXToenEaN/8AomaDuz5mm+UG3e+LwAMU4r JW+LpqsGZvSJgHqdgNyqiQ12AWhTNpxudUEWWHZqKtS4+gcYHgdMB90gFsHahg== X-Gm-Gg: AZuq6aIasJLIwgbAknGxZBFiv2axR5hh+5kcufm2RGmucGn8f3rZm4ihPM+a710jR+H KXs63lyZ9Cn83dn7ffoNeHuMvFRWmEWYiCbJgmsNCPeQqDuDMWcAZClLhNL41fsbZJ3+BVr5oXB 3m/FWvbZFmpFNyQOqPFZYbsqeBf5/H6f5/ElcczfEB/7E4Ap4dC9N2FqrW3UZT+2m4/FZlRpi9k MtUiwhiDl/Sr1L7rpBhH14WrIe/6cLjF/6FK3hsFFsjHLQx4qNv4ygSCz63rmU14Oku1FpvAy+l HeMFvTeCK658gzT1r76LNBgmeeLDmpY3lpsj9uM1SSZ2CatSvG4cQEM0Rj/B/tjUb8Icf0XOa06 AxF32CFuBKZPfGKnS/YEAr1MEQ5whleh4H/tkQnquKqC82vq4WJ1duJBrfeMqLJUyjuUu9Rgsvm odza3a6bxsJ4XiIYajEK3mJm+LnkSQoIpQie0SwE21l64= X-Received: by 2002:a05:693c:37c7:b0:2b8:1d16:972f with SMTP id 5a478bee46e88-2b8567307d0mr2625175eec.22.1770459925189; Sat, 07 Feb 2026 02:25:25 -0800 (PST) Received: from fedora (c-67-164-59-41.hsd1.ca.comcast.net. [67.164.59.41]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b86ab1aaf7sm787244eec.17.2026.02.07.02.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Feb 2026 02:25:24 -0800 (PST) Date: Sat, 7 Feb 2026 02:25:20 -0800 From: "Vishal Moola (Oracle)" To: Mike Rapoport 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: On Sat, Feb 07, 2026 at 09:45:22AM +0200, Mike Rapoport wrote: > 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. Agreed, I'll change that in the next version. I had misread an s390 function that expects an (unsigned long *) and assumed some callers might want the unsigned long, thinking we'd have to cast anyway. After taking a closer look I see now that every single caller actually expects a pointer.