From: Mike Rapoport <rppt@kernel.org>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org
Subject: Re: [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h
Date: Mon, 20 Oct 2025 17:44:08 +0300 [thread overview]
Message-ID: <aPZKuOKlb87yX0du@kernel.org> (raw)
In-Reply-To: <20251019072509.9488-3-harry.yoo@oracle.com>
On Sun, Oct 19, 2025 at 04:25:09PM +0900, Harry Yoo wrote:
> For now, including <asm/pgalloc.h> instead of <linux/pgalloc.h>
> is technically fine unless the .c file calls p*d_populate_kernel()
> helper functions.
>
> But it is a better practice to always include <linux/pgalloc.h>.
> Include <linux/pgalloc.h> instead of <asm/pgalloc.h> outside arch/.
>
> Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
> ---
> drivers/firmware/efi/arm-runtime.c | 2 +-
> drivers/firmware/efi/riscv-runtime.c | 2 +-
> drivers/s390/char/sclp_sd.c | 3 +--
> fs/dax.c | 2 +-
> kernel/fork.c | 2 +-
> mm/debug_vm_pgtable.c | 2 +-
> mm/filemap.c | 2 +-
> mm/huge_memory.c | 2 +-
> mm/hugetlb.c | 2 +-
> mm/hugetlb_vmemmap.c | 2 +-
> mm/khugepaged.c | 2 +-
> mm/memory.c | 2 +-
> mm/mmu_gather.c | 2 +-
> mm/mremap.c | 2 +-
> mm/pgtable-generic.c | 2 +-
> mm/pt_reclaim.c | 2 +-
> 16 files changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
> index 83092d93f36a..2e3b5131df32 100644
> --- a/drivers/firmware/efi/arm-runtime.c
> +++ b/drivers/firmware/efi/arm-runtime.c
> @@ -19,11 +19,11 @@
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> #include <linux/pgtable.h>
> +#include <linux/pgalloc.h>
Looks like here the includes are sorted alphabetically, please keep it.
> #include <asm/cacheflush.h>
> #include <asm/efi.h>
> #include <asm/mmu.h>
> -#include <asm/pgalloc.h>
>
> #if defined(CONFIG_PTDUMP_DEBUGFS) || defined(CONFIG_ARM_PTDUMP_DEBUGFS)
> #include <asm/ptdump.h>
> diff --git a/drivers/firmware/efi/riscv-runtime.c b/drivers/firmware/efi/riscv-runtime.c
> index fa71cd898120..5b8d72885fee 100644
> --- a/drivers/firmware/efi/riscv-runtime.c
> +++ b/drivers/firmware/efi/riscv-runtime.c
> @@ -21,11 +21,11 @@
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> #include <linux/pgtable.h>
> +#include <linux/pgalloc.h>
And here as well.
> #include <asm/cacheflush.h>
> #include <asm/efi.h>
> #include <asm/mmu.h>
> -#include <asm/pgalloc.h>
...
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 3da0f08615a9..9d48646e659f 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -107,7 +107,7 @@
> #include <linux/tick.h>
> #include <linux/unwind_deferred.h>
>
> -#include <asm/pgalloc.h>
> +#include <linux/pgalloc.h>
> #include <linux/uaccess.h>
I'd kill an empty line before include <linux/pgalloc.h> and add one here to
separate include <asm/.
> #include <asm/mmu_context.h>
> #include <asm/cacheflush.h>
...
> diff --git a/mm/pt_reclaim.c b/mm/pt_reclaim.c
> index 7e9455a18aae..ec6fe4eb2644 100644
> --- a/mm/pt_reclaim.c
> +++ b/mm/pt_reclaim.c
> @@ -1,7 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0
> #include <linux/hugetlb.h>
> #include <asm-generic/tlb.h>
> -#include <asm/pgalloc.h>
> +#include <linux/pgalloc.h>
Please move it before include <asm-generic/tlb.h>
> #include "internal.h"
With those fixed
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2025-10-20 14:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-19 7:25 [PATCH V1 0/2] mm: MISC follow-up patches for linux/pgalloc.h Harry Yoo
2025-10-19 7:25 ` [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section Harry Yoo
2025-10-19 22:07 ` SeongJae Park
2025-10-20 7:43 ` Harry Yoo
2025-10-20 13:38 ` David Hildenbrand
2025-10-20 13:51 ` Harry Yoo
2025-10-20 14:07 ` David Hildenbrand
2025-10-20 14:05 ` Lorenzo Stoakes
2025-10-20 14:10 ` Harry Yoo
2025-10-20 14:34 ` Mike Rapoport
2025-10-19 7:25 ` [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h Harry Yoo
2025-10-20 13:39 ` David Hildenbrand
2025-10-20 14:12 ` Lorenzo Stoakes
2025-10-20 14:44 ` Mike Rapoport [this message]
2025-10-21 5:09 ` Harry Yoo
2025-10-21 6:07 ` Mike Rapoport
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=aPZKuOKlb87yX0du@kernel.org \
--to=rppt@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=harry.yoo@oracle.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).