diff options
| author | Harry Yoo <harry.yoo@oracle.com> | 2025-10-24 20:30:47 +0900 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-11-16 17:28:25 -0800 |
| commit | ad8b2e096181bd23a32d8672de107136d0c478e9 (patch) | |
| tree | ac1581474e37185b8e112ecacbbc33ec47e32e4f | |
| parent | 5e0fa7ed984d1c3b8bda4158e35a46cb2b0badac (diff) | |
treewide: include linux/pgalloc.h instead of asm/pgalloc.h
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/.
Link: https://lkml.kernel.org/r/20251024113047.119058-3-harry.yoo@oracle.com
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| -rw-r--r-- | drivers/firmware/efi/arm-runtime.c | 4 | ||||
| -rw-r--r-- | drivers/firmware/efi/riscv-runtime.c | 4 | ||||
| -rw-r--r-- | drivers/s390/char/sclp_sd.c | 3 | ||||
| -rw-r--r-- | fs/dax.c | 2 | ||||
| -rw-r--r-- | kernel/fork.c | 4 | ||||
| -rw-r--r-- | mm/debug_vm_pgtable.c | 2 | ||||
| -rw-r--r-- | mm/filemap.c | 3 | ||||
| -rw-r--r-- | mm/huge_memory.c | 2 | ||||
| -rw-r--r-- | mm/hugetlb.c | 2 | ||||
| -rw-r--r-- | mm/hugetlb_vmemmap.c | 3 | ||||
| -rw-r--r-- | mm/khugepaged.c | 2 | ||||
| -rw-r--r-- | mm/memory.c | 4 | ||||
| -rw-r--r-- | mm/mmu_gather.c | 2 | ||||
| -rw-r--r-- | mm/mremap.c | 2 | ||||
| -rw-r--r-- | mm/pgtable-generic.c | 3 | ||||
| -rw-r--r-- | mm/pt_reclaim.c | 3 |
16 files changed, 24 insertions, 21 deletions
diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 83092d93f36a..53a5336cde5a 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -12,18 +12,18 @@ #include <linux/io.h> #include <linux/memblock.h> #include <linux/mm_types.h> +#include <linux/pgalloc.h> +#include <linux/pgtable.h> #include <linux/preempt.h> #include <linux/rbtree.h> #include <linux/rwsem.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/spinlock.h> -#include <linux/pgtable.h> #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..7ceb02bc57f7 100644 --- a/drivers/firmware/efi/riscv-runtime.c +++ b/drivers/firmware/efi/riscv-runtime.c @@ -14,18 +14,18 @@ #include <linux/io.h> #include <linux/memblock.h> #include <linux/mm_types.h> +#include <linux/pgalloc.h> +#include <linux/pgtable.h> #include <linux/preempt.h> #include <linux/rbtree.h> #include <linux/rwsem.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/spinlock.h> -#include <linux/pgtable.h> #include <asm/cacheflush.h> #include <asm/efi.h> #include <asm/mmu.h> -#include <asm/pgalloc.h> static bool __init efi_virtmap_init(void) { diff --git a/drivers/s390/char/sclp_sd.c b/drivers/s390/char/sclp_sd.c index 129b89fe40a3..7a791cb35aea 100644 --- a/drivers/s390/char/sclp_sd.c +++ b/drivers/s390/char/sclp_sd.c @@ -17,8 +17,7 @@ #include <linux/vmalloc.h> #include <linux/async.h> #include <linux/mutex.h> - -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #include "sclp.h" @@ -24,7 +24,7 @@ #include <linux/mmu_notifier.h> #include <linux/iomap.h> #include <linux/rmap.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #define CREATE_TRACE_POINTS #include <trace/events/fs_dax.h> diff --git a/kernel/fork.c b/kernel/fork.c index 3da0f08615a9..dd0bb5fe4305 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -106,9 +106,9 @@ #include <linux/pidfs.h> #include <linux/tick.h> #include <linux/unwind_deferred.h> - -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #include <linux/uaccess.h> + #include <asm/mmu_context.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 133543ca2821..055e0e025b42 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -30,9 +30,9 @@ #include <linux/sched/mm.h> #include <linux/io.h> #include <linux/vmalloc.h> +#include <linux/pgalloc.h> #include <asm/cacheflush.h> -#include <asm/pgalloc.h> #include <asm/tlbflush.h> /* diff --git a/mm/filemap.c b/mm/filemap.c index 526ad8c92250..ff75bd89b68c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -48,7 +48,8 @@ #include <linux/rcupdate_wait.h> #include <linux/sched/mm.h> #include <linux/sysctl.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> + #include <asm/tlbflush.h> #include "internal.h" diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 0a521cf9b10a..d716c6965e27 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -37,11 +37,11 @@ #include <linux/sched/sysctl.h> #include <linux/memory-tiers.h> #include <linux/compat.h> +#include <linux/pgalloc.h> #include <linux/pgalloc_tag.h> #include <linux/pagewalk.h> #include <asm/tlb.h> -#include <asm/pgalloc.h> #include "internal.h" #include "swap.h" diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 86e672fcb305..1ea459723cce 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -39,9 +39,9 @@ #include <linux/memory.h> #include <linux/mm_inline.h> #include <linux/padata.h> +#include <linux/pgalloc.h> #include <asm/page.h> -#include <asm/pgalloc.h> #include <asm/tlb.h> #include <asm/setup.h> diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index 96ee2bd16ee1..9d01f883fd71 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -15,7 +15,8 @@ #include <linux/bootmem_info.h> #include <linux/mmdebug.h> #include <linux/pagewalk.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> + #include <asm/tlbflush.h> #include "hugetlb_vmemmap.h" diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 643abf4be236..f6a92958157d 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -21,9 +21,9 @@ #include <linux/shmem_fs.h> #include <linux/dax.h> #include <linux/ksm.h> +#include <linux/pgalloc.h> #include <asm/tlb.h> -#include <asm/pgalloc.h> #include "internal.h" #include "mm_slot.h" diff --git a/mm/memory.c b/mm/memory.c index 8e02b8d75535..8d8c36adafa8 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -76,13 +76,13 @@ #include <linux/ptrace.h> #include <linux/vmalloc.h> #include <linux/sched/sysctl.h> +#include <linux/pgalloc.h> +#include <linux/uaccess.h> #include <trace/events/kmem.h> #include <asm/io.h> #include <asm/mmu_context.h> -#include <asm/pgalloc.h> -#include <linux/uaccess.h> #include <asm/tlb.h> #include <asm/tlbflush.h> diff --git a/mm/mmu_gather.c b/mm/mmu_gather.c index 374aa6f021c6..247e3f9db6c7 100644 --- a/mm/mmu_gather.c +++ b/mm/mmu_gather.c @@ -9,8 +9,8 @@ #include <linux/smp.h> #include <linux/swap.h> #include <linux/rmap.h> +#include <linux/pgalloc.h> -#include <asm/pgalloc.h> #include <asm/tlb.h> #ifndef CONFIG_MMU_GATHER_NO_GATHER diff --git a/mm/mremap.c b/mm/mremap.c index 419a0ea0a870..8ad06cf50783 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -25,10 +25,10 @@ #include <linux/uaccess.h> #include <linux/userfaultfd_k.h> #include <linux/mempolicy.h> +#include <linux/pgalloc.h> #include <asm/cacheflush.h> #include <asm/tlb.h> -#include <asm/pgalloc.h> #include "internal.h" diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 8c22be79b734..e46f0cf2159c 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -14,7 +14,8 @@ #include <linux/swapops.h> #include <linux/mm_inline.h> #include <linux/iommu.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> + #include <asm/tlb.h> /* diff --git a/mm/pt_reclaim.c b/mm/pt_reclaim.c index 7e9455a18aae..0d9cfbf4fe5d 100644 --- a/mm/pt_reclaim.c +++ b/mm/pt_reclaim.c @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/hugetlb.h> +#include <linux/pgalloc.h> + #include <asm-generic/tlb.h> -#include <asm/pgalloc.h> #include "internal.h" |