mm: MISC follow-up patches for linux/pgalloc.h
Subsystems (14)
cover mm: MISC follow-up patches for linux/pgalloc.h
Hi folks.
This is a follow-up patch series for the patch series named:
"[PATCH V5 mm-hotfixes 0/3] mm, x86: fix crash due to missing page table sync and make it harder to miss".
This is a follow-up for MM. For x86/mm specific cleanup patches, another follow-up series is planned.
Patch 1 creates a F: entry to MAINTAINERS file in MM CORE section. Patch 2 converts common code to include <linux/pgalloc.h> instead of <asm/pgalloc.h>
[1] https://lore.kernel.org/linux-mm/[email protected]/
Harry Yoo (2):
MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
treewide: include linux/pgalloc.h instead of asm/pgalloc.h
MAINTAINERS | 1 + 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 +- 17 files changed, 17 insertions(+), 17 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Since include/linux/pgtable.h is already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.h F: include/linux/ptdump.h F: include/linux/vmpressure.h F: include/linux/vmstat.h
Signature · 1 line
2.43.0
Re: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 13 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.h
Nit. Should we alphabetically sort?
Thanks,
SJ
[...]
Re: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Quoted 9 lines · SeongJae Park
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>Acked-by SeongJae Park <[email protected]>
Thanks!
Quoted 4 lines
Quoted 4 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 9 lines
MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.hNit. Should we alphabetically sort?
TBH I have no idea.
I thought only subsystem names should be alphabetically sorted?
Quoted 4 lines
Thanks,
SJ[...]
Signature · 2 lines
Cheers, Harry / Hyeonggon
Re: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Quoted 29 lines · Harry Yoo
Quoted 9 lines · SeongJae Park
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>Acked-by SeongJae Park <[email protected]>Thanks!
Quoted 4 lines
Quoted 4 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 9 lines
MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.hNit. Should we alphabetically sort?
Quoted 3 lines
TBH I have no idea.
I thought only subsystem names should be alphabetically sorted?
I think we usually try to sort alphabetically here.
Signature · 3 lines
Cheers David / dhildenb
Re: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Quoted 30 lines · David Hildenbrand
Quoted 29 lines · Harry Yoo
Quoted 9 lines · SeongJae Park
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>Acked-by SeongJae Park <[email protected]>Thanks!
Quoted 15 lines
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 13 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.hNit. Should we alphabetically sort?
Quoted 5 lines
Quoted 3 lines
TBH I have no idea.
I thought only subsystem names should be alphabetically sorted?
I think we usually try to sort alphabetically here.
Thank you SJ and David, I'll sort it and resend in few days (unless Andrew prefers to adjust it)
Quoted 5 lines
Signature · 3 lines
Cheers David / dhildenb
Signature · 2 lines
Cheers, Harry / Hyeonggon
David Hildenbrand
Acked-byRe: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Quoted 31 lines · Harry Yoo
Quoted 30 lines · David Hildenbrand
Quoted 29 lines · Harry Yoo
Quoted 9 lines · SeongJae Park
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>Acked-by SeongJae Park <[email protected]>Thanks!
Quoted 15 lines
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 13 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.hNit. Should we alphabetically sort?
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
TBH I have no idea.
I thought only subsystem names should be alphabetically sorted?
I think we usually try to sort alphabetically here.
Thank you SJ and David, I'll sort it and resend in few days (unless Andrew prefers to adjust it)
Feel free to add my
Then!
Signature · 3 lines
Cheers David / dhildenb
Lorenzo Stoakes
Acked-byRe: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
In reply to Harry YooQuoted 8 lines · Harry Yoo
Quoted 7 lines · SeongJae Park
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>
Thanks for adding, but please put before pgtable.h to fix the checkpatch warning.
With that done:
Quoted 21 lines
Quoted 2 lines
Acked-by SeongJae Park <[email protected]>Thanks!
Quoted 4 lines
Quoted 4 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 9 lines
MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.hNit. Should we alphabetically sort?
Quoted 3 lines
TBH I have no idea.
I thought only subsystem names should be alphabetically sorted?
No it's files too, checkpatch will tell you:
● checkpatch.pl: 262: WARNING: Misordered MAINTAINERS entry - list file patterns in alphabetic order
Quoted 10 lines
Quoted 5 lines
Thanks,
SJ[...]
--
Cheers,
Harry / Hyeonggon
Re: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Quoted 38 lines · Lorenzo Stoakes
Quoted 8 lines · Harry Yoo
Quoted 7 lines · SeongJae Park
Quoted 5 lines · On Sun, 19 Oct 2025 16:25:08 +0900 Harry Yoo <[email protected]> wrote:
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>Thanks for adding, but please put before
pgtable.hto fix the checkpatch warning.With that done:
Acked-by Lorenzo Stoakes <[email protected]>Quoted 21 lines
Quoted 2 lines
Acked-by SeongJae Park <[email protected]>Thanks!
Quoted 15 lines
MAINTAINERS F: include/linux/mmdebug.h · line 16252
Quoted 13 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.hNit. Should we alphabetically sort?
Quoted 7 lines
Quoted 3 lines
TBH I have no idea.
I thought only subsystem names should be alphabetically sorted?
No it's files too, checkpatch will tell you:
● checkpatch.pl: 262: WARNING: Misordered
MAINTAINERSentry - list file patterns in alphabetic order
*blaming myself for not running checkpatch*
Thanks, will fix it!
Signature · 2 lines
Cheers, Harry / Hyeonggon
Re: [PATCH V1 1/2] MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
In reply to Harry YooQuoted 5 lines · Harry Yoo
Since
include/linux/pgtable.his already listed in the MM CORE section, add it to the section as well to keep it maintained by the appropriate maintainers.Signed-off-by Harry Yoo <[email protected]>
with the alphabetical sorting others mentioned :)
Quoted 19 lines
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -16249,6 +16249,7 @@ F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h F: include/linux/pgtable.h +F: include/linux/pgalloc.h F: include/linux/ptdump.h F: include/linux/vmpressure.h F: include/linux/vmstat.hSignature · 1 line
2.43.0
Signature · 2 lines
Sincerely yours, Mike.
PATCH 2/2 treewide: include linux/pgalloc.h instead of asm/pgalloc.h
In reply to Harry YooFor 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/.
--- 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(-)
drivers/firmware/efi/arm-runtime.c +1 -1
@@ -19,11 +19,11 @@#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/pgtable.h> +#include <linux/pgalloc.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>
drivers/firmware/efi/riscv-runtime.c +1 -1
@@ -21,11 +21,11 @@#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/pgtable.h> +#include <linux/pgalloc.h> #include <asm/cacheflush.h> #include <asm/efi.h> #include <asm/mmu.h> -#include <asm/pgalloc.h> static bool __init efi_virtmap_init (void ) {
drivers/s390/char/sclp_sd.c +1 -2
@@ -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"
fs/dax.c +1 -1
@@ -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>
kernel/fork.c +1 -1
@@ -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> #include <asm/mmu_context.h> #include <asm/cacheflush.h>
mm/debug_vm_pgtable.c +1 -1
@@ -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> /*
mm/filemap.c +1 -1
@@ -48,7 +48,7 @@#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"
mm/huge_memory.c +1 -1
@@ -39,9 +39,9 @@#include <linux/compat.h> #include <linux/pgalloc_tag.h> #include <linux/pagewalk.h> +#include <linux/pgalloc.h> #include <asm/tlb.h> -#include <asm/pgalloc.h> #include "internal.h" #include "swap.h"
mm/hugetlb.c +1 -1
@@ -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>
mm/hugetlb_vmemmap.c +1 -1
@@ -15,7 +15,7 @@#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"
mm/khugepaged.c +1 -1
@@ -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"
mm/memory.c +1 -1
@@ -80,7 +80,7 @@#include <asm/io.h> #include <asm/mmu_context.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #include <linux/uaccess.h> #include <asm/tlb.h> #include <asm/tlbflush.h>
mm/mmu_gather.c +1 -1
@@ -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
mm/mremap.c +1 -1
@@ -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"
mm/pgtable-generic.c +1 -1
@@ -13,7 +13,7 @@#include <linux/swap.h> #include <linux/swapops.h> #include <linux/mm_inline.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #include <asm/tlb.h> /*
mm/pt_reclaim.c +1 -1
@@ -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> #include "internal.h"
Signature · 1 line
2.43.0
Re: [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h
Quoted 9 lines · Harry Yoo
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> outsidearch/.Signed-off-by Harry Yoo <[email protected]>---
Signature · 3 lines
Cheers David / dhildenb
Re: [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h
In reply to Harry YooQuoted 8 lines · Harry Yoo
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> outsidearch/.Signed-off-by Harry Yoo <[email protected]>
Thanks for this, LGTM so:
Quoted 252 lines
--- 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(-)drivers/firmware/efi/arm-runtime.c +1
-1@@ -19,11 +19,11 @@#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/pgtable.h> +#include <linux/pgalloc.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> drivers/firmware/efi/riscv-runtime.c +1
-1@@ -21,11 +21,11 @@#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/pgtable.h> +#include <linux/pgalloc.h> #include <asm/cacheflush.h> #include <asm/efi.h> #include <asm/mmu.h> -#include <asm/pgalloc.h> static bool __init efi_virtmap_init (void ) {drivers/s390/char/sclp_sd.c +1
-2@@ -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" fs/dax.c +1
-1@@ -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> kernel/fork.c +1
-1@@ -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> #include <asm/mmu_context.h> #include <asm/cacheflush.h> mm/debug_vm_pgtable.c +1
-1@@ -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> /* mm/filemap.c +1
-1@@ -48,7 +48,7 @@#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" mm/huge_memory.c +1
-1@@ -39,9 +39,9 @@#include <linux/compat.h> #include <linux/pgalloc_tag.h> #include <linux/pagewalk.h> +#include <linux/pgalloc.h> #include <asm/tlb.h> -#include <asm/pgalloc.h> #include "internal.h" #include "swap.h" mm/hugetlb.c +1
-1@@ -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> mm/hugetlb_vmemmap.c +1
-1@@ -15,7 +15,7 @@#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" mm/khugepaged.c +1
-1@@ -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" mm/memory.c +1
-1@@ -80,7 +80,7 @@#include <asm/io.h> #include <asm/mmu_context.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #include <linux/uaccess.h> #include <asm/tlb.h> #include <asm/tlbflush.h> mm/mmu_gather.c +1
-1@@ -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 mm/mremap.c +1
-1@@ -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" mm/pgtable-generic.c +1
-1@@ -13,7 +13,7 @@#include <linux/swap.h> #include <linux/swapops.h> #include <linux/mm_inline.h> -#include <asm/pgalloc.h> +#include <linux/pgalloc.h> #include <asm/tlb.h> /* mm/pt_reclaim.c +1
-2@@ -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> #include "internal.h" --2.43.0
Re: [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h
In reply to Harry YooQuoted 32 lines · Harry Yoo
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> outsidearch/.Signed-off-by Harry Yoo <[email protected]>--- 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(-)drivers/firmware/efi/arm-runtime.c +0
-0
drivers/firmware/efi/arm-runtime.c line 22
Quoted 4 lines
drivers/firmware/efi/arm-runtime.c +1
-0@@ -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.
Quoted 12 lines
drivers/firmware/efi/arm-runtime.c +0
-1#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> drivers/firmware/efi/riscv-runtime.c +0
-0
drivers/firmware/efi/riscv-runtime.c line 24
Quoted 4 lines
drivers/firmware/efi/riscv-runtime.c +1
-0@@ -21,11 +21,11 @@#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/pgtable.h> +#include <linux/pgalloc.h>
And here as well.
Quoted 4 lines
drivers/firmware/efi/riscv-runtime.c +0
-1#include <asm/cacheflush.h> #include <asm/efi.h> #include <asm/mmu.h> -#include <asm/pgalloc.h>
...
kernel/fork.c line 111
Quoted 11 lines
kernel/fork.c +1
-1@@ -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/.
Quoted 2 lines
kernel/fork.c +0
-0#include <asm/mmu_context.h> #include <asm/cacheflush.h>
...
mm/pt_reclaim.c line 4
Quoted 10 lines
mm/pt_reclaim.c +1
-1@@ -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>
mm/pt_reclaim.c line 5
Quoted 1 line
mm/pt_reclaim.c +0
-0#include "internal.h"
With those fixed
Signature · 2 lines
Sincerely yours, Mike.
Re: [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h
Quoted 19 lines · Mike Rapoport
Quoted 18 lines · Harry Yoo
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> outsidearch/.Signed-off-by Harry Yoo <[email protected]>--- 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 +-
Quoted 8 lines
Quoted 8 lines
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(-)
Hi Mike, thanks for review.
I wasn't really sure if there are certain rules for header inclusion (yeah, they are not very consistent across different files...) but now that you mention it I can see them, thanks!
Quoted 11 lines
drivers/firmware/efi/arm-runtime.c line 22
Quoted 9 lines
drivers/firmware/efi/arm-runtime.c +1
-0@@ -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.
Will do.
Quoted 5 lines
Quoted 5 lines
drivers/firmware/efi/arm-runtime.c +0
-1#include <asm/cacheflush.h> #include <asm/efi.h> #include <asm/mmu.h> -#include <asm/pgalloc.h>
Quoted 13 lines
drivers/firmware/efi/riscv-runtime.c line 24
Quoted 11 lines
drivers/firmware/efi/arm-runtime.c +0
-0#if defined(CONFIG_PTDUMP_DEBUGFS ) || defined(CONFIG_ARM_PTDUMP_DEBUGFS )#include <asm/ptdump.h> drivers/firmware/efi/riscv-runtime.c +1
-0@@ -21,11 +21,11 @@#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/pgtable.h> +#include <linux/pgalloc.h> And here as well.
Will do.
Quoted 15 lines
Quoted 4 lines
drivers/firmware/efi/riscv-runtime.c +0
-1#include <asm/cacheflush.h> #include <asm/efi.h> #include <asm/mmu.h> -#include <asm/pgalloc.h> ...
Quoted 8 lines
kernel/fork.c +0
-0@@ -107,7 +107,7 @@#include <linux/tick.h> #include <linux/unwind_deferred.h>
Quoted 6 lines
kernel/fork.c line 111
Quoted 3 lines
kernel/fork.c +1
-1-#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/.
That looks good and will do.
Quoted 5 lines
Quoted 2 lines
kernel/fork.c +0
-0#include <asm/mmu_context.h> #include <asm/cacheflush.h> ...
Quoted 12 lines
mm/pt_reclaim.c line 4
Quoted 10 lines
mm/pt_reclaim.c +1
-1@@ -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>
Will do, and in this case no empty line between #include <asm*/*.h> and #include <linux/*.h>, right?
Quoted 5 lines
mm/pt_reclaim.c line 5
Quoted 1 line
mm/pt_reclaim.c +0
-0#include "internal.h" With those fixed
Reviewed-by Mike Rapoport (Microsoft) <[email protected]>
Thanks a lot!
Quoted 3 lines
Signature · 2 lines
Sincerely yours, Mike.
Signature · 2 lines
Cheers, Harry / Hyeonggon
Mike Rapoport
reviewerRe: [PATCH V1 2/2] treewide: include linux/pgalloc.h instead of asm/pgalloc.h
Quoted 14 lines · Harry Yoo
Quoted 4 lines · Mike Rapoport
Quoted 4 lines
mm/pt_reclaim.c +0
-0Quoted 8 lines
mm/pt_reclaim.c line 4
Quoted 6 lines
mm/pt_reclaim.c +1
-1@@ -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>
Quoted 2 lines
Will do, and in this case no empty line between #include <asm*/*.h> and #include <linux/*.h>, right?
Won't hurt :)
Signature · 2 lines
Sincerely yours, Mike.