]> git.baikalelectronics.ru Git - kernel.git/commit
mm: don't include asm/pgtable.h if linux/mm.h is already included
authorMike Rapoport <rppt@linux.ibm.com>
Tue, 9 Jun 2020 04:32:33 +0000 (21:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Jun 2020 16:39:13 +0000 (09:39 -0700)
commit987b75ddbaf26360787cf73a5a370c2748f4a537
tree52533470ee6bb0a9a7d6d56e8aa885f3b6d14945
parenta1376871f17f0d4cea991e2bd6b01e5c14543df1
mm: don't include asm/pgtable.h if linux/mm.h is already included

Patch series "mm: consolidate definitions of page table accessors", v2.

The low level page table accessors (pXY_index(), pXY_offset()) are
duplicated across all architectures and sometimes more than once.  For
instance, we have 31 definition of pgd_offset() for 25 supported
architectures.

Most of these definitions are actually identical and typically it boils
down to, e.g.

static inline unsigned long pmd_index(unsigned long address)
{
        return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
}

static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
{
        return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
}

These definitions can be shared among 90% of the arches provided
XYZ_SHIFT, PTRS_PER_XYZ and xyz_page_vaddr() are defined.

For architectures that really need a custom version there is always
possibility to override the generic version with the usual ifdefs magic.

These patches introduce include/linux/pgtable.h that replaces
include/asm-generic/pgtable.h and add the definitions of the page table
accessors to the new header.

This patch (of 12):

The linux/mm.h header includes <asm/pgtable.h> to allow inlining of the
functions involving page table manipulations, e.g.  pte_alloc() and
pmd_alloc().  So, there is no point to explicitly include <asm/pgtable.h>
in the files that include <linux/mm.h>.

The include statements in such cases are remove with a simple loop:

for f in $(git grep -l "include <linux/mm.h>") ; do
sed -i -e '/include <asm\/pgtable.h>/ d' $f
done

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: http://lkml.kernel.org/r/20200514170327.31389-1-rppt@kernel.org
Link: http://lkml.kernel.org/r/20200514170327.31389-2-rppt@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
319 files changed:
arch/alpha/boot/bootp.c
arch/alpha/boot/bootpz.c
arch/alpha/boot/main.c
arch/alpha/include/asm/io.h
arch/alpha/kernel/process.c
arch/alpha/kernel/ptrace.c
arch/alpha/kernel/setup.c
arch/alpha/kernel/smp.c
arch/alpha/kernel/sys_alcor.c
arch/alpha/kernel/sys_cabriolet.c
arch/alpha/kernel/sys_dp264.c
arch/alpha/kernel/sys_eb64p.c
arch/alpha/kernel/sys_eiger.c
arch/alpha/kernel/sys_jensen.c
arch/alpha/kernel/sys_marvel.c
arch/alpha/kernel/sys_miata.c
arch/alpha/kernel/sys_mikasa.c
arch/alpha/kernel/sys_nautilus.c
arch/alpha/kernel/sys_noritake.c
arch/alpha/kernel/sys_rawhide.c
arch/alpha/kernel/sys_ruffian.c
arch/alpha/kernel/sys_rx164.c
arch/alpha/kernel/sys_sable.c
arch/alpha/kernel/sys_sio.c
arch/alpha/kernel/sys_sx164.c
arch/alpha/kernel/sys_takara.c
arch/alpha/kernel/sys_titan.c
arch/alpha/kernel/sys_wildfire.c
arch/alpha/mm/init.c
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/module.c
arch/arm/kernel/ptrace.c
arch/arm/kernel/smp.c
arch/arm/mach-ebsa110/core.c
arch/arm/mach-footbridge/common.c
arch/arm/mach-imx/mm-imx21.c
arch/arm/mach-imx/mm-imx27.c
arch/arm/mach-imx/mm-imx3.c
arch/arm/mach-iop32x/i2c.c
arch/arm/mach-iop32x/iq31244.c
arch/arm/mach-iop32x/iq80321.c
arch/arm/mach-iop32x/n2100.c
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-sa1100/assabet.c
arch/arm/mm/copypage-v4mc.c
arch/arm/mm/copypage-v6.c
arch/arm/mm/copypage-xscale.c
arch/arm/mm/dump.c
arch/arm/mm/fault-armv.c
arch/arm/mm/fault.c
arch/arm/mm/pageattr.c
arch/arm64/kernel/hibernate.c
arch/arm64/kernel/ptrace.c
arch/arm64/kernel/smp.c
arch/arm64/mm/dump.c
arch/arm64/mm/fault.c
arch/arm64/mm/kasan_init.c
arch/arm64/mm/pageattr.c
arch/csky/kernel/module.c
arch/csky/kernel/ptrace.c
arch/csky/mm/init.c
arch/csky/mm/tlb.c
arch/h8300/kernel/process.c
arch/h8300/kernel/setup.c
arch/h8300/kernel/signal.c
arch/h8300/mm/fault.c
arch/h8300/mm/init.c
arch/h8300/mm/memory.c
arch/hexagon/mm/vm_fault.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/ptrace.c
arch/ia64/kernel/smp.c
arch/ia64/kernel/smpboot.c
arch/ia64/mm/contig.c
arch/ia64/mm/fault.c
arch/m68k/68000/timers.c
arch/m68k/amiga/config.c
arch/m68k/apollo/config.c
arch/m68k/atari/atasound.c
arch/m68k/atari/stram.c
arch/m68k/bvme6000/config.c
arch/m68k/kernel/process.c
arch/m68k/kernel/ptrace.c
arch/m68k/kernel/setup_no.c
arch/m68k/kernel/signal.c
arch/m68k/kernel/uboot.c
arch/m68k/mac/config.c
arch/m68k/mm/mcfmmu.c
arch/m68k/mm/sun3kmap.c
arch/m68k/mm/sun3mmu.c
arch/m68k/mvme147/config.c
arch/m68k/mvme16x/config.c
arch/m68k/q40/config.c
arch/m68k/sun3/config.c
arch/m68k/sun3/dvma.c
arch/m68k/sun3/mmu_emu.c
arch/m68k/sun3/sun3dvma.c
arch/m68k/sun3x/dvma.c
arch/m68k/sun3x/prom.c
arch/microblaze/kernel/signal.c
arch/microblaze/mm/fault.c
arch/mips/fw/arc/memory.c
arch/mips/include/asm/mach-generic/floppy.h
arch/mips/include/asm/mach-jazz/floppy.h
arch/mips/jazz/jazzdma.c
arch/mips/kernel/module.c
arch/mips/kernel/process.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace32.c
arch/mips/kernel/smp-bmips.c
arch/mips/kernel/traps.c
arch/mips/kvm/tlb.c
arch/mips/lib/dump_tlb.c
arch/mips/lib/r3k_dump_tlb.c
arch/mips/mm/c-octeon.c
arch/mips/mm/c-r3k.c
arch/mips/mm/c-r4k.c
arch/mips/mm/c-tx39.c
arch/mips/mm/init.c
arch/mips/mm/page.c
arch/mips/mm/pgtable-32.c
arch/mips/mm/pgtable-64.c
arch/mips/mm/sc-ip22.c
arch/mips/mm/sc-mips.c
arch/mips/mm/sc-r5k.c
arch/mips/mm/tlb-r3k.c
arch/mips/mm/tlb-r4k.c
arch/mips/sgi-ip27/ip27-init.c
arch/mips/sgi-ip27/ip27-timer.c
arch/mips/sgi-ip32/ip32-memory.c
arch/nds32/mm/fault.c
arch/nds32/mm/proc.c
arch/nios2/kernel/module.c
arch/nios2/mm/init.c
arch/nios2/mm/pgtable.c
arch/nios2/mm/tlb.c
arch/openrisc/include/asm/tlbflush.h
arch/openrisc/kernel/asm-offsets.c
arch/openrisc/kernel/process.c
arch/openrisc/kernel/ptrace.c
arch/openrisc/kernel/setup.c
arch/openrisc/kernel/traps.c
arch/openrisc/mm/init.c
arch/openrisc/mm/tlb.c
arch/parisc/include/asm/mmu_context.h
arch/parisc/kernel/module.c
arch/parisc/kernel/ptrace.c
arch/parisc/kernel/smp.c
arch/parisc/mm/init.c
arch/powerpc/include/asm/io.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/kernel/traps.c
arch/powerpc/kernel/vdso.c
arch/powerpc/lib/code-patching.c
arch/powerpc/mm/book3s64/hash_hugetlbpage.c
arch/powerpc/mm/book3s64/hash_pgtable.c
arch/powerpc/mm/book3s64/radix_hugetlbpage.c
arch/powerpc/mm/book3s64/radix_pgtable.c
arch/powerpc/mm/fault.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/init_32.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/nohash/40x.c
arch/powerpc/mm/nohash/fsl_booke.c
arch/powerpc/mm/pgtable_32.c
arch/powerpc/mm/pgtable_64.c
arch/powerpc/mm/ptdump/hashpagetable.c
arch/powerpc/mm/ptdump/ptdump.c
arch/powerpc/perf/callchain.c
arch/powerpc/perf/callchain_32.c
arch/powerpc/perf/callchain_64.c
arch/powerpc/platforms/8xx/cpm1.c
arch/powerpc/platforms/8xx/micropatch.c
arch/powerpc/platforms/cell/setup.c
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/maple/time.c
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/powermac/time.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/sysdev/cpm2.c
arch/powerpc/xmon/xmon.c
arch/riscv/kernel/setup.c
arch/riscv/mm/init.c
arch/s390/include/asm/tlbflush.h
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/ptrace.c
arch/s390/kernel/vdso.c
arch/s390/mm/dump_pagetables.c
arch/s390/mm/fault.c
arch/s390/mm/init.c
arch/s390/mm/pageattr.c
arch/s390/mm/pgtable.c
arch/s390/mm/vmem.c
arch/sh/kernel/machine_kexec.c
arch/sh/kernel/ptrace_32.c
arch/sh/kernel/signal_32.c
arch/sh/mm/cache-sh3.c
arch/sh/mm/cache-sh4.c
arch/sh/mm/cache-sh7705.c
arch/sh/mm/nommu.c
arch/sparc/kernel/leon_smp.c
arch/sparc/kernel/process_32.c
arch/sparc/kernel/process_64.c
arch/sparc/kernel/ptrace_32.c
arch/sparc/kernel/ptrace_64.c
arch/sparc/kernel/setup_32.c
arch/sparc/kernel/setup_64.c
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/signal_64.c
arch/sparc/kernel/smp_32.c
arch/sparc/kernel/smp_64.c
arch/sparc/kernel/traps_64.c
arch/sparc/mm/fault_32.c
arch/sparc/mm/fault_64.c
arch/sparc/mm/hugetlbpage.c
arch/sparc/mm/init_32.c
arch/sparc/mm/init_64.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/iommu.c
arch/sparc/mm/tlb.c
arch/um/kernel/process.c
arch/um/kernel/skas/mmu.c
arch/um/kernel/skas/uaccess.c
arch/um/kernel/tlb.c
arch/um/kernel/trap.c
arch/um/kernel/um_arch.c
arch/unicore32/kernel/module.c
arch/unicore32/mm/fault.c
arch/x86/include/asm/iomap.h
arch/x86/include/asm/xen/page.h
arch/x86/kernel/alternative.c
arch/x86/kernel/amd_gart_64.c
arch/x86/kernel/doublefault_32.c
arch/x86/kernel/machine_kexec_32.c
arch/x86/kernel/machine_kexec_64.c
arch/x86/kernel/module.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/kernel/ptrace.c
arch/x86/kernel/tboot.c
arch/x86/mm/dump_pagetables.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
arch/x86/mm/kasan_init_64.c
arch/x86/mm/pat/cpa-test.c
arch/x86/mm/pat/memtype.c
arch/x86/mm/pgtable.c
arch/x86/mm/pgtable_32.c
arch/x86/mm/pti.c
arch/x86/platform/efi/efi_64.c
arch/x86/xen/enlighten_pv.c
arch/x86/xen/grant-table.c
arch/xtensa/kernel/process.c
arch/xtensa/kernel/ptrace.c
arch/xtensa/kernel/setup.c
drivers/char/agp/frontend.c
drivers/char/agp/generic.c
drivers/char/bsr.c
drivers/char/mspec.c
drivers/gpu/drm/i915/i915_mm.c
drivers/infiniband/sw/rdmavt/mmap.c
drivers/infiniband/sw/rxe/rxe_mmap.c
drivers/media/platform/davinci/vpbe_display.c
drivers/media/v4l2-core/v4l2-common.c
drivers/misc/sgi-gru/grufault.c
drivers/net/ethernet/sun/sunhme.c
drivers/sbus/char/flash.c
drivers/sbus/char/uctrl.c
drivers/scsi/a2091.c
drivers/scsi/a3000.c
drivers/scsi/gvp11.c
drivers/scsi/lasi700.c
drivers/scsi/mvme147.c
drivers/scsi/sni_53c710.c
drivers/video/console/newport_con.c
drivers/video/fbdev/acornfb.c
drivers/video/fbdev/atafb.c
drivers/video/fbdev/cirrusfb.c
drivers/video/fbdev/cyber2000fb.c
drivers/video/fbdev/fb-puv3.c
drivers/video/fbdev/hitfb.c
drivers/video/fbdev/neofb.c
drivers/video/fbdev/q40fb.c
drivers/video/fbdev/savage/savagefb_driver.c
drivers/xen/balloon.c
drivers/xen/grant-table.c
drivers/xen/privcmd.c
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenbus/xenbus_probe_backend.c
drivers/xen/xenbus/xenbus_probe_frontend.c
fs/proc/array.c
fs/proc/meminfo.c
fs/proc/nommu.c
fs/proc/vmcore.c
include/linux/dax.h
init/init_task.c
kernel/exit.c
kernel/fork.c
kernel/power/snapshot.c
lib/ioremap.c
mm/debug_vm_pgtable.c
mm/gup.c
mm/hugetlb.c
mm/memory.c
mm/page_io.c
mm/shmem.c
mm/sparse-vmemmap.c
mm/sparse.c
mm/swap_state.c
mm/swapfile.c
mm/vmacache.c
sound/core/sgbuf.c
virt/kvm/kvm_main.c