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 A6FA6296BD5 for ; Wed, 21 Jan 2026 17:26:22 +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=1769016382; cv=none; b=MqtFRyjXHWcHxLh5yYyY4oTx1f3hmmdHD1E3xK95eUx8qzF3UW2e2uFvd+OmewU0VezFDR0BhOEJxBdetAqtUtWKZC+JDVBmQBtQdQ+10d0RHpVhhdprdLwWSmEWt2ioHsMVSMTY89T5bUzh3I8IAxsm73GS6ZFwYjgDLEhc4OA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769016382; c=relaxed/simple; bh=H2cZyOrU5YaqFRoEWy15WU0X17vWC6wsd1JZ58PmZ0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kawZvNOvyaQ4Mmzz0TtjaYdw9pzILVdEVMjab7fM6Sc9Ts35fYn/ZoIQfyGRv5oo/jYPb3XMS+BFKBRRsOTsPqSdGdVV6hgeWEIzUaxXo3w0mvhCaRg8LFdDaR3wHz+mVyGObFE5X3fvUNAJg3n/CM0A4sAHRIK9U7GB6NmlFvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nw9NAeAd; 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="Nw9NAeAd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90B65C4CEF1; Wed, 21 Jan 2026 17:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769016382; bh=H2cZyOrU5YaqFRoEWy15WU0X17vWC6wsd1JZ58PmZ0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nw9NAeAd2EREUfgIqRkY1OK+LynggE+5VrpuaSFH+0FLUq8/tgJfAV4avkYWL/LKr STN7AVVGJmR/i5ZPxio82Lw8a4gZjCTWd3x6xd+k5/NdQoBN/H2JzVarm0axJj3aiw 9F7Y0cX4SagCNN6ZsqmjpoTn2CNVUVy/Zf0908tkrIdkDiqRcp2n1qSmDlJ0RQTI8g u5lCxgf/W3vbGl/5JBDibE8t1IFy0Rj16iZV4/XQZuavtljrI+N7xt0iQYZZR8ofuG GwdX6Tj6th9jhcAcpP4xK7zybBqblc5gSliR7Du/4lt4Vv4B8QGXnBkvCwzq5dfAeU 0kjd1AjGSYaNA== From: SeongJae Park To: "Liam R. Howlett" Cc: SeongJae Park , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Lorenzo Stoakes , Pedro Falcato , David Hildenbrand , Vlastimil Babka , Michal Hocko , Jann Horn , shikemeng@huaweicloud.com, kasong@tencent.com, nphamcs@gmail.com, bhe@redhat.com, baohua@kernel.org, chrisl@kernel.org, Matthew Wilcox Subject: Re: [PATCH v3 01/11] mm: Relocate the page table ceiling and floor definitions Date: Wed, 21 Jan 2026 09:26:17 -0800 Message-ID: <20260121172618.39532-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260121164946.2093480-2-Liam.Howlett@oracle.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 21 Jan 2026 11:49:36 -0500 "Liam R. Howlett" wrote: > pgtables.h defines a fallback for ceiling and floor of the page tables > within the CONFIG_MMU section. Moving the definitions to outside the > CONFIG_MMU Allows for using them in generic code. > > Suggested-by: Lorenzo Stoakes > Suggested-by: SeongJae Park > Signed-off-by: Liam R. Howlett > --- > include/linux/pgtable.h | 39 ++++++++++++++++++++------------------- > mm/vma_internal.h | 1 + > 2 files changed, 21 insertions(+), 19 deletions(-) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index eb8aacba3698d..557ac918bdca6 100644 > --- a/include/linux/pgtable.h > +++ b/include/linux/pgtable.h > @@ -22,25 +22,6 @@ > #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED > #endif > > -/* > - * On almost all architectures and configurations, 0 can be used as the > - * upper ceiling to free_pgtables(): on many architectures it has the same > - * effect as using TASK_SIZE. However, there is one configuration which > - * must impose a more careful limit, to avoid freeing kernel pgtables. > - */ > -#ifndef USER_PGTABLES_CEILING > -#define USER_PGTABLES_CEILING 0UL > -#endif > - > -/* > - * This defines the first usable user address. Platforms > - * can override its value with custom FIRST_USER_ADDRESS > - * defined in their respective . > - */ > -#ifndef FIRST_USER_ADDRESS > -#define FIRST_USER_ADDRESS 0UL > -#endif > - > /* > * This defines the generic helper for accessing PMD page > * table page. Although platforms can still override this > @@ -1660,6 +1641,26 @@ void arch_sync_kernel_mappings(unsigned long start, unsigned long end); > > #endif /* CONFIG_MMU */ > > +/* > + * On almost all architectures and configurations, 0 can be used as the > + * upper ceiling to free_pgtables(): on many architectures it has the same > + * effect as using TASK_SIZE. However, there is one configuration which > + * must impose a more careful limit, to avoid freeing kernel pgtables. > + */ > +#ifndef USER_PGTABLES_CEILING > +#define USER_PGTABLES_CEILING 0UL > +#endif > + > +/* > + * This defines the first usable user address. Platforms > + * can override its value with custom FIRST_USER_ADDRESS > + * defined in their respective . > + */ > +#ifndef FIRST_USER_ADDRESS > +#define FIRST_USER_ADDRESS 0UL > +#endif Looks good to me :) > + > + Nit. I think just one new line here should be ok? > /* > * No-op macros that just return the current protection value. Defined here > * because these macros can be used even if CONFIG_MMU is not defined. > diff --git a/mm/vma_internal.h b/mm/vma_internal.h > index 2f05735ff190c..2da6d224c1a85 100644 > --- a/mm/vma_internal.h > +++ b/mm/vma_internal.h > @@ -46,6 +46,7 @@ > #include > #include > #include > +#include I think this might be better to be done together with the following change that starts using the ceiling and floor from generic code, or mention this change in the description together? Above comments are for only trivial things that I don't really mind. Please feel free to proceed as you want. Thanks, SJ [...]