mm: remove unneeded includes of <asm/pgalloc.h>
authorMike Rapoport <rppt@linux.ibm.com>
Fri, 7 Aug 2020 06:22:28 +0000 (23:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Aug 2020 18:33:26 +0000 (11:33 -0700)
commitca15ca406f660ad5fab55b851d2b269ce915c88d
tree07b397bd42287ea67735ea632de88def5e61dc5e
parent0c4123e3fb82d6014d0a70b52eb38153f658541c
mm: remove unneeded includes of <asm/pgalloc.h>

Patch series "mm: cleanup usage of <asm/pgalloc.h>"

Most architectures have very similar versions of pXd_alloc_one() and
pXd_free_one() for intermediate levels of page table.  These patches add
generic versions of these functions in <asm-generic/pgalloc.h> and enable
use of the generic functions where appropriate.

In addition, functions declared and defined in <asm/pgalloc.h> headers are
used mostly by core mm and early mm initialization in arch and there is no
actual reason to have the <asm/pgalloc.h> included all over the place.
The first patch in this series removes unneeded includes of
<asm/pgalloc.h>

In the end it didn't work out as neatly as I hoped and moving
pXd_alloc_track() definitions to <asm-generic/pgalloc.h> would require
unnecessary changes to arches that have custom page table allocations, so
I've decided to move lib/ioremap.c to mm/ and make pgalloc-track.h local
to mm/.

This patch (of 8):

In most cases <asm/pgalloc.h> header is required only for allocations of
page table memory.  Most of the .c files that include that header do not
use symbols declared in <asm/pgalloc.h> and do not require that header.

As for the other header files that used to include <asm/pgalloc.h>, it is
possible to move that include into the .c file that actually uses symbols
from <asm/pgalloc.h> and drop the include from the header file.

The process was somewhat automated using

sed -i -E '/[<"]asm\/pgalloc\.h/d' \
                $(grep -L -w -f /tmp/xx \
                        $(git grep -E -l '[<"]asm/pgalloc\.h'))

where /tmp/xx contains all the symbols defined in
arch/*/include/asm/pgalloc.h.

[rppt@linux.ibm.com: fix powerpc warning]

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
Cc: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Matthew Wilcox <willy@infradead.org>
Link: http://lkml.kernel.org/r/20200627143453.31835-1-rppt@kernel.org
Link: http://lkml.kernel.org/r/20200627143453.31835-2-rppt@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
125 files changed:
arch/alpha/include/asm/tlbflush.h
arch/alpha/kernel/core_irongate.c
arch/alpha/kernel/core_marvel.c
arch/alpha/kernel/core_titan.c
arch/alpha/kernel/machvec_impl.h
arch/alpha/kernel/smp.c
arch/alpha/mm/numa.c
arch/arc/mm/fault.c
arch/arc/mm/init.c
arch/arm/include/asm/tlb.h
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/smp.c
arch/arm/kernel/suspend.c
arch/arm/mach-omap2/omap-mpuss-lowpower.c
arch/arm/mm/hugetlbpage.c
arch/arm/mm/mmu.c
arch/arm64/kernel/smp.c
arch/arm64/mm/hugetlbpage.c
arch/arm64/mm/ioremap.c
arch/arm64/mm/mmu.c
arch/csky/kernel/smp.c
arch/ia64/include/asm/tlb.h
arch/ia64/kernel/process.c
arch/ia64/kernel/smp.c
arch/ia64/kernel/smpboot.c
arch/ia64/mm/contig.c
arch/ia64/mm/discontig.c
arch/ia64/mm/hugetlbpage.c
arch/ia64/mm/tlb.c
arch/m68k/include/asm/mmu_context.h
arch/m68k/kernel/dma.c
arch/m68k/kernel/traps.c
arch/m68k/mm/cache.c
arch/m68k/mm/fault.c
arch/m68k/mm/kmap.c
arch/m68k/mm/mcfmmu.c
arch/m68k/mm/memory.c
arch/m68k/sun3x/dvma.c
arch/microblaze/include/asm/tlbflush.h
arch/microblaze/kernel/process.c
arch/microblaze/kernel/signal.c
arch/mips/sgi-ip32/ip32-memory.c
arch/openrisc/include/asm/tlbflush.h
arch/openrisc/kernel/or32_ksyms.c
arch/parisc/include/asm/mmu_context.h
arch/parisc/kernel/cache.c
arch/parisc/kernel/pci-dma.c
arch/parisc/kernel/process.c
arch/parisc/kernel/signal.c
arch/parisc/kernel/smp.c
arch/parisc/mm/hugetlbpage.c
arch/parisc/mm/ioremap.c
arch/powerpc/include/asm/tlb.h
arch/powerpc/mm/book3s64/hash_hugetlbpage.c
arch/powerpc/mm/book3s64/hash_pgtable.c
arch/powerpc/mm/book3s64/hash_tlb.c
arch/powerpc/mm/book3s64/radix_hugetlbpage.c
arch/powerpc/mm/init_32.c
arch/powerpc/mm/kasan/8xx.c
arch/powerpc/mm/kasan/book3s_32.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/nohash/40x.c
arch/powerpc/mm/nohash/8xx.c
arch/powerpc/mm/nohash/fsl_booke.c
arch/powerpc/mm/nohash/kaslr_booke.c
arch/powerpc/mm/nohash/tlb.c
arch/powerpc/mm/pgtable.c
arch/powerpc/mm/pgtable_64.c
arch/powerpc/mm/ptdump/hashpagetable.c
arch/powerpc/mm/ptdump/ptdump.c
arch/powerpc/platforms/pseries/cmm.c
arch/riscv/mm/fault.c
arch/s390/include/asm/tlb.h
arch/s390/include/asm/tlbflush.h
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/ptrace.c
arch/s390/kvm/diag.c
arch/s390/kvm/priv.c
arch/s390/kvm/pv.c
arch/s390/mm/cmm.c
arch/s390/mm/mmap.c
arch/s390/mm/pgtable.c
arch/sh/kernel/idle.c
arch/sh/kernel/machine_kexec.c
arch/sh/mm/cache-sh3.c
arch/sh/mm/cache-sh7705.c
arch/sh/mm/hugetlbpage.c
arch/sh/mm/init.c
arch/sh/mm/ioremap_fixed.c
arch/sh/mm/tlb-sh3.c
arch/sparc/include/asm/ide.h
arch/sparc/include/asm/tlb_64.h
arch/sparc/kernel/leon_smp.c
arch/sparc/kernel/process_32.c
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/smp_32.c
arch/sparc/kernel/smp_64.c
arch/sparc/kernel/sun4m_irq.c
arch/sparc/mm/highmem.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/iommu.c
arch/sparc/mm/tlb.c
arch/x86/ia32/ia32_aout.c
arch/x86/include/asm/mmu_context.h
arch/x86/kernel/alternative.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/traps.c
arch/x86/mm/fault.c
arch/x86/mm/hugetlbpage.c
arch/x86/mm/kaslr.c
arch/x86/mm/pgtable_32.c
arch/x86/mm/pti.c
arch/x86/platform/uv/bios_uv.c
arch/xtensa/kernel/xtensa_ksyms.c
arch/xtensa/mm/cache.c
arch/xtensa/mm/fault.c
drivers/block/xen-blkback/common.h
drivers/iommu/ipmmu-vmsa.c
drivers/xen/balloon.c
drivers/xen/privcmd.c
fs/binfmt_elf_fdpic.c
include/asm-generic/tlb.h
mm/hugetlb.c
mm/sparse.c