]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
treewide: include linux/pgalloc.h instead of asm/pgalloc.h
authorHarry Yoo <harry.yoo@oracle.com>
Fri, 24 Oct 2025 11:30:47 +0000 (20:30 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Nov 2025 01:28:25 +0000 (17:28 -0800)
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>
16 files changed:
drivers/firmware/efi/arm-runtime.c
drivers/firmware/efi/riscv-runtime.c
drivers/s390/char/sclp_sd.c
fs/dax.c
kernel/fork.c
mm/debug_vm_pgtable.c
mm/filemap.c
mm/huge_memory.c
mm/hugetlb.c
mm/hugetlb_vmemmap.c
mm/khugepaged.c
mm/memory.c
mm/mmu_gather.c
mm/mremap.c
mm/pgtable-generic.c
mm/pt_reclaim.c

index 83092d93f36a63087ffbd8b6460d38a824e9cbb1..53a5336cde5afde0d8beea293f560d499269add0 100644 (file)
 #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>
index fa71cd898120302c8e8787f1032c9f60733b02c6..7ceb02bc57f7ab73547936530516e8445a933dcf 100644 (file)
 #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)
 {
index 129b89fe40a36a1eeff89b7d9f8a1e91b651bbaf..7a791cb35aeaec7e80f6be43f298a1a562fc3223 100644 (file)
@@ -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"
 
index 516f995a988c8f660d85227ddc72b9de843d98b6..0e766aec43036a1c976c31bbf7e096bc8612c186 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -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>
index 3da0f08615a95eea55373a3f266fbfddd6fc9943..dd0bb5fe430526add1d61836c13c9cf5d64e50e8 100644 (file)
 #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>
index 133543ca28219c3595c41acc6aff426eb9dc6a2b..055e0e025b42d366d6730f5ac919ed4d626b4b35 100644 (file)
@@ -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>
 
 /*
index 526ad8c922504d9b354d0a6c6be3d0f51a2d9ad7..ff75bd89b68ca1754b04c03152f3418f96f7a881 100644 (file)
@@ -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"
 
index 0a521cf9b10a473435651da86573602eb842d6f4..d716c6965e27ef9dfae8a1252ecc3037087ef63f 100644 (file)
 #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"
 
index 86e672fcb305c8ec4a7cf225f619c5effdd3c1a3..1ea459723cce69184d35ede76a340da5cc36df3a 100644 (file)
@@ -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>
 
index 96ee2bd16ee1536dfdc134c570d35f987732d2b6..9d01f883fd71ec0a11a5e1b5af5ee35838152819 100644 (file)
@@ -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"
 
index 643abf4be2360aa023f614f38bb0c1e584fcb48a..f6a92958157d6c015a78c96a56ccefad1d93bf2c 100644 (file)
@@ -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"
 
index 8e02b8d755352d143155142be2dbee8a118e68eb..8d8c36adafa865f0dd09bde834275dc9b9844aea 100644 (file)
 #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>
 
index 374aa6f021c6b0e09bfcd1c31076edb479c4b268..247e3f9db6c7ae8d4f7bf1030ef338c83dc719db 100644 (file)
@@ -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
index 419a0ea0a8708adc41c0f8e81e8d078194b088e7..8ad06cf50783a21640cb70fa9ceb1fbc03b654a0 100644 (file)
 #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"
 
index 8c22be79b734398243301dcdcec778a2d8ef8193..e46f0cf2159cc24c05e44e92c4905485d51921b1 100644 (file)
@@ -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>
 
 /*
index 7e9455a18aae7d8b6b2fe3d2fe50618e1e2a7b1f..0d9cfbf4fe5d81a56351de809549f8ddcebe3efe 100644 (file)
@@ -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"