linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* incoming
@ 2020-06-09  4:29 Andrew Morton
  2020-06-09  4:29 ` [patch 01/93] kallsyms/printk: add loglvl to print_ip_sym() Andrew Morton
                   ` (95 more replies)
  0 siblings, 96 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:29 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- a kernel-wide sweep of show_stack()

- pagetable cleanups

- abstract out accesses to mmap_sem - prep for mmap_sem scalability work

- hch's user acess work


93 patches, based on abfbb29297c27e3f101f348dc9e467b0fe70f919:

Subsystems affected by this patch series:

  debug
  mm/pagemap
  mm/maccess
  mm/documentation

Subsystem: debug

    Dmitry Safonov <dima@arista.com>:
    Patch series "Add log level to show_stack()", v3:
      kallsyms/printk: add loglvl to print_ip_sym()
      alpha: add show_stack_loglvl()
      arc: add show_stack_loglvl()
      arm/asm: add loglvl to c_backtrace()
      arm: add loglvl to unwind_backtrace()
      arm: add loglvl to dump_backtrace()
      arm: wire up dump_backtrace_{entry,stm}
      arm: add show_stack_loglvl()
      arm64: add loglvl to dump_backtrace()
      arm64: add show_stack_loglvl()
      c6x: add show_stack_loglvl()
      csky: add show_stack_loglvl()
      h8300: add show_stack_loglvl()
      hexagon: add show_stack_loglvl()
      ia64: pass log level as arg into ia64_do_show_stack()
      ia64: add show_stack_loglvl()
      m68k: add show_stack_loglvl()
      microblaze: add loglvl to microblaze_unwind_inner()
      microblaze: add loglvl to microblaze_unwind()
      microblaze: add show_stack_loglvl()
      mips: add show_stack_loglvl()
      nds32: add show_stack_loglvl()
      nios2: add show_stack_loglvl()
      openrisc: add show_stack_loglvl()
      parisc: add show_stack_loglvl()
      powerpc: add show_stack_loglvl()
      riscv: add show_stack_loglvl()
      s390: add show_stack_loglvl()
      sh: add loglvl to dump_mem()
      sh: remove needless printk()
      sh: add loglvl to printk_address()
      sh: add loglvl to show_trace()
      sh: add show_stack_loglvl()
      sparc: add show_stack_loglvl()
      um/sysrq: remove needless variable sp
      um: add show_stack_loglvl()
      unicore32: remove unused pmode argument in c_backtrace()
      unicore32: add loglvl to c_backtrace()
      unicore32: add show_stack_loglvl()
      x86: add missing const qualifiers for log_lvl
      x86: add show_stack_loglvl()
      xtensa: add loglvl to show_trace()
      xtensa: add show_stack_loglvl()
      sysrq: use show_stack_loglvl()
      x86/amd_gart: print stacktrace for a leak with KERN_ERR
      power: use show_stack_loglvl()
      kdb: don't play with console_loglevel
      sched: print stack trace with KERN_INFO
      kernel: use show_stack_loglvl()
      kernel: rename show_stack_loglvl() => show_stack()

Subsystem: mm/pagemap

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: consolidate definitions of page table accessors", v2:
      mm: don't include asm/pgtable.h if linux/mm.h is already included
      mm: introduce include/linux/pgtable.h
      mm: reorder includes after introduction of linux/pgtable.h
      csky: replace definitions of __pXd_offset() with pXd_index()
      m68k/mm/motorola: move comment about page table allocation funcitons
      m68k/mm: move {cache,nocahe}_page() definitions close to their user
      x86/mm: simplify init_trampoline() and surrounding logic
      mm: pgtable: add shortcuts for accessing kernel PMD and PTE
      mm: consolidate pte_index() and pte_offset_*() definitions

    Michel Lespinasse <walken@google.com>:
      mmap locking API: initial implementation as rwsem wrappers
      MMU notifier: use the new mmap locking API
      DMA reservations: use the new mmap locking API
      mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
      mmap locking API: convert mmap_sem call sites missed by coccinelle
      mmap locking API: convert nested write lock sites
      mmap locking API: add mmap_read_trylock_non_owner()
      mmap locking API: add MMAP_LOCK_INITIALIZER
      mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked()
      mmap locking API: rename mmap_sem to mmap_lock
      mmap locking API: convert mmap_sem API comments
      mmap locking API: convert mmap_sem comments

Subsystem: mm/maccess

    Christoph Hellwig <hch@lst.de>:
    Patch series "clean up and streamline probe_kernel_* and friends", v4:
      maccess: unexport probe_kernel_write()
      maccess: remove various unused weak aliases
      maccess: remove duplicate kerneldoc comments
      maccess: clarify kerneldoc comments
      maccess: update the top of file comment
      maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault
      maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault
      maccess: rename strnlen_unsafe_user to strnlen_user_nofault
      maccess: remove probe_read_common and probe_write_common
      maccess: unify the probe kernel arch hooks
      bpf: factor out a bpf_trace_copy_string helper
      bpf: handle the compat string in bpf_trace_copy_string better

    Andrew Morton <akpm@linux-foundation.org>:
      bpf:bpf_seq_printf(): handle potentially unsafe format string better

    Christoph Hellwig <hch@lst.de>:
      bpf: rework the compat kernel probe handling
      tracing/kprobes: handle mixed kernel/userspace probes better
      maccess: remove strncpy_from_unsafe
      maccess: always use strict semantics for probe_kernel_read
      maccess: move user access routines together
      maccess: allow architectures to provide kernel probing directly
      x86: use non-set_fs based maccess routines
      maccess: return -ERANGE when probe_kernel_read() fails

Subsystem: mm/documentation

    Luis Chamberlain <mcgrof@kernel.org>:
      include/linux/cache.h: expand documentation over __read_mostly

 Documentation/admin-guide/mm/numa_memory_policy.rst   |   10 
 Documentation/admin-guide/mm/userfaultfd.rst          |    2 
 Documentation/filesystems/locking.rst                 |    2 
 Documentation/vm/hmm.rst                              |    6 
 Documentation/vm/transhuge.rst                        |    4 
 arch/alpha/boot/bootp.c                               |    1 
 arch/alpha/boot/bootpz.c                              |    1 
 arch/alpha/boot/main.c                                |    1 
 arch/alpha/include/asm/io.h                           |    1 
 arch/alpha/include/asm/pgtable.h                      |   16 
 arch/alpha/kernel/process.c                           |    1 
 arch/alpha/kernel/proto.h                             |    4 
 arch/alpha/kernel/ptrace.c                            |    1 
 arch/alpha/kernel/setup.c                             |    1 
 arch/alpha/kernel/smp.c                               |    1 
 arch/alpha/kernel/sys_alcor.c                         |    1 
 arch/alpha/kernel/sys_cabriolet.c                     |    1 
 arch/alpha/kernel/sys_dp264.c                         |    1 
 arch/alpha/kernel/sys_eb64p.c                         |    1 
 arch/alpha/kernel/sys_eiger.c                         |    1 
 arch/alpha/kernel/sys_jensen.c                        |    1 
 arch/alpha/kernel/sys_marvel.c                        |    1 
 arch/alpha/kernel/sys_miata.c                         |    1 
 arch/alpha/kernel/sys_mikasa.c                        |    1 
 arch/alpha/kernel/sys_nautilus.c                      |    1 
 arch/alpha/kernel/sys_noritake.c                      |    1 
 arch/alpha/kernel/sys_rawhide.c                       |    1 
 arch/alpha/kernel/sys_ruffian.c                       |    1 
 arch/alpha/kernel/sys_rx164.c                         |    1 
 arch/alpha/kernel/sys_sable.c                         |    1 
 arch/alpha/kernel/sys_sio.c                           |    1 
 arch/alpha/kernel/sys_sx164.c                         |    1 
 arch/alpha/kernel/sys_takara.c                        |    1 
 arch/alpha/kernel/sys_titan.c                         |    1 
 arch/alpha/kernel/sys_wildfire.c                      |    1 
 arch/alpha/kernel/traps.c                             |   40 
 arch/alpha/mm/fault.c                                 |   12 
 arch/alpha/mm/init.c                                  |    1 
 arch/arc/include/asm/bug.h                            |    3 
 arch/arc/include/asm/pgtable.h                        |   24 
 arch/arc/kernel/process.c                             |    4 
 arch/arc/kernel/stacktrace.c                          |   29 
 arch/arc/kernel/troubleshoot.c                        |    6 
 arch/arc/mm/fault.c                                   |    6 
 arch/arc/mm/highmem.c                                 |   14 
 arch/arc/mm/tlbex.S                                   |    4 
 arch/arm/include/asm/bug.h                            |    3 
 arch/arm/include/asm/efi.h                            |    3 
 arch/arm/include/asm/fixmap.h                         |    4 
 arch/arm/include/asm/idmap.h                          |    2 
 arch/arm/include/asm/pgtable-2level.h                 |    1 
 arch/arm/include/asm/pgtable-3level.h                 |    7 
 arch/arm/include/asm/pgtable-nommu.h                  |    3 
 arch/arm/include/asm/pgtable.h                        |   25 
 arch/arm/include/asm/traps.h                          |    3 
 arch/arm/include/asm/unwind.h                         |    3 
 arch/arm/kernel/head.S                                |    4 
 arch/arm/kernel/machine_kexec.c                       |    1 
 arch/arm/kernel/module.c                              |    1 
 arch/arm/kernel/process.c                             |    4 
 arch/arm/kernel/ptrace.c                              |    1 
 arch/arm/kernel/smp.c                                 |    1 
 arch/arm/kernel/suspend.c                             |    4 
 arch/arm/kernel/swp_emulate.c                         |    4 
 arch/arm/kernel/traps.c                               |   61 
 arch/arm/kernel/unwind.c                              |    7 
 arch/arm/kernel/vdso.c                                |    2 
 arch/arm/kernel/vmlinux.lds.S                         |    4 
 arch/arm/lib/backtrace-clang.S                        |    9 
 arch/arm/lib/backtrace.S                              |   14 
 arch/arm/lib/uaccess_with_memcpy.c                    |   16 
 arch/arm/mach-ebsa110/core.c                          |    1 
 arch/arm/mach-footbridge/common.c                     |    1 
 arch/arm/mach-imx/mm-imx21.c                          |    1 
 arch/arm/mach-imx/mm-imx27.c                          |    1 
 arch/arm/mach-imx/mm-imx3.c                           |    1 
 arch/arm/mach-integrator/core.c                       |    4 
 arch/arm/mach-iop32x/i2c.c                            |    1 
 arch/arm/mach-iop32x/iq31244.c                        |    1 
 arch/arm/mach-iop32x/iq80321.c                        |    1 
 arch/arm/mach-iop32x/n2100.c                          |    1 
 arch/arm/mach-ixp4xx/common.c                         |    1 
 arch/arm/mach-keystone/platsmp.c                      |    4 
 arch/arm/mach-sa1100/assabet.c                        |    3 
 arch/arm/mach-sa1100/hackkit.c                        |    4 
 arch/arm/mach-tegra/iomap.h                           |    2 
 arch/arm/mach-zynq/common.c                           |    4 
 arch/arm/mm/copypage-v4mc.c                           |    1 
 arch/arm/mm/copypage-v6.c                             |    1 
 arch/arm/mm/copypage-xscale.c                         |    1 
 arch/arm/mm/dump.c                                    |    1 
 arch/arm/mm/fault-armv.c                              |    1 
 arch/arm/mm/fault.c                                   |    9 
 arch/arm/mm/highmem.c                                 |    4 
 arch/arm/mm/idmap.c                                   |    4 
 arch/arm/mm/ioremap.c                                 |   31 
 arch/arm/mm/mm.h                                      |    8 
 arch/arm/mm/mmu.c                                     |    7 
 arch/arm/mm/pageattr.c                                |    1 
 arch/arm/mm/proc-arm1020.S                            |    4 
 arch/arm/mm/proc-arm1020e.S                           |    4 
 arch/arm/mm/proc-arm1022.S                            |    4 
 arch/arm/mm/proc-arm1026.S                            |    4 
 arch/arm/mm/proc-arm720.S                             |    4 
 arch/arm/mm/proc-arm740.S                             |    4 
 arch/arm/mm/proc-arm7tdmi.S                           |    4 
 arch/arm/mm/proc-arm920.S                             |    4 
 arch/arm/mm/proc-arm922.S                             |    4 
 arch/arm/mm/proc-arm925.S                             |    4 
 arch/arm/mm/proc-arm926.S                             |    4 
 arch/arm/mm/proc-arm940.S                             |    4 
 arch/arm/mm/proc-arm946.S                             |    4 
 arch/arm/mm/proc-arm9tdmi.S                           |    4 
 arch/arm/mm/proc-fa526.S                              |    4 
 arch/arm/mm/proc-feroceon.S                           |    4 
 arch/arm/mm/proc-mohawk.S                             |    4 
 arch/arm/mm/proc-sa110.S                              |    4 
 arch/arm/mm/proc-sa1100.S                             |    4 
 arch/arm/mm/proc-v6.S                                 |    4 
 arch/arm/mm/proc-v7.S                                 |    4 
 arch/arm/mm/proc-xsc3.S                               |    4 
 arch/arm/mm/proc-xscale.S                             |    4 
 arch/arm/mm/pv-fixup-asm.S                            |    4 
 arch/arm64/include/asm/io.h                           |    4 
 arch/arm64/include/asm/kernel-pgtable.h               |    2 
 arch/arm64/include/asm/kvm_mmu.h                      |    4 
 arch/arm64/include/asm/mmu_context.h                  |    4 
 arch/arm64/include/asm/pgtable.h                      |   40 
 arch/arm64/include/asm/stacktrace.h                   |    3 
 arch/arm64/include/asm/stage2_pgtable.h               |    2 
 arch/arm64/include/asm/vmap_stack.h                   |    4 
 arch/arm64/kernel/acpi.c                              |    4 
 arch/arm64/kernel/head.S                              |    4 
 arch/arm64/kernel/hibernate.c                         |    5 
 arch/arm64/kernel/kaslr.c                             |    4 
 arch/arm64/kernel/process.c                           |    2 
 arch/arm64/kernel/ptrace.c                            |    1 
 arch/arm64/kernel/smp.c                               |    1 
 arch/arm64/kernel/suspend.c                           |    4 
 arch/arm64/kernel/traps.c                             |   37 
 arch/arm64/kernel/vdso.c                              |    8 
 arch/arm64/kernel/vmlinux.lds.S                       |    3 
 arch/arm64/kvm/mmu.c                                  |   14 
 arch/arm64/mm/dump.c                                  |    1 
 arch/arm64/mm/fault.c                                 |    9 
 arch/arm64/mm/kasan_init.c                            |    3 
 arch/arm64/mm/mmu.c                                   |    8 
 arch/arm64/mm/pageattr.c                              |    1 
 arch/arm64/mm/proc.S                                  |    4 
 arch/c6x/include/asm/pgtable.h                        |    3 
 arch/c6x/kernel/traps.c                               |   28 
 arch/csky/include/asm/io.h                            |    2 
 arch/csky/include/asm/pgtable.h                       |   37 
 arch/csky/kernel/module.c                             |    1 
 arch/csky/kernel/ptrace.c                             |    5 
 arch/csky/kernel/stacktrace.c                         |   20 
 arch/csky/kernel/vdso.c                               |    4 
 arch/csky/mm/fault.c                                  |   10 
 arch/csky/mm/highmem.c                                |    2 
 arch/csky/mm/init.c                                   |    7 
 arch/csky/mm/tlb.c                                    |    1 
 arch/h8300/include/asm/pgtable.h                      |    1 
 arch/h8300/kernel/process.c                           |    1 
 arch/h8300/kernel/setup.c                             |    1 
 arch/h8300/kernel/signal.c                            |    1 
 arch/h8300/kernel/traps.c                             |   26 
 arch/h8300/mm/fault.c                                 |    1 
 arch/h8300/mm/init.c                                  |    1 
 arch/h8300/mm/memory.c                                |    1 
 arch/hexagon/include/asm/fixmap.h                     |    4 
 arch/hexagon/include/asm/pgtable.h                    |   55 
 arch/hexagon/kernel/traps.c                           |   39 
 arch/hexagon/kernel/vdso.c                            |    4 
 arch/hexagon/mm/uaccess.c                             |    2 
 arch/hexagon/mm/vm_fault.c                            |    9 
 arch/ia64/include/asm/pgtable.h                       |   34 
 arch/ia64/include/asm/ptrace.h                        |    1 
 arch/ia64/include/asm/uaccess.h                       |    2 
 arch/ia64/kernel/efi.c                                |    1 
 arch/ia64/kernel/entry.S                              |    4 
 arch/ia64/kernel/head.S                               |    5 
 arch/ia64/kernel/irq_ia64.c                           |    4 
 arch/ia64/kernel/ivt.S                                |    4 
 arch/ia64/kernel/kprobes.c                            |    4 
 arch/ia64/kernel/mca.c                                |    2 
 arch/ia64/kernel/mca_asm.S                            |    4 
 arch/ia64/kernel/perfmon.c                            |    8 
 arch/ia64/kernel/process.c                            |   37 
 arch/ia64/kernel/ptrace.c                             |    1 
 arch/ia64/kernel/relocate_kernel.S                    |    6 
 arch/ia64/kernel/setup.c                              |    4 
 arch/ia64/kernel/smp.c                                |    1 
 arch/ia64/kernel/smpboot.c                            |    1 
 arch/ia64/kernel/uncached.c                           |    4 
 arch/ia64/kernel/vmlinux.lds.S                        |    4 
 arch/ia64/mm/contig.c                                 |    1 
 arch/ia64/mm/fault.c                                  |   17 
 arch/ia64/mm/init.c                                   |   12 
 arch/m68k/68000/m68EZ328.c                            |    2 
 arch/m68k/68000/m68VZ328.c                            |    4 
 arch/m68k/68000/timers.c                              |    1 
 arch/m68k/amiga/config.c                              |    1 
 arch/m68k/apollo/config.c                             |    1 
 arch/m68k/atari/atasound.c                            |    1 
 arch/m68k/atari/stram.c                               |    1 
 arch/m68k/bvme6000/config.c                           |    1 
 arch/m68k/include/asm/mcf_pgtable.h                   |   63 
 arch/m68k/include/asm/motorola_pgalloc.h              |    8 
 arch/m68k/include/asm/motorola_pgtable.h              |   84 -
 arch/m68k/include/asm/pgtable_mm.h                    |    1 
 arch/m68k/include/asm/pgtable_no.h                    |    2 
 arch/m68k/include/asm/sun3_pgtable.h                  |   24 
 arch/m68k/include/asm/sun3xflop.h                     |    4 
 arch/m68k/kernel/head.S                               |    4 
 arch/m68k/kernel/process.c                            |    1 
 arch/m68k/kernel/ptrace.c                             |    1 
 arch/m68k/kernel/setup_no.c                           |    1 
 arch/m68k/kernel/signal.c                             |    1 
 arch/m68k/kernel/sys_m68k.c                           |   14 
 arch/m68k/kernel/traps.c                              |   27 
 arch/m68k/kernel/uboot.c                              |    1 
 arch/m68k/mac/config.c                                |    1 
 arch/m68k/mm/fault.c                                  |   10 
 arch/m68k/mm/init.c                                   |    2 
 arch/m68k/mm/mcfmmu.c                                 |    1 
 arch/m68k/mm/motorola.c                               |   65 
 arch/m68k/mm/sun3kmap.c                               |    1 
 arch/m68k/mm/sun3mmu.c                                |    1 
 arch/m68k/mvme147/config.c                            |    1 
 arch/m68k/mvme16x/config.c                            |    1 
 arch/m68k/q40/config.c                                |    1 
 arch/m68k/sun3/config.c                               |    1 
 arch/m68k/sun3/dvma.c                                 |    1 
 arch/m68k/sun3/mmu_emu.c                              |    1 
 arch/m68k/sun3/sun3dvma.c                             |    1 
 arch/m68k/sun3x/dvma.c                                |    1 
 arch/m68k/sun3x/prom.c                                |    1 
 arch/microblaze/include/asm/pgalloc.h                 |    4 
 arch/microblaze/include/asm/pgtable.h                 |   23 
 arch/microblaze/include/asm/uaccess.h                 |    2 
 arch/microblaze/include/asm/unwind.h                  |    3 
 arch/microblaze/kernel/hw_exception_handler.S         |    4 
 arch/microblaze/kernel/module.c                       |    4 
 arch/microblaze/kernel/setup.c                        |    4 
 arch/microblaze/kernel/signal.c                       |    9 
 arch/microblaze/kernel/stacktrace.c                   |    4 
 arch/microblaze/kernel/traps.c                        |   28 
 arch/microblaze/kernel/unwind.c                       |   46 
 arch/microblaze/mm/fault.c                            |   17 
 arch/microblaze/mm/init.c                             |    9 
 arch/microblaze/mm/pgtable.c                          |    4 
 arch/mips/fw/arc/memory.c                             |    1 
 arch/mips/include/asm/fixmap.h                        |    3 
 arch/mips/include/asm/mach-generic/floppy.h           |    1 
 arch/mips/include/asm/mach-jazz/floppy.h              |    1 
 arch/mips/include/asm/pgtable-32.h                    |   22 
 arch/mips/include/asm/pgtable-64.h                    |   32 
 arch/mips/include/asm/pgtable.h                       |    2 
 arch/mips/jazz/irq.c                                  |    4 
 arch/mips/jazz/jazzdma.c                              |    1 
 arch/mips/jazz/setup.c                                |    4 
 arch/mips/kernel/module.c                             |    1 
 arch/mips/kernel/process.c                            |    1 
 arch/mips/kernel/ptrace.c                             |    1 
 arch/mips/kernel/ptrace32.c                           |    1 
 arch/mips/kernel/smp-bmips.c                          |    1 
 arch/mips/kernel/traps.c                              |   58 
 arch/mips/kernel/vdso.c                               |    4 
 arch/mips/kvm/mips.c                                  |    4 
 arch/mips/kvm/mmu.c                                   |   20 
 arch/mips/kvm/tlb.c                                   |    1 
 arch/mips/kvm/trap_emul.c                             |    2 
 arch/mips/lib/dump_tlb.c                              |    1 
 arch/mips/lib/r3k_dump_tlb.c                          |    1 
 arch/mips/mm/c-octeon.c                               |    1 
 arch/mips/mm/c-r3k.c                                  |   11 
 arch/mips/mm/c-r4k.c                                  |   11 
 arch/mips/mm/c-tx39.c                                 |   11 
 arch/mips/mm/fault.c                                  |   12 
 arch/mips/mm/highmem.c                                |    2 
 arch/mips/mm/init.c                                   |    1 
 arch/mips/mm/page.c                                   |    1 
 arch/mips/mm/pgtable-32.c                             |    1 
 arch/mips/mm/pgtable-64.c                             |    1 
 arch/mips/mm/sc-ip22.c                                |    1 
 arch/mips/mm/sc-mips.c                                |    1 
 arch/mips/mm/sc-r5k.c                                 |    1 
 arch/mips/mm/tlb-r3k.c                                |    1 
 arch/mips/mm/tlb-r4k.c                                |    1 
 arch/mips/mm/tlbex.c                                  |    4 
 arch/mips/sgi-ip27/ip27-init.c                        |    1 
 arch/mips/sgi-ip27/ip27-timer.c                       |    1 
 arch/mips/sgi-ip32/ip32-memory.c                      |    1 
 arch/nds32/include/asm/highmem.h                      |    3 
 arch/nds32/include/asm/pgtable.h                      |   22 
 arch/nds32/kernel/head.S                              |    4 
 arch/nds32/kernel/module.c                            |    2 
 arch/nds32/kernel/traps.c                             |   33 
 arch/nds32/kernel/vdso.c                              |    6 
 arch/nds32/mm/fault.c                                 |   17 
 arch/nds32/mm/init.c                                  |   13 
 arch/nds32/mm/proc.c                                  |    7 
 arch/nios2/include/asm/pgtable.h                      |   24 
 arch/nios2/kernel/module.c                            |    1 
 arch/nios2/kernel/nios2_ksyms.c                       |    4 
 arch/nios2/kernel/traps.c                             |   35 
 arch/nios2/mm/fault.c                                 |   14 
 arch/nios2/mm/init.c                                  |    5 
 arch/nios2/mm/pgtable.c                               |    1 
 arch/nios2/mm/tlb.c                                   |    1 
 arch/openrisc/include/asm/io.h                        |    3 
 arch/openrisc/include/asm/pgtable.h                   |   33 
 arch/openrisc/include/asm/tlbflush.h                  |    1 
 arch/openrisc/kernel/asm-offsets.c                    |    1 
 arch/openrisc/kernel/entry.S                          |    4 
 arch/openrisc/kernel/head.S                           |    4 
 arch/openrisc/kernel/or32_ksyms.c                     |    4 
 arch/openrisc/kernel/process.c                        |    1 
 arch/openrisc/kernel/ptrace.c                         |    1 
 arch/openrisc/kernel/setup.c                          |    1 
 arch/openrisc/kernel/traps.c                          |   27 
 arch/openrisc/mm/fault.c                              |   12 
 arch/openrisc/mm/init.c                               |    1 
 arch/openrisc/mm/ioremap.c                            |    4 
 arch/openrisc/mm/tlb.c                                |    1 
 arch/parisc/include/asm/io.h                          |    2 
 arch/parisc/include/asm/mmu_context.h                 |    1 
 arch/parisc/include/asm/pgtable.h                     |   33 
 arch/parisc/kernel/asm-offsets.c                      |    4 
 arch/parisc/kernel/entry.S                            |    4 
 arch/parisc/kernel/head.S                             |    4 
 arch/parisc/kernel/module.c                           |    1 
 arch/parisc/kernel/pacache.S                          |    4 
 arch/parisc/kernel/pci-dma.c                          |    2 
 arch/parisc/kernel/pdt.c                              |    4 
 arch/parisc/kernel/ptrace.c                           |    1 
 arch/parisc/kernel/smp.c                              |    1 
 arch/parisc/kernel/traps.c                            |   42 
 arch/parisc/lib/memcpy.c                              |   14 
 arch/parisc/mm/fault.c                                |   10 
 arch/parisc/mm/fixmap.c                               |    6 
 arch/parisc/mm/init.c                                 |    1 
 arch/powerpc/include/asm/book3s/32/pgtable.h          |   20 
 arch/powerpc/include/asm/book3s/64/pgtable.h          |   43 
 arch/powerpc/include/asm/fixmap.h                     |    4 
 arch/powerpc/include/asm/io.h                         |    1 
 arch/powerpc/include/asm/kup.h                        |    2 
 arch/powerpc/include/asm/nohash/32/pgtable.h          |   17 
 arch/powerpc/include/asm/nohash/64/pgtable-4k.h       |    4 
 arch/powerpc/include/asm/nohash/64/pgtable.h          |   22 
 arch/powerpc/include/asm/nohash/pgtable.h             |    2 
 arch/powerpc/include/asm/pgtable.h                    |   28 
 arch/powerpc/include/asm/pkeys.h                      |    2 
 arch/powerpc/include/asm/tlb.h                        |    2 
 arch/powerpc/kernel/asm-offsets.c                     |    1 
 arch/powerpc/kernel/btext.c                           |    4 
 arch/powerpc/kernel/fpu.S                             |    3 
 arch/powerpc/kernel/head_32.S                         |    4 
 arch/powerpc/kernel/head_40x.S                        |    4 
 arch/powerpc/kernel/head_44x.S                        |    4 
 arch/powerpc/kernel/head_8xx.S                        |    4 
 arch/powerpc/kernel/head_fsl_booke.S                  |    4 
 arch/powerpc/kernel/io-workarounds.c                  |    4 
 arch/powerpc/kernel/irq.c                             |    4 
 arch/powerpc/kernel/mce_power.c                       |    4 
 arch/powerpc/kernel/paca.c                            |    4 
 arch/powerpc/kernel/process.c                         |   30 
 arch/powerpc/kernel/prom.c                            |    4 
 arch/powerpc/kernel/prom_init.c                       |    4 
 arch/powerpc/kernel/rtas_pci.c                        |    4 
 arch/powerpc/kernel/setup-common.c                    |    4 
 arch/powerpc/kernel/setup_32.c                        |    4 
 arch/powerpc/kernel/setup_64.c                        |    4 
 arch/powerpc/kernel/signal_32.c                       |    1 
 arch/powerpc/kernel/signal_64.c                       |    1 
 arch/powerpc/kernel/smp.c                             |    4 
 arch/powerpc/kernel/stacktrace.c                      |    2 
 arch/powerpc/kernel/traps.c                           |    1 
 arch/powerpc/kernel/vdso.c                            |    7 
 arch/powerpc/kvm/book3s_64_mmu_radix.c                |    4 
 arch/powerpc/kvm/book3s_hv.c                          |    6 
 arch/powerpc/kvm/book3s_hv_nested.c                   |    4 
 arch/powerpc/kvm/book3s_hv_rm_xics.c                  |    4 
 arch/powerpc/kvm/book3s_hv_rm_xive.c                  |    4 
 arch/powerpc/kvm/book3s_hv_uvmem.c                    |   18 
 arch/powerpc/kvm/e500_mmu_host.c                      |    4 
 arch/powerpc/kvm/fpu.S                                |    4 
 arch/powerpc/lib/code-patching.c                      |    1 
 arch/powerpc/mm/book3s32/hash_low.S                   |    4 
 arch/powerpc/mm/book3s32/mmu.c                        |    2 
 arch/powerpc/mm/book3s32/tlb.c                        |    6 
 arch/powerpc/mm/book3s64/hash_hugetlbpage.c           |    1 
 arch/powerpc/mm/book3s64/hash_native.c                |    4 
 arch/powerpc/mm/book3s64/hash_pgtable.c               |    5 
 arch/powerpc/mm/book3s64/hash_utils.c                 |    4 
 arch/powerpc/mm/book3s64/iommu_api.c                  |    4 
 arch/powerpc/mm/book3s64/radix_hugetlbpage.c          |    1 
 arch/powerpc/mm/book3s64/radix_pgtable.c              |    1 
 arch/powerpc/mm/book3s64/slb.c                        |    4 
 arch/powerpc/mm/book3s64/subpage_prot.c               |   16 
 arch/powerpc/mm/copro_fault.c                         |    4 
 arch/powerpc/mm/fault.c                               |   23 
 arch/powerpc/mm/hugetlbpage.c                         |    1 
 arch/powerpc/mm/init-common.c                         |    4 
 arch/powerpc/mm/init_32.c                             |    1 
 arch/powerpc/mm/init_64.c                             |    1 
 arch/powerpc/mm/kasan/8xx.c                           |    4 
 arch/powerpc/mm/kasan/book3s_32.c                     |    2 
 arch/powerpc/mm/kasan/kasan_init_32.c                 |    8 
 arch/powerpc/mm/mem.c                                 |    1 
 arch/powerpc/mm/nohash/40x.c                          |    5 
 arch/powerpc/mm/nohash/8xx.c                          |    2 
 arch/powerpc/mm/nohash/fsl_booke.c                    |    1 
 arch/powerpc/mm/nohash/tlb_low_64e.S                  |    4 
 arch/powerpc/mm/pgtable.c                             |    2 
 arch/powerpc/mm/pgtable_32.c                          |    5 
 arch/powerpc/mm/pgtable_64.c                          |    1 
 arch/powerpc/mm/ptdump/8xx.c                          |    2 
 arch/powerpc/mm/ptdump/bats.c                         |    4 
 arch/powerpc/mm/ptdump/book3s64.c                     |    2 
 arch/powerpc/mm/ptdump/hashpagetable.c                |    1 
 arch/powerpc/mm/ptdump/ptdump.c                       |    1 
 arch/powerpc/mm/ptdump/shared.c                       |    2 
 arch/powerpc/oprofile/cell/spu_task_sync.c            |    6 
 arch/powerpc/perf/callchain.c                         |    1 
 arch/powerpc/perf/callchain_32.c                      |    1 
 arch/powerpc/perf/callchain_64.c                      |    1 
 arch/powerpc/platforms/85xx/corenet_generic.c         |    4 
 arch/powerpc/platforms/85xx/mpc85xx_cds.c             |    4 
 arch/powerpc/platforms/85xx/qemu_e500.c               |    4 
 arch/powerpc/platforms/85xx/sbc8548.c                 |    4 
 arch/powerpc/platforms/85xx/smp.c                     |    4 
 arch/powerpc/platforms/86xx/mpc86xx_smp.c             |    4 
 arch/powerpc/platforms/8xx/cpm1.c                     |    1 
 arch/powerpc/platforms/8xx/micropatch.c               |    1 
 arch/powerpc/platforms/cell/cbe_regs.c                |    4 
 arch/powerpc/platforms/cell/interrupt.c               |    4 
 arch/powerpc/platforms/cell/pervasive.c               |    4 
 arch/powerpc/platforms/cell/setup.c                   |    1 
 arch/powerpc/platforms/cell/smp.c                     |    4 
 arch/powerpc/platforms/cell/spider-pic.c              |    4 
 arch/powerpc/platforms/cell/spufs/file.c              |   10 
 arch/powerpc/platforms/chrp/pci.c                     |    4 
 arch/powerpc/platforms/chrp/setup.c                   |    1 
 arch/powerpc/platforms/chrp/smp.c                     |    4 
 arch/powerpc/platforms/maple/setup.c                  |    1 
 arch/powerpc/platforms/maple/time.c                   |    1 
 arch/powerpc/platforms/powermac/setup.c               |    1 
 arch/powerpc/platforms/powermac/smp.c                 |    4 
 arch/powerpc/platforms/powermac/time.c                |    1 
 arch/powerpc/platforms/pseries/lpar.c                 |    4 
 arch/powerpc/platforms/pseries/setup.c                |    1 
 arch/powerpc/platforms/pseries/smp.c                  |    4 
 arch/powerpc/sysdev/cpm2.c                            |    1 
 arch/powerpc/sysdev/fsl_85xx_cache_sram.c             |    2 
 arch/powerpc/sysdev/mpic.c                            |    4 
 arch/powerpc/xmon/xmon.c                              |    1 
 arch/riscv/include/asm/fixmap.h                       |    4 
 arch/riscv/include/asm/io.h                           |    4 
 arch/riscv/include/asm/kasan.h                        |    4 
 arch/riscv/include/asm/pgtable-64.h                   |    7 
 arch/riscv/include/asm/pgtable.h                      |   22 
 arch/riscv/kernel/module.c                            |    2 
 arch/riscv/kernel/setup.c                             |    1 
 arch/riscv/kernel/soc.c                               |    2 
 arch/riscv/kernel/stacktrace.c                        |   23 
 arch/riscv/kernel/vdso.c                              |    4 
 arch/riscv/mm/cacheflush.c                            |    3 
 arch/riscv/mm/fault.c                                 |   14 
 arch/riscv/mm/init.c                                  |   31 
 arch/riscv/mm/kasan_init.c                            |    4 
 arch/riscv/mm/pageattr.c                              |    6 
 arch/riscv/mm/ptdump.c                                |    2 
 arch/s390/boot/ipl_parm.c                             |    4 
 arch/s390/boot/kaslr.c                                |    4 
 arch/s390/include/asm/hugetlb.h                       |    4 
 arch/s390/include/asm/kasan.h                         |    4 
 arch/s390/include/asm/pgtable.h                       |   15 
 arch/s390/include/asm/tlbflush.h                      |    1 
 arch/s390/kernel/asm-offsets.c                        |    4 
 arch/s390/kernel/dumpstack.c                          |   25 
 arch/s390/kernel/machine_kexec.c                      |    1 
 arch/s390/kernel/ptrace.c                             |    1 
 arch/s390/kernel/uv.c                                 |    4 
 arch/s390/kernel/vdso.c                               |    5 
 arch/s390/kvm/gaccess.c                               |    8 
 arch/s390/kvm/interrupt.c                             |    4 
 arch/s390/kvm/kvm-s390.c                              |   32 
 arch/s390/kvm/priv.c                                  |   38 
 arch/s390/mm/dump_pagetables.c                        |    1 
 arch/s390/mm/extmem.c                                 |    4 
 arch/s390/mm/fault.c                                  |   17 
 arch/s390/mm/gmap.c                                   |   80 
 arch/s390/mm/init.c                                   |    1 
 arch/s390/mm/kasan_init.c                             |    4 
 arch/s390/mm/pageattr.c                               |   13 
 arch/s390/mm/pgalloc.c                                |    2 
 arch/s390/mm/pgtable.c                                |    1 
 arch/s390/mm/vmem.c                                   |    1 
 arch/s390/pci/pci_mmio.c                              |    4 
 arch/sh/include/asm/io.h                              |    2 
 arch/sh/include/asm/kdebug.h                          |    6 
 arch/sh/include/asm/pgtable-3level.h                  |    7 
 arch/sh/include/asm/pgtable.h                         |    2 
 arch/sh/include/asm/pgtable_32.h                      |   25 
 arch/sh/include/asm/processor_32.h                    |    2 
 arch/sh/kernel/dumpstack.c                            |   54 
 arch/sh/kernel/machine_kexec.c                        |    1 
 arch/sh/kernel/process_32.c                           |    2 
 arch/sh/kernel/ptrace_32.c                            |    1 
 arch/sh/kernel/signal_32.c                            |    1 
 arch/sh/kernel/sys_sh.c                               |    6 
 arch/sh/kernel/traps.c                                |    4 
 arch/sh/kernel/vsyscall/vsyscall.c                    |    4 
 arch/sh/mm/cache-sh3.c                                |    1 
 arch/sh/mm/cache-sh4.c                                |   11 
 arch/sh/mm/cache-sh7705.c                             |    1 
 arch/sh/mm/fault.c                                    |   16 
 arch/sh/mm/kmap.c                                     |    5 
 arch/sh/mm/nommu.c                                    |    1 
 arch/sh/mm/pmb.c                                      |    4 
 arch/sparc/include/asm/floppy_32.h                    |    4 
 arch/sparc/include/asm/highmem.h                      |    4 
 arch/sparc/include/asm/ide.h                          |    2 
 arch/sparc/include/asm/io-unit.h                      |    4 
 arch/sparc/include/asm/pgalloc_32.h                   |    4 
 arch/sparc/include/asm/pgalloc_64.h                   |    2 
 arch/sparc/include/asm/pgtable_32.h                   |   34 
 arch/sparc/include/asm/pgtable_64.h                   |   32 
 arch/sparc/kernel/cpu.c                               |    4 
 arch/sparc/kernel/entry.S                             |    4 
 arch/sparc/kernel/head_64.S                           |    4 
 arch/sparc/kernel/ktlb.S                              |    4 
 arch/sparc/kernel/leon_smp.c                          |    1 
 arch/sparc/kernel/pci.c                               |    4 
 arch/sparc/kernel/process_32.c                        |   29 
 arch/sparc/kernel/process_64.c                        |    3 
 arch/sparc/kernel/ptrace_32.c                         |    1 
 arch/sparc/kernel/ptrace_64.c                         |    1 
 arch/sparc/kernel/setup_32.c                          |    1 
 arch/sparc/kernel/setup_64.c                          |    1 
 arch/sparc/kernel/signal32.c                          |    1 
 arch/sparc/kernel/signal_32.c                         |    1 
 arch/sparc/kernel/signal_64.c                         |    1 
 arch/sparc/kernel/smp_32.c                            |    1 
 arch/sparc/kernel/smp_64.c                            |    1 
 arch/sparc/kernel/sun4m_irq.c                         |    4 
 arch/sparc/kernel/trampoline_64.S                     |    4 
 arch/sparc/kernel/traps_32.c                          |    4 
 arch/sparc/kernel/traps_64.c                          |   24 
 arch/sparc/lib/clear_page.S                           |    4 
 arch/sparc/lib/copy_page.S                            |    2 
 arch/sparc/mm/fault_32.c                              |   21 
 arch/sparc/mm/fault_64.c                              |   17 
 arch/sparc/mm/highmem.c                               |   12 
 arch/sparc/mm/hugetlbpage.c                           |    1 
 arch/sparc/mm/init_32.c                               |    1 
 arch/sparc/mm/init_64.c                               |    7 
 arch/sparc/mm/io-unit.c                               |   11 
 arch/sparc/mm/iommu.c                                 |    9 
 arch/sparc/mm/tlb.c                                   |    1 
 arch/sparc/mm/tsb.c                                   |    4 
 arch/sparc/mm/ultra.S                                 |    4 
 arch/sparc/vdso/vma.c                                 |    4 
 arch/um/drivers/mconsole_kern.c                       |    2 
 arch/um/include/asm/mmu_context.h                     |    5 
 arch/um/include/asm/pgtable-3level.h                  |    4 
 arch/um/include/asm/pgtable.h                         |   69 
 arch/um/kernel/maccess.c                              |   12 
 arch/um/kernel/mem.c                                  |   10 
 arch/um/kernel/process.c                              |    1 
 arch/um/kernel/skas/mmu.c                             |    3 
 arch/um/kernel/skas/uaccess.c                         |    1 
 arch/um/kernel/sysrq.c                                |   35 
 arch/um/kernel/tlb.c                                  |    5 
 arch/um/kernel/trap.c                                 |   15 
 arch/um/kernel/um_arch.c                              |    1 
 arch/unicore32/include/asm/pgtable.h                  |   19 
 arch/unicore32/kernel/hibernate.c                     |    4 
 arch/unicore32/kernel/hibernate_asm.S                 |    4 
 arch/unicore32/kernel/module.c                        |    1 
 arch/unicore32/kernel/setup.h                         |    4 
 arch/unicore32/kernel/traps.c                         |   50 
 arch/unicore32/lib/backtrace.S                        |   24 
 arch/unicore32/mm/alignment.c                         |    4 
 arch/unicore32/mm/fault.c                             |    9 
 arch/unicore32/mm/mm.h                                |   10 
 arch/unicore32/mm/proc-ucv2.S                         |    4 
 arch/x86/boot/compressed/kaslr_64.c                   |    4 
 arch/x86/entry/vdso/vma.c                             |   14 
 arch/x86/events/core.c                                |    4 
 arch/x86/include/asm/agp.h                            |    2 
 arch/x86/include/asm/asm-prototypes.h                 |    4 
 arch/x86/include/asm/efi.h                            |    4 
 arch/x86/include/asm/iomap.h                          |    1 
 arch/x86/include/asm/kaslr.h                          |    2 
 arch/x86/include/asm/mmu.h                            |    2 
 arch/x86/include/asm/pgtable-3level.h                 |    8 
 arch/x86/include/asm/pgtable.h                        |   89 -
 arch/x86/include/asm/pgtable_32.h                     |   11 
 arch/x86/include/asm/pgtable_64.h                     |    4 
 arch/x86/include/asm/setup.h                          |   12 
 arch/x86/include/asm/stacktrace.h                     |    2 
 arch/x86/include/asm/uaccess.h                        |   16 
 arch/x86/include/asm/xen/hypercall.h                  |    4 
 arch/x86/include/asm/xen/page.h                       |    1 
 arch/x86/kernel/acpi/boot.c                           |    4 
 arch/x86/kernel/acpi/sleep.c                          |    4 
 arch/x86/kernel/alternative.c                         |    1 
 arch/x86/kernel/amd_gart_64.c                         |    5 
 arch/x86/kernel/apic/apic_numachip.c                  |    4 
 arch/x86/kernel/cpu/bugs.c                            |    4 
 arch/x86/kernel/cpu/common.c                          |    4 
 arch/x86/kernel/cpu/intel.c                           |    4 
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c             |    6 
 arch/x86/kernel/cpu/resctrl/rdtgroup.c                |    6 
 arch/x86/kernel/crash_core_32.c                       |    4 
 arch/x86/kernel/crash_core_64.c                       |    4 
 arch/x86/kernel/doublefault_32.c                      |    1 
 arch/x86/kernel/dumpstack.c                           |   21 
 arch/x86/kernel/early_printk.c                        |    4 
 arch/x86/kernel/espfix_64.c                           |    2 
 arch/x86/kernel/head64.c                              |    4 
 arch/x86/kernel/head_64.S                             |    4 
 arch/x86/kernel/i8259.c                               |    4 
 arch/x86/kernel/irqinit.c                             |    4 
 arch/x86/kernel/kprobes/core.c                        |    4 
 arch/x86/kernel/kprobes/opt.c                         |    4 
 arch/x86/kernel/ldt.c                                 |    2 
 arch/x86/kernel/machine_kexec_32.c                    |    1 
 arch/x86/kernel/machine_kexec_64.c                    |    1 
 arch/x86/kernel/module.c                              |    1 
 arch/x86/kernel/paravirt.c                            |    4 
 arch/x86/kernel/process_32.c                          |    1 
 arch/x86/kernel/process_64.c                          |    1 
 arch/x86/kernel/ptrace.c                              |    1 
 arch/x86/kernel/reboot.c                              |    4 
 arch/x86/kernel/smpboot.c                             |    4 
 arch/x86/kernel/tboot.c                               |    3 
 arch/x86/kernel/vm86_32.c                             |    4 
 arch/x86/kvm/mmu/paging_tmpl.h                        |    8 
 arch/x86/mm/cpu_entry_area.c                          |    4 
 arch/x86/mm/debug_pagetables.c                        |    2 
 arch/x86/mm/dump_pagetables.c                         |    1 
 arch/x86/mm/fault.c                                   |   22 
 arch/x86/mm/init.c                                    |   22 
 arch/x86/mm/init_32.c                                 |   27 
 arch/x86/mm/init_64.c                                 |    1 
 arch/x86/mm/ioremap.c                                 |    4 
 arch/x86/mm/kasan_init_64.c                           |    1 
 arch/x86/mm/kaslr.c                                   |   37 
 arch/x86/mm/maccess.c                                 |   44 
 arch/x86/mm/mem_encrypt_boot.S                        |    2 
 arch/x86/mm/mmio-mod.c                                |    4 
 arch/x86/mm/pat/cpa-test.c                            |    1 
 arch/x86/mm/pat/memtype.c                             |    1 
 arch/x86/mm/pat/memtype_interval.c                    |    4 
 arch/x86/mm/pgtable.c                                 |    1 
 arch/x86/mm/pgtable_32.c                              |    1 
 arch/x86/mm/pti.c                                     |    1 
 arch/x86/mm/setup_nx.c                                |    4 
 arch/x86/platform/efi/efi_32.c                        |    4 
 arch/x86/platform/efi/efi_64.c                        |    1 
 arch/x86/platform/olpc/olpc_ofw.c                     |    4 
 arch/x86/power/cpu.c                                  |    4 
 arch/x86/power/hibernate.c                            |    4 
 arch/x86/power/hibernate_32.c                         |    4 
 arch/x86/power/hibernate_64.c                         |    4 
 arch/x86/realmode/init.c                              |    4 
 arch/x86/um/vdso/vma.c                                |    4 
 arch/x86/xen/enlighten_pv.c                           |    1 
 arch/x86/xen/grant-table.c                            |    1 
 arch/x86/xen/mmu_pv.c                                 |    4 
 arch/x86/xen/smp_pv.c                                 |    2 
 arch/xtensa/include/asm/fixmap.h                      |   12 
 arch/xtensa/include/asm/highmem.h                     |    4 
 arch/xtensa/include/asm/initialize_mmu.h              |    2 
 arch/xtensa/include/asm/mmu_context.h                 |    4 
 arch/xtensa/include/asm/pgtable.h                     |   20 
 arch/xtensa/kernel/entry.S                            |    4 
 arch/xtensa/kernel/process.c                          |    1 
 arch/xtensa/kernel/ptrace.c                           |    1 
 arch/xtensa/kernel/setup.c                            |    1 
 arch/xtensa/kernel/traps.c                            |   42 
 arch/xtensa/kernel/vectors.S                          |    4 
 arch/xtensa/mm/cache.c                                |    4 
 arch/xtensa/mm/fault.c                                |   12 
 arch/xtensa/mm/highmem.c                              |    2 
 arch/xtensa/mm/ioremap.c                              |    4 
 arch/xtensa/mm/kasan_init.c                           |   10 
 arch/xtensa/mm/misc.S                                 |    4 
 arch/xtensa/mm/mmu.c                                  |    5 
 drivers/acpi/scan.c                                   |    3 
 drivers/android/binder_alloc.c                        |   14 
 drivers/atm/fore200e.c                                |    4 
 drivers/base/power/main.c                             |    4 
 drivers/block/z2ram.c                                 |    4 
 drivers/char/agp/frontend.c                           |    1 
 drivers/char/agp/generic.c                            |    1 
 drivers/char/bsr.c                                    |    1 
 drivers/char/mspec.c                                  |    3 
 drivers/dma-buf/dma-resv.c                            |    5 
 drivers/firmware/efi/arm-runtime.c                    |    4 
 drivers/firmware/efi/efi.c                            |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h            |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c     |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c     |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c      |    4 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c               |   10 
 drivers/gpu/drm/amd/amdkfd/kfd_events.c               |    4 
 drivers/gpu/drm/drm_vm.c                              |    4 
 drivers/gpu/drm/etnaviv/etnaviv_gem.c                 |    2 
 drivers/gpu/drm/i915/gem/i915_gem_mman.c              |    4 
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c           |   14 
 drivers/gpu/drm/i915/i915_mm.c                        |    1 
 drivers/gpu/drm/i915/i915_perf.c                      |    2 
 drivers/gpu/drm/nouveau/nouveau_svm.c                 |   22 
 drivers/gpu/drm/radeon/radeon_cs.c                    |    4 
 drivers/gpu/drm/radeon/radeon_gem.c                   |    6 
 drivers/gpu/drm/ttm/ttm_bo_vm.c                       |   10 
 drivers/infiniband/core/umem_odp.c                    |    4 
 drivers/infiniband/core/uverbs_main.c                 |    6 
 drivers/infiniband/hw/hfi1/mmu_rb.c                   |    2 
 drivers/infiniband/hw/mlx4/mr.c                       |    4 
 drivers/infiniband/hw/qib/qib_file_ops.c              |    4 
 drivers/infiniband/hw/qib/qib_user_pages.c            |    6 
 drivers/infiniband/hw/usnic/usnic_uiom.c              |    4 
 drivers/infiniband/sw/rdmavt/mmap.c                   |    1 
 drivers/infiniband/sw/rxe/rxe_mmap.c                  |    1 
 drivers/infiniband/sw/siw/siw_mem.c                   |    4 
 drivers/iommu/amd_iommu_v2.c                          |    4 
 drivers/iommu/intel-svm.c                             |    4 
 drivers/macintosh/macio-adb.c                         |    4 
 drivers/macintosh/mediabay.c                          |    4 
 drivers/macintosh/via-pmu.c                           |    4 
 drivers/media/pci/bt8xx/bt878.c                       |    4 
 drivers/media/pci/bt8xx/btcx-risc.c                   |    4 
 drivers/media/pci/bt8xx/bttv-risc.c                   |    4 
 drivers/media/platform/davinci/vpbe_display.c         |    1 
 drivers/media/v4l2-core/v4l2-common.c                 |    1 
 drivers/media/v4l2-core/videobuf-core.c               |    4 
 drivers/media/v4l2-core/videobuf-dma-contig.c         |    4 
 drivers/media/v4l2-core/videobuf-dma-sg.c             |   10 
 drivers/media/v4l2-core/videobuf-vmalloc.c            |    4 
 drivers/misc/cxl/cxllib.c                             |    9 
 drivers/misc/cxl/fault.c                              |    4 
 drivers/misc/genwqe/card_utils.c                      |    2 
 drivers/misc/sgi-gru/grufault.c                       |   25 
 drivers/misc/sgi-gru/grufile.c                        |    4 
 drivers/mtd/ubi/ubi.h                                 |    2 
 drivers/net/ethernet/amd/7990.c                       |    4 
 drivers/net/ethernet/amd/hplance.c                    |    4 
 drivers/net/ethernet/amd/mvme147.c                    |    4 
 drivers/net/ethernet/amd/sun3lance.c                  |    4 
 drivers/net/ethernet/amd/sunlance.c                   |    4 
 drivers/net/ethernet/apple/bmac.c                     |    4 
 drivers/net/ethernet/apple/mace.c                     |    4 
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |    4 
 drivers/net/ethernet/freescale/fs_enet/mac-fcc.c      |    4 
 drivers/net/ethernet/freescale/fs_enet/mii-fec.c      |    4 
 drivers/net/ethernet/i825xx/82596.c                   |    4 
 drivers/net/ethernet/korina.c                         |    4 
 drivers/net/ethernet/marvell/pxa168_eth.c             |    4 
 drivers/net/ethernet/natsemi/jazzsonic.c              |    4 
 drivers/net/ethernet/natsemi/macsonic.c               |    4 
 drivers/net/ethernet/natsemi/xtsonic.c                |    4 
 drivers/net/ethernet/sun/sunbmac.c                    |    4 
 drivers/net/ethernet/sun/sunhme.c                     |    1 
 drivers/net/ethernet/sun/sunqe.c                      |    4 
 drivers/oprofile/buffer_sync.c                        |   12 
 drivers/sbus/char/flash.c                             |    1 
 drivers/sbus/char/uctrl.c                             |    1 
 drivers/scsi/53c700.c                                 |    4 
 drivers/scsi/a2091.c                                  |    1 
 drivers/scsi/a3000.c                                  |    1 
 drivers/scsi/arm/cumana_2.c                           |    4 
 drivers/scsi/arm/eesox.c                              |    4 
 drivers/scsi/arm/powertec.c                           |    4 
 drivers/scsi/dpt_i2o.c                                |    4 
 drivers/scsi/gvp11.c                                  |    1 
 drivers/scsi/lasi700.c                                |    1 
 drivers/scsi/mac53c94.c                               |    4 
 drivers/scsi/mesh.c                                   |    4 
 drivers/scsi/mvme147.c                                |    1 
 drivers/scsi/qlogicpti.c                              |    4 
 drivers/scsi/sni_53c710.c                             |    1 
 drivers/scsi/zorro_esp.c                              |    4 
 drivers/staging/android/ashmem.c                      |    4 
 drivers/staging/comedi/comedi_fops.c                  |    2 
 drivers/staging/kpc2000/kpc_dma/fileops.c             |    4 
 drivers/staging/media/atomisp/pci/hmm/hmm_bo.c        |    4 
 drivers/tee/optee/call.c                              |    4 
 drivers/tty/sysrq.c                                   |    4 
 drivers/tty/vt/consolemap.c                           |    2 
 drivers/vfio/pci/vfio_pci.c                           |   22 
 drivers/vfio/vfio_iommu_type1.c                       |    8 
 drivers/vhost/vdpa.c                                  |    4 
 drivers/video/console/newport_con.c                   |    1 
 drivers/video/fbdev/acornfb.c                         |    1 
 drivers/video/fbdev/atafb.c                           |    1 
 drivers/video/fbdev/cirrusfb.c                        |    1 
 drivers/video/fbdev/cyber2000fb.c                     |    1 
 drivers/video/fbdev/fb-puv3.c                         |    1 
 drivers/video/fbdev/hitfb.c                           |    1 
 drivers/video/fbdev/neofb.c                           |    1 
 drivers/video/fbdev/q40fb.c                           |    1 
 drivers/video/fbdev/savage/savagefb_driver.c          |    1 
 drivers/xen/balloon.c                                 |    1 
 drivers/xen/gntdev.c                                  |    6 
 drivers/xen/grant-table.c                             |    1 
 drivers/xen/privcmd.c                                 |   15 
 drivers/xen/xenbus/xenbus_probe.c                     |    1 
 drivers/xen/xenbus/xenbus_probe_backend.c             |    1 
 drivers/xen/xenbus/xenbus_probe_frontend.c            |    1 
 fs/aio.c                                              |    4 
 fs/coredump.c                                         |    8 
 fs/exec.c                                             |   18 
 fs/ext2/file.c                                        |    2 
 fs/ext4/super.c                                       |    6 
 fs/hugetlbfs/inode.c                                  |    2 
 fs/io_uring.c                                         |    4 
 fs/kernfs/file.c                                      |    4 
 fs/proc/array.c                                       |    1 
 fs/proc/base.c                                        |   24 
 fs/proc/meminfo.c                                     |    1 
 fs/proc/nommu.c                                       |    1 
 fs/proc/task_mmu.c                                    |   34 
 fs/proc/task_nommu.c                                  |   18 
 fs/proc/vmcore.c                                      |    1 
 fs/userfaultfd.c                                      |   46 
 fs/xfs/xfs_file.c                                     |    2 
 fs/xfs/xfs_inode.c                                    |   14 
 fs/xfs/xfs_iops.c                                     |    4 
 include/asm-generic/io.h                              |    2 
 include/asm-generic/pgtable-nopmd.h                   |    1 
 include/asm-generic/pgtable-nopud.h                   |    1 
 include/asm-generic/pgtable.h                         | 1322 ----------------
 include/linux/cache.h                                 |   10 
 include/linux/crash_dump.h                            |    3 
 include/linux/dax.h                                   |    1 
 include/linux/dma-noncoherent.h                       |    2 
 include/linux/fs.h                                    |    4 
 include/linux/hmm.h                                   |    2 
 include/linux/huge_mm.h                               |    2 
 include/linux/hugetlb.h                               |    2 
 include/linux/io-mapping.h                            |    4 
 include/linux/kallsyms.h                              |    4 
 include/linux/kasan.h                                 |    4 
 include/linux/mempolicy.h                             |    2 
 include/linux/mm.h                                    |   15 
 include/linux/mm_types.h                              |    4 
 include/linux/mmap_lock.h                             |  128 +
 include/linux/mmu_notifier.h                          |   13 
 include/linux/pagemap.h                               |    2 
 include/linux/pgtable.h                               | 1444 +++++++++++++++++-
 include/linux/rmap.h                                  |    2 
 include/linux/sched/debug.h                           |    7 
 include/linux/sched/mm.h                              |   10 
 include/linux/uaccess.h                               |   62 
 include/xen/arm/page.h                                |    4 
 init/init_task.c                                      |    1 
 ipc/shm.c                                             |    8 
 kernel/acct.c                                         |    6 
 kernel/bpf/stackmap.c                                 |   21 
 kernel/bpf/syscall.c                                  |    2 
 kernel/cgroup/cpuset.c                                |    4 
 kernel/debug/kdb/kdb_bt.c                             |   17 
 kernel/events/core.c                                  |   10 
 kernel/events/uprobes.c                               |   20 
 kernel/exit.c                                         |   11 
 kernel/fork.c                                         |   15 
 kernel/futex.c                                        |    4 
 kernel/locking/lockdep.c                              |    4 
 kernel/locking/rtmutex-debug.c                        |    4 
 kernel/power/snapshot.c                               |    1 
 kernel/relay.c                                        |    2 
 kernel/sched/core.c                                   |   10 
 kernel/sched/fair.c                                   |    4 
 kernel/sys.c                                          |   22 
 kernel/trace/bpf_trace.c                              |  176 +-
 kernel/trace/ftrace.c                                 |    8 
 kernel/trace/trace_kprobe.c                           |   80 
 kernel/trace/trace_output.c                           |    4 
 lib/dump_stack.c                                      |    4 
 lib/ioremap.c                                         |    1 
 lib/test_hmm.c                                        |   14 
 lib/test_lockup.c                                     |   16 
 mm/debug.c                                            |   10 
 mm/debug_vm_pgtable.c                                 |    1 
 mm/filemap.c                                          |   46 
 mm/frame_vector.c                                     |    6 
 mm/gup.c                                              |   73 
 mm/hmm.c                                              |    2 
 mm/huge_memory.c                                      |    8 
 mm/hugetlb.c                                          |    3 
 mm/init-mm.c                                          |    6 
 mm/internal.h                                         |    6 
 mm/khugepaged.c                                       |   72 
 mm/ksm.c                                              |   48 
 mm/maccess.c                                          |  496 +++---
 mm/madvise.c                                          |   40 
 mm/memcontrol.c                                       |   10 
 mm/memory.c                                           |   61 
 mm/mempolicy.c                                        |   36 
 mm/migrate.c                                          |   16 
 mm/mincore.c                                          |    8 
 mm/mlock.c                                            |   22 
 mm/mmap.c                                             |   74 
 mm/mmu_gather.c                                       |    2 
 mm/mmu_notifier.c                                     |   22 
 mm/mprotect.c                                         |   22 
 mm/mremap.c                                           |   14 
 mm/msync.c                                            |    8 
 mm/nommu.c                                            |   22 
 mm/oom_kill.c                                         |   14 
 mm/page_io.c                                          |    1 
 mm/page_reporting.h                                   |    2 
 mm/pagewalk.c                                         |   12 
 mm/pgtable-generic.c                                  |    6 
 mm/process_vm_access.c                                |    4 
 mm/ptdump.c                                           |    4 
 mm/rmap.c                                             |   12 
 mm/shmem.c                                            |    5 
 mm/sparse-vmemmap.c                                   |    1 
 mm/sparse.c                                           |    1 
 mm/swap_state.c                                       |    5 
 mm/swapfile.c                                         |    5 
 mm/userfaultfd.c                                      |   26 
 mm/util.c                                             |   12 
 mm/vmacache.c                                         |    1 
 mm/zsmalloc.c                                         |    4 
 net/ipv4/tcp.c                                        |    8 
 net/xdp/xdp_umem.c                                    |    4 
 security/keys/keyctl.c                                |    2 
 sound/core/oss/pcm_oss.c                              |    2 
 sound/core/sgbuf.c                                    |    1 
 sound/pci/hda/hda_intel.c                             |    4 
 sound/soc/intel/common/sst-firmware.c                 |    4 
 sound/soc/intel/haswell/sst-haswell-pcm.c             |    4 
 tools/include/linux/kallsyms.h                        |    2 
 virt/kvm/async_pf.c                                   |    4 
 virt/kvm/kvm_main.c                                   |    9 
 942 files changed, 4580 insertions(+), 5662 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 01/93] kallsyms/printk: add loglvl to print_ip_sym()
  2020-06-09  4:29 incoming Andrew Morton
@ 2020-06-09  4:29 ` Andrew Morton
  2020-06-09  4:30 ` [patch 02/93] alpha: add show_stack_loglvl() Andrew Morton
                   ` (94 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:29 UTC (permalink / raw)
  To: 0x7f454c46, akpm, anton.ivanov, aou, bcain, benh, borntraeger,
	bp, bsegall, catalin.marinas, chris, dalias, daniel.thompson,
	davem, deanbo422, deller, dianders, dietmar.eggemann, dima,
	fenghua.yu, geert, gor, green.hu, gregkh, guoren, gxt,
	heiko.carstens, hpa, ink, jacquiot.aurelien, James.Bottomley,
	jason.wessel, jcmvbkbc, jdike, jhogan, jonas, jslaby, juri.lelli,
	len.brown, lftan, linux-mm, linux, mattst88, mgorman, mingo,
	mm-commits, monstr, mpe, msalter, palmer, paul.walmsley,
	paulburton, paulus, pavel, peterz, pmladek, rafael.j.wysocki,
	ralf, richard, rjw, rostedt, rth, sergey.senozhatsky, shorne,
	stefan.kristiansson, tglx, tony.luck, torvalds, vgupta,
	vincent.guittot, will, ysato

From: Dmitry Safonov <dima@arista.com>
Subject: kallsyms/printk: add loglvl to print_ip_sym()

Patch series "Add log level to show_stack()", v3.

Add log level argument to show_stack().

Done in three stages:
1. Introducing show_stack_loglvl() for every architecture
2. Migrating old users with an explicit log level
3. Renaming show_stack_loglvl() into show_stack()

Justification:

- It's a design mistake to move a business-logic decision into platform
  realization detail.

- I have currently two patches sets that would benefit from this work:
  Removing console_loglevel jumps in sysrq driver [1] Hung task warning
  before panic [2] - suggested by Tetsuo (but he probably didn't realise
  what it would involve).

- While doing (1), (2) the backtraces were adjusted to headers and other
  messages for each situation - so there won't be a situation when the
  backtrace is printed, but the headers are missing because they have
  lesser log level (or the reverse).

- As the result in (2) plays with console_loglevel for kdb are removed.

The least important for upstream, but maybe still worth to note that every
company I've worked in so far had an off-list patch to print backtrace
with the needed log level (but only for the architecture they cared
about).  If you have other ideas how you will benefit from show_stack()
with a log level - please, reply to this cover letter.

See also discussion on v1:
https://lore.kernel.org/linux-riscv/20191106083538.z5nlpuf64cigxigh@pathway.suse.cz/


This patch (of 50):

print_ip_sym() needs to have a log level parameter to comply with other
parts being printed.  Otherwise, half of the expected backtrace would be
printed and other may be missing with some logging level.

The following callee(s) are using now the adjusted log level:
- microblaze/unwind: the same level as headers & userspace unwind.
  Note that pr_debug()'s there are for debugging the unwinder itself.
- nds32/traps: symbol addresses are printed with the same log level
  as backtrace headers.
- lockdep: ip for locking issues is printed with the same log level
  as other part of the warning.
- sched: ip where preemption was disabled is printed as error like
  the rest part of the message.
- ftrace: bug reports are now consistent in the log level being used.

Link: http://lkml.kernel.org/r/20200418201944.482088-2-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Ben Segall <bsegall@google.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Will Deacon <will@kernel.org>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Dmitry Safonov <dima@arista.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Guo Ren <guoren@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Rich Felker <dalias@libc.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/microblaze/kernel/unwind.c |    2 +-
 arch/mips/kernel/traps.c        |    4 ++--
 arch/nds32/kernel/traps.c       |    4 ++--
 arch/riscv/kernel/stacktrace.c  |    2 +-
 include/linux/kallsyms.h        |    4 ++--
 kernel/locking/lockdep.c        |    4 ++--
 kernel/sched/core.c             |    6 ++----
 kernel/trace/ftrace.c           |    8 ++++----
 tools/include/linux/kallsyms.h  |    2 +-
 9 files changed, 17 insertions(+), 19 deletions(-)

--- a/arch/microblaze/kernel/unwind.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/arch/microblaze/kernel/unwind.c
@@ -254,7 +254,7 @@ static void microblaze_unwind_inner(stru
 					task->comm);
 				break;
 			} else
-				print_ip_sym(pc);
+				print_ip_sym(KERN_INFO, pc);
 		}
 
 		/* Stop when we reach anything not part of the kernel */
--- a/arch/mips/kernel/traps.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/arch/mips/kernel/traps.c
@@ -125,7 +125,7 @@ static void show_raw_backtrace(unsigned
 			break;
 		}
 		if (__kernel_text_address(addr))
-			print_ip_sym(addr);
+			print_ip_sym(KERN_DEFAULT, addr);
 	}
 	printk("\n");
 }
@@ -155,7 +155,7 @@ static void show_backtrace(struct task_s
 	}
 	printk("Call Trace:\n");
 	do {
-		print_ip_sym(pc);
+		print_ip_sym(KERN_DEFAULT, pc);
 		pc = unwind_stack(task, &sp, pc, &ra);
 	} while (pc);
 	pr_cont("\n");
--- a/arch/nds32/kernel/traps.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/arch/nds32/kernel/traps.c
@@ -108,7 +108,7 @@ static void __dump(struct task_struct *t
 			if (__kernel_text_address(ret_addr)) {
 				ret_addr = ftrace_graph_ret_addr(
 						tsk, &graph, ret_addr, NULL);
-				print_ip_sym(ret_addr);
+				print_ip_sym(KERN_EMERG, ret_addr);
 			}
 			if (--cnt < 0)
 				break;
@@ -124,7 +124,7 @@ static void __dump(struct task_struct *t
 
 				ret_addr = ftrace_graph_ret_addr(
 						tsk, &graph, ret_addr, NULL);
-				print_ip_sym(ret_addr);
+				print_ip_sym(KERN_EMERG, ret_addr);
 			}
 			if (--cnt < 0)
 				break;
--- a/arch/riscv/kernel/stacktrace.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/arch/riscv/kernel/stacktrace.c
@@ -99,7 +99,7 @@ void notrace walk_stackframe(struct task
 
 static bool print_trace_address(unsigned long pc, void *arg)
 {
-	print_ip_sym(pc);
+	print_ip_sym(KERN_DEFAULT, pc);
 	return false;
 }
 
--- a/include/linux/kallsyms.h~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/include/linux/kallsyms.h
@@ -165,9 +165,9 @@ static inline int kallsyms_show_value(vo
 
 #endif /*CONFIG_KALLSYMS*/
 
-static inline void print_ip_sym(unsigned long ip)
+static inline void print_ip_sym(const char *loglvl, unsigned long ip)
 {
-	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
+	printk("%s[<%px>] %pS\n", loglvl, (void *) ip, (void *) ip);
 }
 
 #endif /*_LINUX_KALLSYMS_H*/
--- a/kernel/locking/lockdep.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/kernel/locking/lockdep.c
@@ -4424,7 +4424,7 @@ static void print_unlock_imbalance_bug(s
 		curr->comm, task_pid_nr(curr));
 	print_lockdep_cache(lock);
 	pr_cont(") at:\n");
-	print_ip_sym(ip);
+	print_ip_sym(KERN_WARNING, ip);
 	pr_warn("but there are no more locks to release!\n");
 	pr_warn("\nother info that might help us debug this:\n");
 	lockdep_print_held_locks(curr);
@@ -5075,7 +5075,7 @@ static void print_lock_contention_bug(st
 		curr->comm, task_pid_nr(curr));
 	print_lockdep_cache(lock);
 	pr_cont(") at:\n");
-	print_ip_sym(ip);
+	print_ip_sym(KERN_WARNING, ip);
 	pr_warn("but there are no locks held!\n");
 	pr_warn("\nother info that might help us debug this:\n");
 	lockdep_print_held_locks(curr);
--- a/kernel/sched/core.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/kernel/sched/core.c
@@ -3922,8 +3922,7 @@ static noinline void __schedule_bug(stru
 	if (IS_ENABLED(CONFIG_DEBUG_PREEMPT)
 	    && in_atomic_preempt_off()) {
 		pr_err("Preemption disabled at:");
-		print_ip_sym(preempt_disable_ip);
-		pr_cont("\n");
+		print_ip_sym(KERN_ERR, preempt_disable_ip);
 	}
 	if (panic_on_warn)
 		panic("scheduling while atomic\n");
@@ -6871,8 +6870,7 @@ void ___might_sleep(const char *file, in
 	if (IS_ENABLED(CONFIG_DEBUG_PREEMPT)
 	    && !preempt_count_equals(preempt_offset)) {
 		pr_err("Preemption disabled at:");
-		print_ip_sym(preempt_disable_ip);
-		pr_cont("\n");
+		print_ip_sym(KERN_ERR, preempt_disable_ip);
 	}
 	dump_stack();
 	add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
--- a/kernel/trace/ftrace.c~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/kernel/trace/ftrace.c
@@ -2020,12 +2020,12 @@ void ftrace_bug(int failed, struct dyn_f
 	case -EFAULT:
 		FTRACE_WARN_ON_ONCE(1);
 		pr_info("ftrace faulted on modifying ");
-		print_ip_sym(ip);
+		print_ip_sym(KERN_INFO, ip);
 		break;
 	case -EINVAL:
 		FTRACE_WARN_ON_ONCE(1);
 		pr_info("ftrace failed to modify ");
-		print_ip_sym(ip);
+		print_ip_sym(KERN_INFO, ip);
 		print_ip_ins(" actual:   ", (unsigned char *)ip);
 		pr_cont("\n");
 		if (ftrace_expected) {
@@ -2036,12 +2036,12 @@ void ftrace_bug(int failed, struct dyn_f
 	case -EPERM:
 		FTRACE_WARN_ON_ONCE(1);
 		pr_info("ftrace faulted on writing ");
-		print_ip_sym(ip);
+		print_ip_sym(KERN_INFO, ip);
 		break;
 	default:
 		FTRACE_WARN_ON_ONCE(1);
 		pr_info("ftrace faulted on unknown error ");
-		print_ip_sym(ip);
+		print_ip_sym(KERN_INFO, ip);
 	}
 	print_bug_type();
 	if (rec) {
--- a/tools/include/linux/kallsyms.h~kallsyms-printk-add-loglvl-to-print_ip_sym
+++ a/tools/include/linux/kallsyms.h
@@ -20,7 +20,7 @@ static inline const char *kallsyms_looku
 
 #include <execinfo.h>
 #include <stdlib.h>
-static inline void print_ip_sym(unsigned long ip)
+static inline void print_ip_sym(const char *loglvl, unsigned long ip)
 {
 	char **name;
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 02/93] alpha: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
  2020-06-09  4:29 ` [patch 01/93] kallsyms/printk: add loglvl to print_ip_sym() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 03/93] arc: " Andrew Morton
                   ` (93 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, ink, linux-mm, mattst88, mm-commits, rth, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: alpha: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-3-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/kernel/traps.c |   28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

--- a/arch/alpha/kernel/traps.c~alpha-add-show_stack_loglvl
+++ a/arch/alpha/kernel/traps.c
@@ -121,10 +121,10 @@ dik_show_code(unsigned int *pc)
 }
 
 static void
-dik_show_trace(unsigned long *sp)
+dik_show_trace(unsigned long *sp, const char *loglvl)
 {
 	long i = 0;
-	printk("Trace:\n");
+	printk("%sTrace:\n", loglvl);
 	while (0x1ff8 & (unsigned long) sp) {
 		extern char _stext[], _etext[];
 		unsigned long tmp = *sp;
@@ -133,24 +133,25 @@ dik_show_trace(unsigned long *sp)
 			continue;
 		if (tmp >= (unsigned long) &_etext)
 			continue;
-		printk("[<%lx>] %pSR\n", tmp, (void *)tmp);
+		printk("%s[<%lx>] %pSR\n", loglvl, tmp, (void *)tmp);
 		if (i > 40) {
-			printk(" ...");
+			printk("%s ...", loglvl);
 			break;
 		}
 	}
-	printk("\n");
+	printk("%s\n", loglvl);
 }
 
 static int kstack_depth_to_print = 24;
 
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+			const char *loglvl)
 {
 	unsigned long *stack;
 	int i;
 
 	/*
-	 * debugging aid: "show_stack(NULL);" prints the
+	 * debugging aid: "show_stack(NULL, NULL, KERN_EMERG);" prints the
 	 * back trace for this cpu.
 	 */
 	if(sp==NULL)
@@ -163,14 +164,19 @@ void show_stack(struct task_struct *task
 		if ((i % 4) == 0) {
 			if (i)
 				pr_cont("\n");
-			printk("       ");
+			printk("%s       ", loglvl);
 		} else {
 			pr_cont(" ");
 		}
 		pr_cont("%016lx", *stack++);
 	}
 	pr_cont("\n");
-	dik_show_trace(sp);
+	dik_show_trace(sp, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
 }
 
 void
@@ -184,7 +190,7 @@ die_if_kernel(char * str, struct pt_regs
 	printk("%s(%d): %s %ld\n", current->comm, task_pid_nr(current), str, err);
 	dik_show_regs(regs, r9_15);
 	add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
-	dik_show_trace((unsigned long *)(regs+1));
+	dik_show_trace((unsigned long *)(regs+1), KERN_DEFAULT);
 	dik_show_code((unsigned int *)regs->pc);
 
 	if (test_and_set_thread_flag (TIF_DIE_IF_KERNEL)) {
@@ -625,7 +631,7 @@ got_exception:
 	printk("gp = %016lx  sp = %p\n", regs->gp, regs+1);
 
 	dik_show_code((unsigned int *)pc);
-	dik_show_trace((unsigned long *)(regs+1));
+	dik_show_trace((unsigned long *)(regs+1), KERN_DEFAULT);
 
 	if (test_and_set_thread_flag (TIF_DIE_IF_KERNEL)) {
 		printk("die_if_kernel recursion detected.\n");
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 03/93] arc: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
  2020-06-09  4:29 ` [patch 01/93] kallsyms/printk: add loglvl to print_ip_sym() Andrew Morton
  2020-06-09  4:30 ` [patch 02/93] alpha: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 04/93] arm/asm: add loglvl to c_backtrace() Andrew Morton
                   ` (92 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mm-commits, torvalds, vgupta

From: Dmitry Safonov <dima@arista.com>
Subject: arc: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

As a good side-effect header "Stack Trace:" is now printed with the same
log level as the rest of backtrace.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-4-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arc/include/asm/bug.h     |    3 ++-
 arch/arc/kernel/stacktrace.c   |   21 +++++++++++++++------
 arch/arc/kernel/troubleshoot.c |    2 +-
 3 files changed, 18 insertions(+), 8 deletions(-)

--- a/arch/arc/include/asm/bug.h~arc-add-show_stack_loglvl
+++ a/arch/arc/include/asm/bug.h
@@ -13,7 +13,8 @@
 struct task_struct;
 
 void show_regs(struct pt_regs *regs);
-void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs);
+void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs,
+		     const char *loglvl);
 void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
 			    unsigned long address);
 void die(const char *str, struct pt_regs *regs, unsigned long address);
--- a/arch/arc/kernel/stacktrace.c~arc-add-show_stack_loglvl
+++ a/arch/arc/kernel/stacktrace.c
@@ -158,9 +158,11 @@ arc_unwind_core(struct task_struct *tsk,
 /* Call-back which plugs into unwinding core to dump the stack in
  * case of panic/OOPs/BUG etc
  */
-static int __print_sym(unsigned int address, void *unused)
+static int __print_sym(unsigned int address, void *arg)
 {
-	printk("  %pS\n", (void *)address);
+	const char *loglvl = arg;
+
+	printk("%s  %pS\n", loglvl, (void *)address);
 	return 0;
 }
 
@@ -217,17 +219,24 @@ static int __get_first_nonsched(unsigned
  *-------------------------------------------------------------------------
  */
 
-noinline void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs)
+noinline void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs,
+			      const char *loglvl)
 {
-	pr_info("\nStack Trace:\n");
-	arc_unwind_core(tsk, regs, __print_sym, NULL);
+	printk("%s\nStack Trace:\n", loglvl);
+	arc_unwind_core(tsk, regs, __print_sym, (void *)loglvl);
 }
 EXPORT_SYMBOL(show_stacktrace);
 
 /* Expected by sched Code */
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+			const char *loglvl)
+{
+	show_stacktrace(tsk, NULL, loglvl);
+}
+
 void show_stack(struct task_struct *tsk, unsigned long *sp)
 {
-	show_stacktrace(tsk, NULL);
+	show_stack_loglvl(tsk, sp, KERN_DEFAULT);
 }
 
 /* Another API expected by schedular, shows up in "ps" as Wait Channel
--- a/arch/arc/kernel/troubleshoot.c~arc-add-show_stack_loglvl
+++ a/arch/arc/kernel/troubleshoot.c
@@ -240,5 +240,5 @@ void show_kernel_fault_diag(const char *
 
 	/* Show stack trace if this Fatality happened in kernel mode */
 	if (!user_mode(regs))
-		show_stacktrace(current, regs);
+		show_stacktrace(current, regs, KERN_DEFAULT);
 }
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 04/93] arm/asm: add loglvl to c_backtrace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (2 preceding siblings ...)
  2020-06-09  4:30 ` [patch 03/93] arc: " Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 05/93] arm: add loglvl to unwind_backtrace() Andrew Morton
                   ` (91 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm/asm: add loglvl to c_backtrace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to c_backtrace() as a preparation for introducing
show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-5-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/include/asm/bug.h     |    3 ++-
 arch/arm/include/asm/traps.h   |    3 ++-
 arch/arm/kernel/traps.c        |    9 +++++----
 arch/arm/kernel/unwind.c       |    2 +-
 arch/arm/lib/backtrace-clang.S |    9 +++++++--
 arch/arm/lib/backtrace.S       |   14 ++++++++++----
 6 files changed, 27 insertions(+), 13 deletions(-)

--- a/arch/arm/include/asm/bug.h~arm-asm-add-loglvl-to-c_backtrace
+++ a/arch/arm/include/asm/bug.h
@@ -82,7 +82,8 @@ void hook_ifault_code(int nr, int (*fn)(
 				       struct pt_regs *),
 		     int sig, int code, const char *name);
 
-extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
+extern asmlinkage void c_backtrace(unsigned long fp, int pmode,
+				   const char *loglvl);
 
 struct mm_struct;
 void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr);
--- a/arch/arm/include/asm/traps.h~arm-asm-add-loglvl-to-c_backtrace
+++ a/arch/arm/include/asm/traps.h
@@ -29,7 +29,8 @@ static inline int __in_irqentry_text(uns
 }
 
 extern void __init early_trap_init(void *);
-extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
+extern void dump_backtrace_entry(unsigned long where, unsigned long from,
+				 unsigned long frame, const char *loglvl);
 extern void ptrace_break(struct pt_regs *regs);
 
 extern void *vectors_page;
--- a/arch/arm/kernel/traps.c~arm-asm-add-loglvl-to-c_backtrace
+++ a/arch/arm/kernel/traps.c
@@ -62,7 +62,8 @@ __setup("user_debug=", user_debug_setup)
 
 static void dump_mem(const char *, const char *, unsigned long, unsigned long);
 
-void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
+void dump_backtrace_entry(unsigned long where, unsigned long from,
+			  unsigned long frame, const char *loglvl)
 {
 	unsigned long end = frame + 4 + sizeof(struct pt_regs);
 
@@ -76,7 +77,7 @@ void dump_backtrace_entry(unsigned long
 		dump_mem("", "Exception stack", frame + 4, end);
 }
 
-void dump_backtrace_stm(u32 *stack, u32 instruction)
+void dump_backtrace_stm(u32 *stack, u32 instruction, const char *loglvl)
 {
 	char str[80], *p;
 	unsigned int x;
@@ -238,7 +239,7 @@ static void dump_backtrace(struct pt_reg
 	pr_cont("\n");
 
 	if (ok)
-		c_backtrace(fp, mode);
+		c_backtrace(fp, mode, NULL);
 }
 #endif
 
@@ -666,7 +667,7 @@ asmlinkage int arm_syscall(int no, struc
 		dump_instr("", regs);
 		if (user_mode(regs)) {
 			__show_regs(regs);
-			c_backtrace(frame_pointer(regs), processor_mode(regs));
+			c_backtrace(frame_pointer(regs), processor_mode(regs), NULL);
 		}
 	}
 #endif
--- a/arch/arm/kernel/unwind.c~arm-asm-add-loglvl-to-c_backtrace
+++ a/arch/arm/kernel/unwind.c
@@ -493,7 +493,7 @@ void unwind_backtrace(struct pt_regs *re
 		urc = unwind_frame(&frame);
 		if (urc < 0)
 			break;
-		dump_backtrace_entry(where, frame.pc, frame.sp - 4);
+		dump_backtrace_entry(where, frame.pc, frame.sp - 4, NULL);
 	}
 }
 
--- a/arch/arm/lib/backtrace-clang.S~arm-asm-add-loglvl-to-c_backtrace
+++ a/arch/arm/lib/backtrace-clang.S
@@ -17,6 +17,7 @@
 #define sv_pc	r6
 #define mask	r7
 #define sv_lr	r8
+#define loglvl	r9
 
 ENTRY(c_backtrace)
 
@@ -99,6 +100,7 @@ ENDPROC(c_backtrace)
 						@ to ensure 8 byte alignment
 		movs	frame, r0		@ if frame pointer is zero
 		beq	no_frame		@ we have no stack frames
+		mov	loglvl, r2
 		tst	r1, #0x10		@ 26 or 32-bit mode?
 		moveq	mask, #0xfc000003
 		movne	mask, #0		@ mask for 32-bit
@@ -167,6 +169,7 @@ finished_setup:
 		mov	r1, sv_lr
 		mov	r2, frame
 		bic	r1, r1, mask		@ mask PC/LR for the mode
+		mov	r3, loglvl
 		bl	dump_backtrace_entry
 
 /*
@@ -183,6 +186,7 @@ finished_setup:
 		ldr	r0, [frame]		@ locals are stored in
 						@ the preceding frame
 		subeq	r0, r0, #4
+		mov	r2, loglvl
 		bleq	dump_backtrace_stm	@ dump saved registers
 
 /*
@@ -196,7 +200,8 @@ finished_setup:
 		bhi	for_each_frame
 
 1006:		adr	r0, .Lbad
-		mov	r1, frame
+		mov	r1, loglvl
+		mov	r2, frame
 		bl	printk
 no_frame:	ldmfd	sp!, {r4 - r9, fp, pc}
 ENDPROC(c_backtrace)
@@ -209,7 +214,7 @@ ENDPROC(c_backtrace)
 		.long   1005b, 1006b
 		.popsection
 
-.Lbad:		.asciz	"Backtrace aborted due to bad frame pointer <%p>\n"
+.Lbad:		.asciz	"%sBacktrace aborted due to bad frame pointer <%p>\n"
 		.align
 .Lopcode:	.word	0xe92d4800 >> 11	@ stmfd sp!, {... fp, lr}
 		.word	0x0b000000		@ bl if these bits are set
--- a/arch/arm/lib/backtrace.S~arm-asm-add-loglvl-to-c_backtrace
+++ a/arch/arm/lib/backtrace.S
@@ -18,6 +18,7 @@
 #define sv_pc	r6
 #define mask	r7
 #define offset	r8
+#define loglvl	r9
 
 ENTRY(c_backtrace)
 
@@ -25,9 +26,10 @@ ENTRY(c_backtrace)
 		ret	lr
 ENDPROC(c_backtrace)
 #else
-		stmfd	sp!, {r4 - r8, lr}	@ Save an extra register so we have a location...
+		stmfd	sp!, {r4 - r9, lr}	@ Save an extra register so we have a location...
 		movs	frame, r0		@ if frame pointer is zero
 		beq	no_frame		@ we have no stack frames
+		mov	loglvl, r2
 
 		tst	r1, #0x10		@ 26 or 32-bit mode?
  ARM(		moveq	mask, #0xfc000003	)
@@ -73,6 +75,7 @@ for_each_frame:	tst	frame, mask		@ Check
 		ldr	r1, [frame, #-4]	@ get saved lr
 		mov	r2, frame
 		bic	r1, r1, mask		@ mask PC/LR for the mode
+		mov	r3, loglvl
 		bl	dump_backtrace_entry
 
 		ldr	r1, [sv_pc, #-4]	@ if stmfd sp!, {args} exists,
@@ -80,12 +83,14 @@ for_each_frame:	tst	frame, mask		@ Check
 		teq	r3, r1, lsr #11
 		ldreq	r0, [frame, #-8]	@ get sp
 		subeq	r0, r0, #4		@ point at the last arg
+		mov	r2, loglvl
 		bleq	dump_backtrace_stm	@ dump saved registers
 
 1004:		ldr	r1, [sv_pc, #0]		@ if stmfd sp!, {..., fp, ip, lr, pc}
 		ldr	r3, .Ldsi		@ instruction exists,
 		teq	r3, r1, lsr #11
 		subeq	r0, frame, #16
+		mov	r2, loglvl
 		bleq	dump_backtrace_stm	@ dump saved registers
 
 		teq	sv_fp, #0		@ zero saved fp means
@@ -96,9 +101,10 @@ for_each_frame:	tst	frame, mask		@ Check
 		bhi	for_each_frame
 
 1006:		adr	r0, .Lbad
-		mov	r1, frame
+		mov	r1, loglvl
+		mov	r2, frame
 		bl	printk
-no_frame:	ldmfd	sp!, {r4 - r8, pc}
+no_frame:	ldmfd	sp!, {r4 - r9, pc}
 ENDPROC(c_backtrace)
 		
 		.pushsection __ex_table,"a"
@@ -109,7 +115,7 @@ ENDPROC(c_backtrace)
 		.long	1004b, 1006b
 		.popsection
 
-.Lbad:		.asciz	"Backtrace aborted due to bad frame pointer <%p>\n"
+.Lbad:		.asciz	"%sBacktrace aborted due to bad frame pointer <%p>\n"
 		.align
 .Ldsi:		.word	0xe92dd800 >> 11	@ stmfd sp!, {... fp, ip, lr, pc}
 		.word	0xe92d0000 >> 11	@ stmfd sp!, {}
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 05/93] arm: add loglvl to unwind_backtrace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (3 preceding siblings ...)
  2020-06-09  4:30 ` [patch 04/93] arm/asm: add loglvl to c_backtrace() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 06/93] arm: add loglvl to dump_backtrace() Andrew Morton
                   ` (90 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm: add loglvl to unwind_backtrace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to unwind_backtrace() as a preparation for
introducing show_stack_loglvl().

As a good side-effect arm_syscall() is now printing errors with the same
log level as the backtrace.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-6-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/include/asm/unwind.h |    3 ++-
 arch/arm/kernel/traps.c       |    6 +++---
 arch/arm/kernel/unwind.c      |    5 +++--
 3 files changed, 8 insertions(+), 6 deletions(-)

--- a/arch/arm/include/asm/unwind.h~arm-add-loglvl-to-unwind_backtrace
+++ a/arch/arm/include/asm/unwind.h
@@ -36,7 +36,8 @@ extern struct unwind_table *unwind_table
 					     unsigned long text_addr,
 					     unsigned long text_size);
 extern void unwind_table_del(struct unwind_table *tab);
-extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk);
+extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+			     const char *loglvl);
 
 #endif	/* !__ASSEMBLY__ */
 
--- a/arch/arm/kernel/traps.c~arm-add-loglvl-to-unwind_backtrace
+++ a/arch/arm/kernel/traps.c
@@ -204,7 +204,7 @@ static void dump_instr(const char *lvl,
 #ifdef CONFIG_ARM_UNWIND
 static inline void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
 {
-	unwind_backtrace(regs, tsk);
+	unwind_backtrace(regs, tsk, KERN_DEFAULT);
 }
 #else
 static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
@@ -664,10 +664,10 @@ asmlinkage int arm_syscall(int no, struc
 	if (user_debug & UDBG_SYSCALL) {
 		pr_err("[%d] %s: arm syscall %d\n",
 		       task_pid_nr(current), current->comm, no);
-		dump_instr("", regs);
+		dump_instr(KERN_ERR, regs);
 		if (user_mode(regs)) {
 			__show_regs(regs);
-			c_backtrace(frame_pointer(regs), processor_mode(regs), NULL);
+			c_backtrace(frame_pointer(regs), processor_mode(regs), KERN_ERR);
 		}
 	}
 #endif
--- a/arch/arm/kernel/unwind.c~arm-add-loglvl-to-unwind_backtrace
+++ a/arch/arm/kernel/unwind.c
@@ -455,7 +455,8 @@ int unwind_frame(struct stackframe *fram
 	return URC_OK;
 }
 
-void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
+void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+		      const char *loglvl)
 {
 	struct stackframe frame;
 
@@ -493,7 +494,7 @@ void unwind_backtrace(struct pt_regs *re
 		urc = unwind_frame(&frame);
 		if (urc < 0)
 			break;
-		dump_backtrace_entry(where, frame.pc, frame.sp - 4, NULL);
+		dump_backtrace_entry(where, frame.pc, frame.sp - 4, loglvl);
 	}
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 06/93] arm: add loglvl to dump_backtrace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (4 preceding siblings ...)
  2020-06-09  4:30 ` [patch 05/93] arm: add loglvl to unwind_backtrace() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 07/93] arm: wire up dump_backtrace_{entry,stm} Andrew Morton
                   ` (89 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm: add loglvl to dump_backtrace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to dump_backtrace() as a preparation for
introducing show_stack_loglvl().

As a good side-effect __die() now prints not only "Stack:" header with
KERN_EMERG, but the backtrace itself.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-7-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/kernel/traps.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

--- a/arch/arm/kernel/traps.c~arm-add-loglvl-to-dump_backtrace
+++ a/arch/arm/kernel/traps.c
@@ -202,17 +202,19 @@ static void dump_instr(const char *lvl,
 }
 
 #ifdef CONFIG_ARM_UNWIND
-static inline void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
+static inline void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+				  const char *loglvl)
 {
-	unwind_backtrace(regs, tsk, KERN_DEFAULT);
+	unwind_backtrace(regs, tsk, loglvl);
 }
 #else
-static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
+static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+			   const char *loglvl)
 {
 	unsigned int fp, mode;
 	int ok = 1;
 
-	printk("Backtrace: ");
+	printk("%sBacktrace: ", loglvl);
 
 	if (!tsk)
 		tsk = current;
@@ -239,13 +241,13 @@ static void dump_backtrace(struct pt_reg
 	pr_cont("\n");
 
 	if (ok)
-		c_backtrace(fp, mode, NULL);
+		c_backtrace(fp, mode, loglvl);
 }
 #endif
 
 void show_stack(struct task_struct *tsk, unsigned long *sp)
 {
-	dump_backtrace(NULL, tsk);
+	dump_backtrace(NULL, tsk, KERN_DEFAULT);
 	barrier();
 }
 
@@ -289,7 +291,7 @@ static int __die(const char *str, int er
 	if (!user_mode(regs) || in_interrupt()) {
 		dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp,
 			 THREAD_SIZE + (unsigned long)task_stack_page(tsk));
-		dump_backtrace(regs, tsk);
+		dump_backtrace(regs, tsk, KERN_EMERG);
 		dump_instr(KERN_EMERG, regs);
 	}
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 07/93] arm: wire up dump_backtrace_{entry,stm}
  2020-06-09  4:29 incoming Andrew Morton
                   ` (5 preceding siblings ...)
  2020-06-09  4:30 ` [patch 06/93] arm: add loglvl to dump_backtrace() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 08/93] arm: add show_stack_loglvl() Andrew Morton
                   ` (88 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm: wire up dump_backtrace_{entry,stm}

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Now that c_backtrace() always emits correct loglvl, use it for printing.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-8-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/kernel/traps.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

--- a/arch/arm/kernel/traps.c~arm-wire-up-dump_backtrace_entrystm
+++ a/arch/arm/kernel/traps.c
@@ -68,13 +68,15 @@ void dump_backtrace_entry(unsigned long
 	unsigned long end = frame + 4 + sizeof(struct pt_regs);
 
 #ifdef CONFIG_KALLSYMS
-	printk("[<%08lx>] (%ps) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from);
+	printk("%s[<%08lx>] (%ps) from [<%08lx>] (%pS)\n",
+		loglvl, where, (void *)where, from, (void *)from);
 #else
-	printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
+	printk("%sFunction entered at [<%08lx>] from [<%08lx>]\n",
+		loglvl, where, from);
 #endif
 
 	if (in_entry_text(from) && end <= ALIGN(frame, THREAD_SIZE))
-		dump_mem("", "Exception stack", frame + 4, end);
+		dump_mem(loglvl, "Exception stack", frame + 4, end);
 }
 
 void dump_backtrace_stm(u32 *stack, u32 instruction, const char *loglvl)
@@ -89,12 +91,12 @@ void dump_backtrace_stm(u32 *stack, u32
 			if (++x == 6) {
 				x = 0;
 				p = str;
-				printk("%s\n", str);
+				printk("%s%s\n", loglvl, str);
 			}
 		}
 	}
 	if (p != str)
-		printk("%s\n", str);
+		printk("%s%s\n", loglvl, str);
 }
 
 #ifndef CONFIG_ARM_UNWIND
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 08/93] arm: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (6 preceding siblings ...)
  2020-06-09  4:30 ` [patch 07/93] arm: wire up dump_backtrace_{entry,stm} Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 09/93] arm64: add loglvl to dump_backtrace() Andrew Morton
                   ` (87 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-9-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/kernel/traps.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/arch/arm/kernel/traps.c~arm-add-show_stack_loglvl
+++ a/arch/arm/kernel/traps.c
@@ -247,12 +247,18 @@ static void dump_backtrace(struct pt_reg
 }
 #endif
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+		       const char *loglvl)
 {
-	dump_backtrace(NULL, tsk, KERN_DEFAULT);
+	dump_backtrace(NULL, tsk, loglvl);
 	barrier();
 }
 
+void show_stack(struct task_struct *tsk, unsigned long *sp)
+{
+	show_stack_loglvl(tsk, sp, KERN_DEFAULT);
+}
+
 #ifdef CONFIG_PREEMPT
 #define S_PREEMPT " PREEMPT"
 #elif defined(CONFIG_PREEMPT_RT)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 09/93] arm64: add loglvl to dump_backtrace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (7 preceding siblings ...)
  2020-06-09  4:30 ` [patch 08/93] arm: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 10/93] arm64: add show_stack_loglvl() Andrew Morton
                   ` (86 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, catalin.marinas, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm64: add loglvl to dump_backtrace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to dump_backtrace() as a preparation for
introducing show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-10-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm64/include/asm/stacktrace.h |    3 ++-
 arch/arm64/kernel/process.c         |    2 +-
 arch/arm64/kernel/traps.c           |   15 ++++++++-------
 3 files changed, 11 insertions(+), 9 deletions(-)

--- a/arch/arm64/include/asm/stacktrace.h~arm64-add-loglvl-to-dump_backtrace
+++ a/arch/arm64/include/asm/stacktrace.h
@@ -64,7 +64,8 @@ struct stackframe {
 extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame);
 extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame,
 			    int (*fn)(struct stackframe *, void *), void *data);
-extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk);
+extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+			   const char *loglvl);
 
 DECLARE_PER_CPU(unsigned long *, irq_stack_ptr);
 
--- a/arch/arm64/kernel/process.c~arm64-add-loglvl-to-dump_backtrace
+++ a/arch/arm64/kernel/process.c
@@ -306,7 +306,7 @@ void __show_regs(struct pt_regs *regs)
 void show_regs(struct pt_regs * regs)
 {
 	__show_regs(regs);
-	dump_backtrace(regs, NULL);
+	dump_backtrace(regs, NULL, KERN_DEFAULT);
 }
 
 static void tls_thread_flush(void)
--- a/arch/arm64/kernel/traps.c~arm64-add-loglvl-to-dump_backtrace
+++ a/arch/arm64/kernel/traps.c
@@ -53,9 +53,9 @@ static const char *handler[]= {
 
 int show_unhandled_signals = 0;
 
-static void dump_backtrace_entry(unsigned long where)
+static void dump_backtrace_entry(unsigned long where, const char *loglvl)
 {
-	printk(" %pS\n", (void *)where);
+	printk("%s %pS\n", loglvl, (void *)where);
 }
 
 static void dump_kernel_instr(const char *lvl, struct pt_regs *regs)
@@ -83,7 +83,8 @@ static void dump_kernel_instr(const char
 	printk("%sCode: %s\n", lvl, str);
 }
 
-void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
+void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+		    const char *loglvl)
 {
 	struct stackframe frame;
 	int skip = 0;
@@ -115,11 +116,11 @@ void dump_backtrace(struct pt_regs *regs
 				thread_saved_pc(tsk));
 	}
 
-	printk("Call trace:\n");
+	printk("%sCall trace:\n", loglvl);
 	do {
 		/* skip until specified stack frame */
 		if (!skip) {
-			dump_backtrace_entry(frame.pc);
+			dump_backtrace_entry(frame.pc, loglvl);
 		} else if (frame.fp == regs->regs[29]) {
 			skip = 0;
 			/*
@@ -129,7 +130,7 @@ void dump_backtrace(struct pt_regs *regs
 			 * at which an exception has taken place, use regs->pc
 			 * instead.
 			 */
-			dump_backtrace_entry(regs->pc);
+			dump_backtrace_entry(regs->pc, loglvl);
 		}
 	} while (!unwind_frame(tsk, &frame));
 
@@ -138,7 +139,7 @@ void dump_backtrace(struct pt_regs *regs
 
 void show_stack(struct task_struct *tsk, unsigned long *sp)
 {
-	dump_backtrace(NULL, tsk);
+	dump_backtrace(NULL, tsk, KERN_DEFAULT);
 	barrier();
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 10/93] arm64: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (8 preceding siblings ...)
  2020-06-09  4:30 ` [patch 09/93] arm64: add loglvl to dump_backtrace() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 11/93] c6x: " Andrew Morton
                   ` (85 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, catalin.marinas, dima, linux-mm, linux, mm-commits, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: arm64: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-11-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm64/kernel/traps.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/arch/arm64/kernel/traps.c~arm64-add-show_stack_loglvl
+++ a/arch/arm64/kernel/traps.c
@@ -137,12 +137,18 @@ void dump_backtrace(struct pt_regs *regs
 	put_task_stack(tsk);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+		       const char *loglvl)
 {
-	dump_backtrace(NULL, tsk, KERN_DEFAULT);
+	dump_backtrace(NULL, tsk, loglvl);
 	barrier();
 }
 
+void show_stack(struct task_struct *tsk, unsigned long *sp)
+{
+	show_stack_loglvl(tsk, sp, KERN_DEFAULT);
+}
+
 #ifdef CONFIG_PREEMPT
 #define S_PREEMPT " PREEMPT"
 #elif defined(CONFIG_PREEMPT_RT)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 11/93] c6x: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (9 preceding siblings ...)
  2020-06-09  4:30 ` [patch 10/93] arm64: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 12/93] csky: " Andrew Morton
                   ` (84 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, jacquiot.aurelien, linux-mm, mm-commits, msalter, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: c6x: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-12-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Cc: Mark Salter <msalter@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/c6x/kernel/traps.c |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

--- a/arch/c6x/kernel/traps.c~c6x-add-show_stack_loglvl
+++ a/arch/c6x/kernel/traps.c
@@ -344,12 +344,13 @@ asmlinkage int process_exception(struct
 
 static int kstack_depth_to_print = 48;
 
-static void show_trace(unsigned long *stack, unsigned long *endstack)
+static void show_trace(unsigned long *stack, unsigned long *endstack,
+		       const char *loglvl)
 {
 	unsigned long addr;
 	int i;
 
-	pr_debug("Call trace:");
+	printk("%sCall trace:", loglvl);
 	i = 0;
 	while (stack + 1 <= endstack) {
 		addr = *stack++;
@@ -364,16 +365,17 @@ static void show_trace(unsigned long *st
 		if (__kernel_text_address(addr)) {
 #ifndef CONFIG_KALLSYMS
 			if (i % 5 == 0)
-				pr_debug("\n	    ");
+				printk("%s\n	    ", loglvl);
 #endif
-			pr_debug(" [<%08lx>] %pS\n", addr, (void *)addr);
+			printk("%s [<%08lx>] %pS\n", loglvl, addr, (void *)addr);
 			i++;
 		}
 	}
-	pr_debug("\n");
+	printk("%s\n", loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
+void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+		const char *loglvl)
 {
 	unsigned long *p, *endstack;
 	int i;
@@ -398,7 +400,12 @@ void show_stack(struct task_struct *task
 		pr_cont(" %08lx", *p++);
 	}
 	pr_cont("\n");
-	show_trace(stack, endstack);
+	show_trace(stack, endstack, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *stack)
+{
+	show_stack_loglvl(task, stack, KERN_DEBUG);
 }
 
 int is_valid_bugaddr(unsigned long addr)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 12/93] csky: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (10 preceding siblings ...)
  2020-06-09  4:30 ` [patch 11/93] c6x: " Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 13/93] h8300: " Andrew Morton
                   ` (83 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, guoren, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: csky: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-13-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Guo Ren <guoren@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/csky/kernel/stacktrace.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- a/arch/csky/kernel/stacktrace.c~csky-add-show_stack_loglvl
+++ a/arch/csky/kernel/stacktrace.c
@@ -91,14 +91,21 @@ static void notrace walk_stackframe(stru
 
 static bool print_trace_address(unsigned long pc, void *arg)
 {
-	print_ip_sym(pc);
+	print_ip_sym((const char *)arg, pc);
 	return false;
 }
 
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
+{
+	pr_cont("Call Trace:\n");
+	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
+}
+
 void show_stack(struct task_struct *task, unsigned long *sp)
 {
 	pr_cont("Call Trace:\n");
-	walk_stackframe(task, NULL, print_trace_address, NULL);
+	walk_stackframe(task, NULL, print_trace_address, KERN_INFO);
 }
 
 static bool save_wchan(unsigned long pc, void *arg)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 13/93] h8300: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (11 preceding siblings ...)
  2020-06-09  4:30 ` [patch 12/93] csky: " Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 14/93] hexagon: " Andrew Morton
                   ` (82 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mm-commits, torvalds, ysato

From: Dmitry Safonov <dima@arista.com>
Subject: h8300: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-14-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/h8300/kernel/traps.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

--- a/arch/h8300/kernel/traps.c~h8300-add-show_stack_loglvl
+++ a/arch/h8300/kernel/traps.c
@@ -115,7 +115,8 @@ void die(const char *str, struct pt_regs
 
 static int kstack_depth_to_print = 24;
 
-void show_stack(struct task_struct *task, unsigned long *esp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
+		       const char *loglvl)
 {
 	unsigned long *stack,  addr;
 	int i;
@@ -125,17 +126,17 @@ void show_stack(struct task_struct *task
 
 	stack = esp;
 
-	pr_info("Stack from %08lx:", (unsigned long)stack);
+	printk("%sStack from %08lx:", loglvl, (unsigned long)stack);
 	for (i = 0; i < kstack_depth_to_print; i++) {
 		if (((unsigned long)stack & (THREAD_SIZE - 1)) >=
 		    THREAD_SIZE-4)
 			break;
 		if (i % 8 == 0)
-			pr_info(" ");
+			printk("%s ", loglvl);
 		pr_cont(" %08lx", *stack++);
 	}
 
-	pr_info("\nCall Trace:\n");
+	printk("%s\nCall Trace:\n", loglvl);
 	i = 0;
 	stack = esp;
 	while (((unsigned long)stack & (THREAD_SIZE - 1)) < THREAD_SIZE-4) {
@@ -150,10 +151,15 @@ void show_stack(struct task_struct *task
 		 */
 		if (check_kernel_text(addr)) {
 			if (i % 4 == 0)
-				pr_info("       ");
+				printk("%s       ", loglvl);
 			pr_cont(" [<%08lx>]", addr);
 			i++;
 		}
 	}
-	pr_info("\n");
+	printk("%s\n", loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *esp)
+{
+	show_stack_loglvl(task, esp, KERN_INFO);
 }
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 14/93] hexagon: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (12 preceding siblings ...)
  2020-06-09  4:30 ` [patch 13/93] h8300: " Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 15/93] ia64: pass log level as arg into ia64_do_show_stack() Andrew Morton
                   ` (81 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, bcain, dima, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: hexagon: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

As a good side-effect die() now prints the stacktrace with KERN_EMERG
aligned with other messages.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-15-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Acked-by: Brian Cain <bcain@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/hexagon/kernel/traps.c |   31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

--- a/arch/hexagon/kernel/traps.c~hexagon-add-show_stack_loglvl
+++ a/arch/hexagon/kernel/traps.c
@@ -79,7 +79,7 @@ static const char *ex_name(int ex)
 }
 
 static void do_show_stack(struct task_struct *task, unsigned long *fp,
-			  unsigned long ip)
+			  unsigned long ip, const char *loglvl)
 {
 	int kstack_depth_to_print = 24;
 	unsigned long offset, size;
@@ -93,9 +93,8 @@ static void do_show_stack(struct task_st
 	if (task == NULL)
 		task = current;
 
-	printk(KERN_INFO "CPU#%d, %s/%d, Call Trace:\n",
-	       raw_smp_processor_id(), task->comm,
-	       task_pid_nr(task));
+	printk("%sCPU#%d, %s/%d, Call Trace:\n", loglvl, raw_smp_processor_id(),
+		task->comm, task_pid_nr(task));
 
 	if (fp == NULL) {
 		if (task == current) {
@@ -108,7 +107,7 @@ static void do_show_stack(struct task_st
 	}
 
 	if ((((unsigned long) fp) & 0x3) || ((unsigned long) fp < 0x1000)) {
-		printk(KERN_INFO "-- Corrupt frame pointer %p\n", fp);
+		printk("%s-- Corrupt frame pointer %p\n", loglvl, fp);
 		return;
 	}
 
@@ -125,8 +124,7 @@ static void do_show_stack(struct task_st
 
 		name = kallsyms_lookup(ip, &size, &offset, &modname, tmpstr);
 
-		printk(KERN_INFO "[%p] 0x%lx: %s + 0x%lx", fp, ip, name,
-			offset);
+		printk("%s[%p] 0x%lx: %s + 0x%lx", loglvl, fp, ip, name, offset);
 		if (((unsigned long) fp < low) || (high < (unsigned long) fp))
 			printk(KERN_CONT " (FP out of bounds!)");
 		if (modname)
@@ -136,8 +134,7 @@ static void do_show_stack(struct task_st
 		newfp = (unsigned long *) *fp;
 
 		if (((unsigned long) newfp) & 0x3) {
-			printk(KERN_INFO "-- Corrupt frame pointer %p\n",
-				newfp);
+			printk("%s-- Corrupt frame pointer %p\n", loglvl, newfp);
 			break;
 		}
 
@@ -147,7 +144,7 @@ static void do_show_stack(struct task_st
 						+ 8);
 
 			if (regs->syscall_nr != -1) {
-				printk(KERN_INFO "-- trap0 -- syscall_nr: %ld",
+				printk("%s-- trap0 -- syscall_nr: %ld", loglvl,
 					regs->syscall_nr);
 				printk(KERN_CONT "  psp: %lx  elr: %lx\n",
 					 pt_psp(regs), pt_elr(regs));
@@ -155,7 +152,7 @@ static void do_show_stack(struct task_st
 			} else {
 				/* really want to see more ... */
 				kstack_depth_to_print += 6;
-				printk(KERN_INFO "-- %s (0x%lx)  badva: %lx\n",
+				printk("%s-- %s (0x%lx)  badva: %lx\n", loglvl,
 					ex_name(pt_cause(regs)), pt_cause(regs),
 					pt_badva(regs));
 			}
@@ -178,10 +175,16 @@ static void do_show_stack(struct task_st
 	}
 }
 
-void show_stack(struct task_struct *task, unsigned long *fp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *fp,
+		       const char *loglvl)
 {
 	/* Saved link reg is one word above FP */
-	do_show_stack(task, fp, 0);
+	do_show_stack(task, fp, 0, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *fp)
+{
+	show_stack_loglvl(task, fp, 0, KERN_INFO);
 }
 
 int die(const char *str, struct pt_regs *regs, long err)
@@ -207,7 +210,7 @@ int die(const char *str, struct pt_regs
 
 	print_modules();
 	show_regs(regs);
-	do_show_stack(current, &regs->r30, pt_elr(regs));
+	do_show_stack(current, &regs->r30, pt_elr(regs), KERN_EMERG);
 
 	bust_spinlocks(0);
 	add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 15/93] ia64: pass log level as arg into ia64_do_show_stack()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (13 preceding siblings ...)
  2020-06-09  4:30 ` [patch 14/93] hexagon: " Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 16/93] ia64: add show_stack_loglvl() Andrew Morton
                   ` (80 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, fenghua.yu, linux-mm, mm-commits, tony.luck, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: ia64: pass log level as arg into ia64_do_show_stack()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to ia64_do_show_stack() as a preparation to
introduce show_stack_loglvl().  Also, make ia64_do_show_stack() static as
it's not used outside.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-16-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/ia64/include/asm/ptrace.h |    1 -
 arch/ia64/kernel/process.c     |   13 +++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

--- a/arch/ia64/include/asm/ptrace.h~ia64-pass-log-level-as-arg-into-ia64_do_show_stack
+++ a/arch/ia64/include/asm/ptrace.h
@@ -114,7 +114,6 @@ static inline long regs_return_value(str
   struct task_struct;			/* forward decl */
   struct unw_frame_info;		/* forward decl */
 
-  extern void ia64_do_show_stack (struct unw_frame_info *, void *);
   extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *,
 					      unsigned long *);
   extern long ia64_peek (struct task_struct *, struct switch_stack *, unsigned long,
--- a/arch/ia64/kernel/process.c~ia64-pass-log-level-as-arg-into-ia64_do_show_stack
+++ a/arch/ia64/kernel/process.c
@@ -64,12 +64,13 @@ EXPORT_SYMBOL(boot_option_idle_override)
 void (*pm_power_off) (void);
 EXPORT_SYMBOL(pm_power_off);
 
-void
+static void
 ia64_do_show_stack (struct unw_frame_info *info, void *arg)
 {
 	unsigned long ip, sp, bsp;
+	const char *loglvl = arg;
 
-	printk("\nCall Trace:\n");
+	printk("%s\nCall Trace:\n", loglvl);
 	do {
 		unw_get_ip(info, &ip);
 		if (ip == 0)
@@ -77,9 +78,9 @@ ia64_do_show_stack (struct unw_frame_inf
 
 		unw_get_sp(info, &sp);
 		unw_get_bsp(info, &bsp);
-		printk(" [<%016lx>] %pS\n"
+		printk("%s [<%016lx>] %pS\n"
 			 "                                sp=%016lx bsp=%016lx\n",
-			 ip, (void *)ip, sp, bsp);
+			 loglvl, ip, (void *)ip, sp, bsp);
 	} while (unw_unwind(info) >= 0);
 }
 
@@ -87,12 +88,12 @@ void
 show_stack (struct task_struct *task, unsigned long *sp)
 {
 	if (!task)
-		unw_init_running(ia64_do_show_stack, NULL);
+		unw_init_running(ia64_do_show_stack, (void *)KERN_DEFAULT);
 	else {
 		struct unw_frame_info info;
 
 		unw_init_from_blocked_task(&info, task);
-		ia64_do_show_stack(&info, NULL);
+		ia64_do_show_stack(&info, (void *)KERN_DEFAULT);
 	}
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 16/93] ia64: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (14 preceding siblings ...)
  2020-06-09  4:30 ` [patch 15/93] ia64: pass log level as arg into ia64_do_show_stack() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 17/93] m68k: " Andrew Morton
                   ` (79 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, fenghua.yu, linux-mm, mm-commits, tony.luck, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: ia64: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-17-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/ia64/kernel/process.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

--- a/arch/ia64/kernel/process.c~ia64-add-show_stack_loglvl
+++ a/arch/ia64/kernel/process.c
@@ -85,19 +85,26 @@ ia64_do_show_stack (struct unw_frame_inf
 }
 
 void
-show_stack (struct task_struct *task, unsigned long *sp)
+show_stack_loglvl (struct task_struct *task, unsigned long *sp,
+		   const char *loglvl)
 {
 	if (!task)
-		unw_init_running(ia64_do_show_stack, (void *)KERN_DEFAULT);
+		unw_init_running(ia64_do_show_stack, (void *)loglvl);
 	else {
 		struct unw_frame_info info;
 
 		unw_init_from_blocked_task(&info, task);
-		ia64_do_show_stack(&info, (void *)KERN_DEFAULT);
+		ia64_do_show_stack(&info, (void *)loglvl);
 	}
 }
 
 void
+show_stack (struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
+}
+
+void
 show_regs (struct pt_regs *regs)
 {
 	unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 17/93] m68k: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (15 preceding siblings ...)
  2020-06-09  4:30 ` [patch 16/93] ia64: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 18/93] microblaze: add loglvl to microblaze_unwind_inner() Andrew Morton
                   ` (78 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, geert, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: m68k: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-18-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/m68k/kernel/traps.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

--- a/arch/m68k/kernel/traps.c~m68k-add-show_stack_loglvl
+++ a/arch/m68k/kernel/traps.c
@@ -811,13 +811,13 @@ asmlinkage void buserr_c(struct frame *f
 
 static int kstack_depth_to_print = 48;
 
-void show_trace(unsigned long *stack)
+static void show_trace(unsigned long *stack, const char *loglvl)
 {
 	unsigned long *endstack;
 	unsigned long addr;
 	int i;
 
-	pr_info("Call Trace:");
+	printk("%sCall Trace:", loglvl);
 	addr = (unsigned long)stack + THREAD_SIZE - 1;
 	endstack = (unsigned long *)(addr & -THREAD_SIZE);
 	i = 0;
@@ -935,7 +935,8 @@ void show_registers(struct pt_regs *regs
 	pr_cont("\n");
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
+void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+		       const char *loglvl)
 {
 	unsigned long *p;
 	unsigned long *endstack;
@@ -949,7 +950,7 @@ void show_stack(struct task_struct *task
 	}
 	endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
 
-	pr_info("Stack from %08lx:", (unsigned long)stack);
+	printk("%sStack from %08lx:", loglvl, (unsigned long)stack);
 	p = stack;
 	for (i = 0; i < kstack_depth_to_print; i++) {
 		if (p + 1 > endstack)
@@ -959,7 +960,12 @@ void show_stack(struct task_struct *task
 		pr_cont(" %08lx", *p++);
 	}
 	pr_cont("\n");
-	show_trace(stack);
+	show_trace(stack, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *stack)
+{
+	show_stack_loglvl(task, stack, KERN_INFO);
 }
 
 /*
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 18/93] microblaze: add loglvl to microblaze_unwind_inner()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (16 preceding siblings ...)
  2020-06-09  4:30 ` [patch 17/93] m68k: " Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 19/93] microblaze: add loglvl to microblaze_unwind() Andrew Morton
                   ` (77 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mm-commits, monstr, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: microblaze: add loglvl to microblaze_unwind_inner()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to microblaze_unwind_inner() as a preparation for
introducing show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-19-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/microblaze/kernel/unwind.c |   38 ++++++++++++++++++------------
 1 file changed, 23 insertions(+), 15 deletions(-)

--- a/arch/microblaze/kernel/unwind.c~microblaze-add-loglvl-to-microblaze_unwind_inner
+++ a/arch/microblaze/kernel/unwind.c
@@ -154,7 +154,8 @@ static int lookup_prev_stack_frame(unsig
 static void microblaze_unwind_inner(struct task_struct *task,
 				    unsigned long pc, unsigned long fp,
 				    unsigned long leaf_return,
-				    struct stack_trace *trace);
+				    struct stack_trace *trace,
+				    const char *loglvl);
 
 /**
  * unwind_trap - Unwind through a system trap, that stored previous state
@@ -162,16 +163,18 @@ static void microblaze_unwind_inner(stru
  */
 #ifdef CONFIG_MMU
 static inline void unwind_trap(struct task_struct *task, unsigned long pc,
-				unsigned long fp, struct stack_trace *trace)
+				unsigned long fp, struct stack_trace *trace,
+				const char *loglvl)
 {
 	/* To be implemented */
 }
 #else
 static inline void unwind_trap(struct task_struct *task, unsigned long pc,
-				unsigned long fp, struct stack_trace *trace)
+				unsigned long fp, struct stack_trace *trace,
+				const char *loglvl)
 {
 	const struct pt_regs *regs = (const struct pt_regs *) fp;
-	microblaze_unwind_inner(task, regs->pc, regs->r1, regs->r15, trace);
+	microblaze_unwind_inner(task, regs->pc, regs->r1, regs->r15, trace, loglvl);
 }
 #endif
 
@@ -184,11 +187,13 @@ static inline void unwind_trap(struct ta
  *				  the caller's return address.
  * @trace : Where to store stack backtrace (PC values).
  *	    NULL == print backtrace to kernel log
+ * @loglvl : Used for printk log level if (trace == NULL).
  */
 static void microblaze_unwind_inner(struct task_struct *task,
 			     unsigned long pc, unsigned long fp,
 			     unsigned long leaf_return,
-			     struct stack_trace *trace)
+			     struct stack_trace *trace,
+			     const char *loglvl)
 {
 	int ofs = 0;
 
@@ -214,11 +219,11 @@ static void microblaze_unwind_inner(stru
 			const struct pt_regs *regs =
 				(const struct pt_regs *) fp;
 #endif
-			pr_info("HW EXCEPTION\n");
+			printk("%sHW EXCEPTION\n", loglvl);
 #ifndef CONFIG_MMU
 			microblaze_unwind_inner(task, regs->r17 - 4,
 						fp + EX_HANDLER_STACK_SIZ,
-						regs->r15, trace);
+						regs->r15, trace, loglvl);
 #endif
 			return;
 		}
@@ -228,8 +233,8 @@ static void microblaze_unwind_inner(stru
 			if ((return_to >= handler->start_addr)
 			    && (return_to <= handler->end_addr)) {
 				if (!trace)
-					pr_info("%s\n", handler->trap_name);
-				unwind_trap(task, pc, fp, trace);
+					printk("%s%s\n", loglvl, handler->trap_name);
+				unwind_trap(task, pc, fp, trace, loglvl);
 				return;
 			}
 		}
@@ -248,13 +253,13 @@ static void microblaze_unwind_inner(stru
 		} else {
 			/* Have we reached userland? */
 			if (unlikely(pc == task_pt_regs(task)->pc)) {
-				pr_info("[<%p>] PID %lu [%s]\n",
-					(void *) pc,
+				printk("%s[<%p>] PID %lu [%s]\n",
+					loglvl, (void *) pc,
 					(unsigned long) task->pid,
 					task->comm);
 				break;
 			} else
-				print_ip_sym(KERN_INFO, pc);
+				print_ip_sym(loglvl, pc);
 		}
 
 		/* Stop when we reach anything not part of the kernel */
@@ -285,11 +290,13 @@ static void microblaze_unwind_inner(stru
  */
 void microblaze_unwind(struct task_struct *task, struct stack_trace *trace)
 {
+	const char *loglvl = KERN_INFO;
+
 	if (task) {
 		if (task == current) {
 			const struct pt_regs *regs = task_pt_regs(task);
 			microblaze_unwind_inner(task, regs->pc, regs->r1,
-						regs->r15, trace);
+						regs->r15, trace, loglvl);
 		} else {
 			struct thread_info *thread_info =
 				(struct thread_info *)(task->stack);
@@ -299,7 +306,8 @@ void microblaze_unwind(struct task_struc
 			microblaze_unwind_inner(task,
 						(unsigned long) &_switch_to,
 						cpu_context->r1,
-						cpu_context->r15, trace);
+						cpu_context->r15,
+						trace, loglvl);
 		}
 	} else {
 		unsigned long pc, fp;
@@ -314,7 +322,7 @@ void microblaze_unwind(struct task_struc
 		);
 
 		/* Since we are not a leaf function, use leaf_return = 0 */
-		microblaze_unwind_inner(current, pc, fp, 0, trace);
+		microblaze_unwind_inner(current, pc, fp, 0, trace, loglvl);
 	}
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 19/93] microblaze: add loglvl to microblaze_unwind()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (17 preceding siblings ...)
  2020-06-09  4:30 ` [patch 18/93] microblaze: add loglvl to microblaze_unwind_inner() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 20/93] microblaze: add show_stack_loglvl() Andrew Morton
                   ` (76 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mm-commits, monstr, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: microblaze: add loglvl to microblaze_unwind()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level parameter to microblaze_unwind() as a preparation to add
show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-20-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/microblaze/include/asm/unwind.h |    3 ++-
 arch/microblaze/kernel/stacktrace.c  |    4 ++--
 arch/microblaze/kernel/traps.c       |    2 +-
 arch/microblaze/kernel/unwind.c      |    6 +++---
 4 files changed, 8 insertions(+), 7 deletions(-)

--- a/arch/microblaze/include/asm/unwind.h~microblaze-add-loglvl-to-microblaze_unwind
+++ a/arch/microblaze/include/asm/unwind.h
@@ -20,7 +20,8 @@ extern struct trap_handler_info microbla
 extern const char _hw_exception_handler;
 extern const char ex_handler_unhandled;
 
-void microblaze_unwind(struct task_struct *task, struct stack_trace *trace);
+void microblaze_unwind(struct task_struct *task, struct stack_trace *trace,
+		       const char *loglvl);
 
 #endif	/* __MICROBLAZE_UNWIND_H */
 
--- a/arch/microblaze/kernel/stacktrace.c~microblaze-add-loglvl-to-microblaze_unwind
+++ a/arch/microblaze/kernel/stacktrace.c
@@ -20,12 +20,12 @@ void save_stack_trace(struct stack_trace
 {
 	/* Exclude our helper functions from the trace*/
 	trace->skip += 2;
-	microblaze_unwind(NULL, trace);
+	microblaze_unwind(NULL, trace, "");
 }
 EXPORT_SYMBOL_GPL(save_stack_trace);
 
 void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
 {
-	microblaze_unwind(tsk, trace);
+	microblaze_unwind(tsk, trace, "");
 }
 EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
--- a/arch/microblaze/kernel/traps.c~microblaze-add-loglvl-to-microblaze_unwind
+++ a/arch/microblaze/kernel/traps.c
@@ -68,7 +68,7 @@ void show_stack(struct task_struct *task
 	print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 32, 4, (void *)fp,
 		       words_to_show << 2, 0);
 	pr_info("\n\nCall Trace:\n");
-	microblaze_unwind(task, NULL);
+	microblaze_unwind(task, NULL, KERN_INFO);
 	pr_info("\n");
 
 	if (!task)
--- a/arch/microblaze/kernel/unwind.c~microblaze-add-loglvl-to-microblaze_unwind
+++ a/arch/microblaze/kernel/unwind.c
@@ -287,11 +287,11 @@ static void microblaze_unwind_inner(stru
  * @task  : Task whose stack we are to unwind (NULL == current)
  * @trace : Where to store stack backtrace (PC values).
  *	    NULL == print backtrace to kernel log
+ * @loglvl : Used for printk log level if (trace == NULL).
  */
-void microblaze_unwind(struct task_struct *task, struct stack_trace *trace)
+void microblaze_unwind(struct task_struct *task, struct stack_trace *trace,
+		       const char *loglvl)
 {
-	const char *loglvl = KERN_INFO;
-
 	if (task) {
 		if (task == current) {
 			const struct pt_regs *regs = task_pt_regs(task);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 20/93] microblaze: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (18 preceding siblings ...)
  2020-06-09  4:30 ` [patch 19/93] microblaze: add loglvl to microblaze_unwind() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:30 ` [patch 21/93] mips: " Andrew Morton
                   ` (75 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mm-commits, monstr, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: microblaze: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-21-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/microblaze/kernel/traps.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

--- a/arch/microblaze/kernel/traps.c~microblaze-add-show_stack_loglvl
+++ a/arch/microblaze/kernel/traps.c
@@ -31,7 +31,8 @@ static int __init kstack_setup(char *s)
 }
 __setup("kstack=", kstack_setup);
 
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
 {
 	unsigned long words_to_show;
 	u32 fp = (u32) sp;
@@ -50,7 +51,7 @@ void show_stack(struct task_struct *task
 	if (kstack_depth_to_print && (words_to_show > kstack_depth_to_print))
 		words_to_show = kstack_depth_to_print;
 
-	pr_info("Kernel Stack:\n");
+	printk("%sKernel Stack:\n", loglvl);
 
 	/*
 	 * Make the first line an 'odd' size if necessary to get
@@ -65,14 +66,19 @@ void show_stack(struct task_struct *task
 			words_to_show -= line1_words;
 		}
 	}
-	print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 32, 4, (void *)fp,
+	print_hex_dump(loglvl, "", DUMP_PREFIX_ADDRESS, 32, 4, (void *)fp,
 		       words_to_show << 2, 0);
-	pr_info("\n\nCall Trace:\n");
-	microblaze_unwind(task, NULL, KERN_INFO);
-	pr_info("\n");
+	printk("%s\n\nCall Trace:\n", loglvl);
+	microblaze_unwind(task, NULL, loglvl);
+	printk("%s\n", loglvl);
 
 	if (!task)
 		task = current;
 
 	debug_show_held_locks(task);
 }
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_INFO);
+}
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 21/93] mips: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (19 preceding siblings ...)
  2020-06-09  4:30 ` [patch 20/93] microblaze: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:30 ` Andrew Morton
  2020-06-09  4:31 ` [patch 22/93] nds32: " Andrew Morton
                   ` (74 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:30 UTC (permalink / raw)
  To: akpm, dima, jhogan, linux-mm, mm-commits, paulburton, ralf, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: mips: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-22-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/mips/kernel/traps.c |   41 +++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 17 deletions(-)

--- a/arch/mips/kernel/traps.c~mips-add-show_stack_loglvl
+++ a/arch/mips/kernel/traps.c
@@ -108,26 +108,26 @@ void (*board_bind_eic_interrupt)(int irq
 void (*board_ebase_setup)(void);
 void(*board_cache_error_setup)(void);
 
-static void show_raw_backtrace(unsigned long reg29)
+static void show_raw_backtrace(unsigned long reg29, const char *loglvl)
 {
 	unsigned long *sp = (unsigned long *)(reg29 & ~3);
 	unsigned long addr;
 
-	printk("Call Trace:");
+	printk("%sCall Trace:", loglvl);
 #ifdef CONFIG_KALLSYMS
-	printk("\n");
+	printk("%s\n", loglvl);
 #endif
 	while (!kstack_end(sp)) {
 		unsigned long __user *p =
 			(unsigned long __user *)(unsigned long)sp++;
 		if (__get_user(addr, p)) {
-			printk(" (Bad stack address)");
+			printk("%s (Bad stack address)", loglvl);
 			break;
 		}
 		if (__kernel_text_address(addr))
-			print_ip_sym(KERN_DEFAULT, addr);
+			print_ip_sym(loglvl, addr);
 	}
-	printk("\n");
+	printk("%s\n", loglvl);
 }
 
 #ifdef CONFIG_KALLSYMS
@@ -140,7 +140,8 @@ static int __init set_raw_show_trace(cha
 __setup("raw_show_trace", set_raw_show_trace);
 #endif
 
-static void show_backtrace(struct task_struct *task, const struct pt_regs *regs)
+static void show_backtrace(struct task_struct *task, const struct pt_regs *regs,
+			   const char *loglvl)
 {
 	unsigned long sp = regs->regs[29];
 	unsigned long ra = regs->regs[31];
@@ -150,12 +151,12 @@ static void show_backtrace(struct task_s
 		task = current;
 
 	if (raw_show_trace || user_mode(regs) || !__kernel_text_address(pc)) {
-		show_raw_backtrace(sp);
+		show_raw_backtrace(sp, loglvl);
 		return;
 	}
-	printk("Call Trace:\n");
+	printk("%sCall Trace:\n", loglvl);
 	do {
-		print_ip_sym(KERN_DEFAULT, pc);
+		print_ip_sym(loglvl, pc);
 		pc = unwind_stack(task, &sp, pc, &ra);
 	} while (pc);
 	pr_cont("\n");
@@ -166,19 +167,19 @@ static void show_backtrace(struct task_s
  * with at least a bit of error checking ...
  */
 static void show_stacktrace(struct task_struct *task,
-	const struct pt_regs *regs)
+	const struct pt_regs *regs, const char *loglvl)
 {
 	const int field = 2 * sizeof(unsigned long);
 	long stackdata;
 	int i;
 	unsigned long __user *sp = (unsigned long __user *)regs->regs[29];
 
-	printk("Stack :");
+	printk("%sStack :", loglvl);
 	i = 0;
 	while ((unsigned long) sp & (PAGE_SIZE - 1)) {
 		if (i && ((i % (64 / field)) == 0)) {
 			pr_cont("\n");
-			printk("       ");
+			printk("%s       ", loglvl);
 		}
 		if (i > 39) {
 			pr_cont(" ...");
@@ -194,10 +195,11 @@ static void show_stacktrace(struct task_
 		i++;
 	}
 	pr_cont("\n");
-	show_backtrace(task, regs);
+	show_backtrace(task, regs, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
 {
 	struct pt_regs regs;
 	mm_segment_t old_fs = get_fs();
@@ -221,10 +223,15 @@ void show_stack(struct task_struct *task
 	 * the stack in the kernel (not user) address space.
 	 */
 	set_fs(KERNEL_DS);
-	show_stacktrace(task, &regs);
+	show_stacktrace(task, &regs, loglvl);
 	set_fs(old_fs);
 }
 
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT)
+}
+
 static void show_code(unsigned int __user *pc)
 {
 	long i;
@@ -373,7 +380,7 @@ void show_registers(struct pt_regs *regs
 	if (!user_mode(regs))
 		/* Necessary for getting the correct stack content */
 		set_fs(KERNEL_DS);
-	show_stacktrace(current, regs);
+	show_stacktrace(current, regs, KERN_DEFAULT);
 	show_code((unsigned int __user *) regs->cp0_epc);
 	printk("\n");
 	set_fs(old_fs);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 22/93] nds32: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (20 preceding siblings ...)
  2020-06-09  4:30 ` [patch 21/93] mips: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 23/93] nios2: " Andrew Morton
                   ` (73 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, deanbo422, dima, green.hu, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: nds32: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-23-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/nds32/kernel/traps.c |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

--- a/arch/nds32/kernel/traps.c~nds32-add-show_stack_loglvl
+++ a/arch/nds32/kernel/traps.c
@@ -97,18 +97,19 @@ static void dump_instr(struct pt_regs *r
 }
 
 #define LOOP_TIMES (100)
-static void __dump(struct task_struct *tsk, unsigned long *base_reg)
+static void __dump(struct task_struct *tsk, unsigned long *base_reg,
+		   const char *loglvl)
 {
 	unsigned long ret_addr;
 	int cnt = LOOP_TIMES, graph = 0;
-	pr_emerg("Call Trace:\n");
+	printk("%sCall Trace:\n", loglvl);
 	if (!IS_ENABLED(CONFIG_FRAME_POINTER)) {
 		while (!kstack_end(base_reg)) {
 			ret_addr = *base_reg++;
 			if (__kernel_text_address(ret_addr)) {
 				ret_addr = ftrace_graph_ret_addr(
 						tsk, &graph, ret_addr, NULL);
-				print_ip_sym(KERN_EMERG, ret_addr);
+				print_ip_sym(loglvl, ret_addr);
 			}
 			if (--cnt < 0)
 				break;
@@ -124,17 +125,18 @@ static void __dump(struct task_struct *t
 
 				ret_addr = ftrace_graph_ret_addr(
 						tsk, &graph, ret_addr, NULL);
-				print_ip_sym(KERN_EMERG, ret_addr);
+				print_ip_sym(loglvl, ret_addr);
 			}
 			if (--cnt < 0)
 				break;
 			base_reg = (unsigned long *)next_fp;
 		}
 	}
-	pr_emerg("\n");
+	printk("%s\n", loglvl);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+		       const char *loglvl)
 {
 	unsigned long *base_reg;
 
@@ -151,10 +153,15 @@ void show_stack(struct task_struct *tsk,
 		else
 			__asm__ __volatile__("\tori\t%0, $fp, #0\n":"=r"(base_reg));
 	}
-	__dump(tsk, base_reg);
+	__dump(tsk, base_reg, loglvl);
 	barrier();
 }
 
+void show_stack(struct task_struct *tsk, unsigned long *sp)
+{
+	show_stack_loglvl(tsk, sp, KERN_EMERG);
+}
+
 DEFINE_SPINLOCK(die_lock);
 
 /*
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 23/93] nios2: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (21 preceding siblings ...)
  2020-06-09  4:31 ` [patch 22/93] nds32: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 24/93] openrisc: " Andrew Morton
                   ` (72 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dima, lftan, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: nios2: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-24-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Ley Foon Tan <lftan@altera.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/nios2/kernel/traps.c |   23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

--- a/arch/nios2/kernel/traps.c~nios2-add-show_stack_loglvl
+++ a/arch/nios2/kernel/traps.c
@@ -52,12 +52,14 @@ void _exception(int signo, struct pt_reg
 }
 
 /*
- * The show_stack is an external API which we do not use ourselves.
+ * The show_stack(), show_stack_loglvl() are external API
+ * which we do not use ourselves.
  */
 
 int kstack_depth_to_print = 48;
 
-void show_stack(struct task_struct *task, unsigned long *stack)
+void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+		       const char *loglvl)
 {
 	unsigned long *endstack, addr;
 	int i;
@@ -72,16 +74,16 @@ void show_stack(struct task_struct *task
 	addr = (unsigned long) stack;
 	endstack = (unsigned long *) PAGE_ALIGN(addr);
 
-	pr_emerg("Stack from %08lx:", (unsigned long)stack);
+	printk("%sStack from %08lx:", loglvl, (unsigned long)stack);
 	for (i = 0; i < kstack_depth_to_print; i++) {
 		if (stack + 1 > endstack)
 			break;
 		if (i % 8 == 0)
-			pr_emerg("\n       ");
-		pr_emerg(" %08lx", *stack++);
+			printk("%s\n       ", loglvl);
+		printk("%s %08lx", loglvl, *stack++);
 	}
 
-	pr_emerg("\nCall Trace:");
+	printk("%s\nCall Trace:", loglvl);
 	i = 0;
 	while (stack + 1 <= endstack) {
 		addr = *stack++;
@@ -97,11 +99,16 @@ void show_stack(struct task_struct *task
 		     (addr <= (unsigned long) _etext))) {
 			if (i % 4 == 0)
 				pr_emerg("\n       ");
-			pr_emerg(" [<%08lx>]", addr);
+			printk("%s [<%08lx>]", loglvl, addr);
 			i++;
 		}
 	}
-	pr_emerg("\n");
+	printk("%s\n", loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *stack)
+{
+	show_stack_loglvl(task, stack, KERN_EMERG);
 }
 
 void __init trap_init(void)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 24/93] openrisc: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (22 preceding siblings ...)
  2020-06-09  4:31 ` [patch 23/93] nios2: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 25/93] parisc: " Andrew Morton
                   ` (71 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dima, jonas, linux-mm, mm-commits, shorne,
	stefan.kristiansson, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: openrisc: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-25-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/openrisc/kernel/traps.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- a/arch/openrisc/kernel/traps.c~openrisc-add-show_stack_loglvl
+++ a/arch/openrisc/kernel/traps.c
@@ -41,18 +41,26 @@ unsigned long __user *lwa_addr;
 
 void print_trace(void *data, unsigned long addr, int reliable)
 {
-	pr_emerg("[<%p>] %s%pS\n", (void *) addr, reliable ? "" : "? ",
+	const char *loglvl = data;
+
+	printk("%s[<%p>] %s%pS\n", loglvl, (void *) addr, reliable ? "" : "? ",
 	       (void *) addr);
 }
 
 /* displays a short stack trace */
-void show_stack(struct task_struct *task, unsigned long *esp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
+		const char *loglvl)
 {
 	if (esp == NULL)
 		esp = (unsigned long *)&esp;
 
-	pr_emerg("Call trace:\n");
-	unwind_stack(NULL, esp, print_trace);
+	printk("%sCall trace:\n", loglvl);
+	unwind_stack((void *)loglvl, esp, print_trace);
+}
+
+void show_stack(struct task_struct *task, unsigned long *esp)
+{
+	show_stack_loglvl(task, esp, KERN_EMERG);
 }
 
 void show_registers(struct pt_regs *regs)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 25/93] parisc: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (23 preceding siblings ...)
  2020-06-09  4:31 ` [patch 24/93] openrisc: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 26/93] powerpc: " Andrew Morton
                   ` (70 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, deller, dima, James.Bottomley, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: parisc: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-26-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/parisc/kernel/traps.c |   28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

--- a/arch/parisc/kernel/traps.c~parisc-add-show_stack_loglvl
+++ a/arch/parisc/kernel/traps.c
@@ -49,7 +49,7 @@
 #include "../math-emu/math-emu.h"	/* for handle_fpe() */
 
 static void parisc_show_stack(struct task_struct *task,
-	struct pt_regs *regs);
+	struct pt_regs *regs, const char *loglvl);
 
 static int printbinary(char *buf, unsigned long x, int nbits)
 {
@@ -155,7 +155,7 @@ void show_regs(struct pt_regs *regs)
 		printk("%s IAOQ[1]: %pS\n", level, (void *) regs->iaoq[1]);
 		printk("%s RP(r2): %pS\n", level, (void *) regs->gr[2]);
 
-		parisc_show_stack(current, regs);
+		parisc_show_stack(current, regs, KERN_DEFAULT);
 	}
 }
 
@@ -170,37 +170,43 @@ static DEFINE_RATELIMIT_STATE(_hppa_rs,
 }
 
 
-static void do_show_stack(struct unwind_frame_info *info)
+static void do_show_stack(struct unwind_frame_info *info, const char *loglvl)
 {
 	int i = 1;
 
-	printk(KERN_CRIT "Backtrace:\n");
+	printk("%sBacktrace:\n", loglvl);
 	while (i <= MAX_UNWIND_ENTRIES) {
 		if (unwind_once(info) < 0 || info->ip == 0)
 			break;
 
 		if (__kernel_text_address(info->ip)) {
-			printk(KERN_CRIT " [<" RFMT ">] %pS\n",
-				info->ip, (void *) info->ip);
+			printk("%s [<" RFMT ">] %pS\n",
+				loglvl, info->ip, (void *) info->ip);
 			i++;
 		}
 	}
-	printk(KERN_CRIT "\n");
+	printk("%s\n", loglvl);
 }
 
 static void parisc_show_stack(struct task_struct *task,
-	struct pt_regs *regs)
+	struct pt_regs *regs, const char *loglvl)
 {
 	struct unwind_frame_info info;
 
 	unwind_frame_init_task(&info, task, regs);
 
-	do_show_stack(&info);
+	do_show_stack(&info, loglvl);
+}
+
+void show_stack_loglvl(struct task_struct *t, unsigned long *sp,
+		       const char *loglvl)
+{
+	parisc_show_stack(t, NULL, loglvl);
 }
 
 void show_stack(struct task_struct *t, unsigned long *sp)
 {
-	parisc_show_stack(t, NULL);
+	show_stack_loglvl(t, sp, KERN_CRIT)
 }
 
 int is_valid_bugaddr(unsigned long iaoq)
@@ -446,7 +452,7 @@ void parisc_terminate(char *msg, struct
 		/* show_stack(NULL, (unsigned long *)regs->gr[30]); */
 		struct unwind_frame_info info;
 		unwind_frame_init(&info, current, regs);
-		do_show_stack(&info);
+		do_show_stack(&info, KERN_CRIT);
 	}
 
 	printk("\n");
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 26/93] powerpc: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (24 preceding siblings ...)
  2020-06-09  4:31 ` [patch 25/93] parisc: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 27/93] riscv: " Andrew Morton
                   ` (69 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, benh, dima, linux-mm, mm-commits, mpe, paulus, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: powerpc: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-27-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/kernel/process.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

--- a/arch/powerpc/kernel/process.c~powerpc-add-show_stack_loglvl
+++ a/arch/powerpc/kernel/process.c
@@ -2063,7 +2063,8 @@ unsigned long get_wchan(struct task_stru
 
 static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
 
-void show_stack(struct task_struct *tsk, unsigned long *stack)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *stack,
+		       const char *loglvl)
 {
 	unsigned long sp, ip, lr, newsp;
 	int count = 0;
@@ -2088,7 +2089,7 @@ void show_stack(struct task_struct *tsk,
 	}
 
 	lr = 0;
-	printk("Call Trace:\n");
+	printk("%sCall Trace:\n", loglvl);
 	do {
 		if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD))
 			break;
@@ -2097,7 +2098,8 @@ void show_stack(struct task_struct *tsk,
 		newsp = stack[0];
 		ip = stack[STACK_FRAME_LR_SAVE];
 		if (!firstframe || ip != lr) {
-			printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
+			printk("%s["REG"] ["REG"] %pS",
+				loglvl, sp, ip, (void *)ip);
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 			ret_addr = ftrace_graph_ret_addr(current,
 						&ftrace_idx, ip, stack);
@@ -2119,8 +2121,9 @@ void show_stack(struct task_struct *tsk,
 			struct pt_regs *regs = (struct pt_regs *)
 				(sp + STACK_FRAME_OVERHEAD);
 			lr = regs->link;
-			printk("--- interrupt: %lx at %pS\n    LR = %pS\n",
-			       regs->trap, (void *)regs->nip, (void *)lr);
+			printk("%s--- interrupt: %lx at %pS\n    LR = %pS\n",
+			       loglvl, regs->trap,
+			       (void *)regs->nip, (void *)lr);
 			firstframe = 1;
 		}
 
@@ -2130,6 +2133,11 @@ void show_stack(struct task_struct *tsk,
 	put_task_stack(tsk);
 }
 
+void show_stack(struct task_struct *tsk, unsigned long *stack)
+{
+	show_stack_loglvl(tsk, stack, KERN_DEFAULT);
+}
+
 #ifdef CONFIG_PPC64
 /* Called with hard IRQs off */
 void notrace __ppc64_runlatch_on(void)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 27/93] riscv: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (25 preceding siblings ...)
  2020-06-09  4:31 ` [patch 26/93] powerpc: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 28/93] s390: " Andrew Morton
                   ` (68 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, aou, dima, linux-mm, mm-commits, palmer, paul.walmsley, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: riscv: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-28-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/riscv/kernel/stacktrace.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

--- a/arch/riscv/kernel/stacktrace.c~riscv-add-show_stack_loglvl
+++ a/arch/riscv/kernel/stacktrace.c
@@ -99,16 +99,23 @@ void notrace walk_stackframe(struct task
 
 static bool print_trace_address(unsigned long pc, void *arg)
 {
-	print_ip_sym(KERN_DEFAULT, pc);
+	const char *loglvl = arg;
+
+	print_ip_sym(loglvl, pc);
 	return false;
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
 {
 	pr_cont("Call Trace:\n");
-	walk_stackframe(task, NULL, print_trace_address, NULL);
+	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
 }
 
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
+}
 
 static bool save_wchan(unsigned long pc, void *arg)
 {
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 28/93] s390: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (26 preceding siblings ...)
  2020-06-09  4:31 ` [patch 27/93] riscv: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 29/93] sh: add loglvl to dump_mem() Andrew Morton
                   ` (67 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, borntraeger, dima, gor, heiko.carstens, linux-mm,
	mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: s390: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-29-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/s390/kernel/dumpstack.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

--- a/arch/s390/kernel/dumpstack.c~s390-add-show_stack_loglvl
+++ a/arch/s390/kernel/dumpstack.c
@@ -126,18 +126,24 @@ unknown:
 	return -EINVAL;
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
+void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+		       const char *loglvl)
 {
 	struct unwind_state state;
 
-	printk("Call Trace:\n");
+	printk("%sCall Trace:\n", loglvl);
 	unwind_for_each_frame(&state, task, NULL, (unsigned long) stack)
-		printk(state.reliable ? " [<%016lx>] %pSR \n" :
-					"([<%016lx>] %pSR)\n",
-		       state.ip, (void *) state.ip);
+		printk(state.reliable ? "%s [<%016lx>] %pSR \n" :
+					"%s([<%016lx>] %pSR)\n",
+		       loglvl, state.ip, (void *) state.ip);
 	debug_show_held_locks(task ? : current);
 }
 
+void show_stack(struct task_struct *task, unsigned long *stack)
+{
+	show_stack_loglvl(task, stack, KERN_DEFAULT);
+}
+
 static void show_last_breaking_event(struct pt_regs *regs)
 {
 	printk("Last Breaking-Event-Address:\n");
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 29/93] sh: add loglvl to dump_mem()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (27 preceding siblings ...)
  2020-06-09  4:31 ` [patch 28/93] s390: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 30/93] sh: remove needless printk() Andrew Morton
                   ` (66 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dalias, dima, linux-mm, mm-commits, torvalds, ysato

From: Dmitry Safonov <dima@arista.com>
Subject: sh: add loglvl to dump_mem()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to dump_mem() as a preparation to introduce
show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-30-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sh/include/asm/kdebug.h |    3 ++-
 arch/sh/kernel/dumpstack.c   |   17 +++++++++--------
 arch/sh/kernel/traps.c       |    4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)

--- a/arch/sh/include/asm/kdebug.h~sh-add-loglvl-to-dump_mem
+++ a/arch/sh/include/asm/kdebug.h
@@ -13,6 +13,7 @@ enum die_val {
 
 /* arch/sh/kernel/dumpstack.c */
 extern void printk_address(unsigned long address, int reliable);
-extern void dump_mem(const char *str, unsigned long bottom, unsigned long top);
+extern void dump_mem(const char *str, const char *loglvl,
+		     unsigned long bottom, unsigned long top);
 
 #endif /* __ASM_SH_KDEBUG_H */
--- a/arch/sh/kernel/dumpstack.c~sh-add-loglvl-to-dump_mem
+++ a/arch/sh/kernel/dumpstack.c
@@ -16,30 +16,31 @@
 #include <asm/unwinder.h>
 #include <asm/stacktrace.h>
 
-void dump_mem(const char *str, unsigned long bottom, unsigned long top)
+void dump_mem(const char *str, const char *loglvl,
+	      unsigned long bottom, unsigned long top)
 {
 	unsigned long p;
 	int i;
 
-	printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
+	printk("%s%s(0x%08lx to 0x%08lx)\n", loglvl, str, bottom, top);
 
 	for (p = bottom & ~31; p < top; ) {
-		printk("%04lx: ", p & 0xffff);
+		printk("%s%04lx: ", loglvl,  p & 0xffff);
 
 		for (i = 0; i < 8; i++, p += 4) {
 			unsigned int val;
 
 			if (p < bottom || p >= top)
-				printk("         ");
+				printk("%s         ", loglvl);
 			else {
 				if (__get_user(val, (unsigned int __user *)p)) {
-					printk("\n");
+					printk("%s\n", loglvl);
 					return;
 				}
-				printk("%08x ", val);
+				printk("%s%08x ", loglvl, val);
 			}
 		}
-		printk("\n");
+		printk("%s\n", loglvl);
 	}
 }
 
@@ -156,7 +157,7 @@ void show_stack(struct task_struct *tsk,
 		sp = (unsigned long *)tsk->thread.sp;
 
 	stack = (unsigned long)sp;
-	dump_mem("Stack: ", stack, THREAD_SIZE +
+	dump_mem("Stack: ", KERN_DEFAULT, stack, THREAD_SIZE +
 		 (unsigned long)task_stack_page(tsk));
 	show_trace(tsk, sp, NULL);
 }
--- a/arch/sh/kernel/traps.c~sh-add-loglvl-to-dump_mem
+++ a/arch/sh/kernel/traps.c
@@ -38,8 +38,8 @@ void die(const char *str, struct pt_regs
 			task_pid_nr(current), task_stack_page(current) + 1);
 
 	if (!user_mode(regs) || in_interrupt())
-		dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
-			 (unsigned long)task_stack_page(current));
+		dump_mem("Stack: ", KERN_DEFAULT, regs->regs[15],
+			THREAD_SIZE + (unsigned long)task_stack_page(current));
 
 	notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 30/93] sh: remove needless printk()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (28 preceding siblings ...)
  2020-06-09  4:31 ` [patch 29/93] sh: add loglvl to dump_mem() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 31/93] sh: add loglvl to printk_address() Andrew Morton
                   ` (65 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dalias, dima, linux-mm, mm-commits, torvalds, ysato

From: Dmitry Safonov <dima@arista.com>
Subject: sh: remove needless printk()

Currently `data' is always an empty line "".  No need for additional
printk() call.

Link: http://lkml.kernel.org/r/20200418201944.482088-31-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sh/kernel/dumpstack.c |    1 -
 1 file changed, 1 deletion(-)

--- a/arch/sh/kernel/dumpstack.c~sh-remove-needless-printk
+++ a/arch/sh/kernel/dumpstack.c
@@ -118,7 +118,6 @@ static int print_trace_stack(void *data,
  */
 static void print_trace_address(void *data, unsigned long addr, int reliable)
 {
-	printk("%s", (char *)data);
 	printk_address(addr, reliable);
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 31/93] sh: add loglvl to printk_address()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (29 preceding siblings ...)
  2020-06-09  4:31 ` [patch 30/93] sh: remove needless printk() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 32/93] sh: add loglvl to show_trace() Andrew Morton
                   ` (64 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dalias, dima, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: sh: add loglvl to printk_address()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to printk_address() as a preparation to introduce
show_stack_loglvl().

As a good side-effect show_fault_oops() now prints the address with
KERN_EMREG as the rest of output, making sure there won't be situation
where "PC: " is printed without actual address.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-32-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Rich Felker <dalias@libc.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sh/include/asm/kdebug.h |    3 ++-
 arch/sh/kernel/dumpstack.c   |    6 +++---
 arch/sh/mm/fault.c           |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

--- a/arch/sh/include/asm/kdebug.h~sh-add-loglvl-to-printk_address
+++ a/arch/sh/include/asm/kdebug.h
@@ -12,7 +12,8 @@ enum die_val {
 };
 
 /* arch/sh/kernel/dumpstack.c */
-extern void printk_address(unsigned long address, int reliable);
+extern void printk_address(unsigned long address, int reliable,
+			   const char *loglvl);
 extern void dump_mem(const char *str, const char *loglvl,
 		     unsigned long bottom, unsigned long top);
 
--- a/arch/sh/kernel/dumpstack.c~sh-add-loglvl-to-printk_address
+++ a/arch/sh/kernel/dumpstack.c
@@ -44,9 +44,9 @@ void dump_mem(const char *str, const cha
 	}
 }
 
-void printk_address(unsigned long address, int reliable)
+void printk_address(unsigned long address, int reliable, const char *loglvl)
 {
-	printk(" [<%p>] %s%pS\n", (void *) address,
+	printk("%s [<%p>] %s%pS\n", loglvl, (void *) address,
 			reliable ? "" : "? ", (void *) address);
 }
 
@@ -118,7 +118,7 @@ static int print_trace_stack(void *data,
  */
 static void print_trace_address(void *data, unsigned long addr, int reliable)
 {
-	printk_address(addr, reliable);
+	printk_address(addr, reliable, (char *)data);
 }
 
 static const struct stacktrace_ops print_trace_ops = {
--- a/arch/sh/mm/fault.c~sh-add-loglvl-to-printk_address
+++ a/arch/sh/mm/fault.c
@@ -214,7 +214,7 @@ show_fault_oops(struct pt_regs *regs, un
 				     : "paging request",
 		 address);
 	pr_alert("PC:");
-	printk_address(regs->pc, 1);
+	printk_address(regs->pc, 1, KERN_ALERT);
 
 	show_pte(NULL, address);
 }
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 32/93] sh: add loglvl to show_trace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (30 preceding siblings ...)
  2020-06-09  4:31 ` [patch 31/93] sh: add loglvl to printk_address() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 33/93] sh: add show_stack_loglvl() Andrew Morton
                   ` (63 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dalias, dima, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: sh: add loglvl to show_trace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level parameter to show_trace() as a preparation to introduce
show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-33-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Rich Felker <dalias@libc.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sh/include/asm/processor_32.h |    2 +-
 arch/sh/kernel/dumpstack.c         |   10 +++++-----
 arch/sh/kernel/process_32.c        |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

--- a/arch/sh/include/asm/processor_32.h~sh-add-loglvl-to-show_trace
+++ a/arch/sh/include/asm/processor_32.h
@@ -171,7 +171,7 @@ static __inline__ void enable_fpu(void)
 #define thread_saved_pc(tsk)	(tsk->thread.pc)
 
 void show_trace(struct task_struct *tsk, unsigned long *sp,
-		struct pt_regs *regs);
+		struct pt_regs *regs, const char *loglvl);
 
 #ifdef CONFIG_DUMP_CODE
 void show_code(struct pt_regs *regs);
--- a/arch/sh/kernel/dumpstack.c~sh-add-loglvl-to-show_trace
+++ a/arch/sh/kernel/dumpstack.c
@@ -127,16 +127,16 @@ static const struct stacktrace_ops print
 };
 
 void show_trace(struct task_struct *tsk, unsigned long *sp,
-		struct pt_regs *regs)
+		struct pt_regs *regs, const char *loglvl)
 {
 	if (regs && user_mode(regs))
 		return;
 
-	printk("\nCall trace:\n");
+	printk("%s\nCall trace:\n", loglvl);
 
-	unwind_stack(tsk, regs, sp, &print_trace_ops, "");
+	unwind_stack(tsk, regs, sp, &print_trace_ops, (void *)loglvl);
 
-	printk("\n");
+	printk("%s\n", loglvl);
 
 	if (!tsk)
 		tsk = current;
@@ -158,5 +158,5 @@ void show_stack(struct task_struct *tsk,
 	stack = (unsigned long)sp;
 	dump_mem("Stack: ", KERN_DEFAULT, stack, THREAD_SIZE +
 		 (unsigned long)task_stack_page(tsk));
-	show_trace(tsk, sp, NULL);
+	show_trace(tsk, sp, NULL, KERN_DEFAULT);
 }
--- a/arch/sh/kernel/process_32.c~sh-add-loglvl-to-show_trace
+++ a/arch/sh/kernel/process_32.c
@@ -59,7 +59,7 @@ void show_regs(struct pt_regs * regs)
 	printk("MACH: %08lx MACL: %08lx GBR : %08lx PR  : %08lx\n",
 	       regs->mach, regs->macl, regs->gbr, regs->pr);
 
-	show_trace(NULL, (unsigned long *)regs->regs[15], regs);
+	show_trace(NULL, (unsigned long *)regs->regs[15], regs, KERN_DEFAULT);
 	show_code(regs);
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 33/93] sh: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (31 preceding siblings ...)
  2020-06-09  4:31 ` [patch 32/93] sh: add loglvl to show_trace() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 34/93] sparc: " Andrew Morton
                   ` (62 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dalias, dima, linux-mm, mm-commits, torvalds, ysato

From: Dmitry Safonov <dima@arista.com>
Subject: sh: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-34-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sh/kernel/dumpstack.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/arch/sh/kernel/dumpstack.c~sh-add-show_stack_loglvl
+++ a/arch/sh/kernel/dumpstack.c
@@ -144,7 +144,8 @@ void show_trace(struct task_struct *tsk,
 	debug_show_held_locks(tsk);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+		       const char *loglvl)
 {
 	unsigned long stack;
 
@@ -156,7 +157,12 @@ void show_stack(struct task_struct *tsk,
 		sp = (unsigned long *)tsk->thread.sp;
 
 	stack = (unsigned long)sp;
-	dump_mem("Stack: ", KERN_DEFAULT, stack, THREAD_SIZE +
+	dump_mem("Stack: ", loglvl, stack, THREAD_SIZE +
 		 (unsigned long)task_stack_page(tsk));
-	show_trace(tsk, sp, NULL, KERN_DEFAULT);
+	show_trace(tsk, sp, NULL, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
 }
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 34/93] sparc: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (32 preceding siblings ...)
  2020-06-09  4:31 ` [patch 33/93] sh: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 35/93] um/sysrq: remove needless variable sp Andrew Morton
                   ` (61 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, davem, dima, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: sparc: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-35-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sparc/kernel/process_32.c |   17 ++++++++++++-----
 arch/sparc/kernel/traps_64.c   |   15 +++++++++++----
 2 files changed, 23 insertions(+), 9 deletions(-)

--- a/arch/sparc/kernel/process_32.c~sparc-add-show_stack_loglvl
+++ a/arch/sparc/kernel/process_32.c
@@ -145,10 +145,12 @@ void show_regs(struct pt_regs *r)
 }
 
 /*
- * The show_stack is an external API which we do not use ourselves.
+ * The show_stack(), show_stack_loglvl() are external APIs which
+ * we do not use ourselves.
  * The oops is printed in die_if_kernel.
  */
-void show_stack(struct task_struct *tsk, unsigned long *_ksp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
+		       const char *loglvl)
 {
 	unsigned long pc, fp;
 	unsigned long task_base;
@@ -170,11 +172,16 @@ void show_stack(struct task_struct *tsk,
 			break;
 		rw = (struct reg_window32 *) fp;
 		pc = rw->ins[7];
-		printk("[%08lx : ", pc);
-		printk("%pS ] ", (void *) pc);
+		printk("%s[%08lx : ", loglvl, pc);
+		printk("%s%pS ] ", loglvl, (void *) pc);
 		fp = rw->ins[6];
 	} while (++count < 16);
-	printk("\n");
+	printk("%s\n", loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
 }
 
 /*
--- a/arch/sparc/kernel/traps_64.c~sparc-add-show_stack_loglvl
+++ a/arch/sparc/kernel/traps_64.c
@@ -18,6 +18,7 @@
 #include <linux/smp.h>
 #include <linux/mm.h>
 #include <linux/init.h>
+#include <linux/kallsyms.h>
 #include <linux/kdebug.h>
 #include <linux/ftrace.h>
 #include <linux/reboot.h>
@@ -2452,7 +2453,8 @@ static void user_instruction_dump(unsign
 	printk("\n");
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *_ksp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
+			 const char *loglvl)
 {
 	unsigned long fp, ksp;
 	struct thread_info *tp;
@@ -2476,7 +2478,7 @@ void show_stack(struct task_struct *tsk,
 
 	fp = ksp + STACK_BIAS;
 
-	printk("Call Trace:\n");
+	printk("%sCall Trace:\n", loglvl);
 	do {
 		struct sparc_stackf *sf;
 		struct pt_regs *regs;
@@ -2497,14 +2499,14 @@ void show_stack(struct task_struct *tsk,
 			fp = (unsigned long)sf->fp + STACK_BIAS;
 		}
 
-		printk(" [%016lx] %pS\n", pc, (void *) pc);
+		print_ip_sym(loglvl, pc);
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 		if ((pc + 8UL) == (unsigned long) &return_to_handler) {
 			struct ftrace_ret_stack *ret_stack;
 			ret_stack = ftrace_graph_get_ret_stack(tsk, graph);
 			if (ret_stack) {
 				pc = ret_stack->ret;
-				printk(" [%016lx] %pS\n", pc, (void *) pc);
+				print_ip_sym(loglvl, pc);
 				graph++;
 			}
 		}
@@ -2512,6 +2514,11 @@ void show_stack(struct task_struct *tsk,
 	} while (++count < 16);
 }
 
+void show_stack(struct task_struct *tsk, unsigned long *_ksp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
+}
+
 static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
 {
 	unsigned long fp = rw->ins[6];
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 35/93] um/sysrq: remove needless variable sp
  2020-06-09  4:29 incoming Andrew Morton
                   ` (33 preceding siblings ...)
  2020-06-09  4:31 ` [patch 34/93] sparc: " Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 36/93] um: add show_stack_loglvl() Andrew Morton
                   ` (60 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, anton.ivanov, dima, jdike, linux-mm, mm-commits, richard, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: um/sysrq: remove needless variable sp

`sp' is a needless excercise here.

Link: http://lkml.kernel.org/r/20200418201944.482088-36-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/um/kernel/sysrq.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/arch/um/kernel/sysrq.c~um-sysrq-remove-needless-variable-sp
+++ a/arch/um/kernel/sysrq.c
@@ -27,7 +27,6 @@ static const struct stacktrace_ops stack
 
 void show_stack(struct task_struct *task, unsigned long *stack)
 {
-	unsigned long *sp = stack;
 	struct pt_regs *segv_regs = current->thread.segv_regs;
 	int i;
 
@@ -38,10 +37,9 @@ void show_stack(struct task_struct *task
 	}
 
 	if (!stack)
-		sp = get_stack_pointer(task, segv_regs);
+		stack = get_stack_pointer(task, segv_regs);
 
 	pr_info("Stack:\n");
-	stack = sp;
 	for (i = 0; i < 3 * STACKSLOTS_PER_LINE; i++) {
 		if (kstack_end(stack))
 			break;
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 36/93] um: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (34 preceding siblings ...)
  2020-06-09  4:31 ` [patch 35/93] um/sysrq: remove needless variable sp Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 37/93] unicore32: remove unused pmode argument in c_backtrace() Andrew Morton
                   ` (59 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, anton.ivanov, dima, jdike, linux-mm, mm-commits, richard, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: um: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-37-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/um/kernel/sysrq.c |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

--- a/arch/um/kernel/sysrq.c~um-add-show_stack_loglvl
+++ a/arch/um/kernel/sysrq.c
@@ -17,7 +17,9 @@
 
 static void _print_addr(void *data, unsigned long address, int reliable)
 {
-	pr_info(" [<%08lx>] %s%pS\n", address, reliable ? "" : "? ",
+	const char *loglvl = data;
+
+	printk("%s [<%08lx>] %s%pS\n", loglvl, address, reliable ? "" : "? ",
 		(void *)address);
 }
 
@@ -25,7 +27,8 @@ static const struct stacktrace_ops stack
 	.address = _print_addr
 };
 
-void show_stack(struct task_struct *task, unsigned long *stack)
+void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+		       const char *loglvl)
 {
 	struct pt_regs *segv_regs = current->thread.segv_regs;
 	int i;
@@ -39,17 +42,22 @@ void show_stack(struct task_struct *task
 	if (!stack)
 		stack = get_stack_pointer(task, segv_regs);
 
-	pr_info("Stack:\n");
+	printk("%sStack:\n", loglvl);
 	for (i = 0; i < 3 * STACKSLOTS_PER_LINE; i++) {
 		if (kstack_end(stack))
 			break;
 		if (i && ((i % STACKSLOTS_PER_LINE) == 0))
-			pr_cont("\n");
+			printk("%s\n", loglvl);
 		pr_cont(" %08lx", *stack++);
 	}
-	pr_cont("\n");
+	printk("%s\n", loglvl);
+
+	printk("%sCall Trace:\n", loglvl);
+	dump_trace(current, &stackops, (void *)loglvl);
+	printk("%s\n", loglvl);
+}
 
-	pr_info("Call Trace:\n");
-	dump_trace(current, &stackops, NULL);
-	pr_info("\n");
+void show_stack(struct task_struct *task, unsigned long *stack)
+{
+	show_stack_loglvl(task, stack, KERN_INFO);
 }
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 37/93] unicore32: remove unused pmode argument in c_backtrace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (35 preceding siblings ...)
  2020-06-09  4:31 ` [patch 36/93] um: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 38/93] unicore32: add loglvl to c_backtrace() Andrew Morton
                   ` (58 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dima, gxt, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: unicore32: remove unused pmode argument in c_backtrace()

The pmode parameter isn't used in assembly - remove it.  Second argument
will be reused for printk() log level.

Link: http://lkml.kernel.org/r/20200418201944.482088-38-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/unicore32/kernel/setup.h |    2 +-
 arch/unicore32/kernel/traps.c |   14 +++++---------
 2 files changed, 6 insertions(+), 10 deletions(-)

--- a/arch/unicore32/kernel/setup.h~unicore32-remove-unused-pmode-argument-in-c_backtrace
+++ a/arch/unicore32/kernel/setup.h
@@ -29,7 +29,7 @@ extern void kernel_thread_helper(void);
 extern void __init early_signal_init(void);
 
 extern asmlinkage void __backtrace(void);
-extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
+extern asmlinkage void c_backtrace(unsigned long fp);
 
 extern void __show_regs(struct pt_regs *);
 
--- a/arch/unicore32/kernel/traps.c~unicore32-remove-unused-pmode-argument-in-c_backtrace
+++ a/arch/unicore32/kernel/traps.c
@@ -137,7 +137,7 @@ static void dump_instr(const char *lvl,
 
 static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
 {
-	unsigned int fp, mode;
+	unsigned int fp;
 	int ok = 1;
 
 	printk(KERN_DEFAULT "Backtrace: ");
@@ -145,16 +145,12 @@ static void dump_backtrace(struct pt_reg
 	if (!tsk)
 		tsk = current;
 
-	if (regs) {
+	if (regs)
 		fp = regs->UCreg_fp;
-		mode = processor_mode(regs);
-	} else if (tsk != current) {
+	else if (tsk != current)
 		fp = thread_saved_fp(tsk);
-		mode = 0x10;
-	} else {
+	else
 		asm("mov %0, fp" : "=r" (fp) : : "cc");
-		mode = 0x10;
-	}
 
 	if (!fp) {
 		printk("no frame pointer");
@@ -167,7 +163,7 @@ static void dump_backtrace(struct pt_reg
 	printk("\n");
 
 	if (ok)
-		c_backtrace(fp, mode);
+		c_backtrace(fp);
 }
 
 void show_stack(struct task_struct *tsk, unsigned long *sp)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 38/93] unicore32: add loglvl to c_backtrace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (36 preceding siblings ...)
  2020-06-09  4:31 ` [patch 37/93] unicore32: remove unused pmode argument in c_backtrace() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 39/93] unicore32: add show_stack_loglvl() Andrew Morton
                   ` (57 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dima, gxt, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: unicore32: add loglvl to c_backtrace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level parameter to c_backtrace() as a preparation for introducing
show_stack_loglvl()

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-39-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/unicore32/kernel/setup.h  |    2 +-
 arch/unicore32/kernel/traps.c  |    2 +-
 arch/unicore32/lib/backtrace.S |   24 ++++++++++++++++--------
 3 files changed, 18 insertions(+), 10 deletions(-)

--- a/arch/unicore32/kernel/setup.h~unicore32-add-loglvl-to-c_backtrace
+++ a/arch/unicore32/kernel/setup.h
@@ -29,7 +29,7 @@ extern void kernel_thread_helper(void);
 extern void __init early_signal_init(void);
 
 extern asmlinkage void __backtrace(void);
-extern asmlinkage void c_backtrace(unsigned long fp);
+extern asmlinkage void c_backtrace(unsigned long fp, const char *loglvl);
 
 extern void __show_regs(struct pt_regs *);
 
--- a/arch/unicore32/kernel/traps.c~unicore32-add-loglvl-to-c_backtrace
+++ a/arch/unicore32/kernel/traps.c
@@ -163,7 +163,7 @@ static void dump_backtrace(struct pt_reg
 	printk("\n");
 
 	if (ok)
-		c_backtrace(fp);
+		c_backtrace(fp, KERN_DEFAULT);
 }
 
 void show_stack(struct task_struct *tsk, unsigned long *sp)
--- a/arch/unicore32/lib/backtrace.S~unicore32-add-loglvl-to-c_backtrace
+++ a/arch/unicore32/lib/backtrace.S
@@ -16,6 +16,7 @@
 #define sv_fp	v5
 #define sv_pc	v6
 #define offset	v8
+#define loglvl	v9
 
 ENTRY(__backtrace)
 		mov	r0, fp
@@ -27,10 +28,11 @@ ENTRY(c_backtrace)
 ENDPROC(__backtrace)
 ENDPROC(c_backtrace)
 #else
-		stm.w	(v4 - v8, lr), [sp-]	@ Save an extra register
+		stm.w	(v4 - v10, lr), [sp-]	@ Save an extra register
 						@ so we have a location...
 		mov.a	frame, r0		@ if frame pointer is zero
 		beq	no_frame		@ we have no stack frames
+		mov	loglvl, r1
 
 1:		stm.w	(pc), [sp-]		@ calculate offset of PC stored
 		ldw.w	r0, [sp]+, #4		@ by stmfd for this CPU
@@ -95,9 +97,10 @@ for_each_frame:
 		bua	for_each_frame
 
 1006:		adr	r0, .Lbad
-		mov	r1, frame
+		mov	r1, loglvl
+		mov	r2, frame
 		b.l	printk
-no_frame:	ldm.w	(v4 - v8, pc), [sp]+
+no_frame:	ldm.w	(v4 - v10, pc), [sp]+
 ENDPROC(__backtrace)
 ENDPROC(c_backtrace)
 
@@ -128,8 +131,11 @@ ENDPROC(c_backtrace)
 		add	v7, v7, #1
 		cxor.a	v7, #6
 		cmoveq	v7, #1
-		cmoveq	r1, #'\n'
-		cmovne	r1, #' '
+		bne	201f
+		adr	r0, .Lcr
+		mov	r1, loglvl
+		b.l	printk
+201:
 		ldw.w	r3, [stack]+, #-4
 		mov	r2, reg
 		csub.a	r2, #8
@@ -141,18 +147,20 @@ ENDPROC(c_backtrace)
 		add	r2, r2, #0x10		@ so r2 need add 16
 201:
 		adr	r0, .Lfp
+		mov	r1, loglvl
 		b.l	printk
 2:		sub.a	reg, reg, #1
 		bns	1b
 		cxor.a	v7, #0
 		beq	201f
 		adr	r0, .Lcr
+		mov	r1, loglvl
 		b.l	printk
 201:		ldm.w	(instr, reg, stack, v7, pc), [sp]+
 
-.Lfp:		.asciz	"%cr%d:%08x"
-.Lcr:		.asciz	"\n"
-.Lbad:		.asciz	"Backtrace aborted due to bad frame pointer <%p>\n"
+.Lfp:		.asciz	"%sr%d:%08x "
+.Lcr:		.asciz	"%s\n"
+.Lbad:		.asciz	"%sBacktrace aborted due to bad frame pointer <%p>\n"
 		.align
 .Ldsi:		.word	0x92eec000 >> 14	@ stm.w sp, (... fp, ip, lr, pc)
 		.word	0x92e10000 >> 14	@ stm.w sp, ()
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 39/93] unicore32: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (37 preceding siblings ...)
  2020-06-09  4:31 ` [patch 38/93] unicore32: add loglvl to c_backtrace() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:31 ` [patch 40/93] x86: add missing const qualifiers for log_lvl Andrew Morton
                   ` (56 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, dima, gxt, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: unicore32: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

As a nice side-effect - print backtrace in __die() with the same log level
as the rest of function.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-40-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/unicore32/kernel/traps.c |   27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

--- a/arch/unicore32/kernel/traps.c~unicore32-add-show_stack_loglvl
+++ a/arch/unicore32/kernel/traps.c
@@ -135,12 +135,13 @@ static void dump_instr(const char *lvl,
 	set_fs(fs);
 }
 
-static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
+static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
+			   const char *loglvl)
 {
 	unsigned int fp;
 	int ok = 1;
 
-	printk(KERN_DEFAULT "Backtrace: ");
+	printk("%sBacktrace: ", loglvl);
 
 	if (!tsk)
 		tsk = current;
@@ -153,25 +154,31 @@ static void dump_backtrace(struct pt_reg
 		asm("mov %0, fp" : "=r" (fp) : : "cc");
 
 	if (!fp) {
-		printk("no frame pointer");
+		printk("%sno frame pointer", loglvl);
 		ok = 0;
 	} else if (verify_stack(fp)) {
-		printk("invalid frame pointer 0x%08x", fp);
+		printk("%sinvalid frame pointer 0x%08x", loglvl, fp);
 		ok = 0;
 	} else if (fp < (unsigned long)end_of_stack(tsk))
-		printk("frame pointer underflow");
-	printk("\n");
+		printk("%sframe pointer underflow", loglvl);
+	printk("%s\n", loglvl);
 
 	if (ok)
-		c_backtrace(fp, KERN_DEFAULT);
+		c_backtrace(fp, loglvl);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+		       const char *loglvl)
 {
-	dump_backtrace(NULL, tsk);
+	dump_backtrace(NULL, tsk, loglvl);
 	barrier();
 }
 
+void show_stack(struct task_struct *tsk, unsigned long *sp)
+{
+	show_stack_loglvl(tsk, sp, KERN_DEFAULT)
+}
+
 static int __die(const char *str, int err, struct thread_info *thread,
 		struct pt_regs *regs)
 {
@@ -196,7 +203,7 @@ static int __die(const char *str, int er
 	if (!user_mode(regs) || in_interrupt()) {
 		dump_mem(KERN_EMERG, "Stack: ", regs->UCreg_sp,
 			 THREAD_SIZE + (unsigned long)task_stack_page(tsk));
-		dump_backtrace(regs, tsk);
+		dump_backtrace(regs, tsk, KERN_EMERG);
 		dump_instr(KERN_EMERG, regs);
 	}
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 40/93] x86: add missing const qualifiers for log_lvl
  2020-06-09  4:29 incoming Andrew Morton
                   ` (38 preceding siblings ...)
  2020-06-09  4:31 ` [patch 39/93] unicore32: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:31 ` Andrew Morton
  2020-06-09  4:32 ` [patch 41/93] x86: add show_stack_loglvl() Andrew Morton
                   ` (55 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:31 UTC (permalink / raw)
  To: akpm, bp, dima, hpa, linux-mm, mingo, mm-commits, tglx, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: x86: add missing const qualifiers for log_lvl

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Keep log_lvl const show_trace_log_lvl() and printk_stack_address() as the
new generic show_stack_loglvl() wants to have a proper const qualifier.

And gcc rightfully produces warnings in case it's not keept:
arch/x86/kernel/dumpstack.c: In function `show_stack':
arch/x86/kernel/dumpstack.c:294:37: warning: passing argument 4 of `show_trace_log_lv ' discards `const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  294 |  show_trace_log_lvl(task, NULL, sp, loglvl);
      |                                     ^~~~~~
arch/x86/kernel/dumpstack.c:163:32: note: expected `char *' but argument is of type `const char *'
  163 |    unsigned long *stack, char *log_lvl)
      |                          ~~~~~~^~~~~~~

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-41-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/include/asm/stacktrace.h |    2 +-
 arch/x86/kernel/dumpstack.c       |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--- a/arch/x86/include/asm/stacktrace.h~x86-add-missing-const-qualifiers-for-log_lvl
+++ a/arch/x86/include/asm/stacktrace.h
@@ -87,7 +87,7 @@ get_stack_pointer(struct task_struct *ta
 }
 
 void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
-			unsigned long *stack, char *log_lvl);
+			unsigned long *stack, const char *log_lvl);
 
 /* The form of the top of the frame on the stack */
 struct stack_frame {
--- a/arch/x86/kernel/dumpstack.c~x86-add-missing-const-qualifiers-for-log_lvl
+++ a/arch/x86/kernel/dumpstack.c
@@ -65,7 +65,7 @@ bool in_entry_stack(unsigned long *stack
 }
 
 static void printk_stack_address(unsigned long address, int reliable,
-				 char *log_lvl)
+				 const char *log_lvl)
 {
 	touch_nmi_watchdog();
 	printk("%s %s%pB\n", log_lvl, reliable ? "" : "? ", (void *)address);
@@ -160,7 +160,7 @@ static void show_regs_if_on_stack(struct
 }
 
 void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
-			unsigned long *stack, char *log_lvl)
+			unsigned long *stack, const char *log_lvl)
 {
 	struct unwind_state state;
 	struct stack_info stack_info = {0};
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 41/93] x86: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (39 preceding siblings ...)
  2020-06-09  4:31 ` [patch 40/93] x86: add missing const qualifiers for log_lvl Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 42/93] xtensa: add loglvl to show_trace() Andrew Morton
                   ` (54 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, bp, dima, hpa, linux-mm, mingo, mm-commits, tglx, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: x86: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-42-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/kernel/dumpstack.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/dumpstack.c~x86-add-show_stack_loglvl
+++ a/arch/x86/kernel/dumpstack.c
@@ -279,7 +279,8 @@ next:
 	}
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
 {
 	task = task ? : current;
 
@@ -290,7 +291,12 @@ void show_stack(struct task_struct *task
 	if (!sp && task == current)
 		sp = get_stack_pointer(current, NULL);
 
-	show_trace_log_lvl(task, NULL, sp, KERN_DEFAULT);
+	show_trace_log_lvl(task, NULL, sp, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_DEFAULT);
 }
 
 void show_stack_regs(struct pt_regs *regs)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 42/93] xtensa: add loglvl to show_trace()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (40 preceding siblings ...)
  2020-06-09  4:32 ` [patch 41/93] x86: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 43/93] xtensa: add show_stack_loglvl() Andrew Morton
                   ` (53 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, chris, dima, jcmvbkbc, linux-mm, mm-commits, rppt, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: xtensa: add loglvl to show_trace()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Add log level argument to show_trace() as a preparation for introducing
show_stack_loglvl().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

[rppt@kernel.org: build fix]
  Link: http://lkml.kernel.org/r/20200511194534.GA1018386@kernel.org
Link: http://lkml.kernel.org/r/20200418201944.482088-43-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/xtensa/kernel/traps.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

--- a/arch/xtensa/kernel/traps.c~xtensa-add-loglvl-to-show_trace
+++ a/arch/xtensa/kernel/traps.c
@@ -479,18 +479,22 @@ void show_regs(struct pt_regs * regs)
 
 static int show_trace_cb(struct stackframe *frame, void *data)
 {
+	const char *loglvl = data;
+
 	if (kernel_text_address(frame->pc))
-		pr_cont(" [<%08lx>] %pB\n", frame->pc, (void *)frame->pc);
+		printk("%s [<%08lx>] %pB\n",
+			loglvl, frame->pc, (void *)frame->pc);
 	return 0;
 }
 
-void show_trace(struct task_struct *task, unsigned long *sp)
+static void show_trace(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
 {
 	if (!sp)
 		sp = stack_pointer(task);
 
-	pr_info("Call Trace:\n");
-	walk_stackframe(sp, show_trace_cb, NULL);
+	printk("%sCall Trace:\n", loglvl);
+	walk_stackframe(sp, show_trace_cb, (void *)loglvl);
 }
 
 #define STACK_DUMP_ENTRY_SIZE 4
@@ -511,7 +515,7 @@ void show_stack(struct task_struct *task
 	print_hex_dump(KERN_INFO, " ", DUMP_PREFIX_NONE,
 		       STACK_DUMP_LINE_SIZE, STACK_DUMP_ENTRY_SIZE,
 		       sp, len, false);
-	show_trace(task, sp);
+	show_trace(task, sp, KERN_INFO);
 }
 
 DEFINE_SPINLOCK(die_lock);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 43/93] xtensa: add show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (41 preceding siblings ...)
  2020-06-09  4:32 ` [patch 42/93] xtensa: add loglvl to show_trace() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 44/93] sysrq: use show_stack_loglvl() Andrew Morton
                   ` (52 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, chris, dima, jcmvbkbc, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: xtensa: add show_stack_loglvl()

Currently, the log-level of show_stack() depends on a platform
realization.  It creates situations where the headers are printed with
lower log level or higher than the stacktrace (depending on a platform or
user).

Furthermore, it forces the logic decision from user to an architecture
side.  In result, some users as sysrq/kdb/etc are doing tricks with
temporary rising console_loglevel while printing their messages.  And in
result it not only may print unwanted messages from other CPUs, but also
omit printing at all in the unlucky case where the printk() was deferred.

Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier
approach than introducing more printk buffers.  Also, it will consolidate
printings with headers.

Introduce show_stack_loglvl(), that eventually will substitute
show_stack().

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u

Link: http://lkml.kernel.org/r/20200418201944.482088-44-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/xtensa/kernel/traps.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

--- a/arch/xtensa/kernel/traps.c~xtensa-add-show_stack_loglvl
+++ a/arch/xtensa/kernel/traps.c
@@ -501,7 +501,8 @@ static void show_trace(struct task_struc
 #define STACK_DUMP_LINE_SIZE 32
 static size_t kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
 
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl)
 {
 	size_t len;
 
@@ -511,11 +512,16 @@ void show_stack(struct task_struct *task
 	len = min((-(size_t)sp) & (THREAD_SIZE - STACK_DUMP_ENTRY_SIZE),
 		  kstack_depth_to_print * STACK_DUMP_ENTRY_SIZE);
 
-	pr_info("Stack:\n");
-	print_hex_dump(KERN_INFO, " ", DUMP_PREFIX_NONE,
+	printk("%sStack:\n", loglvl);
+	print_hex_dump(loglvl, " ", DUMP_PREFIX_NONE,
 		       STACK_DUMP_LINE_SIZE, STACK_DUMP_ENTRY_SIZE,
 		       sp, len, false);
-	show_trace(task, sp, KERN_INFO);
+	show_trace(task, sp, loglvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	show_stack_loglvl(task, sp, KERN_INFO);
 }
 
 DEFINE_SPINLOCK(die_lock);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 44/93] sysrq: use show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (42 preceding siblings ...)
  2020-06-09  4:32 ` [patch 43/93] xtensa: add show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 45/93] x86/amd_gart: print stacktrace for a leak with KERN_ERR Andrew Morton
                   ` (51 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, dima, gregkh, jslaby, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: sysrq: use show_stack_loglvl()

Show the stack trace on a CPU with the same log level as "CPU%d" header.

Link: http://lkml.kernel.org/r/20200418201944.482088-45-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/tty/sysrq.c         |    2 +-
 include/linux/sched/debug.h |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/tty/sysrq.c~sysrq-use-show_stack_loglvl
+++ a/drivers/tty/sysrq.c
@@ -235,7 +235,7 @@ static void showacpu(void *dummy)
 
 	raw_spin_lock_irqsave(&show_lock, flags);
 	pr_info("CPU%d:\n", smp_processor_id());
-	show_stack(NULL, NULL);
+	show_stack_loglvl(NULL, NULL, KERN_INFO);
 	raw_spin_unlock_irqrestore(&show_lock, flags);
 }
 
--- a/include/linux/sched/debug.h~sysrq-use-show_stack_loglvl
+++ a/include/linux/sched/debug.h
@@ -31,6 +31,8 @@ extern void show_regs(struct pt_regs *);
  * trace (or NULL if the entire call-chain of the task should be shown).
  */
 extern void show_stack(struct task_struct *task, unsigned long *sp);
+extern void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+			      const char *loglvl);
 
 extern void sched_show_task(struct task_struct *p);
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 45/93] x86/amd_gart: print stacktrace for a leak with KERN_ERR
  2020-06-09  4:29 incoming Andrew Morton
                   ` (43 preceding siblings ...)
  2020-06-09  4:32 ` [patch 44/93] sysrq: use show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 46/93] power: use show_stack_loglvl() Andrew Morton
                   ` (50 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, bp, dima, hpa, linux-mm, mingo, mm-commits, tglx, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: x86/amd_gart: print stacktrace for a leak with KERN_ERR

It's under CONFIG_IOMMU_LEAK option which is enabled by debug config. 
Likely the backtrace is worth to be seen - so aligning with log level of
error message in iommu_full().

Link: http://lkml.kernel.org/r/20200418201944.482088-46-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/kernel/amd_gart_64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/amd_gart_64.c~x86-amd_gart-print-stacktrace-for-a-leak-with-kern_err
+++ a/arch/x86/kernel/amd_gart_64.c
@@ -159,7 +159,7 @@ static void dump_leak(void)
 		return;
 	dump = 1;
 
-	show_stack(NULL, NULL);
+	show_stack_loglvl(NULL, NULL, KERN_ERR);
 	debug_dma_dump_mappings(NULL);
 }
 #endif
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 46/93] power: use show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (44 preceding siblings ...)
  2020-06-09  4:32 ` [patch 45/93] x86/amd_gart: print stacktrace for a leak with KERN_ERR Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 47/93] kdb: don't play with console_loglevel Andrew Morton
                   ` (49 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, dima, gregkh, len.brown, linux-mm, mm-commits, pavel,
	rafael.j.wysocki, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: power: use show_stack_loglvl()

Aligning with other watchdog messages just before panic - use KERN_EMERG.

Link: http://lkml.kernel.org/r/20200418201944.482088-47-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/base/power/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/base/power/main.c~power-use-show_stack_loglvl
+++ a/drivers/base/power/main.c
@@ -519,7 +519,7 @@ static void dpm_watchdog_handler(struct
 	struct dpm_watchdog *wd = from_timer(wd, t, timer);
 
 	dev_emerg(wd->dev, "**** DPM device timeout ****\n");
-	show_stack(wd->tsk, NULL);
+	show_stack_loglvl(wd->tsk, NULL, KERN_EMERG);
 	panic("%s %s: unrecoverable failure\n",
 		dev_driver_string(wd->dev), dev_name(wd->dev));
 }
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 47/93] kdb: don't play with console_loglevel
  2020-06-09  4:29 incoming Andrew Morton
                   ` (45 preceding siblings ...)
  2020-06-09  4:32 ` [patch 46/93] power: use show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 48/93] sched: print stack trace with KERN_INFO Andrew Morton
                   ` (48 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, daniel.thompson, dianders, dima, jason.wessel, linux-mm,
	mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: kdb: don't play with console_loglevel

Print the stack trace with KERN_EMERG - it should be always visible.

Playing with console_loglevel is a bad idea as there may be more messages
printed than wanted.  Also the stack trace might be not printed at all if
printk() was deferred and console_loglevel was raised back before the
trace got flushed.

Unfortunately, after rebasing on commit 2277b492582d ("kdb: Fix stack
crawling on 'running' CPUs that aren't the master"), kdb_show_stack() uses
now kdb_dump_stack_on_cpu(), which for now won't be converted as it uses
dump_stack() instead of show_stack().

Convert for now the branch that uses show_stack() and remove
console_loglevel exercise from that case.

Link: http://lkml.kernel.org/r/20200418201944.482088-48-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/debug/kdb/kdb_bt.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

--- a/kernel/debug/kdb/kdb_bt.c~kdb-dont-play-with-console_loglevel
+++ a/kernel/debug/kdb/kdb_bt.c
@@ -21,17 +21,18 @@
 
 static void kdb_show_stack(struct task_struct *p, void *addr)
 {
-	int old_lvl = console_loglevel;
-
-	console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
 	kdb_trap_printk++;
 
-	if (!addr && kdb_task_has_cpu(p))
+	if (!addr && kdb_task_has_cpu(p)) {
+		int old_lvl = console_loglevel;
+
+		console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
 		kdb_dump_stack_on_cpu(kdb_process_cpu(p));
-	else
-		show_stack(p, addr);
+		console_loglevel = old_lvl;
+	} else {
+		show_stack_loglvl(p, addr, KERN_EMERG);
+	}
 
-	console_loglevel = old_lvl;
 	kdb_trap_printk--;
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 48/93] sched: print stack trace with KERN_INFO
  2020-06-09  4:29 incoming Andrew Morton
                   ` (46 preceding siblings ...)
  2020-06-09  4:32 ` [patch 47/93] kdb: don't play with console_loglevel Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 49/93] kernel: use show_stack_loglvl() Andrew Morton
                   ` (47 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, bsegall, dietmar.eggemann, dima, juri.lelli, linux-mm,
	mgorman, mingo, mm-commits, peterz, rostedt, torvalds,
	vincent.guittot

From: Dmitry Safonov <dima@arista.com>
Subject: sched: print stack trace with KERN_INFO

Aligning with other messages printed in sched_show_task() - use KERN_INFO
to print the backtrace.

Link: http://lkml.kernel.org/r/20200418201944.482088-49-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Ben Segall <bsegall@google.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/sched/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/sched/core.c~sched-print-stack-trace-with-kern_info
+++ a/kernel/sched/core.c
@@ -6025,7 +6025,7 @@ void sched_show_task(struct task_struct
 		(unsigned long)task_thread_info(p)->flags);
 
 	print_worker_info(KERN_INFO, p);
-	show_stack(p, NULL);
+	show_stack_loglvl(p, NULL, KERN_INFO);
 	put_task_stack(p);
 }
 EXPORT_SYMBOL_GPL(sched_show_task);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 49/93] kernel: use show_stack_loglvl()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (47 preceding siblings ...)
  2020-06-09  4:32 ` [patch 48/93] sched: print stack trace with KERN_INFO Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 50/93] kernel: rename show_stack_loglvl() => show_stack() Andrew Morton
                   ` (46 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mingo, mm-commits, peterz, torvalds, will

From: Dmitry Safonov <dima@arista.com>
Subject: kernel: use show_stack_loglvl()

Align the last users of show_stack() by KERN_DEFAULT as the surrounding
headers/messages.

Link: http://lkml.kernel.org/r/20200418201944.482088-50-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/locking/rtmutex-debug.c |    2 +-
 lib/dump_stack.c               |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/locking/rtmutex-debug.c~kernel-use-show_stack_loglvl
+++ a/kernel/locking/rtmutex-debug.c
@@ -125,7 +125,7 @@ void debug_rt_mutex_print_deadlock(struc
 
 	printk("\n%s/%d's [blocked] stackdump:\n\n",
 		task->comm, task_pid_nr(task));
-	show_stack(task, NULL);
+	show_stack_loglvl(task, NULL, KERN_DEFAULT);
 	printk("\n%s/%d's [current] stackdump:\n\n",
 		current->comm, task_pid_nr(current));
 	dump_stack();
--- a/lib/dump_stack.c~kernel-use-show_stack_loglvl
+++ a/lib/dump_stack.c
@@ -74,7 +74,7 @@ void show_regs_print_info(const char *lo
 static void __dump_stack(void)
 {
 	dump_stack_print_info(KERN_DEFAULT);
-	show_stack(NULL, NULL);
+	show_stack_loglvl(NULL, NULL, KERN_DEFAULT);
 }
 
 /**
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 50/93] kernel: rename show_stack_loglvl() => show_stack()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (48 preceding siblings ...)
  2020-06-09  4:32 ` [patch 49/93] kernel: use show_stack_loglvl() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 51/93] mm: don't include asm/pgtable.h if linux/mm.h is already included Andrew Morton
                   ` (45 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, dima, linux-mm, mm-commits, torvalds

From: Dmitry Safonov <dima@arista.com>
Subject: kernel: rename show_stack_loglvl() => show_stack()

Now the last users of show_stack() got converted to use an explicit log
level, show_stack_loglvl() can drop it's redundant suffix and become once
again well known show_stack().

Link: http://lkml.kernel.org/r/20200418201944.482088-51-dima@arista.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/kernel/traps.c        |    8 +-------
 arch/arc/kernel/stacktrace.c     |    8 +-------
 arch/arm/kernel/traps.c          |    8 +-------
 arch/arm64/kernel/traps.c        |    8 +-------
 arch/c6x/kernel/traps.c          |    7 +------
 arch/csky/kernel/ptrace.c        |    4 ++--
 arch/csky/kernel/stacktrace.c    |    9 +--------
 arch/h8300/kernel/traps.c        |    8 +-------
 arch/hexagon/kernel/traps.c      |    8 +-------
 arch/ia64/kernel/mca.c           |    2 +-
 arch/ia64/kernel/process.c       |   11 ++---------
 arch/m68k/kernel/traps.c         |   11 +++--------
 arch/microblaze/kernel/traps.c   |    8 +-------
 arch/mips/kernel/traps.c         |    8 +-------
 arch/nds32/kernel/traps.c        |    8 +-------
 arch/nios2/kernel/traps.c        |   12 +++---------
 arch/openrisc/kernel/traps.c     |   10 ++--------
 arch/parisc/kernel/traps.c       |    8 +-------
 arch/powerpc/kernel/process.c    |   11 +++--------
 arch/powerpc/kernel/stacktrace.c |    2 +-
 arch/riscv/kernel/stacktrace.c   |    8 +-------
 arch/s390/kernel/dumpstack.c     |    9 ++-------
 arch/sh/kernel/dumpstack.c       |    8 +-------
 arch/sparc/kernel/process_32.c   |   11 ++---------
 arch/sparc/kernel/process_64.c   |    2 +-
 arch/sparc/kernel/traps_64.c     |    8 +-------
 arch/um/drivers/mconsole_kern.c  |    2 +-
 arch/um/kernel/sysrq.c           |    7 +------
 arch/unicore32/kernel/traps.c    |    7 +------
 arch/x86/kernel/amd_gart_64.c    |    2 +-
 arch/x86/kernel/dumpstack.c      |    7 +------
 arch/xtensa/kernel/traps.c       |   10 ++--------
 drivers/base/power/main.c        |    2 +-
 drivers/tty/sysrq.c              |    2 +-
 include/linux/sched/debug.h      |    5 ++---
 kernel/debug/kdb/kdb_bt.c        |    2 +-
 kernel/locking/rtmutex-debug.c   |    2 +-
 kernel/sched/core.c              |    2 +-
 lib/dump_stack.c                 |    2 +-
 39 files changed, 52 insertions(+), 205 deletions(-)

--- a/arch/alpha/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/alpha/kernel/traps.c
@@ -144,8 +144,7 @@ dik_show_trace(unsigned long *sp, const
 
 static int kstack_depth_to_print = 24;
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-			const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	unsigned long *stack;
 	int i;
@@ -174,11 +173,6 @@ void show_stack_loglvl(struct task_struc
 	dik_show_trace(sp, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
-
 void
 die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
 {
--- a/arch/arc/kernel/stacktrace.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/arc/kernel/stacktrace.c
@@ -228,17 +228,11 @@ noinline void show_stacktrace(struct tas
 EXPORT_SYMBOL(show_stacktrace);
 
 /* Expected by sched Code */
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
-			const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
 {
 	show_stacktrace(tsk, NULL, loglvl);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
-{
-	show_stack_loglvl(tsk, sp, KERN_DEFAULT);
-}
-
 /* Another API expected by schedular, shows up in "ps" as Wait Channel
  * Of course just returning schedule( ) would be pointless so unwind until
  * the function is not in schedular code
--- a/arch/arm64/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/arm64/kernel/traps.c
@@ -137,18 +137,12 @@ void dump_backtrace(struct pt_regs *regs
 	put_task_stack(tsk);
 }
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
 {
 	dump_backtrace(NULL, tsk, loglvl);
 	barrier();
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
-{
-	show_stack_loglvl(tsk, sp, KERN_DEFAULT);
-}
-
 #ifdef CONFIG_PREEMPT
 #define S_PREEMPT " PREEMPT"
 #elif defined(CONFIG_PREEMPT_RT)
--- a/arch/arm/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/arm/kernel/traps.c
@@ -247,18 +247,12 @@ static void dump_backtrace(struct pt_reg
 }
 #endif
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
 {
 	dump_backtrace(NULL, tsk, loglvl);
 	barrier();
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
-{
-	show_stack_loglvl(tsk, sp, KERN_DEFAULT);
-}
-
 #ifdef CONFIG_PREEMPT
 #define S_PREEMPT " PREEMPT"
 #elif defined(CONFIG_PREEMPT_RT)
--- a/arch/c6x/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/c6x/kernel/traps.c
@@ -374,7 +374,7 @@ static void show_trace(unsigned long *st
 	printk("%s\n", loglvl);
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+void show_stack(struct task_struct *task, unsigned long *stack,
 		const char *loglvl)
 {
 	unsigned long *p, *endstack;
@@ -403,11 +403,6 @@ void show_stack_loglvl(struct task_struc
 	show_trace(stack, endstack, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
-{
-	show_stack_loglvl(task, stack, KERN_DEBUG);
-}
-
 int is_valid_bugaddr(unsigned long addr)
 {
 	return __kernel_text_address(addr);
--- a/arch/csky/kernel/ptrace.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/csky/kernel/ptrace.c
@@ -344,7 +344,7 @@ asmlinkage void syscall_trace_exit(struc
 		trace_sys_exit(regs, syscall_get_return_value(current, regs));
 }
 
-extern void show_stack(struct task_struct *task, unsigned long *stack);
+extern void show_stack(struct task_struct *task, unsigned long *stack, const char *loglvl);
 void show_regs(struct pt_regs *fp)
 {
 	unsigned long   *sp;
@@ -420,6 +420,6 @@ void show_regs(struct pt_regs *fp)
 	}
 	pr_cont("\n");
 
-	show_stack(NULL, (unsigned long *)fp->regs[4]);
+	show_stack(NULL, (unsigned long *)fp->regs[4], KERN_INFO);
 	return;
 }
--- a/arch/csky/kernel/stacktrace.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/csky/kernel/stacktrace.c
@@ -95,19 +95,12 @@ static bool print_trace_address(unsigned
 	return false;
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	pr_cont("Call Trace:\n");
 	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	pr_cont("Call Trace:\n");
-	walk_stackframe(task, NULL, print_trace_address, KERN_INFO);
-}
-
 static bool save_wchan(unsigned long pc, void *arg)
 {
 	if (!in_sched_functions(pc)) {
--- a/arch/h8300/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/h8300/kernel/traps.c
@@ -115,8 +115,7 @@ void die(const char *str, struct pt_regs
 
 static int kstack_depth_to_print = 24;
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
 {
 	unsigned long *stack,  addr;
 	int i;
@@ -158,8 +157,3 @@ void show_stack_loglvl(struct task_struc
 	}
 	printk("%s\n", loglvl);
 }
-
-void show_stack(struct task_struct *task, unsigned long *esp)
-{
-	show_stack_loglvl(task, esp, KERN_INFO);
-}
--- a/arch/hexagon/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/hexagon/kernel/traps.c
@@ -175,18 +175,12 @@ static void do_show_stack(struct task_st
 	}
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *fp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *fp, const char *loglvl)
 {
 	/* Saved link reg is one word above FP */
 	do_show_stack(task, fp, 0, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *fp)
-{
-	show_stack_loglvl(task, fp, 0, KERN_INFO);
-}
-
 int die(const char *str, struct pt_regs *regs, long err)
 {
 	static struct {
--- a/arch/ia64/kernel/mca.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/ia64/kernel/mca.c
@@ -1631,7 +1631,7 @@ default_monarch_init_process(struct noti
 	if (read_trylock(&tasklist_lock)) {
 		do_each_thread (g, t) {
 			printk("\nBacktrace of pid %d (%s)\n", t->pid, t->comm);
-			show_stack(t, NULL);
+			show_stack(t, NULL, KERN_DEFAULT);
 		} while_each_thread (g, t);
 		read_unlock(&tasklist_lock);
 	}
--- a/arch/ia64/kernel/process.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/ia64/kernel/process.c
@@ -85,8 +85,7 @@ ia64_do_show_stack (struct unw_frame_inf
 }
 
 void
-show_stack_loglvl (struct task_struct *task, unsigned long *sp,
-		   const char *loglvl)
+show_stack (struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	if (!task)
 		unw_init_running(ia64_do_show_stack, (void *)loglvl);
@@ -99,12 +98,6 @@ show_stack_loglvl (struct task_struct *t
 }
 
 void
-show_stack (struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
-
-void
 show_regs (struct pt_regs *regs)
 {
 	unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
@@ -158,7 +151,7 @@ show_regs (struct pt_regs *regs)
 			       ((i == sof - 1) || (i % 3) == 2) ? "\n" : " ");
 		}
 	} else
-		show_stack(NULL, NULL);
+		show_stack(NULL, NULL, KERN_DEFAULT);
 }
 
 /* local support for deprecated console_print */
--- a/arch/m68k/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/m68k/kernel/traps.c
@@ -916,7 +916,7 @@ void show_registers(struct pt_regs *regs
 	default:
 		pr_cont("\n");
 	}
-	show_stack(NULL, (unsigned long *)addr);
+	show_stack(NULL, (unsigned long *)addr, KERN_INFO);
 
 	pr_info("Code:");
 	set_fs(KERNEL_DS);
@@ -935,8 +935,8 @@ void show_registers(struct pt_regs *regs
 	pr_cont("\n");
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *stack,
+		const char *loglvl)
 {
 	unsigned long *p;
 	unsigned long *endstack;
@@ -963,11 +963,6 @@ void show_stack_loglvl(struct task_struc
 	show_trace(stack, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
-{
-	show_stack_loglvl(task, stack, KERN_INFO);
-}
-
 /*
  * The vector number returned in the frame pointer may also contain
  * the "fs" (Fault Status) bits on ColdFire. These are in the bottom
--- a/arch/microblaze/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/microblaze/kernel/traps.c
@@ -31,8 +31,7 @@ static int __init kstack_setup(char *s)
 }
 __setup("kstack=", kstack_setup);
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	unsigned long words_to_show;
 	u32 fp = (u32) sp;
@@ -77,8 +76,3 @@ void show_stack_loglvl(struct task_struc
 
 	debug_show_held_locks(task);
 }
-
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_INFO);
-}
--- a/arch/mips/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/mips/kernel/traps.c
@@ -198,8 +198,7 @@ static void show_stacktrace(struct task_
 	show_backtrace(task, regs, loglvl);
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	struct pt_regs regs;
 	mm_segment_t old_fs = get_fs();
@@ -227,11 +226,6 @@ void show_stack_loglvl(struct task_struc
 	set_fs(old_fs);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT)
-}
-
 static void show_code(unsigned int __user *pc)
 {
 	long i;
--- a/arch/nds32/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/nds32/kernel/traps.c
@@ -135,8 +135,7 @@ static void __dump(struct task_struct *t
 	printk("%s\n", loglvl);
 }
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
 {
 	unsigned long *base_reg;
 
@@ -157,11 +156,6 @@ void show_stack_loglvl(struct task_struc
 	barrier();
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
-{
-	show_stack_loglvl(tsk, sp, KERN_EMERG);
-}
-
 DEFINE_SPINLOCK(die_lock);
 
 /*
--- a/arch/nios2/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/nios2/kernel/traps.c
@@ -52,14 +52,13 @@ void _exception(int signo, struct pt_reg
 }
 
 /*
- * The show_stack(), show_stack_loglvl() are external API
- * which we do not use ourselves.
+ * The show_stack() is external API which we do not use ourselves.
  */
 
 int kstack_depth_to_print = 48;
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *stack,
+		const char *loglvl)
 {
 	unsigned long *endstack, addr;
 	int i;
@@ -106,11 +105,6 @@ void show_stack_loglvl(struct task_struc
 	printk("%s\n", loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
-{
-	show_stack_loglvl(task, stack, KERN_EMERG);
-}
-
 void __init trap_init(void)
 {
 	/* Nothing to do here */
--- a/arch/openrisc/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/openrisc/kernel/traps.c
@@ -48,8 +48,7 @@ void print_trace(void *data, unsigned lo
 }
 
 /* displays a short stack trace */
-void show_stack_loglvl(struct task_struct *task, unsigned long *esp,
-		const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
 {
 	if (esp == NULL)
 		esp = (unsigned long *)&esp;
@@ -58,11 +57,6 @@ void show_stack_loglvl(struct task_struc
 	unwind_stack((void *)loglvl, esp, print_trace);
 }
 
-void show_stack(struct task_struct *task, unsigned long *esp)
-{
-	show_stack_loglvl(task, esp, KERN_EMERG);
-}
-
 void show_registers(struct pt_regs *regs)
 {
 	int i;
@@ -104,7 +98,7 @@ void show_registers(struct pt_regs *regs
 	if (in_kernel) {
 
 		printk("\nStack: ");
-		show_stack(NULL, (unsigned long *)esp);
+		show_stack(NULL, (unsigned long *)esp, KERN_EMERG);
 
 		printk("\nCode: ");
 		if (regs->pc < PAGE_OFFSET)
--- a/arch/parisc/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/parisc/kernel/traps.c
@@ -198,17 +198,11 @@ static void parisc_show_stack(struct tas
 	do_show_stack(&info, loglvl);
 }
 
-void show_stack_loglvl(struct task_struct *t, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *t, unsigned long *sp, const char *loglvl)
 {
 	parisc_show_stack(t, NULL, loglvl);
 }
 
-void show_stack(struct task_struct *t, unsigned long *sp)
-{
-	show_stack_loglvl(t, sp, KERN_CRIT)
-}
-
 int is_valid_bugaddr(unsigned long iaoq)
 {
 	return 1;
--- a/arch/powerpc/kernel/process.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/powerpc/kernel/process.c
@@ -1456,7 +1456,7 @@ void show_regs(struct pt_regs * regs)
 	printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
 	printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
 #endif
-	show_stack(current, (unsigned long *) regs->gpr[1]);
+	show_stack(current, (unsigned long *) regs->gpr[1], KERN_DEFAULT);
 	if (!user_mode(regs))
 		show_instructions(regs);
 }
@@ -2063,8 +2063,8 @@ unsigned long get_wchan(struct task_stru
 
 static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *stack,
-		       const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *stack,
+		const char *loglvl)
 {
 	unsigned long sp, ip, lr, newsp;
 	int count = 0;
@@ -2133,11 +2133,6 @@ void show_stack_loglvl(struct task_struc
 	put_task_stack(tsk);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *stack)
-{
-	show_stack_loglvl(tsk, stack, KERN_DEFAULT);
-}
-
 #ifdef CONFIG_PPC64
 /* Called with hard IRQs off */
 void notrace __ppc64_runlatch_on(void)
--- a/arch/powerpc/kernel/stacktrace.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/powerpc/kernel/stacktrace.c
@@ -260,7 +260,7 @@ static void raise_backtrace_ipi(cpumask_
 			pr_cont(" current pointer corrupt? (%px)\n", p->__current);
 
 		pr_warn("Back trace of paca->saved_r1 (0x%016llx) (possibly stale):\n", p->saved_r1);
-		show_stack(p->__current, (unsigned long *)p->saved_r1);
+		show_stack(p->__current, (unsigned long *)p->saved_r1, KERN_WARNING);
 	}
 }
 
--- a/arch/riscv/kernel/stacktrace.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/riscv/kernel/stacktrace.c
@@ -105,18 +105,12 @@ static bool print_trace_address(unsigned
 	return false;
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	pr_cont("Call Trace:\n");
 	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
-
 static bool save_wchan(unsigned long pc, void *arg)
 {
 	if (!in_sched_functions(pc)) {
--- a/arch/s390/kernel/dumpstack.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/s390/kernel/dumpstack.c
@@ -126,7 +126,7 @@ unknown:
 	return -EINVAL;
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+void show_stack(struct task_struct *task, unsigned long *stack,
 		       const char *loglvl)
 {
 	struct unwind_state state;
@@ -139,11 +139,6 @@ void show_stack_loglvl(struct task_struc
 	debug_show_held_locks(task ? : current);
 }
 
-void show_stack(struct task_struct *task, unsigned long *stack)
-{
-	show_stack_loglvl(task, stack, KERN_DEFAULT);
-}
-
 static void show_last_breaking_event(struct pt_regs *regs)
 {
 	printk("Last Breaking-Event-Address:\n");
@@ -181,7 +176,7 @@ void show_regs(struct pt_regs *regs)
 	show_registers(regs);
 	/* Show stack backtrace if pt_regs is from kernel mode */
 	if (!user_mode(regs))
-		show_stack(NULL, (unsigned long *) regs->gprs[15]);
+		show_stack(NULL, (unsigned long *) regs->gprs[15], KERN_DEFAULT);
 	show_last_breaking_event(regs);
 }
 
--- a/arch/sh/kernel/dumpstack.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/sh/kernel/dumpstack.c
@@ -144,8 +144,7 @@ void show_trace(struct task_struct *tsk,
 	debug_show_held_locks(tsk);
 }
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl)
 {
 	unsigned long stack;
 
@@ -161,8 +160,3 @@ void show_stack_loglvl(struct task_struc
 		 (unsigned long)task_stack_page(tsk));
 	show_trace(tsk, sp, NULL, loglvl);
 }
-
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
--- a/arch/sparc/kernel/process_32.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/sparc/kernel/process_32.c
@@ -145,12 +145,10 @@ void show_regs(struct pt_regs *r)
 }
 
 /*
- * The show_stack(), show_stack_loglvl() are external APIs which
- * we do not use ourselves.
+ * The show_stack() is external API which we do not use ourselves.
  * The oops is printed in die_if_kernel.
  */
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
-		       const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *_ksp, const char *loglvl)
 {
 	unsigned long pc, fp;
 	unsigned long task_base;
@@ -179,11 +177,6 @@ void show_stack_loglvl(struct task_struc
 	printk("%s\n", loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
-
 /*
  * Free current thread data structures etc..
  */
--- a/arch/sparc/kernel/process_64.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/sparc/kernel/process_64.c
@@ -195,7 +195,7 @@ void show_regs(struct pt_regs *regs)
 	       regs->u_regs[15]);
 	printk("RPC: <%pS>\n", (void *) regs->u_regs[15]);
 	show_regwindow(regs);
-	show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]);
+	show_stack(current, (unsigned long *)regs->u_regs[UREG_FP], KERN_DEFAULT);
 }
 
 union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
--- a/arch/sparc/kernel/traps_64.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/sparc/kernel/traps_64.c
@@ -2453,8 +2453,7 @@ static void user_instruction_dump(unsign
 	printk("\n");
 }
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *_ksp,
-			 const char *loglvl)
+void show_stack(struct task_struct *tsk, unsigned long *_ksp, const char *loglvl)
 {
 	unsigned long fp, ksp;
 	struct thread_info *tp;
@@ -2514,11 +2513,6 @@ void show_stack_loglvl(struct task_struc
 	} while (++count < 16);
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *_ksp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
-
 static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
 {
 	unsigned long fp = rw->ins[6];
--- a/arch/um/drivers/mconsole_kern.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/um/drivers/mconsole_kern.c
@@ -648,7 +648,7 @@ static void stack_proc(void *arg)
 {
 	struct task_struct *task = arg;
 
-	show_stack(task, NULL);
+	show_stack(task, NULL, KERN_INFO);
 }
 
 /*
--- a/arch/um/kernel/sysrq.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/um/kernel/sysrq.c
@@ -27,7 +27,7 @@ static const struct stacktrace_ops stack
 	.address = _print_addr
 };
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *stack,
+void show_stack(struct task_struct *task, unsigned long *stack,
 		       const char *loglvl)
 {
 	struct pt_regs *segv_regs = current->thread.segv_regs;
@@ -56,8 +56,3 @@ void show_stack_loglvl(struct task_struc
 	dump_trace(current, &stackops, (void *)loglvl);
 	printk("%s\n", loglvl);
 }
-
-void show_stack(struct task_struct *task, unsigned long *stack)
-{
-	show_stack_loglvl(task, stack, KERN_INFO);
-}
--- a/arch/unicore32/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/unicore32/kernel/traps.c
@@ -167,18 +167,13 @@ static void dump_backtrace(struct pt_reg
 		c_backtrace(fp, loglvl);
 }
 
-void show_stack_loglvl(struct task_struct *tsk, unsigned long *sp,
+void show_stack(struct task_struct *tsk, unsigned long *sp,
 		       const char *loglvl)
 {
 	dump_backtrace(NULL, tsk, loglvl);
 	barrier();
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
-{
-	show_stack_loglvl(tsk, sp, KERN_DEFAULT)
-}
-
 static int __die(const char *str, int err, struct thread_info *thread,
 		struct pt_regs *regs)
 {
--- a/arch/x86/kernel/amd_gart_64.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/x86/kernel/amd_gart_64.c
@@ -159,7 +159,7 @@ static void dump_leak(void)
 		return;
 	dump = 1;
 
-	show_stack_loglvl(NULL, NULL, KERN_ERR);
+	show_stack(NULL, NULL, KERN_ERR);
 	debug_dma_dump_mappings(NULL);
 }
 #endif
--- a/arch/x86/kernel/dumpstack.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/x86/kernel/dumpstack.c
@@ -279,7 +279,7 @@ next:
 	}
 }
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
+void show_stack(struct task_struct *task, unsigned long *sp,
 		       const char *loglvl)
 {
 	task = task ? : current;
@@ -294,11 +294,6 @@ void show_stack_loglvl(struct task_struc
 	show_trace_log_lvl(task, NULL, sp, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_DEFAULT);
-}
-
 void show_stack_regs(struct pt_regs *regs)
 {
 	show_trace_log_lvl(current, regs, NULL, KERN_DEFAULT);
--- a/arch/xtensa/kernel/traps.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/arch/xtensa/kernel/traps.c
@@ -501,8 +501,7 @@ static void show_trace(struct task_struc
 #define STACK_DUMP_LINE_SIZE 32
 static size_t kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
 
-void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-		       const char *loglvl)
+void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
 	size_t len;
 
@@ -519,11 +518,6 @@ void show_stack_loglvl(struct task_struc
 	show_trace(task, sp, loglvl);
 }
 
-void show_stack(struct task_struct *task, unsigned long *sp)
-{
-	show_stack_loglvl(task, sp, KERN_INFO);
-}
-
 DEFINE_SPINLOCK(die_lock);
 
 void die(const char * str, struct pt_regs * regs, long err)
@@ -540,7 +534,7 @@ void die(const char * str, struct pt_reg
 	pr_info("%s: sig: %ld [#%d]%s\n", str, err, ++die_counter, pr);
 	show_regs(regs);
 	if (!user_mode(regs))
-		show_stack(NULL, (unsigned long*)regs->areg[1]);
+		show_stack(NULL, (unsigned long *)regs->areg[1], KERN_INFO);
 
 	add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
 	spin_unlock_irq(&die_lock);
--- a/drivers/base/power/main.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/drivers/base/power/main.c
@@ -519,7 +519,7 @@ static void dpm_watchdog_handler(struct
 	struct dpm_watchdog *wd = from_timer(wd, t, timer);
 
 	dev_emerg(wd->dev, "**** DPM device timeout ****\n");
-	show_stack_loglvl(wd->tsk, NULL, KERN_EMERG);
+	show_stack(wd->tsk, NULL, KERN_EMERG);
 	panic("%s %s: unrecoverable failure\n",
 		dev_driver_string(wd->dev), dev_name(wd->dev));
 }
--- a/drivers/tty/sysrq.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/drivers/tty/sysrq.c
@@ -235,7 +235,7 @@ static void showacpu(void *dummy)
 
 	raw_spin_lock_irqsave(&show_lock, flags);
 	pr_info("CPU%d:\n", smp_processor_id());
-	show_stack_loglvl(NULL, NULL, KERN_INFO);
+	show_stack(NULL, NULL, KERN_INFO);
 	raw_spin_unlock_irqrestore(&show_lock, flags);
 }
 
--- a/include/linux/sched/debug.h~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/include/linux/sched/debug.h
@@ -30,9 +30,8 @@ extern void show_regs(struct pt_regs *);
  * task), SP is the stack pointer of the first frame that should be shown in the back
  * trace (or NULL if the entire call-chain of the task should be shown).
  */
-extern void show_stack(struct task_struct *task, unsigned long *sp);
-extern void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
-			      const char *loglvl);
+extern void show_stack(struct task_struct *task, unsigned long *sp,
+		       const char *loglvl);
 
 extern void sched_show_task(struct task_struct *p);
 
--- a/kernel/debug/kdb/kdb_bt.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/kernel/debug/kdb/kdb_bt.c
@@ -30,7 +30,7 @@ static void kdb_show_stack(struct task_s
 		kdb_dump_stack_on_cpu(kdb_process_cpu(p));
 		console_loglevel = old_lvl;
 	} else {
-		show_stack_loglvl(p, addr, KERN_EMERG);
+		show_stack(p, addr, KERN_EMERG);
 	}
 
 	kdb_trap_printk--;
--- a/kernel/locking/rtmutex-debug.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/kernel/locking/rtmutex-debug.c
@@ -125,7 +125,7 @@ void debug_rt_mutex_print_deadlock(struc
 
 	printk("\n%s/%d's [blocked] stackdump:\n\n",
 		task->comm, task_pid_nr(task));
-	show_stack_loglvl(task, NULL, KERN_DEFAULT);
+	show_stack(task, NULL, KERN_DEFAULT);
 	printk("\n%s/%d's [current] stackdump:\n\n",
 		current->comm, task_pid_nr(current));
 	dump_stack();
--- a/kernel/sched/core.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/kernel/sched/core.c
@@ -6025,7 +6025,7 @@ void sched_show_task(struct task_struct
 		(unsigned long)task_thread_info(p)->flags);
 
 	print_worker_info(KERN_INFO, p);
-	show_stack_loglvl(p, NULL, KERN_INFO);
+	show_stack(p, NULL, KERN_INFO);
 	put_task_stack(p);
 }
 EXPORT_SYMBOL_GPL(sched_show_task);
--- a/lib/dump_stack.c~kernel-rename-show_stack_loglvl-=-show_stack
+++ a/lib/dump_stack.c
@@ -74,7 +74,7 @@ void show_regs_print_info(const char *lo
 static void __dump_stack(void)
 {
 	dump_stack_print_info(KERN_DEFAULT);
-	show_stack_loglvl(NULL, NULL, KERN_DEFAULT);
+	show_stack(NULL, NULL, KERN_DEFAULT);
 }
 
 /**
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 51/93] mm: don't include asm/pgtable.h if linux/mm.h is already included
  2020-06-09  4:29 incoming Andrew Morton
                   ` (49 preceding siblings ...)
  2020-06-09  4:32 ` [patch 50/93] kernel: rename show_stack_loglvl() => show_stack() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 52/93] mm: introduce include/linux/pgtable.h Andrew Morton
                   ` (44 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, rppt, shorne, tglx, tony.luck,
	torvalds, tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: 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

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: Mike Rapoport <rppt@linux.ibm.com>
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/boot/bootp.c                       |    1 -
 arch/alpha/boot/bootpz.c                      |    1 -
 arch/alpha/boot/main.c                        |    1 -
 arch/alpha/include/asm/io.h                   |    1 -
 arch/alpha/kernel/process.c                   |    1 -
 arch/alpha/kernel/ptrace.c                    |    1 -
 arch/alpha/kernel/setup.c                     |    1 -
 arch/alpha/kernel/smp.c                       |    1 -
 arch/alpha/kernel/sys_alcor.c                 |    1 -
 arch/alpha/kernel/sys_cabriolet.c             |    1 -
 arch/alpha/kernel/sys_dp264.c                 |    1 -
 arch/alpha/kernel/sys_eb64p.c                 |    1 -
 arch/alpha/kernel/sys_eiger.c                 |    1 -
 arch/alpha/kernel/sys_jensen.c                |    1 -
 arch/alpha/kernel/sys_marvel.c                |    1 -
 arch/alpha/kernel/sys_miata.c                 |    1 -
 arch/alpha/kernel/sys_mikasa.c                |    1 -
 arch/alpha/kernel/sys_nautilus.c              |    1 -
 arch/alpha/kernel/sys_noritake.c              |    1 -
 arch/alpha/kernel/sys_rawhide.c               |    1 -
 arch/alpha/kernel/sys_ruffian.c               |    1 -
 arch/alpha/kernel/sys_rx164.c                 |    1 -
 arch/alpha/kernel/sys_sable.c                 |    1 -
 arch/alpha/kernel/sys_sio.c                   |    1 -
 arch/alpha/kernel/sys_sx164.c                 |    1 -
 arch/alpha/kernel/sys_takara.c                |    1 -
 arch/alpha/kernel/sys_titan.c                 |    1 -
 arch/alpha/kernel/sys_wildfire.c              |    1 -
 arch/alpha/mm/init.c                          |    1 -
 arch/arm/kernel/machine_kexec.c               |    1 -
 arch/arm/kernel/module.c                      |    1 -
 arch/arm/kernel/ptrace.c                      |    1 -
 arch/arm/kernel/smp.c                         |    1 -
 arch/arm/mach-ebsa110/core.c                  |    1 -
 arch/arm/mach-footbridge/common.c             |    1 -
 arch/arm/mach-imx/mm-imx21.c                  |    1 -
 arch/arm/mach-imx/mm-imx27.c                  |    1 -
 arch/arm/mach-imx/mm-imx3.c                   |    1 -
 arch/arm/mach-iop32x/i2c.c                    |    1 -
 arch/arm/mach-iop32x/iq31244.c                |    1 -
 arch/arm/mach-iop32x/iq80321.c                |    1 -
 arch/arm/mach-iop32x/n2100.c                  |    1 -
 arch/arm/mach-ixp4xx/common.c                 |    1 -
 arch/arm/mach-sa1100/assabet.c                |    1 -
 arch/arm/mm/copypage-v4mc.c                   |    1 -
 arch/arm/mm/copypage-v6.c                     |    1 -
 arch/arm/mm/copypage-xscale.c                 |    1 -
 arch/arm/mm/dump.c                            |    1 -
 arch/arm/mm/fault-armv.c                      |    1 -
 arch/arm/mm/fault.c                           |    1 -
 arch/arm/mm/pageattr.c                        |    1 -
 arch/arm64/kernel/hibernate.c                 |    1 -
 arch/arm64/kernel/ptrace.c                    |    1 -
 arch/arm64/kernel/smp.c                       |    1 -
 arch/arm64/mm/dump.c                          |    1 -
 arch/arm64/mm/fault.c                         |    1 -
 arch/arm64/mm/kasan_init.c                    |    1 -
 arch/arm64/mm/pageattr.c                      |    1 -
 arch/csky/kernel/module.c                     |    1 -
 arch/csky/kernel/ptrace.c                     |    1 -
 arch/csky/mm/init.c                           |    1 -
 arch/csky/mm/tlb.c                            |    1 -
 arch/h8300/kernel/process.c                   |    1 -
 arch/h8300/kernel/setup.c                     |    1 -
 arch/h8300/kernel/signal.c                    |    1 -
 arch/h8300/mm/fault.c                         |    1 -
 arch/h8300/mm/init.c                          |    1 -
 arch/h8300/mm/memory.c                        |    1 -
 arch/hexagon/mm/vm_fault.c                    |    1 -
 arch/ia64/kernel/efi.c                        |    1 -
 arch/ia64/kernel/ptrace.c                     |    1 -
 arch/ia64/kernel/smp.c                        |    1 -
 arch/ia64/kernel/smpboot.c                    |    1 -
 arch/ia64/mm/contig.c                         |    1 -
 arch/ia64/mm/fault.c                          |    1 -
 arch/m68k/68000/timers.c                      |    1 -
 arch/m68k/amiga/config.c                      |    1 -
 arch/m68k/apollo/config.c                     |    1 -
 arch/m68k/atari/atasound.c                    |    1 -
 arch/m68k/atari/stram.c                       |    1 -
 arch/m68k/bvme6000/config.c                   |    1 -
 arch/m68k/kernel/process.c                    |    1 -
 arch/m68k/kernel/ptrace.c                     |    1 -
 arch/m68k/kernel/setup_no.c                   |    1 -
 arch/m68k/kernel/signal.c                     |    1 -
 arch/m68k/kernel/uboot.c                      |    1 -
 arch/m68k/mac/config.c                        |    1 -
 arch/m68k/mm/mcfmmu.c                         |    1 -
 arch/m68k/mm/sun3kmap.c                       |    1 -
 arch/m68k/mm/sun3mmu.c                        |    1 -
 arch/m68k/mvme147/config.c                    |    1 -
 arch/m68k/mvme16x/config.c                    |    1 -
 arch/m68k/q40/config.c                        |    1 -
 arch/m68k/sun3/config.c                       |    1 -
 arch/m68k/sun3/dvma.c                         |    1 -
 arch/m68k/sun3/mmu_emu.c                      |    1 -
 arch/m68k/sun3/sun3dvma.c                     |    1 -
 arch/m68k/sun3x/dvma.c                        |    1 -
 arch/m68k/sun3x/prom.c                        |    1 -
 arch/microblaze/kernel/signal.c               |    1 -
 arch/microblaze/mm/fault.c                    |    1 -
 arch/mips/fw/arc/memory.c                     |    1 -
 arch/mips/include/asm/mach-generic/floppy.h   |    1 -
 arch/mips/include/asm/mach-jazz/floppy.h      |    1 -
 arch/mips/jazz/jazzdma.c                      |    1 -
 arch/mips/kernel/module.c                     |    1 -
 arch/mips/kernel/process.c                    |    1 -
 arch/mips/kernel/ptrace.c                     |    1 -
 arch/mips/kernel/ptrace32.c                   |    1 -
 arch/mips/kernel/smp-bmips.c                  |    1 -
 arch/mips/kernel/traps.c                      |    1 -
 arch/mips/kvm/tlb.c                           |    1 -
 arch/mips/lib/dump_tlb.c                      |    1 -
 arch/mips/lib/r3k_dump_tlb.c                  |    1 -
 arch/mips/mm/c-octeon.c                       |    1 -
 arch/mips/mm/c-r3k.c                          |    1 -
 arch/mips/mm/c-r4k.c                          |    1 -
 arch/mips/mm/c-tx39.c                         |    1 -
 arch/mips/mm/init.c                           |    1 -
 arch/mips/mm/page.c                           |    1 -
 arch/mips/mm/pgtable-32.c                     |    1 -
 arch/mips/mm/pgtable-64.c                     |    1 -
 arch/mips/mm/sc-ip22.c                        |    1 -
 arch/mips/mm/sc-mips.c                        |    1 -
 arch/mips/mm/sc-r5k.c                         |    1 -
 arch/mips/mm/tlb-r3k.c                        |    1 -
 arch/mips/mm/tlb-r4k.c                        |    1 -
 arch/mips/sgi-ip27/ip27-init.c                |    1 -
 arch/mips/sgi-ip27/ip27-timer.c               |    1 -
 arch/mips/sgi-ip32/ip32-memory.c              |    1 -
 arch/nds32/mm/fault.c                         |    1 -
 arch/nds32/mm/proc.c                          |    1 -
 arch/nios2/kernel/module.c                    |    1 -
 arch/nios2/mm/init.c                          |    1 -
 arch/nios2/mm/pgtable.c                       |    1 -
 arch/nios2/mm/tlb.c                           |    1 -
 arch/openrisc/include/asm/tlbflush.h          |    1 -
 arch/openrisc/kernel/asm-offsets.c            |    1 -
 arch/openrisc/kernel/process.c                |    1 -
 arch/openrisc/kernel/ptrace.c                 |    1 -
 arch/openrisc/kernel/setup.c                  |    1 -
 arch/openrisc/kernel/traps.c                  |    1 -
 arch/openrisc/mm/init.c                       |    1 -
 arch/openrisc/mm/tlb.c                        |    1 -
 arch/parisc/include/asm/mmu_context.h         |    1 -
 arch/parisc/kernel/module.c                   |    1 -
 arch/parisc/kernel/ptrace.c                   |    1 -
 arch/parisc/kernel/smp.c                      |    1 -
 arch/parisc/mm/init.c                         |    1 -
 arch/powerpc/include/asm/io.h                 |    1 -
 arch/powerpc/kernel/asm-offsets.c             |    1 -
 arch/powerpc/kernel/process.c                 |    1 -
 arch/powerpc/kernel/signal_32.c               |    1 -
 arch/powerpc/kernel/signal_64.c               |    1 -
 arch/powerpc/kernel/traps.c                   |    1 -
 arch/powerpc/kernel/vdso.c                    |    1 -
 arch/powerpc/lib/code-patching.c              |    1 -
 arch/powerpc/mm/book3s64/hash_hugetlbpage.c   |    1 -
 arch/powerpc/mm/book3s64/hash_pgtable.c       |    1 -
 arch/powerpc/mm/book3s64/radix_hugetlbpage.c  |    1 -
 arch/powerpc/mm/book3s64/radix_pgtable.c      |    1 -
 arch/powerpc/mm/fault.c                       |    1 -
 arch/powerpc/mm/hugetlbpage.c                 |    1 -
 arch/powerpc/mm/init_32.c                     |    1 -
 arch/powerpc/mm/init_64.c                     |    1 -
 arch/powerpc/mm/mem.c                         |    1 -
 arch/powerpc/mm/nohash/40x.c                  |    1 -
 arch/powerpc/mm/nohash/fsl_booke.c            |    1 -
 arch/powerpc/mm/pgtable_32.c                  |    1 -
 arch/powerpc/mm/pgtable_64.c                  |    1 -
 arch/powerpc/mm/ptdump/hashpagetable.c        |    1 -
 arch/powerpc/mm/ptdump/ptdump.c               |    1 -
 arch/powerpc/perf/callchain.c                 |    1 -
 arch/powerpc/perf/callchain_32.c              |    1 -
 arch/powerpc/perf/callchain_64.c              |    1 -
 arch/powerpc/platforms/8xx/cpm1.c             |    1 -
 arch/powerpc/platforms/8xx/micropatch.c       |    1 -
 arch/powerpc/platforms/cell/setup.c           |    1 -
 arch/powerpc/platforms/chrp/setup.c           |    1 -
 arch/powerpc/platforms/maple/setup.c          |    1 -
 arch/powerpc/platforms/maple/time.c           |    1 -
 arch/powerpc/platforms/powermac/setup.c       |    1 -
 arch/powerpc/platforms/powermac/time.c        |    1 -
 arch/powerpc/platforms/pseries/setup.c        |    1 -
 arch/powerpc/sysdev/cpm2.c                    |    1 -
 arch/powerpc/xmon/xmon.c                      |    1 -
 arch/riscv/kernel/setup.c                     |    1 -
 arch/riscv/mm/init.c                          |    1 -
 arch/s390/include/asm/tlbflush.h              |    1 -
 arch/s390/kernel/machine_kexec.c              |    1 -
 arch/s390/kernel/ptrace.c                     |    1 -
 arch/s390/kernel/vdso.c                       |    1 -
 arch/s390/mm/dump_pagetables.c                |    1 -
 arch/s390/mm/fault.c                          |    1 -
 arch/s390/mm/init.c                           |    1 -
 arch/s390/mm/pageattr.c                       |    1 -
 arch/s390/mm/pgtable.c                        |    1 -
 arch/s390/mm/vmem.c                           |    1 -
 arch/sh/kernel/machine_kexec.c                |    1 -
 arch/sh/kernel/ptrace_32.c                    |    1 -
 arch/sh/kernel/signal_32.c                    |    1 -
 arch/sh/mm/cache-sh3.c                        |    1 -
 arch/sh/mm/cache-sh4.c                        |    1 -
 arch/sh/mm/cache-sh7705.c                     |    1 -
 arch/sh/mm/nommu.c                            |    1 -
 arch/sparc/kernel/leon_smp.c                  |    1 -
 arch/sparc/kernel/process_32.c                |    1 -
 arch/sparc/kernel/process_64.c                |    1 -
 arch/sparc/kernel/ptrace_32.c                 |    1 -
 arch/sparc/kernel/ptrace_64.c                 |    1 -
 arch/sparc/kernel/setup_32.c                  |    1 -
 arch/sparc/kernel/setup_64.c                  |    1 -
 arch/sparc/kernel/signal32.c                  |    1 -
 arch/sparc/kernel/signal_32.c                 |    1 -
 arch/sparc/kernel/signal_64.c                 |    1 -
 arch/sparc/kernel/smp_32.c                    |    1 -
 arch/sparc/kernel/smp_64.c                    |    1 -
 arch/sparc/kernel/traps_64.c                  |    1 -
 arch/sparc/mm/fault_32.c                      |    1 -
 arch/sparc/mm/fault_64.c                      |    1 -
 arch/sparc/mm/hugetlbpage.c                   |    1 -
 arch/sparc/mm/init_32.c                       |    1 -
 arch/sparc/mm/init_64.c                       |    1 -
 arch/sparc/mm/io-unit.c                       |    1 -
 arch/sparc/mm/iommu.c                         |    1 -
 arch/sparc/mm/tlb.c                           |    1 -
 arch/um/kernel/process.c                      |    1 -
 arch/um/kernel/skas/mmu.c                     |    1 -
 arch/um/kernel/skas/uaccess.c                 |    1 -
 arch/um/kernel/tlb.c                          |    1 -
 arch/um/kernel/trap.c                         |    1 -
 arch/um/kernel/um_arch.c                      |    1 -
 arch/unicore32/kernel/module.c                |    1 -
 arch/unicore32/mm/fault.c                     |    1 -
 arch/x86/include/asm/iomap.h                  |    1 -
 arch/x86/include/asm/xen/page.h               |    1 -
 arch/x86/kernel/alternative.c                 |    1 -
 arch/x86/kernel/amd_gart_64.c                 |    1 -
 arch/x86/kernel/doublefault_32.c              |    1 -
 arch/x86/kernel/machine_kexec_32.c            |    1 -
 arch/x86/kernel/machine_kexec_64.c            |    1 -
 arch/x86/kernel/module.c                      |    1 -
 arch/x86/kernel/process_32.c                  |    1 -
 arch/x86/kernel/process_64.c                  |    1 -
 arch/x86/kernel/ptrace.c                      |    1 -
 arch/x86/kernel/tboot.c                       |    1 -
 arch/x86/mm/dump_pagetables.c                 |    1 -
 arch/x86/mm/init_32.c                         |    1 -
 arch/x86/mm/init_64.c                         |    1 -
 arch/x86/mm/kasan_init_64.c                   |    1 -
 arch/x86/mm/pat/cpa-test.c                    |    1 -
 arch/x86/mm/pat/memtype.c                     |    1 -
 arch/x86/mm/pgtable.c                         |    1 -
 arch/x86/mm/pgtable_32.c                      |    1 -
 arch/x86/mm/pti.c                             |    1 -
 arch/x86/platform/efi/efi_64.c                |    1 -
 arch/x86/xen/enlighten_pv.c                   |    1 -
 arch/x86/xen/grant-table.c                    |    1 -
 arch/xtensa/kernel/process.c                  |    1 -
 arch/xtensa/kernel/ptrace.c                   |    1 -
 arch/xtensa/kernel/setup.c                    |    1 -
 drivers/char/agp/frontend.c                   |    1 -
 drivers/char/agp/generic.c                    |    1 -
 drivers/char/bsr.c                            |    1 -
 drivers/char/mspec.c                          |    1 -
 drivers/gpu/drm/i915/i915_mm.c                |    1 -
 drivers/infiniband/sw/rdmavt/mmap.c           |    1 -
 drivers/infiniband/sw/rxe/rxe_mmap.c          |    1 -
 drivers/media/platform/davinci/vpbe_display.c |    1 -
 drivers/media/v4l2-core/v4l2-common.c         |    1 -
 drivers/misc/sgi-gru/grufault.c               |    1 -
 drivers/net/ethernet/sun/sunhme.c             |    1 -
 drivers/sbus/char/flash.c                     |    1 -
 drivers/sbus/char/uctrl.c                     |    1 -
 drivers/scsi/a2091.c                          |    1 -
 drivers/scsi/a3000.c                          |    1 -
 drivers/scsi/gvp11.c                          |    1 -
 drivers/scsi/lasi700.c                        |    1 -
 drivers/scsi/mvme147.c                        |    1 -
 drivers/scsi/sni_53c710.c                     |    1 -
 drivers/video/console/newport_con.c           |    1 -
 drivers/video/fbdev/acornfb.c                 |    1 -
 drivers/video/fbdev/atafb.c                   |    1 -
 drivers/video/fbdev/cirrusfb.c                |    1 -
 drivers/video/fbdev/cyber2000fb.c             |    1 -
 drivers/video/fbdev/fb-puv3.c                 |    1 -
 drivers/video/fbdev/hitfb.c                   |    1 -
 drivers/video/fbdev/neofb.c                   |    1 -
 drivers/video/fbdev/q40fb.c                   |    1 -
 drivers/video/fbdev/savage/savagefb_driver.c  |    1 -
 drivers/xen/balloon.c                         |    1 -
 drivers/xen/grant-table.c                     |    1 -
 drivers/xen/privcmd.c                         |    1 -
 drivers/xen/xenbus/xenbus_probe.c             |    1 -
 drivers/xen/xenbus/xenbus_probe_backend.c     |    1 -
 drivers/xen/xenbus/xenbus_probe_frontend.c    |    1 -
 fs/proc/array.c                               |    1 -
 fs/proc/meminfo.c                             |    1 -
 fs/proc/nommu.c                               |    1 -
 fs/proc/vmcore.c                              |    1 -
 include/linux/dax.h                           |    1 -
 init/init_task.c                              |    1 -
 kernel/exit.c                                 |    1 -
 kernel/fork.c                                 |    1 -
 kernel/power/snapshot.c                       |    1 -
 lib/ioremap.c                                 |    1 -
 mm/debug_vm_pgtable.c                         |    1 -
 mm/gup.c                                      |    1 -
 mm/hugetlb.c                                  |    1 -
 mm/memory.c                                   |    1 -
 mm/page_io.c                                  |    1 -
 mm/shmem.c                                    |    1 -
 mm/sparse-vmemmap.c                           |    1 -
 mm/sparse.c                                   |    1 -
 mm/swap_state.c                               |    1 -
 mm/swapfile.c                                 |    1 -
 mm/vmacache.c                                 |    1 -
 sound/core/sgbuf.c                            |    1 -
 virt/kvm/kvm_main.c                           |    1 -
 319 files changed, 319 deletions(-)

--- a/arch/alpha/boot/bootp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/boot/bootp.c
@@ -16,7 +16,6 @@
 
 #include <asm/console.h>
 #include <asm/hwrpb.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 
 #include <stdarg.h>
--- a/arch/alpha/boot/bootpz.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/boot/bootpz.c
@@ -18,7 +18,6 @@
 
 #include <asm/console.h>
 #include <asm/hwrpb.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 
 #include <stdarg.h>
--- a/arch/alpha/boot/main.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/boot/main.c
@@ -14,7 +14,6 @@
 
 #include <asm/console.h>
 #include <asm/hwrpb.h>
-#include <asm/pgtable.h>
 
 #include <stdarg.h>
 
--- a/arch/alpha/include/asm/io.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/include/asm/io.h
@@ -7,7 +7,6 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <asm/compiler.h>
-#include <asm/pgtable.h>
 #include <asm/machvec.h>
 #include <asm/hwrpb.h>
 
--- a/arch/alpha/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/process.c
@@ -37,7 +37,6 @@
 #include <asm/reg.h>
 #include <linux/uaccess.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/hwrpb.h>
 #include <asm/fpu.h>
 
--- a/arch/alpha/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/ptrace.c
@@ -19,7 +19,6 @@
 #include <linux/audit.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/fpu.h>
 
 #include "proto.h"
--- a/arch/alpha/kernel/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/setup.c
@@ -55,7 +55,6 @@ static struct notifier_block alpha_panic
 };
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/hwrpb.h>
 #include <asm/dma.h>
 #include <asm/mmu_context.h>
--- a/arch/alpha/kernel/smp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/smp.c
@@ -36,7 +36,6 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_alcor.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_alcor.c
@@ -23,7 +23,6 @@
 #include <asm/dma.h>
 #include <asm/mmu_context.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_cabriolet.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_cabriolet.c
@@ -23,7 +23,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_apecs.h>
 #include <asm/core_cia.h>
 #include <asm/core_lca.h>
--- a/arch/alpha/kernel/sys_dp264.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_dp264.c
@@ -26,7 +26,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_tsunami.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_eb64p.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_eb64p.c
@@ -22,7 +22,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_apecs.h>
 #include <asm/core_lca.h>
 #include <asm/hwrpb.h>
--- a/arch/alpha/kernel/sys_eiger.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_eiger.c
@@ -23,7 +23,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_tsunami.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_jensen.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_jensen.c
@@ -25,7 +25,6 @@
 #include <asm/dma.h>
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 #include "proto.h"
--- a/arch/alpha/kernel/sys_marvel.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_marvel.c
@@ -18,7 +18,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_marvel.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_miata.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_miata.c
@@ -22,7 +22,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_mikasa.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_mikasa.c
@@ -23,7 +23,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_apecs.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_nautilus.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_nautilus.c
@@ -40,7 +40,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_irongate.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_noritake.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_noritake.c
@@ -24,7 +24,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_apecs.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_rawhide.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_rawhide.c
@@ -21,7 +21,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_mcpcia.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_ruffian.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_ruffian.c
@@ -23,7 +23,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_rx164.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_rx164.c
@@ -22,7 +22,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_polaris.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_sable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_sable.c
@@ -21,7 +21,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_t2.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_sio.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_sio.c
@@ -25,7 +25,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_apecs.h>
 #include <asm/core_lca.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_sx164.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_sx164.c
@@ -22,7 +22,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_takara.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_takara.c
@@ -21,7 +21,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
 
--- a/arch/alpha/kernel/sys_titan.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_titan.c
@@ -26,7 +26,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_titan.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/kernel/sys_wildfire.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/kernel/sys_wildfire.c
@@ -20,7 +20,6 @@
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/core_wildfire.h>
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
--- a/arch/alpha/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/alpha/mm/init.c
@@ -24,7 +24,6 @@
 #include <linux/gfp.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/hwrpb.h>
 #include <asm/dma.h>
--- a/arch/arm64/kernel/hibernate.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/kernel/hibernate.c
@@ -32,7 +32,6 @@
 #include <asm/memory.h>
 #include <asm/mmu_context.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/sections.h>
 #include <asm/smp.h>
--- a/arch/arm64/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/kernel/ptrace.c
@@ -34,7 +34,6 @@
 #include <asm/cpufeature.h>
 #include <asm/debug-monitors.h>
 #include <asm/fpsimd.h>
-#include <asm/pgtable.h>
 #include <asm/pointer_auth.h>
 #include <asm/stacktrace.h>
 #include <asm/syscall.h>
--- a/arch/arm64/kernel/smp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/kernel/smp.c
@@ -43,7 +43,6 @@
 #include <asm/kvm_mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/numa.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/processor.h>
 #include <asm/smp_plat.h>
--- a/arch/arm64/mm/dump.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/mm/dump.c
@@ -22,7 +22,6 @@
 #include <asm/fixmap.h>
 #include <asm/kasan.h>
 #include <asm/memory.h>
-#include <asm/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/ptdump.h>
 
--- a/arch/arm64/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/mm/fault.c
@@ -36,7 +36,6 @@
 #include <asm/processor.h>
 #include <asm/sysreg.h>
 #include <asm/system_misc.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/traps.h>
 
--- a/arch/arm64/mm/kasan_init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/mm/kasan_init.c
@@ -18,7 +18,6 @@
 #include <asm/kernel-pgtable.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/tlbflush.h>
 
--- a/arch/arm64/mm/pageattr.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm64/mm/pageattr.c
@@ -8,7 +8,6 @@
 #include <linux/sched.h>
 #include <linux/vmalloc.h>
 
-#include <asm/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/tlbflush.h>
 
--- a/arch/arm/kernel/machine_kexec.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/kernel/machine_kexec.c
@@ -10,7 +10,6 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/memblock.h>
-#include <asm/pgtable.h>
 #include <linux/of_fdt.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
--- a/arch/arm/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/kernel/module.c
@@ -17,7 +17,6 @@
 #include <linux/string.h>
 #include <linux/gfp.h>
 
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/smp_plat.h>
 #include <asm/unwind.h>
--- a/arch/arm/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/kernel/ptrace.c
@@ -25,7 +25,6 @@
 #include <linux/tracehook.h>
 #include <linux/unistd.h>
 
-#include <asm/pgtable.h>
 #include <asm/traps.h>
 
 #define CREATE_TRACE_POINTS
--- a/arch/arm/kernel/smp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/kernel/smp.c
@@ -37,7 +37,6 @@
 #include <asm/idmap.h>
 #include <asm/topology.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/procinfo.h>
 #include <asm/processor.h>
--- a/arch/arm/mach-ebsa110/core.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-ebsa110/core.c
@@ -17,7 +17,6 @@
 #include <asm/irq.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
-#include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/system_misc.h>
 
--- a/arch/arm/mach-footbridge/common.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-footbridge/common.c
@@ -14,7 +14,6 @@
 #include <linux/spinlock.h>
 #include <video/vga.h>
 
-#include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
--- a/arch/arm/mach-imx/mm-imx21.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-imx/mm-imx21.c
@@ -8,7 +8,6 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/pinctrl/machine.h>
-#include <asm/pgtable.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
--- a/arch/arm/mach-imx/mm-imx27.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-imx/mm-imx27.c
@@ -8,7 +8,6 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/pinctrl/machine.h>
-#include <asm/pgtable.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
--- a/arch/arm/mach-imx/mm-imx3.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-imx/mm-imx3.c
@@ -13,7 +13,6 @@
 #include <linux/io.h>
 #include <linux/pinctrl/machine.h>
 
-#include <asm/pgtable.h>
 #include <asm/system_misc.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/map.h>
--- a/arch/arm/mach-iop32x/i2c.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-iop32x/i2c.c
@@ -17,7 +17,6 @@
 #include <linux/serial_core.h>
 #include <linux/io.h>
 #include <linux/gpio/machine.h>
-#include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
--- a/arch/arm/mach-iop32x/iq31244.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-iop32x/iq31244.c
@@ -31,7 +31,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 
 #include "hardware.h"
 #include "irqs.h"
--- a/arch/arm/mach-iop32x/iq80321.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-iop32x/iq80321.c
@@ -27,7 +27,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 
 #include "hardware.h"
 #include "irqs.h"
--- a/arch/arm/mach-iop32x/n2100.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-iop32x/n2100.c
@@ -35,7 +35,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 
 #include "hardware.h"
 #include "irqs.h"
--- a/arch/arm/mach-ixp4xx/common.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-ixp4xx/common.c
@@ -33,7 +33,6 @@
 #include <mach/hardware.h>
 #include <mach/io.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/exception.h>
 #include <asm/irq.h>
--- a/arch/arm/mach-sa1100/assabet.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mach-sa1100/assabet.c
@@ -34,7 +34,6 @@
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 #include <asm/mach/arch.h>
--- a/arch/arm/mm/copypage-v4mc.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/copypage-v4mc.c
@@ -14,7 +14,6 @@
 #include <linux/mm.h>
 #include <linux/highmem.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
 
--- a/arch/arm/mm/copypage-v6.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/copypage-v6.c
@@ -9,7 +9,6 @@
 #include <linux/mm.h>
 #include <linux/highmem.h>
 
-#include <asm/pgtable.h>
 #include <asm/shmparam.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
--- a/arch/arm/mm/copypage-xscale.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/copypage-xscale.c
@@ -14,7 +14,6 @@
 #include <linux/mm.h>
 #include <linux/highmem.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
 
--- a/arch/arm/mm/dump.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/dump.c
@@ -16,7 +16,6 @@
 #include <asm/domain.h>
 #include <asm/fixmap.h>
 #include <asm/memory.h>
-#include <asm/pgtable.h>
 #include <asm/ptdump.h>
 
 static struct addr_marker address_markers[] = {
--- a/arch/arm/mm/fault-armv.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/fault-armv.c
@@ -17,7 +17,6 @@
 #include <asm/bugs.h>
 #include <asm/cacheflush.h>
 #include <asm/cachetype.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 #include "mm.h"
--- a/arch/arm/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/fault.c
@@ -18,7 +18,6 @@
 #include <linux/highmem.h>
 #include <linux/perf_event.h>
 
-#include <asm/pgtable.h>
 #include <asm/system_misc.h>
 #include <asm/system_info.h>
 #include <asm/tlbflush.h>
--- a/arch/arm/mm/pageattr.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/arm/mm/pageattr.c
@@ -5,7 +5,6 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/set_memory.h>
 
--- a/arch/csky/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/csky/kernel/module.c
@@ -10,7 +10,6 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
-#include <asm/pgtable.h>
 
 #ifdef CONFIG_CPU_CK810
 #define IS_BSR32(hi16, lo16)		(((hi16) & 0xFC00) == 0xE000)
--- a/arch/csky/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/csky/kernel/ptrace.c
@@ -18,7 +18,6 @@
 
 #include <asm/thread_info.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/asm-offsets.h>
 
--- a/arch/csky/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/csky/mm/init.c
@@ -24,7 +24,6 @@
 #include <asm/setup.h>
 #include <asm/cachectl.h>
 #include <asm/dma.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
 #include <asm/sections.h>
--- a/arch/csky/mm/tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/csky/mm/tlb.c
@@ -7,7 +7,6 @@
 #include <linux/sched.h>
 
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 
 /*
--- a/arch/h8300/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/h8300/kernel/process.c
@@ -45,7 +45,6 @@
 #include <linux/uaccess.h>
 #include <asm/traps.h>
 #include <asm/setup.h>
-#include <asm/pgtable.h>
 
 void (*pm_power_off)(void) = NULL;
 EXPORT_SYMBOL(pm_power_off);
--- a/arch/h8300/kernel/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/h8300/kernel/setup.c
@@ -31,7 +31,6 @@
 
 #include <asm/setup.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/page.h>
 
--- a/arch/h8300/kernel/signal.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/h8300/kernel/signal.c
@@ -43,7 +43,6 @@
 
 #include <asm/setup.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/traps.h>
 #include <asm/ucontext.h>
 
--- a/arch/h8300/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/h8300/mm/fault.c
@@ -18,7 +18,6 @@
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
 
-#include <asm/pgtable.h>
 
 void die(const char *str, struct pt_regs *fp, unsigned long err);
 
--- a/arch/h8300/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/h8300/mm/init.c
@@ -36,7 +36,6 @@
 #include <asm/setup.h>
 #include <asm/segment.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 
 /*
--- a/arch/h8300/mm/memory.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/h8300/mm/memory.c
@@ -26,7 +26,6 @@
 #include <asm/setup.h>
 #include <asm/segment.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/traps.h>
 #include <asm/io.h>
 
--- a/arch/hexagon/mm/vm_fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/hexagon/mm/vm_fault.c
@@ -11,7 +11,6 @@
  * execptions.
  */
 
-#include <asm/pgtable.h>
 #include <asm/traps.h>
 #include <linux/uaccess.h>
 #include <linux/mm.h>
--- a/arch/ia64/kernel/efi.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/ia64/kernel/efi.c
@@ -37,7 +37,6 @@
 #include <asm/io.h>
 #include <asm/kregs.h>
 #include <asm/meminit.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mca.h>
 #include <asm/setup.h>
--- a/arch/ia64/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/ia64/kernel/ptrace.c
@@ -25,7 +25,6 @@
 #include <linux/elf.h>
 #include <linux/tracehook.h>
 
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace_offsets.h>
 #include <asm/rse.h>
--- a/arch/ia64/kernel/smpboot.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/ia64/kernel/smpboot.c
@@ -50,7 +50,6 @@
 #include <asm/mca.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/sal.h>
--- a/arch/ia64/kernel/smp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/ia64/kernel/smp.c
@@ -40,7 +40,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/sal.h>
--- a/arch/ia64/mm/contig.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/ia64/mm/contig.c
@@ -22,7 +22,6 @@
 
 #include <asm/meminit.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/mca.h>
 
--- a/arch/ia64/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/ia64/mm/fault.c
@@ -15,7 +15,6 @@
 #include <linux/prefetch.h>
 #include <linux/uaccess.h>
 
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/exception.h>
 
--- a/arch/m68k/68000/timers.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/68000/timers.c
@@ -22,7 +22,6 @@
 #include <linux/clocksource.h>
 #include <linux/rtc.h>
 #include <asm/setup.h>
-#include <asm/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/MC68VZ328.h>
 
--- a/arch/m68k/amiga/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/amiga/config.c
@@ -32,7 +32,6 @@
 #include <asm/bootinfo-amiga.h>
 #include <asm/byteorder.h>
 #include <asm/setup.h>
-#include <asm/pgtable.h>
 #include <asm/amigahw.h>
 #include <asm/amigaints.h>
 #include <asm/irq.h>
--- a/arch/m68k/apollo/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/apollo/config.c
@@ -13,7 +13,6 @@
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-apollo.h>
 #include <asm/byteorder.h>
-#include <asm/pgtable.h>
 #include <asm/apollohw.h>
 #include <asm/irq.h>
 #include <asm/machdep.h>
--- a/arch/m68k/atari/atasound.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/atari/atasound.c
@@ -26,7 +26,6 @@
 
 #include <asm/atarihw.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 #include <asm/atariints.h>
 
 
--- a/arch/m68k/atari/stram.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/atari/stram.c
@@ -26,7 +26,6 @@
 #include <asm/setup.h>
 #include <asm/machdep.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/atarihw.h>
 #include <asm/atari_stram.h>
 #include <asm/io.h>
--- a/arch/m68k/bvme6000/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/bvme6000/config.c
@@ -31,7 +31,6 @@
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-vme.h>
 #include <asm/byteorder.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
--- a/arch/m68k/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/kernel/process.c
@@ -36,7 +36,6 @@
 #include <asm/traps.h>
 #include <asm/machdep.h>
 #include <asm/setup.h>
-#include <asm/pgtable.h>
 
 
 asmlinkage void ret_from_fork(void);
--- a/arch/m68k/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/kernel/ptrace.c
@@ -23,7 +23,6 @@
 
 #include <linux/uaccess.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 
 /*
--- a/arch/m68k/kernel/setup_no.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/kernel/setup_no.c
@@ -38,7 +38,6 @@
 #include <asm/bootinfo.h>
 #include <asm/irq.h>
 #include <asm/machdep.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 
 unsigned long memory_start;
--- a/arch/m68k/kernel/signal.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/kernel/signal.c
@@ -47,7 +47,6 @@
 
 #include <asm/setup.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/traps.h>
 #include <asm/ucontext.h>
 #include <asm/cacheflush.h>
--- a/arch/m68k/kernel/uboot.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/kernel/uboot.c
@@ -26,7 +26,6 @@
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/machdep.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 
 /*
--- a/arch/m68k/mac/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/mac/config.c
@@ -36,7 +36,6 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 #include <asm/machdep.h>
 
 #include <asm/macintosh.h>
--- a/arch/m68k/mm/mcfmmu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/mm/mcfmmu.c
@@ -17,7 +17,6 @@
 
 #include <asm/setup.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/mcf_pgalloc.h>
 #include <asm/tlbflush.h>
--- a/arch/m68k/mm/sun3kmap.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/mm/sun3kmap.c
@@ -15,7 +15,6 @@
 #include <linux/vmalloc.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/sun3mmu.h>
 
--- a/arch/m68k/mm/sun3mmu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/mm/sun3mmu.c
@@ -21,7 +21,6 @@
 #include <asm/setup.h>
 #include <linux/uaccess.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
 
--- a/arch/m68k/mvme147/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/mvme147/config.c
@@ -29,7 +29,6 @@
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-vme.h>
 #include <asm/byteorder.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
--- a/arch/m68k/mvme16x/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/mvme16x/config.c
@@ -32,7 +32,6 @@
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-vme.h>
 #include <asm/byteorder.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
--- a/arch/m68k/q40/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/q40/config.c
@@ -29,7 +29,6 @@
 
 #include <asm/io.h>
 #include <asm/bootinfo.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
--- a/arch/m68k/sun3/config.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/sun3/config.c
@@ -22,7 +22,6 @@
 #include <asm/setup.h>
 #include <asm/contregs.h>
 #include <asm/movs.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/sun3-head.h>
 #include <asm/sun3mmu.h>
--- a/arch/m68k/sun3/dvma.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/sun3/dvma.c
@@ -14,7 +14,6 @@
 #include <linux/memblock.h>
 #include <linux/list.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/sun3mmu.h>
 #include <asm/dvma.h>
 
--- a/arch/m68k/sun3/mmu_emu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/sun3/mmu_emu.c
@@ -22,7 +22,6 @@
 #include <asm/traps.h>
 #include <linux/uaccess.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/sun3mmu.h>
 #include <asm/segment.h>
 #include <asm/oplib.h>
--- a/arch/m68k/sun3/sun3dvma.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/sun3/sun3dvma.c
@@ -16,7 +16,6 @@
 #include <linux/list.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/dvma.h>
 
 #undef DVMA_DEBUG
--- a/arch/m68k/sun3x/dvma.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/sun3x/dvma.c
@@ -22,7 +22,6 @@
 #include <asm/dvma.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 
 /* IOMMU support */
--- a/arch/m68k/sun3x/prom.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/m68k/sun3x/prom.c
@@ -10,7 +10,6 @@
 #include <linux/string.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/traps.h>
 #include <asm/sun3xprom.h>
--- a/arch/microblaze/kernel/signal.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/microblaze/kernel/signal.c
@@ -35,7 +35,6 @@
 #include <asm/entry.h>
 #include <asm/ucontext.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <linux/syscalls.h>
 #include <asm/cacheflush.h>
--- a/arch/microblaze/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/microblaze/mm/fault.c
@@ -30,7 +30,6 @@
 #include <linux/interrupt.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <linux/mmu_context.h>
 #include <linux/uaccess.h>
--- a/arch/mips/fw/arc/memory.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/fw/arc/memory.c
@@ -22,7 +22,6 @@
 
 #include <asm/sgialib.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/bootinfo.h>
 
 #undef DEBUG
--- a/arch/mips/include/asm/mach-generic/floppy.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/include/asm/mach-generic/floppy.h
@@ -21,7 +21,6 @@
 #include <asm/floppy.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 
 /*
  * How to access the FDC's registers.
--- a/arch/mips/include/asm/mach-jazz/floppy.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/include/asm/mach-jazz/floppy.h
@@ -15,7 +15,6 @@
 #include <asm/addrspace.h>
 #include <asm/jazz.h>
 #include <asm/jazzdma.h>
-#include <asm/pgtable.h>
 
 static inline unsigned char fd_inb(unsigned int base, unsigned int reg)
 {
--- a/arch/mips/jazz/jazzdma.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/jazz/jazzdma.c
@@ -24,7 +24,6 @@
 #include <linux/uaccess.h>
 #include <asm/dma.h>
 #include <asm/jazzdma.h>
-#include <asm/pgtable.h>
 
 /*
  * Set this to one to enable additional vdma debug code.
--- a/arch/mips/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kernel/module.c
@@ -21,7 +21,6 @@
 #include <linux/spinlock.h>
 #include <linux/jump_label.h>
 
-#include <asm/pgtable.h>	/* MODULE_START */
 
 struct mips_hi16 {
 	struct mips_hi16 *next;
--- a/arch/mips/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kernel/process.c
@@ -42,7 +42,6 @@
 #include <asm/irq.h>
 #include <asm/mips-cps.h>
 #include <asm/msa.h>
-#include <asm/pgtable.h>
 #include <asm/mipsregs.h>
 #include <asm/processor.h>
 #include <asm/reg.h>
--- a/arch/mips/kernel/ptrace32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kernel/ptrace32.c
@@ -30,7 +30,6 @@
 #include <asm/fpu.h>
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
-#include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/reg.h>
 #include <asm/syscall.h>
--- a/arch/mips/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kernel/ptrace.c
@@ -39,7 +39,6 @@
 #include <asm/fpu.h>
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
-#include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 #include <asm/syscall.h>
--- a/arch/mips/kernel/smp-bmips.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kernel/smp-bmips.c
@@ -28,7 +28,6 @@
 #include <linux/kexec.h>
 
 #include <asm/time.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/bootinfo.h>
 #include <asm/cacheflush.h>
--- a/arch/mips/kernel/traps.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kernel/traps.c
@@ -57,7 +57,6 @@
 #include <asm/mipsmtregs.h>
 #include <asm/module.h>
 #include <asm/msa.h>
-#include <asm/pgtable.h>
 #include <asm/ptrace.h>
 #include <asm/sections.h>
 #include <asm/siginfo.h>
--- a/arch/mips/kvm/tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/kvm/tlb.c
@@ -21,7 +21,6 @@
 #include <asm/cpu.h>
 #include <asm/bootinfo.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/tlb.h>
 #include <asm/tlbdebug.h>
--- a/arch/mips/lib/dump_tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/lib/dump_tlb.c
@@ -12,7 +12,6 @@
 #include <asm/mipsregs.h>
 #include <asm/mmu_context.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/tlbdebug.h>
 
 void dump_tlb_regs(void)
--- a/arch/mips/lib/r3k_dump_tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/lib/r3k_dump_tlb.c
@@ -12,7 +12,6 @@
 #include <asm/mipsregs.h>
 #include <asm/mmu_context.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/tlbdebug.h>
 
 extern int r3k_have_wired_reg;
--- a/arch/mips/mm/c-octeon.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/c-octeon.c
@@ -20,7 +20,6 @@
 #include <asm/cpu-features.h>
 #include <asm/cpu-type.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/r4kcache.h>
 #include <asm/traps.h>
 #include <asm/mmu_context.h>
--- a/arch/mips/mm/c-r3k.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/c-r3k.c
@@ -16,7 +16,6 @@
 #include <linux/mm.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/isadep.h>
 #include <asm/io.h>
--- a/arch/mips/mm/c-r4k.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/c-r4k.c
@@ -29,7 +29,6 @@
 #include <asm/cpu-type.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/r4kcache.h>
 #include <asm/sections.h>
 #include <asm/mmu_context.h>
--- a/arch/mips/mm/c-tx39.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/c-tx39.c
@@ -17,7 +17,6 @@
 
 #include <asm/cacheops.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/isadep.h>
 #include <asm/io.h>
--- a/arch/mips/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/init.c
@@ -40,7 +40,6 @@
 #include <asm/maar.h>
 #include <asm/mmu_context.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/fixmap.h>
--- a/arch/mips/mm/page.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/page.c
@@ -20,7 +20,6 @@
 #include <asm/inst.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/prefetch.h>
 #include <asm/bootinfo.h>
 #include <asm/mipsregs.h>
--- a/arch/mips/mm/pgtable-32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/pgtable-32.c
@@ -10,7 +10,6 @@
 #include <linux/memblock.h>
 #include <linux/highmem.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
--- a/arch/mips/mm/pgtable-64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/pgtable-64.c
@@ -10,7 +10,6 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
--- a/arch/mips/mm/sc-ip22.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/sc-ip22.c
@@ -12,7 +12,6 @@
 
 #include <asm/bcache.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/bootinfo.h>
 #include <asm/sgi/ip22.h>
 #include <asm/sgi/mc.h>
--- a/arch/mips/mm/sc-mips.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/sc-mips.c
@@ -12,7 +12,6 @@
 #include <asm/bcache.h>
 #include <asm/cacheops.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/r4kcache.h>
 #include <asm/mips-cps.h>
--- a/arch/mips/mm/sc-r5k.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/sc-r5k.c
@@ -12,7 +12,6 @@
 #include <asm/bcache.h>
 #include <asm/cacheops.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/r4kcache.h>
 
--- a/arch/mips/mm/tlb-r3k.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/tlb-r3k.c
@@ -17,7 +17,6 @@
 #include <linux/mm.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/tlbmisc.h>
 #include <asm/isadep.h>
--- a/arch/mips/mm/tlb-r4k.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/mm/tlb-r4k.c
@@ -21,7 +21,6 @@
 #include <asm/bootinfo.h>
 #include <asm/hazards.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 #include <asm/tlbmisc.h>
 
--- a/arch/mips/sgi-ip27/ip27-init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/sgi-ip27/ip27-init.c
@@ -16,7 +16,6 @@
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/sgialib.h>
 #include <asm/time.h>
 #include <asm/sn/agent.h>
--- a/arch/mips/sgi-ip27/ip27-timer.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/sgi-ip27/ip27-timer.c
@@ -19,7 +19,6 @@
 #include <linux/platform_device.h>
 
 #include <asm/time.h>
-#include <asm/pgtable.h>
 #include <asm/sgialib.h>
 #include <asm/sn/klconfig.h>
 #include <asm/sn/arch.h>
--- a/arch/mips/sgi-ip32/ip32-memory.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/mips/sgi-ip32/ip32-memory.c
@@ -14,7 +14,6 @@
 #include <asm/ip32/crime.h>
 #include <asm/bootinfo.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 
 extern void crime_init(void);
--- a/arch/nds32/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/nds32/mm/fault.c
@@ -11,7 +11,6 @@
 #include <linux/uaccess.h>
 #include <linux/perf_event.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 extern void die(const char *str, struct pt_regs *regs, long err);
--- a/arch/nds32/mm/proc.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/nds32/mm/proc.c
@@ -5,7 +5,6 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <asm/nds32.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
 #include <asm/l2_cache.h>
--- a/arch/nios2/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/nios2/kernel/module.c
@@ -19,7 +19,6 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 
 /*
--- a/arch/nios2/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/nios2/mm/init.c
@@ -29,7 +29,6 @@
 
 #include <asm/setup.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/tlb.h>
 #include <asm/mmu_context.h>
--- a/arch/nios2/mm/pgtable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/nios2/mm/pgtable.c
@@ -10,7 +10,6 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 
-#include <asm/pgtable.h>
 #include <asm/cpuinfo.h>
 
 /* pteaddr:
--- a/arch/nios2/mm/tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/nios2/mm/tlb.c
@@ -16,7 +16,6 @@
 
 #include <asm/tlb.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/cpuinfo.h>
 
 #define TLB_INDEX_MASK		\
--- a/arch/openrisc/include/asm/tlbflush.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/include/asm/tlbflush.h
@@ -17,7 +17,6 @@
 
 #include <linux/mm.h>
 #include <asm/processor.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/current.h>
 #include <linux/sched.h>
--- a/arch/openrisc/kernel/asm-offsets.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/kernel/asm-offsets.c
@@ -32,7 +32,6 @@
 #include <linux/thread_info.h>
 #include <linux/kbuild.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 
 int main(void)
--- a/arch/openrisc/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/kernel/process.c
@@ -36,7 +36,6 @@
 #include <linux/fs.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/spr_defs.h>
--- a/arch/openrisc/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/kernel/ptrace.c
@@ -27,7 +27,6 @@
 
 #include <asm/thread_info.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 
 /*
  * Copy the thread state to a regset that can be interpreted by userspace.
--- a/arch/openrisc/kernel/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/kernel/setup.c
@@ -35,7 +35,6 @@
 #include <linux/device.h>
 
 #include <asm/sections.h>
-#include <asm/pgtable.h>
 #include <asm/types.h>
 #include <asm/setup.h>
 #include <asm/io.h>
--- a/arch/openrisc/kernel/traps.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/kernel/traps.c
@@ -31,7 +31,6 @@
 #include <linux/uaccess.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/unwinder.h>
 #include <asm/sections.h>
 
--- a/arch/openrisc/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/mm/init.c
@@ -29,7 +29,6 @@
 #include <linux/pagemap.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 #include <asm/tlb.h>
--- a/arch/openrisc/mm/tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/openrisc/mm/tlb.c
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 
 #include <asm/tlbflush.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/spr_defs.h>
 
--- a/arch/parisc/include/asm/mmu_context.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/parisc/include/asm/mmu_context.h
@@ -6,7 +6,6 @@
 #include <linux/sched.h>
 #include <linux/atomic.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm-generic/mm_hooks.h>
 
 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
--- a/arch/parisc/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/parisc/kernel/module.c
@@ -50,7 +50,6 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 
-#include <asm/pgtable.h>
 #include <asm/unwind.h>
 #include <asm/sections.h>
 
--- a/arch/parisc/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/parisc/kernel/ptrace.c
@@ -26,7 +26,6 @@
 #include <linux/audit.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/asm-offsets.h>
 
--- a/arch/parisc/kernel/smp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/parisc/kernel/smp.c
@@ -39,7 +39,6 @@
 #include <asm/irq.h>		/* for CPU_IRQ_REGION and friends */
 #include <asm/mmu_context.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
--- a/arch/parisc/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/parisc/mm/init.c
@@ -26,7 +26,6 @@
 #include <linux/compat.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 #include <asm/pdc_chassis.h>
 #include <asm/mmzone.h>
--- a/arch/powerpc/include/asm/io.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/include/asm/io.h
@@ -34,7 +34,6 @@ extern struct pci_dev *isa_bridge_pcidev
 #include <asm/mmiowb.h>
 #include <asm/mmu.h>
 #include <asm/ppc_asm.h>
-#include <asm/pgtable.h>
 
 #define SIO_CONFIG_RA	0x398
 #define SIO_CONFIG_RD	0x399
--- a/arch/powerpc/kernel/asm-offsets.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/kernel/asm-offsets.c
@@ -30,7 +30,6 @@
 
 #include <asm/io.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/kernel/process.c
@@ -41,7 +41,6 @@
 #include <linux/pkeys.h>
 #include <linux/seq_buf.h>
 
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
--- a/arch/powerpc/kernel/signal_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/kernel/signal_32.c
@@ -47,7 +47,6 @@
 #include <asm/unistd.h>
 #else
 #include <asm/ucontext.h>
-#include <asm/pgtable.h>
 #endif
 
 #include "signal.h"
--- a/arch/powerpc/kernel/signal_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/kernel/signal_64.c
@@ -25,7 +25,6 @@
 #include <asm/sigcontext.h>
 #include <asm/ucontext.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/unistd.h>
 #include <asm/cacheflush.h>
 #include <asm/syscalls.h>
--- a/arch/powerpc/kernel/traps.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/kernel/traps.c
@@ -39,7 +39,6 @@
 #include <linux/kmsg_dump.h>
 
 #include <asm/emulated_ops.h>
-#include <asm/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/debugfs.h>
 #include <asm/io.h>
--- a/arch/powerpc/kernel/vdso.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/kernel/vdso.c
@@ -18,7 +18,6 @@
 #include <linux/security.h>
 #include <linux/memblock.h>
 
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
--- a/arch/powerpc/lib/code-patching.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/lib/code-patching.c
@@ -12,7 +12,6 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/page.h>
 #include <asm/code-patching.h>
--- a/arch/powerpc/mm/book3s64/hash_hugetlbpage.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/book3s64/hash_hugetlbpage.c
@@ -10,7 +10,6 @@
 
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/mm/book3s64/hash_pgtable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/book3s64/hash_pgtable.c
@@ -10,7 +10,6 @@
 #include <linux/mm.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/mmu.h>
 #include <asm/tlb.h>
--- a/arch/powerpc/mm/book3s64/radix_hugetlbpage.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/book3s64/radix_hugetlbpage.c
@@ -2,7 +2,6 @@
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
 #include <linux/security.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -17,7 +17,6 @@
 #include <linux/string_helpers.h>
 #include <linux/stop_machine.h>
 
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
 #include <asm/dma.h>
--- a/arch/powerpc/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/fault.c
@@ -35,7 +35,6 @@
 
 #include <asm/firmware.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/siginfo.h>
--- a/arch/powerpc/mm/hugetlbpage.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/hugetlbpage.c
@@ -19,7 +19,6 @@
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/kmemleak.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/setup.h>
--- a/arch/powerpc/mm/init_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/init_32.c
@@ -32,7 +32,6 @@
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/smp.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/mm/init_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/init_64.c
@@ -47,7 +47,6 @@
 #include <asm/rtas.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <linux/uaccess.h>
 #include <asm/smp.h>
--- a/arch/powerpc/mm/mem.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/mem.c
@@ -38,7 +38,6 @@
 #include <asm/prom.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/smp.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/mm/nohash/40x.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/nohash/40x.c
@@ -36,7 +36,6 @@
 #include <asm/prom.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <linux/uaccess.h>
 #include <asm/smp.h>
--- a/arch/powerpc/mm/nohash/fsl_booke.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/nohash/fsl_booke.c
@@ -41,7 +41,6 @@
 #include <asm/prom.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <linux/uaccess.h>
 #include <asm/smp.h>
--- a/arch/powerpc/mm/pgtable_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/pgtable_32.c
@@ -24,7 +24,6 @@
 #include <linux/memblock.h>
 #include <linux/slab.h>
 
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/fixmap.h>
 #include <asm/setup.h>
--- a/arch/powerpc/mm/pgtable_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/pgtable_64.c
@@ -35,7 +35,6 @@
 #include <asm/page.h>
 #include <asm/prom.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/smp.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/mm/ptdump/hashpagetable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/ptdump/hashpagetable.c
@@ -15,7 +15,6 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/seq_file.h>
-#include <asm/pgtable.h>
 #include <linux/const.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
--- a/arch/powerpc/mm/ptdump/ptdump.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/mm/ptdump/ptdump.c
@@ -19,7 +19,6 @@
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
 #include <linux/const.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
--- a/arch/powerpc/perf/callchain_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/perf/callchain_32.c
@@ -11,7 +11,6 @@
 #include <linux/uaccess.h>
 #include <linux/mm.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
 #include <asm/sigcontext.h>
 #include <asm/ucontext.h>
 #include <asm/vdso.h>
--- a/arch/powerpc/perf/callchain_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/perf/callchain_64.c
@@ -11,7 +11,6 @@
 #include <linux/uaccess.h>
 #include <linux/mm.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
 #include <asm/sigcontext.h>
 #include <asm/ucontext.h>
 #include <asm/vdso.h>
--- a/arch/powerpc/perf/callchain.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/perf/callchain.c
@@ -11,7 +11,6 @@
 #include <linux/uaccess.h>
 #include <linux/mm.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
 #include <asm/sigcontext.h>
 #include <asm/ucontext.h>
 #include <asm/vdso.h>
--- a/arch/powerpc/platforms/8xx/cpm1.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/8xx/cpm1.c
@@ -34,7 +34,6 @@
 #include <linux/spinlock.h>
 #include <linux/slab.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/8xx_immap.h>
 #include <asm/cpm1.h>
 #include <asm/io.h>
--- a/arch/powerpc/platforms/8xx/micropatch.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/8xx/micropatch.c
@@ -16,7 +16,6 @@
 #include <linux/interrupt.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/8xx_immap.h>
 #include <asm/cpm.h>
 #include <asm/cpm1.h>
--- a/arch/powerpc/platforms/cell/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/cell/setup.c
@@ -31,7 +31,6 @@
 #include <asm/mmu.h>
 #include <asm/processor.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/pci-bridge.h>
--- a/arch/powerpc/platforms/chrp/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/chrp/setup.c
@@ -34,7 +34,6 @@
 #include <linux/timer.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 #include <asm/dma.h>
--- a/arch/powerpc/platforms/maple/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/maple/setup.c
@@ -42,7 +42,6 @@
 #include <asm/processor.h>
 #include <asm/sections.h>
 #include <asm/prom.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/pci-bridge.h>
 #include <asm/iommu.h>
--- a/arch/powerpc/platforms/maple/time.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/maple/time.c
@@ -23,7 +23,6 @@
 #include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/time.h>
 
--- a/arch/powerpc/platforms/powermac/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/powermac/setup.c
@@ -51,7 +51,6 @@
 #include <asm/reg.h>
 #include <asm/sections.h>
 #include <asm/prom.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/pci-bridge.h>
 #include <asm/ohare.h>
--- a/arch/powerpc/platforms/powermac/time.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/powermac/time.c
@@ -28,7 +28,6 @@
 #include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/time.h>
 #include <asm/nvram.h>
--- a/arch/powerpc/platforms/pseries/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/platforms/pseries/setup.c
@@ -43,7 +43,6 @@
 #include <asm/mmu.h>
 #include <asm/processor.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/pci-bridge.h>
--- a/arch/powerpc/sysdev/cpm2.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/sysdev/cpm2.c
@@ -39,7 +39,6 @@
 #include <asm/irq.h>
 #include <asm/mpc8260.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/cpm2.h>
 #include <asm/rheap.h>
 #include <asm/fs_pd.h>
--- a/arch/powerpc/xmon/xmon.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/powerpc/xmon/xmon.c
@@ -35,7 +35,6 @@
 #include <asm/machdep.h>
 #include <asm/xmon.h>
 #include <asm/processor.h>
-#include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/plpar_wrappers.h>
--- a/arch/riscv/kernel/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/riscv/kernel/setup.c
@@ -22,7 +22,6 @@
 #include <asm/cpu_ops.h>
 #include <asm/setup.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
 #include <asm/sbi.h>
 #include <asm/tlbflush.h>
 #include <asm/thread_info.h>
--- a/arch/riscv/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/riscv/mm/init.c
@@ -18,7 +18,6 @@
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
 #include <asm/soc.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/ptdump.h>
 
--- a/arch/s390/include/asm/tlbflush.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/include/asm/tlbflush.h
@@ -6,7 +6,6 @@
 #include <linux/sched.h>
 #include <asm/processor.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 
 /*
  * Flush all TLB entries on the local CPU.
--- a/arch/s390/kernel/machine_kexec.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/kernel/machine_kexec.c
@@ -16,7 +16,6 @@
 #include <linux/debug_locks.h>
 #include <asm/cio.h>
 #include <asm/setup.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/smp.h>
 #include <asm/ipl.h>
--- a/arch/s390/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/kernel/ptrace.c
@@ -25,7 +25,6 @@
 #include <linux/compat.h>
 #include <trace/syscall.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
--- a/arch/s390/kernel/vdso.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/kernel/vdso.c
@@ -21,7 +21,6 @@
 #include <linux/memblock.h>
 #include <linux/compat.h>
 #include <asm/asm-offsets.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
--- a/arch/s390/mm/dump_pagetables.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/mm/dump_pagetables.c
@@ -6,7 +6,6 @@
 #include <linux/kasan.h>
 #include <asm/kasan.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
 
 static unsigned long max_addr;
 
--- a/arch/s390/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/mm/fault.c
@@ -33,7 +33,6 @@
 #include <linux/hugetlb.h>
 #include <asm/asm-offsets.h>
 #include <asm/diag.h>
-#include <asm/pgtable.h>
 #include <asm/gmap.h>
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
--- a/arch/s390/mm/init.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/mm/init.c
@@ -33,7 +33,6 @@
 #include <linux/dma-direct.h>
 #include <asm/processor.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/lowcore.h>
--- a/arch/s390/mm/pageattr.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/mm/pageattr.c
@@ -7,7 +7,6 @@
 #include <linux/mm.h>
 #include <asm/cacheflush.h>
 #include <asm/facility.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/set_memory.h>
--- a/arch/s390/mm/pgtable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/mm/pgtable.c
@@ -19,7 +19,6 @@
 #include <linux/ksm.h>
 #include <linux/mman.h>
 
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
--- a/arch/s390/mm/vmem.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/s390/mm/vmem.c
@@ -13,7 +13,6 @@
 #include <linux/slab.h>
 #include <asm/cacheflush.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
--- a/arch/sh/kernel/machine_kexec.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/kernel/machine_kexec.c
@@ -14,7 +14,6 @@
 #include <linux/ftrace.h>
 #include <linux/suspend.h>
 #include <linux/memblock.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
 #include <asm/io.h>
--- a/arch/sh/kernel/ptrace_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/kernel/ptrace_32.c
@@ -25,7 +25,6 @@
 #include <linux/regset.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mmu_context.h>
 #include <asm/syscalls.h>
--- a/arch/sh/kernel/signal_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/kernel/signal_32.c
@@ -28,7 +28,6 @@
 #include <linux/tracehook.h>
 #include <asm/ucontext.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/syscalls.h>
 #include <asm/fpu.h>
--- a/arch/sh/mm/cache-sh3.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/mm/cache-sh3.c
@@ -12,7 +12,6 @@
 #include <linux/threads.h>
 #include <asm/addrspace.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/cache.h>
 #include <asm/io.h>
--- a/arch/sh/mm/cache-sh4.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/mm/cache-sh4.c
@@ -16,7 +16,6 @@
 #include <linux/mutex.h>
 #include <linux/fs.h>
 #include <linux/highmem.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/cache_insns.h>
 #include <asm/cacheflush.h>
--- a/arch/sh/mm/cache-sh7705.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/mm/cache-sh7705.c
@@ -16,7 +16,6 @@
 #include <linux/threads.h>
 #include <asm/addrspace.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/cache.h>
 #include <asm/io.h>
--- a/arch/sh/mm/nommu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sh/mm/nommu.c
@@ -10,7 +10,6 @@
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/page.h>
 #include <linux/uaccess.h>
--- a/arch/sparc/kernel/leon_smp.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/leon_smp.c
@@ -39,7 +39,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/cpudata.h>
 #include <asm/asi.h>
--- a/arch/sparc/kernel/process_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/process_32.c
@@ -35,7 +35,6 @@
 #include <linux/uaccess.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/delay.h>
 #include <asm/processor.h>
 #include <asm/psr.h>
--- a/arch/sparc/kernel/process_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/process_64.c
@@ -41,7 +41,6 @@
 #include <linux/uaccess.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/pstate.h>
 #include <asm/elf.h>
--- a/arch/sparc/kernel/ptrace_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/ptrace_32.c
@@ -23,7 +23,6 @@
 #include <linux/elf.h>
 #include <linux/tracehook.h>
 
-#include <asm/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
 
--- a/arch/sparc/kernel/ptrace_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/ptrace_64.c
@@ -32,7 +32,6 @@
 #include <linux/context_tracking.h>
 
 #include <asm/asi.h>
-#include <asm/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/psrcompat.h>
 #include <asm/visasm.h>
--- a/arch/sparc/kernel/setup_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/setup_32.c
@@ -40,7 +40,6 @@
 #include <asm/processor.h>
 #include <asm/oplib.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/traps.h>
 #include <asm/vaddrs.h>
 #include <asm/mbus.h>
--- a/arch/sparc/kernel/setup_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/setup_64.c
@@ -39,7 +39,6 @@
 #include <asm/processor.h>
 #include <asm/oplib.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/idprom.h>
 #include <asm/head.h>
 #include <asm/starfire.h>
--- a/arch/sparc/kernel/signal_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/signal_32.c
@@ -24,7 +24,6 @@
 #include <linux/uaccess.h>
 #include <asm/ptrace.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/cacheflush.h>	/* flush_sig_insns */
 #include <asm/switch_to.h>
 
--- a/arch/sparc/kernel/signal32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/signal32.c
@@ -24,7 +24,6 @@
 
 #include <linux/uaccess.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
 #include <asm/psrcompat.h>
 #include <asm/fpumacro.h>
 #include <asm/visasm.h>
--- a/arch/sparc/kernel/signal_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/signal_64.c
@@ -25,7 +25,6 @@
 
 #include <linux/uaccess.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
 #include <asm/fpumacro.h>
 #include <asm/uctx.h>
 #include <asm/siginfo.h>
--- a/arch/sparc/kernel/smp_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/smp_32.c
@@ -30,7 +30,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
--- a/arch/sparc/kernel/smp_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/smp_64.c
@@ -43,7 +43,6 @@
 #include <asm/irq.h>
 #include <asm/irq_regs.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/oplib.h>
 #include <linux/uaccess.h>
 #include <asm/starfire.h>
--- a/arch/sparc/kernel/traps_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/kernel/traps_64.c
@@ -30,7 +30,6 @@
 #include <asm/ptrace.h>
 #include <asm/oplib.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/unistd.h>
 #include <linux/uaccess.h>
 #include <asm/fpumacro.h>
--- a/arch/sparc/mm/fault_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/fault_32.c
@@ -25,7 +25,6 @@
 #include <linux/uaccess.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/setup.h>
--- a/arch/sparc/mm/fault_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/fault_64.c
@@ -27,7 +27,6 @@
 #include <linux/uaccess.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/asi.h>
--- a/arch/sparc/mm/hugetlbpage.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/hugetlbpage.c
@@ -14,7 +14,6 @@
 
 #include <asm/mman.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
--- a/arch/sparc/mm/init_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/init_32.c
@@ -29,7 +29,6 @@
 
 #include <asm/sections.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/vaddrs.h>
 #include <asm/setup.h>
 #include <asm/tlb.h>
--- a/arch/sparc/mm/init_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/init_64.c
@@ -31,7 +31,6 @@
 #include <asm/head.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/iommu.h>
 #include <asm/io.h>
--- a/arch/sparc/mm/iommu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/iommu.c
@@ -17,7 +17,6 @@
 #include <linux/of_device.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/mxcc.h>
 #include <asm/mbus.h>
--- a/arch/sparc/mm/io-unit.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/io-unit.c
@@ -16,7 +16,6 @@
 #include <linux/of_device.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/io-unit.h>
 #include <asm/mxcc.h>
--- a/arch/sparc/mm/tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/sparc/mm/tlb.c
@@ -10,7 +10,6 @@
 #include <linux/swap.h>
 #include <linux/preempt.h>
 
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
--- a/arch/um/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/um/kernel/process.c
@@ -25,7 +25,6 @@
 #include <linux/threads.h>
 #include <linux/tracehook.h>
 #include <asm/current.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <linux/uaccess.h>
 #include <as-layout.h>
--- a/arch/um/kernel/skas/mmu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/um/kernel/skas/mmu.c
@@ -9,7 +9,6 @@
 #include <linux/slab.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <as-layout.h>
 #include <os.h>
--- a/arch/um/kernel/skas/uaccess.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/um/kernel/skas/uaccess.c
@@ -10,7 +10,6 @@
 #include <linux/sched.h>
 #include <asm/current.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <kern_util.h>
 #include <os.h>
 
--- a/arch/um/kernel/tlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/um/kernel/tlb.c
@@ -7,7 +7,6 @@
 #include <linux/module.h>
 #include <linux/sched/signal.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <as-layout.h>
 #include <mem_user.h>
--- a/arch/um/kernel/trap.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/um/kernel/trap.c
@@ -10,7 +10,6 @@
 #include <linux/uaccess.h>
 #include <linux/sched/debug.h>
 #include <asm/current.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <arch.h>
 #include <as-layout.h>
--- a/arch/um/kernel/um_arch.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/um/kernel/um_arch.c
@@ -14,7 +14,6 @@
 #include <linux/sched/task.h>
 #include <linux/kmsg_dump.h>
 
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
--- a/arch/unicore32/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/unicore32/kernel/module.c
@@ -16,7 +16,6 @@
 #include <linux/string.h>
 #include <linux/gfp.h>
 
-#include <asm/pgtable.h>
 #include <asm/sections.h>
 
 void *module_alloc(unsigned long size)
--- a/arch/unicore32/mm/fault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/unicore32/mm/fault.c
@@ -17,7 +17,6 @@
 #include <linux/sched/signal.h>
 #include <linux/io.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 /*
--- a/arch/x86/include/asm/iomap.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/include/asm/iomap.h
@@ -10,7 +10,6 @@
 #include <linux/mm.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 void __iomem *
--- a/arch/x86/include/asm/xen/page.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/include/asm/xen/page.h
@@ -11,7 +11,6 @@
 
 #include <asm/extable.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 
 #include <xen/interface/xen.h>
 #include <xen/interface/grant_table.h>
--- a/arch/x86/kernel/alternative.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/alternative.c
@@ -18,7 +18,6 @@
 #include <asm/text-patching.h>
 #include <asm/alternative.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
 #include <asm/mce.h>
 #include <asm/nmi.h>
 #include <asm/cacheflush.h>
--- a/arch/x86/kernel/amd_gart_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/amd_gart_64.c
@@ -33,7 +33,6 @@
 #include <linux/atomic.h>
 #include <linux/dma-direct.h>
 #include <asm/mtrr.h>
-#include <asm/pgtable.h>
 #include <asm/proto.h>
 #include <asm/iommu.h>
 #include <asm/gart.h>
--- a/arch/x86/kernel/doublefault_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/doublefault_32.c
@@ -6,7 +6,6 @@
 #include <linux/fs.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/desc.h>
 #include <asm/traps.h>
--- a/arch/x86/kernel/machine_kexec_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/machine_kexec_32.c
@@ -13,7 +13,6 @@
 #include <linux/gfp.h>
 #include <linux/io.h>
 
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
--- a/arch/x86/kernel/machine_kexec_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/machine_kexec_64.c
@@ -19,7 +19,6 @@
 #include <linux/efi.h>
 
 #include <asm/init.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
 #include <asm/io_apic.h>
--- a/arch/x86/kernel/module.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/module.c
@@ -22,7 +22,6 @@
 
 #include <asm/text-patching.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/setup.h>
 #include <asm/unwind.h>
 
--- a/arch/x86/kernel/process_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/process_32.c
@@ -39,7 +39,6 @@
 #include <linux/kdebug.h>
 #include <linux/syscalls.h>
 
-#include <asm/pgtable.h>
 #include <asm/ldt.h>
 #include <asm/processor.h>
 #include <asm/fpu/internal.h>
--- a/arch/x86/kernel/process_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/process_64.c
@@ -40,7 +40,6 @@
 #include <linux/ftrace.h>
 #include <linux/syscalls.h>
 
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/fpu/internal.h>
 #include <asm/mmu_context.h>
--- a/arch/x86/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/ptrace.c
@@ -28,7 +28,6 @@
 #include <linux/nospec.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/fpu/internal.h>
 #include <asm/fpu/signal.h>
--- a/arch/x86/kernel/tboot.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/kernel/tboot.c
@@ -23,7 +23,6 @@
 #include <asm/realmode.h>
 #include <asm/processor.h>
 #include <asm/bootparam.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/swiotlb.h>
 #include <asm/fixmap.h>
--- a/arch/x86/mm/dump_pagetables.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/dump_pagetables.c
@@ -19,7 +19,6 @@
 #include <linux/ptdump.h>
 
 #include <asm/e820/types.h>
-#include <asm/pgtable.h>
 
 /*
  * The dumper groups pagetable entries of the same type into one, and for
--- a/arch/x86/mm/init_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/init_32.c
@@ -35,7 +35,6 @@
 #include <asm/bios_ebda.h>
 #include <asm/processor.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/dma.h>
 #include <asm/fixmap.h>
 #include <asm/e820/api.h>
--- a/arch/x86/mm/init_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/init_64.c
@@ -37,7 +37,6 @@
 #include <asm/processor.h>
 #include <asm/bios_ebda.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/fixmap.h>
--- a/arch/x86/mm/kasan_init_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/kasan_init_64.c
@@ -17,7 +17,6 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
 #include <asm/cpu_entry_area.h>
 
 extern struct range pfn_mapped[E820_MAX_ENTRIES];
--- a/arch/x86/mm/pat/cpa-test.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/pat/cpa-test.c
@@ -14,7 +14,6 @@
 #include <linux/vmalloc.h>
 
 #include <asm/cacheflush.h>
-#include <asm/pgtable.h>
 #include <asm/kdebug.h>
 
 /*
--- a/arch/x86/mm/pat/memtype.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/pat/memtype.c
@@ -46,7 +46,6 @@
 #include <asm/processor.h>
 #include <asm/tlbflush.h>
 #include <asm/x86_init.h>
-#include <asm/pgtable.h>
 #include <asm/fcntl.h>
 #include <asm/e820/api.h>
 #include <asm/mtrr.h>
--- a/arch/x86/mm/pgtable_32.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/pgtable_32.c
@@ -11,7 +11,6 @@
 #include <linux/spinlock.h>
 
 #include <asm/cpu_entry_area.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/fixmap.h>
 #include <asm/e820/api.h>
--- a/arch/x86/mm/pgtable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/pgtable.c
@@ -3,7 +3,6 @@
 #include <linux/gfp.h>
 #include <linux/hugetlb.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 #include <asm/fixmap.h>
 #include <asm/mtrr.h>
--- a/arch/x86/mm/pti.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/mm/pti.c
@@ -34,7 +34,6 @@
 #include <asm/vsyscall.h>
 #include <asm/cmdline.h>
 #include <asm/pti.h>
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/desc.h>
--- a/arch/x86/platform/efi/efi_64.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/platform/efi/efi_64.c
@@ -39,7 +39,6 @@
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/e820/api.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/proto.h>
 #include <asm/efi.h>
--- a/arch/x86/xen/enlighten_pv.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/xen/enlighten_pv.c
@@ -63,7 +63,6 @@
 #include <asm/setup.h>
 #include <asm/desc.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/reboot.h>
 #include <asm/stackprotector.h>
--- a/arch/x86/xen/grant-table.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/x86/xen/grant-table.c
@@ -21,7 +21,6 @@
 #include <xen/grant_table.h>
 #include <xen/xen.h>
 
-#include <asm/pgtable.h>
 
 static struct gnttab_vm_area {
 	struct vm_struct *area;
--- a/arch/xtensa/kernel/process.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/xtensa/kernel/process.c
@@ -37,7 +37,6 @@
 #include <linux/slab.h>
 #include <linux/rcupdate.h>
 
-#include <asm/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/io.h>
 #include <asm/processor.h>
--- a/arch/xtensa/kernel/ptrace.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/xtensa/kernel/ptrace.c
@@ -33,7 +33,6 @@
 #include <asm/coprocessor.h>
 #include <asm/elf.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/ptrace.h>
 
 static int gpr_get(struct task_struct *target,
--- a/arch/xtensa/kernel/setup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/arch/xtensa/kernel/setup.c
@@ -37,7 +37,6 @@
 #include <asm/bootparam.h>
 #include <asm/kasan.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/timex.h>
 #include <asm/platform.h>
--- a/drivers/char/agp/frontend.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/char/agp/frontend.c
@@ -39,7 +39,6 @@
 #include <linux/fs.h>
 #include <linux/sched.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include "agp.h"
 
 struct agp_front_data agp_fe;
--- a/drivers/char/agp/generic.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/char/agp/generic.c
@@ -42,7 +42,6 @@
 #ifdef CONFIG_X86
 #include <asm/set_memory.h>
 #endif
-#include <asm/pgtable.h>
 #include "agp.h"
 
 __u32 *agp_gatt_table;
--- a/drivers/char/bsr.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/char/bsr.c
@@ -17,7 +17,6 @@
 #include <linux/list.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 
 /*
--- a/drivers/char/mspec.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/char/mspec.c
@@ -39,7 +39,6 @@
 #include <linux/numa.h>
 #include <linux/refcount.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <linux/atomic.h>
 #include <asm/tlbflush.h>
 #include <asm/uncached.h>
--- a/drivers/gpu/drm/i915/i915_mm.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/gpu/drm/i915/i915_mm.c
@@ -25,7 +25,6 @@
 #include <linux/mm.h>
 #include <linux/io-mapping.h>
 
-#include <asm/pgtable.h>
 
 #include "i915_drv.h"
 
--- a/drivers/infiniband/sw/rdmavt/mmap.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/infiniband/sw/rdmavt/mmap.c
@@ -48,7 +48,6 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
-#include <asm/pgtable.h>
 #include <rdma/uverbs_ioctl.h>
 #include "mmap.h"
 
--- a/drivers/infiniband/sw/rxe/rxe_mmap.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/infiniband/sw/rxe/rxe_mmap.c
@@ -35,7 +35,6 @@
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
-#include <asm/pgtable.h>
 #include <rdma/uverbs_ioctl.h>
 
 #include "rxe.h"
--- a/drivers/media/platform/davinci/vpbe_display.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/media/platform/davinci/vpbe_display.c
@@ -17,7 +17,6 @@
 #include <linux/videodev2.h>
 #include <linux/slab.h>
 
-#include <asm/pgtable.h>
 
 #include <media/v4l2-dev.h>
 #include <media/v4l2-common.h>
--- a/drivers/media/v4l2-core/v4l2-common.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/media/v4l2-core/v4l2-common.c
@@ -41,7 +41,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/div64.h>
 #include <media/v4l2-common.h>
--- a/drivers/misc/sgi-gru/grufault.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/misc/sgi-gru/grufault.c
@@ -21,7 +21,6 @@
 #include <linux/uaccess.h>
 #include <linux/security.h>
 #include <linux/prefetch.h>
-#include <asm/pgtable.h>
 #include "gru.h"
 #include "grutables.h"
 #include "grulib.h"
--- a/drivers/net/ethernet/sun/sunhme.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/net/ethernet/sun/sunhme.c
@@ -52,7 +52,6 @@
 #endif
 #include <linux/uaccess.h>
 
-#include <asm/pgtable.h>
 #include <asm/irq.h>
 
 #ifdef CONFIG_PCI
--- a/drivers/sbus/char/flash.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/sbus/char/flash.c
@@ -17,7 +17,6 @@
 #include <linux/of_device.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/upa.h>
 
--- a/drivers/sbus/char/uctrl.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/sbus/char/uctrl.c
@@ -21,7 +21,6 @@
 #include <asm/oplib.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
 
 #define DEBUG 1
 #ifdef DEBUG
--- a/drivers/scsi/a2091.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/scsi/a2091.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/amigaints.h>
 #include <asm/amigahw.h>
 
--- a/drivers/scsi/a3000.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/scsi/a3000.c
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/amigaints.h>
 #include <asm/amigahw.h>
 
--- a/drivers/scsi/gvp11.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/scsi/gvp11.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/amigaints.h>
 #include <asm/amigahw.h>
 
--- a/drivers/scsi/lasi700.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/scsi/lasi700.c
@@ -31,7 +31,6 @@
 #include <linux/slab.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/irq.h>
 #include <asm/hardware.h>
 #include <asm/parisc-device.h>
--- a/drivers/scsi/mvme147.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/scsi/mvme147.c
@@ -8,7 +8,6 @@
 #include <linux/module.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/mvme147hw.h>
 #include <asm/irq.h>
 
--- a/drivers/scsi/sni_53c710.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/scsi/sni_53c710.c
@@ -28,7 +28,6 @@
 #include <linux/platform_device.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/irq.h>
 #include <asm/delay.h>
 
--- a/drivers/video/console/newport_con.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/console/newport_con.c
@@ -24,7 +24,6 @@
 #include <asm/io.h>
 #include <linux/uaccess.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/gio_device.h>
 
 #include <video/newport.h>
--- a/drivers/video/fbdev/acornfb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/acornfb.c
@@ -30,7 +30,6 @@
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
-#include <asm/pgtable.h>
 
 #include "acornfb.h"
 
--- a/drivers/video/fbdev/atafb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/atafb.c
@@ -58,7 +58,6 @@
 
 #include <asm/setup.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 
--- a/drivers/video/fbdev/cirrusfb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/cirrusfb.c
@@ -42,7 +42,6 @@
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
-#include <asm/pgtable.h>
 
 #ifdef CONFIG_ZORRO
 #include <linux/zorro.h>
--- a/drivers/video/fbdev/cyber2000fb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/cyber2000fb.c
@@ -47,7 +47,6 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
-#include <asm/pgtable.h>
 
 #ifdef __arm__
 #include <asm/mach-types.h>
--- a/drivers/video/fbdev/fb-puv3.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/fb-puv3.c
@@ -18,7 +18,6 @@
 #include <linux/mm.h>
 
 #include <linux/sizes.h>
-#include <asm/pgtable.h>
 #include <mach/hardware.h>
 
 /* Platform_data reserved for unifb registers. */
--- a/drivers/video/fbdev/hitfb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/hitfb.c
@@ -23,7 +23,6 @@
 
 #include <asm/machvec.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/hd64461.h>
 #include <cpu/dac.h>
--- a/drivers/video/fbdev/neofb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/neofb.c
@@ -70,7 +70,6 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 #include <video/vga.h>
 #include <video/neomagic.h>
 
--- a/drivers/video/fbdev/q40fb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/q40fb.c
@@ -23,7 +23,6 @@
 #include <asm/q40_master.h>
 #include <linux/fb.h>
 #include <linux/module.h>
-#include <asm/pgtable.h>
 
 #define Q40_PHYS_SCREEN_ADDR 0xFE800000
 
--- a/drivers/video/fbdev/savage/savagefb_driver.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/video/fbdev/savage/savagefb_driver.c
@@ -55,7 +55,6 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pgtable.h>
 
 #include "savagefb.h"
 
--- a/drivers/xen/balloon.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/xen/balloon.c
@@ -59,7 +59,6 @@
 
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 
 #include <asm/xen/hypervisor.h>
--- a/drivers/xen/grant-table.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/xen/grant-table.c
@@ -64,7 +64,6 @@
 #include <asm/xen/hypercall.h>
 #include <asm/xen/interface.h>
 
-#include <asm/pgtable.h>
 #include <asm/sync_bitops.h>
 
 /* External tools reserve first few grant table entries. */
--- a/drivers/xen/privcmd.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/xen/privcmd.c
@@ -26,7 +26,6 @@
 #include <linux/moduleparam.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
 
--- a/drivers/xen/xenbus/xenbus_probe_backend.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -48,7 +48,6 @@
 #include <linux/semaphore.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/xen/hypervisor.h>
 #include <asm/hypervisor.h>
 #include <xen/xenbus.h>
--- a/drivers/xen/xenbus/xenbus_probe.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/xen/xenbus/xenbus_probe.c
@@ -51,7 +51,6 @@
 #include <linux/module.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/xen/hypervisor.h>
 
 #include <xen/xen.h>
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -19,7 +19,6 @@
 #include <linux/module.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/xen/hypervisor.h>
 #include <xen/xenbus.h>
 #include <xen/events.h>
--- a/fs/proc/array.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/fs/proc/array.c
@@ -92,7 +92,6 @@
 #include <linux/user_namespace.h>
 #include <linux/fs_struct.h>
 
-#include <asm/pgtable.h>
 #include <asm/processor.h>
 #include "internal.h"
 
--- a/fs/proc/meminfo.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/fs/proc/meminfo.c
@@ -17,7 +17,6 @@
 #include <linux/cma.h>
 #endif
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include "internal.h"
 
 void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
--- a/fs/proc/nommu.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/fs/proc/nommu.c
@@ -22,7 +22,6 @@
 #include <linux/hugetlb.h>
 #include <linux/vmalloc.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 #include <asm/div64.h>
 #include "internal.h"
--- a/fs/proc/vmcore.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/fs/proc/vmcore.c
@@ -27,7 +27,6 @@
 #include <linux/pagemap.h>
 #include <linux/uaccess.h>
 #include <linux/mem_encrypt.h>
-#include <asm/pgtable.h>
 #include <asm/io.h>
 #include "internal.h"
 
--- a/include/linux/dax.h~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/include/linux/dax.h
@@ -5,7 +5,6 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/radix-tree.h>
-#include <asm/pgtable.h>
 
 /* Flag for synchronous flush */
 #define DAXDEV_F_SYNC (1UL << 0)
--- a/init/init_task.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/init/init_task.c
@@ -13,7 +13,6 @@
 #include <linux/numa.h>
 #include <linux/scs.h>
 
-#include <asm/pgtable.h>
 #include <linux/uaccess.h>
 
 static struct signal_struct init_signals = {
--- a/kernel/exit.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/kernel/exit.c
@@ -66,7 +66,6 @@
 
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
-#include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 
 static void __unhash_process(struct task_struct *p, bool group_dead)
--- a/kernel/fork.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/kernel/fork.c
@@ -96,7 +96,6 @@
 #include <linux/kasan.h>
 #include <linux/scs.h>
 
-#include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <linux/uaccess.h>
 #include <asm/mmu_context.h>
--- a/kernel/power/snapshot.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/kernel/power/snapshot.c
@@ -34,7 +34,6 @@
 
 #include <linux/uaccess.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/io.h>
 
--- a/lib/ioremap.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/lib/ioremap.c
@@ -12,7 +12,6 @@
 #include <linux/io.h>
 #include <linux/export.h>
 #include <asm/cacheflush.h>
-#include <asm/pgtable.h>
 
 #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
 static int __read_mostly ioremap_p4d_capable;
--- a/mm/debug_vm_pgtable.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/debug_vm_pgtable.c
@@ -28,7 +28,6 @@
 #include <linux/start_kernel.h>
 #include <linux/sched/mm.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 
 #define VMFLAGS	(VM_READ|VM_WRITE|VM_EXEC)
 
--- a/mm/gup.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/gup.c
@@ -19,7 +19,6 @@
 #include <linux/sched/mm.h>
 
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
 #include "internal.h"
--- a/mm/hugetlb.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/hugetlb.c
@@ -31,7 +31,6 @@
 #include <linux/cma.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #include <asm/tlb.h>
 
 #include <linux/io.h>
--- a/mm/memory.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/memory.c
@@ -80,7 +80,6 @@
 #include <linux/uaccess.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
-#include <asm/pgtable.h>
 
 #include "internal.h"
 
--- a/mm/page_io.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/page_io.c
@@ -25,7 +25,6 @@
 #include <linux/psi.h>
 #include <linux/uio.h>
 #include <linux/sched/task.h>
-#include <asm/pgtable.h>
 
 static struct bio *get_swap_bio(gfp_t gfp_flags,
 				struct page *page, bio_end_io_t end_io)
--- a/mm/shmem.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/shmem.c
@@ -82,7 +82,6 @@ static struct vfsmount *shm_mnt;
 #include <linux/uuid.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 
 #include "internal.h"
 
--- a/mm/sparse.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/sparse.c
@@ -17,7 +17,6 @@
 #include "internal.h"
 #include <asm/dma.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 
 /*
  * Permanent SPARSEMEM data:
--- a/mm/sparse-vmemmap.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/sparse-vmemmap.c
@@ -29,7 +29,6 @@
 #include <linux/sched.h>
 #include <asm/dma.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
 
 /*
  * Allocate a block of memory to be used to back the virtual memory map
--- a/mm/swapfile.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/swapfile.c
@@ -40,7 +40,6 @@
 #include <linux/swap_slots.h>
 #include <linux/sort.h>
 
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <linux/swapops.h>
 #include <linux/swap_cgroup.h>
--- a/mm/swap_state.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/swap_state.c
@@ -22,7 +22,6 @@
 #include <linux/swap_slots.h>
 #include <linux/huge_mm.h>
 
-#include <asm/pgtable.h>
 
 /*
  * swapper_space is a fiction, retained to simplify the path through
--- a/mm/vmacache.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/mm/vmacache.c
@@ -6,7 +6,6 @@
 #include <linux/sched/task.h>
 #include <linux/mm.h>
 #include <linux/vmacache.h>
-#include <asm/pgtable.h>
 
 /*
  * Hash based on the pmd of addr if configured with MMU, which provides a good
--- a/sound/core/sgbuf.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/sound/core/sgbuf.c
@@ -9,7 +9,6 @@
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/export.h>
-#include <asm/pgtable.h>
 #include <sound/memalloc.h>
 
 
--- a/virt/kvm/kvm_main.c~mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included
+++ a/virt/kvm/kvm_main.c
@@ -55,7 +55,6 @@
 #include <asm/processor.h>
 #include <asm/ioctl.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
 
 #include "coalesced_mmio.h"
 #include "async_pf.h"
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 52/93] mm: introduce include/linux/pgtable.h
  2020-06-09  4:29 incoming Andrew Morton
                   ` (50 preceding siblings ...)
  2020-06-09  4:32 ` [patch 51/93] mm: don't include asm/pgtable.h if linux/mm.h is already included Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 53/93] mm: reorder includes after introduction of linux/pgtable.h Andrew Morton
                   ` (43 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: mm: introduce include/linux/pgtable.h

The include/linux/pgtable.h is going to be the home of generic page table
manipulation functions.

Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and
make the latter include asm/pgtable.h.

Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/include/asm/pgtable.h                      |    2 
 arch/alpha/kernel/proto.h                             |    2 
 arch/arc/include/asm/pgtable.h                        |    2 
 arch/arc/mm/highmem.c                                 |    2 
 arch/arc/mm/tlbex.S                                   |    2 
 arch/arm/include/asm/efi.h                            |    2 
 arch/arm/include/asm/fixmap.h                         |    2 
 arch/arm/include/asm/idmap.h                          |    2 
 arch/arm/include/asm/pgtable-nommu.h                  |    2 
 arch/arm/include/asm/pgtable.h                        |    2 
 arch/arm/kernel/head.S                                |    2 
 arch/arm/kernel/suspend.c                             |    2 
 arch/arm/kernel/vmlinux.lds.S                         |    2 
 arch/arm/mach-integrator/core.c                       |    2 
 arch/arm/mach-keystone/platsmp.c                      |    2 
 arch/arm/mach-sa1100/hackkit.c                        |    2 
 arch/arm/mach-tegra/iomap.h                           |    2 
 arch/arm/mach-zynq/common.c                           |    2 
 arch/arm/mm/idmap.c                                   |    2 
 arch/arm/mm/mm.h                                      |    2 
 arch/arm/mm/proc-arm1020.S                            |    2 
 arch/arm/mm/proc-arm1020e.S                           |    2 
 arch/arm/mm/proc-arm1022.S                            |    2 
 arch/arm/mm/proc-arm1026.S                            |    2 
 arch/arm/mm/proc-arm720.S                             |    2 
 arch/arm/mm/proc-arm740.S                             |    2 
 arch/arm/mm/proc-arm7tdmi.S                           |    2 
 arch/arm/mm/proc-arm920.S                             |    2 
 arch/arm/mm/proc-arm922.S                             |    2 
 arch/arm/mm/proc-arm925.S                             |    2 
 arch/arm/mm/proc-arm926.S                             |    2 
 arch/arm/mm/proc-arm940.S                             |    2 
 arch/arm/mm/proc-arm946.S                             |    2 
 arch/arm/mm/proc-arm9tdmi.S                           |    2 
 arch/arm/mm/proc-fa526.S                              |    2 
 arch/arm/mm/proc-feroceon.S                           |    2 
 arch/arm/mm/proc-mohawk.S                             |    2 
 arch/arm/mm/proc-sa110.S                              |    2 
 arch/arm/mm/proc-sa1100.S                             |    2 
 arch/arm/mm/proc-v6.S                                 |    2 
 arch/arm/mm/proc-v7.S                                 |    2 
 arch/arm/mm/proc-xsc3.S                               |    2 
 arch/arm/mm/proc-xscale.S                             |    2 
 arch/arm/mm/pv-fixup-asm.S                            |    2 
 arch/arm64/include/asm/io.h                           |    2 
 arch/arm64/include/asm/kernel-pgtable.h               |    2 
 arch/arm64/include/asm/kvm_mmu.h                      |    2 
 arch/arm64/include/asm/mmu_context.h                  |    2 
 arch/arm64/include/asm/pgtable.h                      |    4 
 arch/arm64/include/asm/stage2_pgtable.h               |    2 
 arch/arm64/include/asm/vmap_stack.h                   |    2 
 arch/arm64/kernel/acpi.c                              |    2 
 arch/arm64/kernel/head.S                              |    2 
 arch/arm64/kernel/kaslr.c                             |    2 
 arch/arm64/kernel/suspend.c                           |    2 
 arch/arm64/kernel/vmlinux.lds.S                       |    2 
 arch/arm64/mm/proc.S                                  |    2 
 arch/c6x/include/asm/pgtable.h                        |    2 
 arch/csky/include/asm/io.h                            |    2 
 arch/csky/include/asm/pgtable.h                       |    2 
 arch/h8300/include/asm/pgtable.h                      |    1 
 arch/hexagon/include/asm/pgtable.h                    |    3 
 arch/hexagon/mm/uaccess.c                             |    2 
 arch/ia64/include/asm/pgtable.h                       |    1 
 arch/ia64/include/asm/uaccess.h                       |    2 
 arch/ia64/kernel/entry.S                              |    2 
 arch/ia64/kernel/head.S                               |    2 
 arch/ia64/kernel/irq_ia64.c                           |    2 
 arch/ia64/kernel/ivt.S                                |    2 
 arch/ia64/kernel/kprobes.c                            |    2 
 arch/ia64/kernel/mca_asm.S                            |    2 
 arch/ia64/kernel/relocate_kernel.S                    |    2 
 arch/ia64/kernel/setup.c                              |    2 
 arch/ia64/kernel/uncached.c                           |    2 
 arch/ia64/kernel/vmlinux.lds.S                        |    2 
 arch/m68k/68000/m68EZ328.c                            |    2 
 arch/m68k/68000/m68VZ328.c                            |    2 
 arch/m68k/include/asm/pgtable_mm.h                    |    1 
 arch/m68k/include/asm/pgtable_no.h                    |    2 
 arch/m68k/include/asm/sun3xflop.h                     |    2 
 arch/m68k/kernel/head.S                               |    2 
 arch/microblaze/include/asm/pgalloc.h                 |    2 
 arch/microblaze/include/asm/pgtable.h                 |    2 
 arch/microblaze/include/asm/uaccess.h                 |    2 
 arch/microblaze/kernel/hw_exception_handler.S         |    2 
 arch/microblaze/kernel/module.c                       |    2 
 arch/microblaze/kernel/setup.c                        |    2 
 arch/microblaze/mm/pgtable.c                          |    2 
 arch/mips/include/asm/pgtable.h                       |    2 
 arch/mips/jazz/irq.c                                  |    2 
 arch/mips/jazz/setup.c                                |    2 
 arch/mips/kvm/mips.c                                  |    2 
 arch/mips/mm/tlbex.c                                  |    2 
 arch/nds32/include/asm/highmem.h                      |    2 
 arch/nds32/include/asm/pgtable.h                      |    2 
 arch/nds32/kernel/head.S                              |    2 
 arch/nds32/kernel/module.c                            |    2 
 arch/nios2/include/asm/pgtable.h                      |    2 
 arch/nios2/kernel/nios2_ksyms.c                       |    2 
 arch/openrisc/include/asm/io.h                        |    2 
 arch/openrisc/include/asm/pgtable.h                   |    2 
 arch/openrisc/kernel/entry.S                          |    2 
 arch/openrisc/kernel/head.S                           |    2 
 arch/openrisc/kernel/or32_ksyms.c                     |    2 
 arch/openrisc/mm/ioremap.c                            |    2 
 arch/parisc/include/asm/io.h                          |    2 
 arch/parisc/include/asm/pgtable.h                     |    1 
 arch/parisc/kernel/asm-offsets.c                      |    2 
 arch/parisc/kernel/entry.S                            |    2 
 arch/parisc/kernel/head.S                             |    2 
 arch/parisc/kernel/pacache.S                          |    2 
 arch/parisc/kernel/pdt.c                              |    2 
 arch/powerpc/include/asm/fixmap.h                     |    2 
 arch/powerpc/include/asm/kup.h                        |    2 
 arch/powerpc/include/asm/nohash/pgtable.h             |    2 
 arch/powerpc/include/asm/pgtable.h                    |    2 
 arch/powerpc/include/asm/tlb.h                        |    2 
 arch/powerpc/kernel/btext.c                           |    2 
 arch/powerpc/kernel/fpu.S                             |    2 
 arch/powerpc/kernel/head_32.S                         |    2 
 arch/powerpc/kernel/head_40x.S                        |    2 
 arch/powerpc/kernel/head_44x.S                        |    2 
 arch/powerpc/kernel/head_8xx.S                        |    2 
 arch/powerpc/kernel/head_fsl_booke.S                  |    2 
 arch/powerpc/kernel/io-workarounds.c                  |    2 
 arch/powerpc/kernel/irq.c                             |    2 
 arch/powerpc/kernel/mce_power.c                       |    2 
 arch/powerpc/kernel/paca.c                            |    2 
 arch/powerpc/kernel/prom.c                            |    2 
 arch/powerpc/kernel/prom_init.c                       |    2 
 arch/powerpc/kernel/rtas_pci.c                        |    2 
 arch/powerpc/kernel/setup-common.c                    |    2 
 arch/powerpc/kernel/setup_32.c                        |    2 
 arch/powerpc/kernel/setup_64.c                        |    2 
 arch/powerpc/kernel/smp.c                             |    2 
 arch/powerpc/kvm/book3s_64_mmu_radix.c                |    2 
 arch/powerpc/kvm/book3s_hv_nested.c                   |    2 
 arch/powerpc/kvm/book3s_hv_rm_xics.c                  |    2 
 arch/powerpc/kvm/book3s_hv_rm_xive.c                  |    2 
 arch/powerpc/kvm/fpu.S                                |    2 
 arch/powerpc/mm/book3s32/hash_low.S                   |    2 
 arch/powerpc/mm/book3s64/hash_native.c                |    2 
 arch/powerpc/mm/book3s64/hash_utils.c                 |    2 
 arch/powerpc/mm/book3s64/slb.c                        |    2 
 arch/powerpc/mm/book3s64/subpage_prot.c               |    2 
 arch/powerpc/mm/init-common.c                         |    2 
 arch/powerpc/mm/nohash/tlb_low_64e.S                  |    2 
 arch/powerpc/mm/ptdump/8xx.c                          |    2 
 arch/powerpc/mm/ptdump/bats.c                         |    2 
 arch/powerpc/mm/ptdump/book3s64.c                     |    2 
 arch/powerpc/mm/ptdump/shared.c                       |    2 
 arch/powerpc/platforms/85xx/corenet_generic.c         |    2 
 arch/powerpc/platforms/85xx/mpc85xx_cds.c             |    2 
 arch/powerpc/platforms/85xx/qemu_e500.c               |    2 
 arch/powerpc/platforms/85xx/sbc8548.c                 |    2 
 arch/powerpc/platforms/85xx/smp.c                     |    2 
 arch/powerpc/platforms/86xx/mpc86xx_smp.c             |    2 
 arch/powerpc/platforms/cell/cbe_regs.c                |    2 
 arch/powerpc/platforms/cell/interrupt.c               |    2 
 arch/powerpc/platforms/cell/pervasive.c               |    2 
 arch/powerpc/platforms/cell/smp.c                     |    2 
 arch/powerpc/platforms/cell/spider-pic.c              |    2 
 arch/powerpc/platforms/chrp/pci.c                     |    2 
 arch/powerpc/platforms/chrp/smp.c                     |    2 
 arch/powerpc/platforms/powermac/smp.c                 |    2 
 arch/powerpc/platforms/pseries/lpar.c                 |    2 
 arch/powerpc/platforms/pseries/smp.c                  |    2 
 arch/powerpc/sysdev/fsl_85xx_cache_sram.c             |    2 
 arch/powerpc/sysdev/mpic.c                            |    2 
 arch/riscv/include/asm/fixmap.h                       |    2 
 arch/riscv/include/asm/io.h                           |    2 
 arch/riscv/include/asm/kasan.h                        |    2 
 arch/riscv/include/asm/pgtable.h                      |    2 
 arch/riscv/kernel/module.c                            |    2 
 arch/riscv/kernel/soc.c                               |    2 
 arch/riscv/mm/cacheflush.c                            |    2 
 arch/riscv/mm/kasan_init.c                            |    2 
 arch/riscv/mm/pageattr.c                              |    2 
 arch/riscv/mm/ptdump.c                                |    2 
 arch/s390/boot/ipl_parm.c                             |    2 
 arch/s390/boot/kaslr.c                                |    2 
 arch/s390/include/asm/hugetlb.h                       |    2 
 arch/s390/include/asm/kasan.h                         |    2 
 arch/s390/include/asm/pgtable.h                       |    2 
 arch/s390/kernel/asm-offsets.c                        |    2 
 arch/s390/kvm/gaccess.c                               |    2 
 arch/s390/kvm/kvm-s390.c                              |    2 
 arch/s390/kvm/priv.c                                  |    2 
 arch/s390/mm/extmem.c                                 |    2 
 arch/s390/mm/gmap.c                                   |    2 
 arch/s390/mm/kasan_init.c                             |    2 
 arch/sh/include/asm/io.h                              |    2 
 arch/sh/include/asm/pgtable.h                         |    2 
 arch/sh/mm/pmb.c                                      |    2 
 arch/sparc/include/asm/floppy_32.h                    |    2 
 arch/sparc/include/asm/highmem.h                      |    2 
 arch/sparc/include/asm/ide.h                          |    2 
 arch/sparc/include/asm/io-unit.h                      |    2 
 arch/sparc/include/asm/pgalloc_32.h                   |    2 
 arch/sparc/include/asm/pgtable_32.h                   |    2 
 arch/sparc/include/asm/pgtable_64.h                   |    1 
 arch/sparc/kernel/cpu.c                               |    2 
 arch/sparc/kernel/entry.S                             |    2 
 arch/sparc/kernel/head_64.S                           |    2 
 arch/sparc/kernel/ktlb.S                              |    2 
 arch/sparc/kernel/pci.c                               |    2 
 arch/sparc/kernel/sun4m_irq.c                         |    2 
 arch/sparc/kernel/trampoline_64.S                     |    2 
 arch/sparc/kernel/traps_32.c                          |    2 
 arch/sparc/lib/clear_page.S                           |    2 
 arch/sparc/lib/copy_page.S                            |    2 
 arch/sparc/mm/tsb.c                                   |    2 
 arch/sparc/mm/ultra.S                                 |    2 
 arch/um/include/asm/pgtable.h                         |    2 
 arch/unicore32/include/asm/pgtable.h                  |    2 
 arch/unicore32/kernel/hibernate.c                     |    2 
 arch/unicore32/kernel/hibernate_asm.S                 |    2 
 arch/unicore32/mm/alignment.c                         |    2 
 arch/unicore32/mm/proc-ucv2.S                         |    2 
 arch/x86/boot/compressed/kaslr_64.c                   |    2 
 arch/x86/include/asm/agp.h                            |    2 
 arch/x86/include/asm/asm-prototypes.h                 |    2 
 arch/x86/include/asm/efi.h                            |    2 
 arch/x86/include/asm/pgtable.h                        |    3 
 arch/x86/include/asm/xen/hypercall.h                  |    2 
 arch/x86/kernel/acpi/boot.c                           |    2 
 arch/x86/kernel/acpi/sleep.c                          |    2 
 arch/x86/kernel/apic/apic_numachip.c                  |    2 
 arch/x86/kernel/cpu/bugs.c                            |    2 
 arch/x86/kernel/cpu/common.c                          |    2 
 arch/x86/kernel/cpu/intel.c                           |    2 
 arch/x86/kernel/crash_core_32.c                       |    2 
 arch/x86/kernel/crash_core_64.c                       |    2 
 arch/x86/kernel/early_printk.c                        |    2 
 arch/x86/kernel/espfix_64.c                           |    2 
 arch/x86/kernel/head64.c                              |    2 
 arch/x86/kernel/head_64.S                             |    2 
 arch/x86/kernel/i8259.c                               |    2 
 arch/x86/kernel/irqinit.c                             |    2 
 arch/x86/kernel/kprobes/core.c                        |    2 
 arch/x86/kernel/kprobes/opt.c                         |    2 
 arch/x86/kernel/paravirt.c                            |    2 
 arch/x86/kernel/reboot.c                              |    2 
 arch/x86/kernel/smpboot.c                             |    2 
 arch/x86/mm/cpu_entry_area.c                          |    2 
 arch/x86/mm/debug_pagetables.c                        |    2 
 arch/x86/mm/ioremap.c                                 |    2 
 arch/x86/mm/kaslr.c                                   |    2 
 arch/x86/mm/mem_encrypt_boot.S                        |    2 
 arch/x86/mm/mmio-mod.c                                |    2 
 arch/x86/mm/pat/memtype_interval.c                    |    2 
 arch/x86/mm/setup_nx.c                                |    2 
 arch/x86/platform/efi/efi_32.c                        |    2 
 arch/x86/platform/olpc/olpc_ofw.c                     |    2 
 arch/x86/power/cpu.c                                  |    2 
 arch/x86/power/hibernate.c                            |    2 
 arch/x86/power/hibernate_32.c                         |    2 
 arch/x86/power/hibernate_64.c                         |    2 
 arch/x86/realmode/init.c                              |    2 
 arch/x86/xen/mmu_pv.c                                 |    2 
 arch/x86/xen/smp_pv.c                                 |    1 
 arch/xtensa/include/asm/fixmap.h                      |    2 
 arch/xtensa/include/asm/highmem.h                     |    2 
 arch/xtensa/include/asm/initialize_mmu.h              |    2 
 arch/xtensa/include/asm/mmu_context.h                 |    2 
 arch/xtensa/include/asm/pgtable.h                     |    2 
 arch/xtensa/kernel/entry.S                            |    2 
 arch/xtensa/kernel/traps.c                            |    2 
 arch/xtensa/kernel/vectors.S                          |    2 
 arch/xtensa/mm/cache.c                                |    2 
 arch/xtensa/mm/ioremap.c                              |    2 
 arch/xtensa/mm/misc.S                                 |    2 
 drivers/acpi/scan.c                                   |    2 
 drivers/atm/fore200e.c                                |    2 
 drivers/block/z2ram.c                                 |    2 
 drivers/firmware/efi/arm-runtime.c                    |    2 
 drivers/gpu/drm/drm_vm.c                              |    2 
 drivers/infiniband/hw/qib/qib_file_ops.c              |    2 
 drivers/macintosh/macio-adb.c                         |    2 
 drivers/macintosh/mediabay.c                          |    2 
 drivers/macintosh/via-pmu.c                           |    2 
 drivers/media/pci/bt8xx/bt878.c                       |    2 
 drivers/media/pci/bt8xx/btcx-risc.c                   |    2 
 drivers/media/pci/bt8xx/bttv-risc.c                   |    2 
 drivers/media/v4l2-core/videobuf-dma-sg.c             |    2 
 drivers/media/v4l2-core/videobuf-vmalloc.c            |    2 
 drivers/misc/genwqe/card_utils.c                      |    2 
 drivers/mtd/ubi/ubi.h                                 |    2 
 drivers/net/ethernet/amd/7990.c                       |    2 
 drivers/net/ethernet/amd/hplance.c                    |    2 
 drivers/net/ethernet/amd/mvme147.c                    |    2 
 drivers/net/ethernet/amd/sun3lance.c                  |    2 
 drivers/net/ethernet/amd/sunlance.c                   |    2 
 drivers/net/ethernet/apple/bmac.c                     |    2 
 drivers/net/ethernet/apple/mace.c                     |    2 
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |    2 
 drivers/net/ethernet/freescale/fs_enet/mac-fcc.c      |    2 
 drivers/net/ethernet/freescale/fs_enet/mii-fec.c      |    2 
 drivers/net/ethernet/i825xx/82596.c                   |    2 
 drivers/net/ethernet/korina.c                         |    2 
 drivers/net/ethernet/marvell/pxa168_eth.c             |    2 
 drivers/net/ethernet/natsemi/jazzsonic.c              |    2 
 drivers/net/ethernet/natsemi/macsonic.c               |    2 
 drivers/net/ethernet/natsemi/xtsonic.c                |    2 
 drivers/net/ethernet/sun/sunbmac.c                    |    2 
 drivers/net/ethernet/sun/sunqe.c                      |    2 
 drivers/scsi/53c700.c                                 |    2 
 drivers/scsi/arm/cumana_2.c                           |    2 
 drivers/scsi/arm/eesox.c                              |    2 
 drivers/scsi/arm/powertec.c                           |    2 
 drivers/scsi/dpt_i2o.c                                |    2 
 drivers/scsi/mac53c94.c                               |    2 
 drivers/scsi/mesh.c                                   |    2 
 drivers/scsi/qlogicpti.c                              |    2 
 drivers/scsi/zorro_esp.c                              |    2 
 include/asm-generic/io.h                              |    2 
 include/asm-generic/pgtable.h                         | 1322 ---------
 include/linux/crash_dump.h                            |    2 
 include/linux/dma-noncoherent.h                       |    2 
 include/linux/hmm.h                                   |    2 
 include/linux/hugetlb.h                               |    2 
 include/linux/io-mapping.h                            |    2 
 include/linux/kasan.h                                 |    2 
 include/linux/mm.h                                    |    2 
 include/linux/pgtable.h                               | 1323 ++++++++++
 include/xen/arm/page.h                                |    2 
 kernel/bpf/syscall.c                                  |    2 
 mm/init-mm.c                                          |    2 
 mm/mincore.c                                          |    2 
 mm/mprotect.c                                         |    2 
 mm/page_reporting.h                                   |    2 
 mm/pgtable-generic.c                                  |    6 
 mm/zsmalloc.c                                         |    2 
 sound/pci/hda/hda_intel.c                             |    2 
 sound/soc/intel/common/sst-firmware.c                 |    2 
 sound/soc/intel/haswell/sst-haswell-pcm.c             |    2 
 336 files changed, 1632 insertions(+), 1683 deletions(-)

--- a/arch/alpha/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/alpha/include/asm/pgtable.h
@@ -355,8 +355,6 @@ extern inline pte_t mk_swap_pte(unsigned
 
 extern void paging_init(void);
 
-#include <asm-generic/pgtable.h>
-
 /* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT.  */
 #define HAVE_ARCH_UNMAPPED_AREA
 
--- a/arch/alpha/kernel/proto.h~mm-introduce-include-linux-pgtableh
+++ a/arch/alpha/kernel/proto.h
@@ -2,7 +2,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* Prototypes of functions used across modules here in this directory.  */
 
--- a/arch/arc/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arc/include/asm/pgtable.h
@@ -390,8 +390,6 @@ void update_mmu_cache(struct vm_area_str
 #include <asm/hugepage.h>
 #endif
 
-#include <asm-generic/pgtable.h>
-
 /* to cope with aliasing VIPT cache */
 #define HAVE_ARCH_UNMAPPED_AREA
 
--- a/arch/arc/mm/highmem.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arc/mm/highmem.c
@@ -7,7 +7,7 @@
 #include <linux/export.h>
 #include <linux/highmem.h>
 #include <asm/processor.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
--- a/arch/arc/mm/tlbex.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arc/mm/tlbex.S
@@ -35,7 +35,7 @@
 #include <linux/linkage.h>
 #include <asm/entry.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/arcregs.h>
 #include <asm/cache.h>
 #include <asm/processor.h>
--- a/arch/arm64/include/asm/io.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/io.h
@@ -13,7 +13,7 @@
 #include <asm/byteorder.h>
 #include <asm/barrier.h>
 #include <asm/memory.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/early_ioremap.h>
 #include <asm/alternative.h>
 #include <asm/cpufeature.h>
--- a/arch/arm64/include/asm/kernel-pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/kernel-pgtable.h
@@ -8,7 +8,7 @@
 #ifndef __ASM_KERNEL_PGTABLE_H
 #define __ASM_KERNEL_PGTABLE_H
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sparsemem.h>
 
 /*
--- a/arch/arm64/include/asm/kvm_mmu.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/kvm_mmu.h
@@ -87,7 +87,7 @@ alternative_cb_end
 #include <asm/cache.h>
 #include <asm/cacheflush.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 void kvm_update_va_mask(struct alt_instr *alt,
 			__le32 *origptr, __le32 *updptr, int nr_inst);
--- a/arch/arm64/include/asm/mmu_context.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/mmu_context.h
@@ -20,7 +20,7 @@
 #include <asm/proc-fns.h>
 #include <asm-generic/mm_hooks.h>
 #include <asm/cputype.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sysreg.h>
 #include <asm/tlbflush.h>
 
--- a/arch/arm64/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/pgtable.h
@@ -340,7 +340,7 @@ static inline pgprot_t mk_pmd_sect_prot(
 
 #ifdef CONFIG_NUMA_BALANCING
 /*
- * See the comment in include/asm-generic/pgtable.h
+ * See the comment in include/linux/pgtable.h
  */
 static inline int pte_protnone(pte_t pte)
 {
@@ -853,8 +853,6 @@ static inline pmd_t pmdp_establish(struc
 
 extern int kern_addr_valid(unsigned long addr);
 
-#include <asm-generic/pgtable.h>
-
 /*
  * On AArch64, the cache coherency is handled via the set_pte_at() function.
  */
--- a/arch/arm64/include/asm/stage2_pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/stage2_pgtable.h
@@ -9,7 +9,7 @@
 #define __ARM64_S2_PGTABLE_H_
 
 #include <linux/hugetlb.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /*
  * PGDIR_SHIFT determines the size a top-level page table entry can map
--- a/arch/arm64/include/asm/vmap_stack.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/include/asm/vmap_stack.h
@@ -8,7 +8,7 @@
 #include <linux/kconfig.h>
 #include <linux/vmalloc.h>
 #include <asm/memory.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/thread_info.h>
 
 /*
--- a/arch/arm64/kernel/acpi.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/kernel/acpi.c
@@ -29,7 +29,7 @@
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
 #include <asm/daifflags.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/smp_plat.h>
 
 int acpi_noirq = 1;		/* skip ACPI IRQ initialization */
--- a/arch/arm64/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/kernel/head.S
@@ -26,7 +26,7 @@
 #include <asm/kvm_arm.h>
 #include <asm/memory.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/scs.h>
 #include <asm/smp.h>
--- a/arch/arm64/kernel/kaslr.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/kernel/kaslr.c
@@ -17,7 +17,7 @@
 #include <asm/kernel-pgtable.h>
 #include <asm/memory.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 
 enum kaslr_status {
--- a/arch/arm64/kernel/suspend.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/kernel/suspend.c
@@ -9,7 +9,7 @@
 #include <asm/daifflags.h>
 #include <asm/debug-monitors.h>
 #include <asm/exec.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/memory.h>
 #include <asm/mmu_context.h>
 #include <asm/smp_plat.h>
--- a/arch/arm64/kernel/vmlinux.lds.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/kernel/vmlinux.lds.S
@@ -13,7 +13,7 @@
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "image.h"
 
--- a/arch/arm64/mm/proc.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm64/mm/proc.S
@@ -13,7 +13,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/asm_pointer_auth.h>
 #include <asm/hwcap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/cpufeature.h>
 #include <asm/alternative.h>
--- a/arch/arm/include/asm/efi.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/include/asm/efi.h
@@ -13,7 +13,7 @@
 #include <asm/highmem.h>
 #include <asm/mach/map.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #ifdef CONFIG_EFI
--- a/arch/arm/include/asm/fixmap.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/include/asm/fixmap.h
@@ -7,7 +7,7 @@
 #define FIXADDR_TOP		(FIXADDR_END - PAGE_SIZE)
 
 #include <asm/kmap_types.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 enum fixed_addresses {
 	FIX_EARLYCON_MEM_BASE,
--- a/arch/arm/include/asm/idmap.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/include/asm/idmap.h
@@ -3,7 +3,7 @@
 #define __ASM_IDMAP_H
 
 #include <linux/compiler.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* Tag a function as requiring to be executed via an identity mapping. */
 #define __idmap __section(.idmap.text) noinline notrace
--- a/arch/arm/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/include/asm/pgtable.h
@@ -339,8 +339,6 @@ static inline pte_t pte_modify(pte_t pte
 /* FIXME: this is not correct */
 #define kern_addr_valid(addr)	(1)
 
-#include <asm-generic/pgtable.h>
-
 /*
  * We provide our own arch_get_unmapped_area to cope with VIPT caches.
  */
--- a/arch/arm/include/asm/pgtable-nommu.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/include/asm/pgtable-nommu.h
@@ -73,8 +73,6 @@ extern unsigned int kobjsize(const void
 
 #define FIRST_USER_ADDRESS      0UL
 
-#include <asm-generic/pgtable.h>
-
 #else 
 
 /*
--- a/arch/arm/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/kernel/head.S
@@ -18,7 +18,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/memory.h>
 #include <asm/thread_info.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
 #include CONFIG_DEBUG_LL_INCLUDE
--- a/arch/arm/kernel/suspend.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/kernel/suspend.c
@@ -7,7 +7,7 @@
 #include <asm/cacheflush.h>
 #include <asm/idmap.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/memory.h>
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
--- a/arch/arm/kernel/vmlinux.lds.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/kernel/vmlinux.lds.S
@@ -14,7 +14,7 @@
 #include <asm/memory.h>
 #include <asm/mpu.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "vmlinux.lds.h"
 
--- a/arch/arm/mach-integrator/core.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mach-integrator/core.c
@@ -24,7 +24,7 @@
 
 #include <asm/mach-types.h>
 #include <asm/mach/time.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "hardware.h"
 #include "cm.h"
--- a/arch/arm/mach-keystone/platsmp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mach-keystone/platsmp.c
@@ -16,7 +16,7 @@
 #include <asm/smp_plat.h>
 #include <asm/prom.h>
 #include <asm/tlbflush.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "keystone.h"
 
--- a/arch/arm/mach-sa1100/hackkit.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mach-sa1100/hackkit.c
@@ -26,7 +26,7 @@
 #include <asm/mach-types.h>
 #include <asm/setup.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
--- a/arch/arm/mach-tegra/iomap.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mach-tegra/iomap.h
@@ -10,7 +10,7 @@
 #ifndef __MACH_TEGRA_IOMAP_H
 #define __MACH_TEGRA_IOMAP_H
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/sizes.h>
 
 #define TEGRA_IRAM_BASE			0x40000000
--- a/arch/arm/mach-zynq/common.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mach-zynq/common.c
@@ -30,7 +30,7 @@
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/smp_scu.h>
 #include <asm/system_info.h>
 #include <asm/hardware/cache-l2x0.h>
--- a/arch/arm/mm/idmap.c~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/idmap.c
@@ -8,7 +8,7 @@
 #include <asm/idmap.h>
 #include <asm/hwcap.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/system_info.h>
 
--- a/arch/arm/mm/mm.h~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/mm.h
@@ -3,7 +3,7 @@
 #include <linux/list.h>
 #include <linux/vmalloc.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* the upper-most page table pointer */
 extern pmd_t *top_pmd;
--- a/arch/arm/mm/proc-arm1020e.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1020e.S
@@ -15,7 +15,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm1020.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1020.S
@@ -15,7 +15,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm1022.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1022.S
@@ -15,7 +15,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm1026.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1026.S
@@ -15,7 +15,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm720.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm720.S
@@ -24,7 +24,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm740.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm740.S
@@ -10,7 +10,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm7tdmi.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm7tdmi.S
@@ -10,7 +10,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm920.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm920.S
@@ -16,7 +16,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm922.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm922.S
@@ -17,7 +17,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm925.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm925.S
@@ -40,7 +40,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm926.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm926.S
@@ -16,7 +16,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm940.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm940.S
@@ -9,7 +9,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-arm946.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm946.S
@@ -11,7 +11,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-arm9tdmi.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-arm9tdmi.S
@@ -10,7 +10,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-fa526.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-fa526.S
@@ -14,7 +14,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 
--- a/arch/arm/mm/proc-feroceon.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-feroceon.S
@@ -11,7 +11,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-mohawk.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-mohawk.S
@@ -12,7 +12,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-sa1100.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-sa1100.S
@@ -22,7 +22,7 @@
 #include <asm/hwcap.h>
 #include <mach/hardware.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-sa110.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-sa110.S
@@ -17,7 +17,7 @@
 #include <asm/hwcap.h>
 #include <mach/hardware.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-v6.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-v6.S
@@ -13,7 +13,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-v7.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-v7.S
@@ -13,7 +13,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/memory.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-xsc3.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-xsc3.S
@@ -25,7 +25,7 @@
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
--- a/arch/arm/mm/proc-xscale.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/proc-xscale.S
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
--- a/arch/arm/mm/pv-fixup-asm.S~mm-introduce-include-linux-pgtableh
+++ a/arch/arm/mm/pv-fixup-asm.S
@@ -9,7 +9,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/cp15.h>
 #include <asm/memory.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 	.section ".idmap.text", "ax"
 
--- a/arch/c6x/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/c6x/include/asm/pgtable.h
@@ -64,6 +64,4 @@ extern unsigned long empty_zero_page;
  */
 #define pgprot_writecombine pgprot_noncached
 
-#include <asm-generic/pgtable.h>
-
 #endif /* _ASM_C6X_PGTABLE_H */
--- a/arch/csky/include/asm/io.h~mm-introduce-include-linux-pgtableh
+++ a/arch/csky/include/asm/io.h
@@ -4,7 +4,7 @@
 #ifndef __ASM_CSKY_IO_H
 #define __ASM_CSKY_IO_H
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/types.h>
 #include <linux/version.h>
 
--- a/arch/csky/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/csky/include/asm/pgtable.h
@@ -306,6 +306,4 @@ void update_mmu_cache(struct vm_area_str
 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
 	remap_pfn_range(vma, vaddr, pfn, size, prot)
 
-#include <asm-generic/pgtable.h>
-
 #endif /* __ASM_CSKY_PGTABLE_H */
--- a/arch/h8300/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/h8300/include/asm/pgtable.h
@@ -2,7 +2,6 @@
 #ifndef _H8300_PGTABLE_H
 #define _H8300_PGTABLE_H
 #include <asm-generic/pgtable-nopud.h>
-#include <asm-generic/pgtable.h>
 extern void paging_init(void);
 #define PAGE_NONE		__pgprot(0)    /* these mean nothing to NO_MM */
 #define PAGE_SHARED		__pgprot(0)    /* these mean nothing to NO_MM */
--- a/arch/hexagon/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/hexagon/include/asm/pgtable.h
@@ -460,7 +460,4 @@ static inline int pte_exec(pte_t pte)
 		((type << 1) | \
 		 ((offset & 0x7ffff0) << 9) | ((offset & 0xf) << 6)) })
 
-/*  Oh boy.  There are a lot of possible arch overrides found in this file.  */
-#include <asm-generic/pgtable.h>
-
 #endif
--- a/arch/hexagon/mm/uaccess.c~mm-introduce-include-linux-pgtableh
+++ a/arch/hexagon/mm/uaccess.c
@@ -11,7 +11,7 @@
  */
 #include <linux/types.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /*
  * For clear_user(), exploit previously defined copy_to_user function
--- a/arch/ia64/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/include/asm/pgtable.h
@@ -583,6 +583,5 @@ extern struct page *zero_page_memmap_ptr
 #include <asm-generic/pgtable-nopud.h>
 #endif
 #include <asm-generic/pgtable-nop4d.h>
-#include <asm-generic/pgtable.h>
 
 #endif /* _ASM_IA64_PGTABLE_H */
--- a/arch/ia64/include/asm/uaccess.h~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/include/asm/uaccess.h
@@ -37,7 +37,7 @@
 #include <linux/page-flags.h>
 
 #include <asm/intrinsics.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/extable.h>
 
--- a/arch/ia64/kernel/entry.S~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/entry.S
@@ -43,7 +43,7 @@
 #include <asm/errno.h>
 #include <asm/kregs.h>
 #include <asm/asm-offsets.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/percpu.h>
 #include <asm/processor.h>
 #include <asm/thread_info.h>
--- a/arch/ia64/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/head.S
@@ -27,7 +27,7 @@
 #include <asm/mmu_context.h>
 #include <asm/asm-offsets.h>
 #include <asm/pal.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/mca_asm.h>
--- a/arch/ia64/kernel/irq_ia64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/irq_ia64.c
@@ -37,7 +37,7 @@
 #include <asm/intrinsics.h>
 #include <asm/io.h>
 #include <asm/hw_irq.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 
 #ifdef CONFIG_PERFMON
--- a/arch/ia64/kernel/ivt.S~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/ivt.S
@@ -52,7 +52,7 @@
 #include <asm/break.h>
 #include <asm/kregs.h>
 #include <asm/asm-offsets.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
--- a/arch/ia64/kernel/kprobes.c~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/kprobes.c
@@ -18,7 +18,7 @@
 #include <linux/extable.h>
 #include <linux/kdebug.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/exception.h>
 
--- a/arch/ia64/kernel/mca_asm.S~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/mca_asm.S
@@ -27,7 +27,7 @@
 #include <linux/threads.h>
 
 #include <asm/asmmacro.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mca_asm.h>
 #include <asm/mca.h>
--- a/arch/ia64/kernel/relocate_kernel.S~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/relocate_kernel.S
@@ -11,7 +11,7 @@
 #include <asm/asmmacro.h>
 #include <asm/kregs.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mca_asm.h>
 
        /* Must be relocatable PIC code callable as a C function
--- a/arch/ia64/kernel/setup.c~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/setup.c
@@ -56,7 +56,7 @@
 #include <asm/meminit.h>
 #include <asm/page.h>
 #include <asm/patch.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/sal.h>
 #include <asm/sections.h>
--- a/arch/ia64/kernel/uncached.c~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/uncached.c
@@ -21,7 +21,7 @@
 #include <linux/gfp.h>
 #include <asm/page.h>
 #include <asm/pal.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/atomic.h>
 #include <asm/tlbflush.h>
 
--- a/arch/ia64/kernel/vmlinux.lds.S~mm-introduce-include-linux-pgtableh
+++ a/arch/ia64/kernel/vmlinux.lds.S
@@ -2,7 +2,7 @@
 
 #include <asm/cache.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/thread_info.h>
 
 #define EMITS_PT_NOTE
--- a/arch/m68k/68000/m68EZ328.c~mm-introduce-include-linux-pgtableh
+++ a/arch/m68k/68000/m68EZ328.c
@@ -17,7 +17,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/rtc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/MC68EZ328.h>
 #ifdef CONFIG_UCSIMM
--- a/arch/m68k/68000/m68VZ328.c~mm-introduce-include-linux-pgtableh
+++ a/arch/m68k/68000/m68VZ328.c
@@ -23,7 +23,7 @@
 #include <linux/irq.h>
 #include <linux/rtc.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/MC68VZ328.h>
 #include <asm/bootstd.h>
--- a/arch/m68k/include/asm/pgtable_mm.h~mm-introduce-include-linux-pgtableh
+++ a/arch/m68k/include/asm/pgtable_mm.h
@@ -176,7 +176,6 @@ pgprot_t pgprot_dmacoherent(pgprot_t pro
 #define pgprot_dmacoherent(prot)	pgprot_dmacoherent(prot)
 
 #endif /* CONFIG_COLDFIRE */
-#include <asm-generic/pgtable.h>
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _M68K_PGTABLE_H */
--- a/arch/m68k/include/asm/pgtable_no.h~mm-introduce-include-linux-pgtableh
+++ a/arch/m68k/include/asm/pgtable_no.h
@@ -53,6 +53,4 @@ extern void paging_init(void);
 #define	KMAP_START	0
 #define	KMAP_END	0xffffffff
 
-#include <asm-generic/pgtable.h>
-
 #endif /* _M68KNOMMU_PGTABLE_H */
--- a/arch/m68k/include/asm/sun3xflop.h~mm-introduce-include-linux-pgtableh
+++ a/arch/m68k/include/asm/sun3xflop.h
@@ -11,7 +11,7 @@
 #define __ASM_SUN3X_FLOPPY_H
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/sun3x.h>
 
--- a/arch/m68k/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/m68k/kernel/head.S
@@ -264,7 +264,7 @@
 #include <asm/bootinfo-vme.h>
 #include <asm/setup.h>
 #include <asm/entry.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
 #ifdef CONFIG_MAC
--- a/arch/microblaze/include/asm/pgalloc.h~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/include/asm/pgalloc.h
@@ -16,7 +16,7 @@
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/cache.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
 #include <asm-generic/pgalloc.h>
--- a/arch/microblaze/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/include/asm/pgtable.h
@@ -507,8 +507,6 @@ void __init *early_get_page(void);
 #endif /* CONFIG_MMU */
 
 #ifndef __ASSEMBLY__
-#include <asm-generic/pgtable.h>
-
 extern unsigned long ioremap_bot, ioremap_base;
 
 void setup_memory(void);
--- a/arch/microblaze/include/asm/uaccess.h~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/include/asm/uaccess.h
@@ -12,7 +12,7 @@
 
 #include <asm/mmu.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/extable.h>
 #include <linux/string.h>
 
--- a/arch/microblaze/kernel/hw_exception_handler.S~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/kernel/hw_exception_handler.S
@@ -70,7 +70,7 @@
 #include <linux/linkage.h>
 
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/signal.h>
 #include <asm/registers.h>
 #include <asm/asm-offsets.h>
--- a/arch/microblaze/kernel/module.c~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/kernel/module.c
@@ -12,7 +12,7 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
--- a/arch/microblaze/kernel/setup.c~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/kernel/setup.c
@@ -33,7 +33,7 @@
 #include <asm/entry.h>
 #include <asm/cpuinfo.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 DEFINE_PER_CPU(unsigned int, KSP);	/* Saved kernel stack pointer */
 DEFINE_PER_CPU(unsigned int, KM);	/* Kernel/user mode */
--- a/arch/microblaze/mm/pgtable.c~mm-introduce-include-linux-pgtableh
+++ a/arch/microblaze/mm/pgtable.c
@@ -33,7 +33,7 @@
 #include <linux/init.h>
 #include <linux/mm_types.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <linux/io.h>
 #include <asm/mmu.h>
--- a/arch/mips/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/mips/include/asm/pgtable.h
@@ -736,8 +736,6 @@ static inline pmd_t pmdp_huge_get_and_cl
 
 #define gup_fast_permitted(start, end)	(!cpu_has_dc_aliases)
 
-#include <asm-generic/pgtable.h>
-
 /*
  * We provide our own get_unmapped area to cope with the virtual aliasing
  * constraints placed on us by the cache architecture.
--- a/arch/mips/jazz/irq.c~mm-introduce-include-linux-pgtableh
+++ a/arch/mips/jazz/irq.c
@@ -19,7 +19,7 @@
 #include <asm/i8259.h>
 #include <asm/io.h>
 #include <asm/jazz.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbmisc.h>
 
 static DEFINE_RAW_SPINLOCK(r4030_lock);
--- a/arch/mips/jazz/setup.c~mm-introduce-include-linux-pgtableh
+++ a/arch/mips/jazz/setup.c
@@ -21,7 +21,7 @@
 #include <asm/jazz.h>
 #include <asm/jazzdma.h>
 #include <asm/reboot.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbmisc.h>
 
 extern asmlinkage void jazz_handle_int(void);
--- a/arch/mips/kvm/mips.c~mm-introduce-include-linux-pgtableh
+++ a/arch/mips/kvm/mips.c
@@ -25,7 +25,7 @@
 #include <asm/cacheflush.h>
 #include <asm/mmu_context.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <linux/kvm_host.h>
 
--- a/arch/mips/mm/tlbex.c~mm-introduce-include-linux-pgtableh
+++ a/arch/mips/mm/tlbex.c
@@ -32,7 +32,7 @@
 #include <asm/cacheflush.h>
 #include <asm/cpu-type.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/war.h>
 #include <asm/uasm.h>
 #include <asm/setup.h>
--- a/arch/nds32/include/asm/highmem.h~mm-introduce-include-linux-pgtableh
+++ a/arch/nds32/include/asm/highmem.h
@@ -7,7 +7,7 @@
 #include <asm/proc-fns.h>
 #include <asm/kmap_types.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /*
  * Right now we initialize only a single pte table. It can be extended
--- a/arch/nds32/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/nds32/include/asm/pgtable.h
@@ -374,8 +374,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD
 /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
 #define kern_addr_valid(addr)	(1)
 
-#include <asm-generic/pgtable.h>
-
 /*
  * We provide our own arch_get_unmapped_area to cope with VIPT caches.
  */
--- a/arch/nds32/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/nds32/kernel/head.S
@@ -6,7 +6,7 @@
 #include <asm/ptrace.h>
 #include <asm/asm-offsets.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/sizes.h>
 #include <asm/thread_info.h>
 
--- a/arch/nds32/kernel/module.c~mm-introduce-include-linux-pgtableh
+++ a/arch/nds32/kernel/module.c
@@ -5,7 +5,7 @@
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
 #include <linux/moduleloader.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 void *module_alloc(unsigned long size)
 {
--- a/arch/nios2/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/nios2/include/asm/pgtable.h
@@ -285,8 +285,6 @@ static inline void pte_clear(struct mm_s
 
 #define kern_addr_valid(addr)		(1)
 
-#include <asm-generic/pgtable.h>
-
 extern void __init paging_init(void);
 extern void __init mmu_init(void);
 
--- a/arch/nios2/kernel/nios2_ksyms.c~mm-introduce-include-linux-pgtableh
+++ a/arch/nios2/kernel/nios2_ksyms.c
@@ -10,7 +10,7 @@
 #include <linux/string.h>
 
 #include <asm/cacheflush.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* string functions */
 
--- a/arch/openrisc/include/asm/io.h~mm-introduce-include-linux-pgtableh
+++ a/arch/openrisc/include/asm/io.h
@@ -26,7 +26,7 @@
 #define PIO_MASK		0
 
 #include <asm-generic/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 void __iomem *ioremap(phys_addr_t offset, unsigned long size);
 extern void iounmap(void *addr);
--- a/arch/openrisc/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/openrisc/include/asm/pgtable.h
@@ -438,8 +438,6 @@ static inline void update_mmu_cache(stru
 
 #define kern_addr_valid(addr)           (1)
 
-#include <asm-generic/pgtable.h>
-
 typedef pte_t *pte_addr_t;
 
 #endif /* __ASSEMBLY__ */
--- a/arch/openrisc/kernel/entry.S~mm-introduce-include-linux-pgtableh
+++ a/arch/openrisc/kernel/entry.S
@@ -21,7 +21,7 @@
 #include <asm/spr_defs.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/asm-offsets.h>
 
 #define DISABLE_INTERRUPTS(t1,t2)			\
--- a/arch/openrisc/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/openrisc/kernel/head.S
@@ -19,7 +19,7 @@
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/thread_info.h>
 #include <asm/cache.h>
 #include <asm/spr_defs.h>
--- a/arch/openrisc/kernel/or32_ksyms.c~mm-introduce-include-linux-pgtableh
+++ a/arch/openrisc/kernel/or32_ksyms.c
@@ -26,7 +26,7 @@
 #include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name)
 
--- a/arch/openrisc/mm/ioremap.c~mm-introduce-include-linux-pgtableh
+++ a/arch/openrisc/mm/ioremap.c
@@ -17,7 +17,7 @@
 #include <asm/kmap_types.h>
 #include <asm/fixmap.h>
 #include <asm/bug.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/sched.h>
 #include <asm/tlbflush.h>
 
--- a/arch/parisc/include/asm/io.h~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/include/asm/io.h
@@ -3,7 +3,7 @@
 #define _ASM_IO_H
 
 #include <linux/types.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #define virt_to_phys(a) ((unsigned long)__pa(a))
 #define phys_to_virt(a) __va(a)
--- a/arch/parisc/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/include/asm/pgtable.h
@@ -571,6 +571,5 @@ extern void arch_report_meminfo(struct s
 #define __HAVE_ARCH_PTEP_GET_AND_CLEAR
 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
 #define __HAVE_ARCH_PTE_SAME
-#include <asm-generic/pgtable.h>
 
 #endif /* _PARISC_PGTABLE_H */
--- a/arch/parisc/kernel/asm-offsets.c~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/kernel/asm-offsets.c
@@ -21,7 +21,7 @@
 #include <linux/hardirq.h>
 #include <linux/kbuild.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 #include <asm/processor.h>
 #include <asm/pdc.h>
--- a/arch/parisc/kernel/entry.S~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/kernel/entry.S
@@ -19,7 +19,7 @@
 #include <asm/psw.h>
 #include <asm/cache.h>		/* for L1_CACHE_SHIFT */
 #include <asm/assembly.h>	/* for LDREG/STREG defines */
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/signal.h>
 #include <asm/unistd.h>
 #include <asm/ldcw.h>
--- a/arch/parisc/kernel/head.S~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/kernel/head.S
@@ -17,7 +17,7 @@
 #include <asm/pdc.h>
 	
 #include <asm/assembly.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <linux/linkage.h>
 #include <linux/init.h>
--- a/arch/parisc/kernel/pacache.S~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/kernel/pacache.S
@@ -21,7 +21,7 @@
 
 #include <asm/psw.h>
 #include <asm/assembly.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cache.h>
 #include <asm/ldcw.h>
 #include <asm/alternative.h>
--- a/arch/parisc/kernel/pdt.c~mm-introduce-include-linux-pgtableh
+++ a/arch/parisc/kernel/pdt.c
@@ -21,7 +21,7 @@
 #include <asm/pdc.h>
 #include <asm/pdcpat.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 enum pdt_access_type {
 	PDT_NONE,
--- a/arch/powerpc/include/asm/fixmap.h~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/include/asm/fixmap.h
@@ -17,7 +17,7 @@
 #ifndef __ASSEMBLY__
 #include <linux/sizes.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
--- a/arch/powerpc/include/asm/kup.h~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/include/asm/kup.h
@@ -39,7 +39,7 @@
 
 #else /* !__ASSEMBLY__ */
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 void setup_kup(void);
 
--- a/arch/powerpc/include/asm/nohash/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/include/asm/nohash/pgtable.h
@@ -56,7 +56,7 @@ static inline bool pte_exec(pte_t pte)
 #ifdef CONFIG_NUMA_BALANCING
 /*
  * These work without NUMA balancing but the kernel does not care. See the
- * comment in include/asm-generic/pgtable.h . On powerpc, this will only
+ * comment in include/linux/pgtable.h . On powerpc, this will only
  * work for user pages and always return true for kernel pages.
  */
 static inline int pte_protnone(pte_t pte)
--- a/arch/powerpc/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/include/asm/pgtable.h
@@ -96,8 +96,6 @@ extern unsigned long ioremap_bot;
  */
 #define kern_addr_valid(addr)	(1)
 
-#include <asm-generic/pgtable.h>
-
 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
 #define pmd_large(pmd)		0
 #endif
--- a/arch/powerpc/include/asm/tlb.h~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/include/asm/tlb.h
@@ -10,7 +10,7 @@
 #ifdef __KERNEL__
 
 #ifndef __powerpc64__
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #endif
 #include <asm/pgalloc.h>
 #ifndef __powerpc64__
--- a/arch/powerpc/kernel/btext.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/btext.c
@@ -15,7 +15,7 @@
 #include <asm/btext.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/udbg.h>
--- a/arch/powerpc/kernel/fpu.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/fpu.S
@@ -12,7 +12,7 @@
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/kernel/head_32.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/head_32.S
@@ -20,7 +20,7 @@
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/kernel/head_40x.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/head_40x.S
@@ -29,7 +29,7 @@
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/head_44x.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/head_44x.S
@@ -28,7 +28,7 @@
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/head_8xx.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/head_8xx.S
@@ -21,7 +21,7 @@
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/cache.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/head_fsl_booke.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/head_fsl_booke.S
@@ -31,7 +31,7 @@
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/io-workarounds.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/io-workarounds.c
@@ -13,7 +13,7 @@
 
 #include <asm/io.h>
 #include <asm/machdep.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ppc-pci.h>
 #include <asm/io-workarounds.h>
 #include <asm/pte-walk.h>
--- a/arch/powerpc/kernel/irq.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/irq.c
@@ -54,7 +54,7 @@
 
 #include <linux/uaccess.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/cache.h>
 #include <asm/prom.h>
--- a/arch/powerpc/kernel/mce_power.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/mce_power.c
@@ -15,7 +15,7 @@
 #include <asm/mmu.h>
 #include <asm/mce.h>
 #include <asm/machdep.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pte-walk.h>
 #include <asm/sstep.h>
 #include <asm/exception-64s.h>
--- a/arch/powerpc/kernel/paca.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/paca.c
@@ -12,7 +12,7 @@
 #include <asm/lppaca.h>
 #include <asm/paca.h>
 #include <asm/sections.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/kexec.h>
 #include <asm/svm.h>
 #include <asm/ultravisor.h>
--- a/arch/powerpc/kernel/prom.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/prom.c
@@ -41,7 +41,7 @@
 #include <asm/smp.h>
 #include <asm/mmu.h>
 #include <asm/paca.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/powernv.h>
 #include <asm/iommu.h>
 #include <asm/btext.h>
--- a/arch/powerpc/kernel/prom_init.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/prom_init.c
@@ -34,7 +34,7 @@
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/iommu.h>
 #include <asm/btext.h>
 #include <asm/sections.h>
--- a/arch/powerpc/kernel/rtas_pci.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/rtas_pci.c
@@ -15,7 +15,7 @@
 #include <linux/init.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/kernel/setup_32.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/setup_32.c
@@ -23,7 +23,7 @@
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
--- a/arch/powerpc/kernel/setup_64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/setup_64.c
@@ -36,7 +36,7 @@
 #include <asm/kdump.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/kernel/setup-common.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/setup-common.c
@@ -37,7 +37,7 @@
 #include <asm/prom.h>
 #include <asm/processor.h>
 #include <asm/vdso_datapage.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/kernel/smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kernel/smp.c
@@ -41,7 +41,7 @@
 #include <asm/kvm_ppc.h>
 #include <asm/dbell.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
 #include <asm/time.h>
--- a/arch/powerpc/kvm/book3s_64_mmu_radix.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_64_mmu_radix.c
@@ -16,7 +16,7 @@
 #include <asm/kvm_book3s.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/pte-walk.h>
 #include <asm/ultravisor.h>
--- a/arch/powerpc/kvm/book3s_hv_nested.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_hv_nested.c
@@ -15,7 +15,7 @@
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/pte-walk.h>
 #include <asm/reg.h>
--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_hv_rm_xics.c
@@ -15,7 +15,7 @@
 #include <asm/xics.h>
 #include <asm/synch.h>
 #include <asm/cputhreads.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ppc-opcode.h>
 #include <asm/pnv-pci.h>
 #include <asm/opal.h>
--- a/arch/powerpc/kvm/book3s_hv_rm_xive.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_hv_rm_xive.c
@@ -11,7 +11,7 @@
 #include <asm/debug.h>
 #include <asm/synch.h>
 #include <asm/cputhreads.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ppc-opcode.h>
 #include <asm/pnv-pci.h>
 #include <asm/opal.h>
--- a/arch/powerpc/kvm/fpu.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/kvm/fpu.S
@@ -8,7 +8,7 @@
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/mm/book3s32/hash_low.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/book3s32/hash_low.S
@@ -16,7 +16,7 @@
 
 #include <asm/reg.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/mm/book3s64/hash_native.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/hash_native.c
@@ -18,7 +18,7 @@
 #include <asm/machdep.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/trace.h>
 #include <asm/tlb.h>
 #include <asm/cputable.h>
--- a/arch/powerpc/mm/book3s64/hash_utils.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/hash_utils.c
@@ -38,7 +38,7 @@
 
 #include <asm/debugfs.h>
 #include <asm/processor.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/page.h>
--- a/arch/powerpc/mm/book3s64/slb.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/slb.c
@@ -10,7 +10,7 @@
  */
 
 #include <asm/asm-prototypes.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/paca.h>
--- a/arch/powerpc/mm/book3s64/subpage_prot.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/subpage_prot.c
@@ -11,7 +11,7 @@
 #include <linux/hugetlb.h>
 #include <linux/syscalls.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/uaccess.h>
 
 /*
--- a/arch/powerpc/mm/init-common.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/init-common.c
@@ -18,7 +18,7 @@
 
 #include <linux/string.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/kup.h>
 
 phys_addr_t memstart_addr __ro_after_init = (phys_addr_t)~0ull;
--- a/arch/powerpc/mm/nohash/tlb_low_64e.S~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/nohash/tlb_low_64e.S
@@ -13,7 +13,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/cputable.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/exception-64e.h>
 #include <asm/ppc-opcode.h>
 #include <asm/kvm_asm.h>
--- a/arch/powerpc/mm/ptdump/8xx.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/ptdump/8xx.c
@@ -5,7 +5,7 @@
  *
  */
 #include <linux/kernel.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "ptdump.h"
 
--- a/arch/powerpc/mm/ptdump/bats.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/ptdump/bats.c
@@ -7,7 +7,7 @@
  */
 
 #include <asm/debugfs.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cpu_has_feature.h>
 
 #include "ptdump.h"
--- a/arch/powerpc/mm/ptdump/book3s64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/ptdump/book3s64.c
@@ -5,7 +5,7 @@
  *
  */
 #include <linux/kernel.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "ptdump.h"
 
--- a/arch/powerpc/mm/ptdump/shared.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/mm/ptdump/shared.c
@@ -5,7 +5,7 @@
  *
  */
 #include <linux/kernel.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "ptdump.h"
 
--- a/arch/powerpc/platforms/85xx/corenet_generic.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -16,7 +16,7 @@
 #include <asm/time.h>
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ppc-pci.h>
 #include <mm/mmu_decl.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -23,7 +23,7 @@
 #include <linux/fsl_devices.h>
 #include <linux/of_platform.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <linux/atomic.h>
 #include <asm/time.h>
--- a/arch/powerpc/platforms/85xx/qemu_e500.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/qemu_e500.c
@@ -14,7 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/of_fdt.h>
 #include <asm/machdep.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/time.h>
 #include <asm/udbg.h>
 #include <asm/mpic.h>
--- a/arch/powerpc/platforms/85xx/sbc8548.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/sbc8548.c
@@ -25,7 +25,7 @@
 #include <linux/fsl_devices.h>
 #include <linux/of_platform.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <linux/atomic.h>
 #include <asm/time.h>
--- a/arch/powerpc/platforms/85xx/smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/smp.c
@@ -18,7 +18,7 @@
 #include <linux/fsl/guts.h>
 
 #include <asm/machdep.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/mpic.h>
 #include <asm/cacheflush.h>
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -13,7 +13,7 @@
 
 #include <asm/code-patching.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pci-bridge.h>
 #include <asm/mpic.h>
 #include <asm/cacheflush.h>
--- a/arch/powerpc/platforms/cell/cbe_regs.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/cbe_regs.c
@@ -14,7 +14,7 @@
 #include <linux/of_platform.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/ptrace.h>
 #include <asm/cell-regs.h>
--- a/arch/powerpc/platforms/cell/interrupt.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/interrupt.c
@@ -25,7 +25,7 @@
 #include <linux/kernel_stat.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/ptrace.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/platforms/cell/pervasive.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/pervasive.c
@@ -19,7 +19,7 @@
 #include <asm/io.h>
 #include <asm/machdep.h>
 #include <asm/prom.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/reg.h>
 #include <asm/cell-regs.h>
 #include <asm/cpu_has_feature.h>
--- a/arch/powerpc/platforms/cell/smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/smp.c
@@ -26,7 +26,7 @@
 #include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
--- a/arch/powerpc/platforms/cell/spider-pic.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/spider-pic.c
@@ -11,7 +11,7 @@
 #include <linux/irq.h>
 #include <linux/ioport.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/io.h>
 
--- a/arch/powerpc/platforms/chrp/pci.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/chrp/pci.c
@@ -10,7 +10,7 @@
 #include <linux/init.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/hydra.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/chrp/smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/chrp/smp.c
@@ -21,7 +21,7 @@
 #include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/powermac/smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/powermac/smp.c
@@ -36,7 +36,7 @@
 #include <asm/code-patching.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/pseries/lpar.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/pseries/lpar.c
@@ -24,7 +24,7 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/mmu_context.h>
 #include <asm/iommu.h>
--- a/arch/powerpc/platforms/pseries/smp.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/platforms/pseries/smp.c
@@ -25,7 +25,7 @@
 #include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
--- a/arch/powerpc/sysdev/fsl_85xx_cache_sram.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/sysdev/fsl_85xx_cache_sram.c
@@ -15,7 +15,7 @@
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/of_platform.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/fsl_85xx_cache_sram.h>
 
 #include "fsl_85xx_cache_ctlr.h"
--- a/arch/powerpc/sysdev/mpic.c~mm-introduce-include-linux-pgtableh
+++ a/arch/powerpc/sysdev/mpic.c
@@ -33,7 +33,7 @@
 #include <asm/ptrace.h>
 #include <asm/signal.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/machdep.h>
 #include <asm/mpic.h>
--- a/arch/riscv/include/asm/fixmap.h~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/include/asm/fixmap.h
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/sizes.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #ifdef CONFIG_MMU
 /*
--- a/arch/riscv/include/asm/io.h~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/include/asm/io.h
@@ -13,7 +13,7 @@
 
 #include <linux/types.h>
 #include <asm/mmiowb.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /*
  * MMIO access functions are separated out to break dependency cycles
--- a/arch/riscv/include/asm/kasan.h~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/include/asm/kasan.h
@@ -8,7 +8,7 @@
 
 #ifdef CONFIG_KASAN
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #define KASAN_SHADOW_SCALE_SHIFT	3
 
--- a/arch/riscv/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/include/asm/pgtable.h
@@ -496,8 +496,6 @@ void paging_init(void);
 extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
 
-#include <asm-generic/pgtable.h>
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_RISCV_PGTABLE_H */
--- a/arch/riscv/kernel/module.c~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/kernel/module.c
@@ -10,7 +10,7 @@
 #include <linux/moduleloader.h>
 #include <linux/vmalloc.h>
 #include <linux/sizes.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 
 static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v)
--- a/arch/riscv/kernel/soc.c~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/kernel/soc.c
@@ -4,7 +4,7 @@
  */
 #include <linux/init.h>
 #include <linux/libfdt.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/soc.h>
 
 /*
--- a/arch/riscv/mm/cacheflush.c~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/mm/cacheflush.c
@@ -3,7 +3,7 @@
  * Copyright (C) 2017 SiFive
  */
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 #ifdef CONFIG_SMP
--- a/arch/riscv/mm/kasan_init.c~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/mm/kasan_init.c
@@ -7,7 +7,7 @@
 #include <linux/kernel.h>
 #include <linux/memblock.h>
 #include <asm/tlbflush.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/fixmap.h>
 
 extern pgd_t early_pg_dir[PTRS_PER_PGD];
--- a/arch/riscv/mm/pageattr.c~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/mm/pageattr.c
@@ -4,7 +4,7 @@
  */
 
 #include <linux/pagewalk.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/bitops.h>
 
--- a/arch/riscv/mm/ptdump.c~mm-introduce-include-linux-pgtableh
+++ a/arch/riscv/mm/ptdump.c
@@ -9,7 +9,7 @@
 #include <linux/ptdump.h>
 
 #include <asm/ptdump.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/kasan.h>
 
 #define pt_dump_seq_printf(m, fmt, args...)	\
--- a/arch/s390/boot/ipl_parm.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/boot/ipl_parm.c
@@ -7,7 +7,7 @@
 #include <asm/sections.h>
 #include <asm/boot_data.h>
 #include <asm/facility.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/uv.h>
 #include "boot.h"
 
--- a/arch/s390/boot/kaslr.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/boot/kaslr.c
@@ -3,7 +3,7 @@
  * Copyright IBM Corp. 2019
  */
 #include <asm/mem_detect.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cpacf.h>
 #include <asm/timex.h>
 #include <asm/sclp.h>
--- a/arch/s390/include/asm/hugetlb.h~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/include/asm/hugetlb.h
@@ -10,7 +10,7 @@
 #define _ASM_S390_HUGETLB_H
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #define hugetlb_free_pgd_range			free_pgd_range
 #define hugepages_supported()			(MACHINE_HAS_EDAT1)
--- a/arch/s390/include/asm/kasan.h~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/include/asm/kasan.h
@@ -2,7 +2,7 @@
 #ifndef __ASM_KASAN_H
 #define __ASM_KASAN_H
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #ifdef CONFIG_KASAN
 
--- a/arch/s390/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/include/asm/pgtable.h
@@ -1683,6 +1683,4 @@ extern void s390_reset_cmma(struct mm_st
 #define HAVE_ARCH_UNMAPPED_AREA
 #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 
-#include <asm-generic/pgtable.h>
-
 #endif /* _S390_PAGE_H */
--- a/arch/s390/kernel/asm-offsets.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/kernel/asm-offsets.c
@@ -13,7 +13,7 @@
 #include <linux/purgatory.h>
 #include <asm/idle.h>
 #include <asm/vdso.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/gmap.h>
 #include <asm/nmi.h>
 #include <asm/stacktrace.h>
--- a/arch/s390/kvm/gaccess.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/kvm/gaccess.c
@@ -10,7 +10,7 @@
 #include <linux/mm_types.h>
 #include <linux/err.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/gmap.h>
 #include "kvm-s390.h"
 #include "gaccess.h"
--- a/arch/s390/kvm/kvm-s390.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/kvm/kvm-s390.c
@@ -35,7 +35,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/lowcore.h>
 #include <asm/stp.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/gmap.h>
 #include <asm/nmi.h>
 #include <asm/switch_to.h>
--- a/arch/s390/kvm/priv.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/kvm/priv.c
@@ -20,7 +20,7 @@
 #include <asm/debug.h>
 #include <asm/ebcdic.h>
 #include <asm/sysinfo.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page-states.h>
 #include <asm/pgalloc.h>
 #include <asm/gmap.h>
--- a/arch/s390/mm/extmem.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/mm/extmem.c
@@ -22,7 +22,7 @@
 #include <linux/refcount.h>
 #include <asm/diag.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/ebcdic.h>
 #include <asm/errno.h>
 #include <asm/extmem.h>
--- a/arch/s390/mm/gmap.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/mm/gmap.c
@@ -18,7 +18,7 @@
 #include <linux/ksm.h>
 #include <linux/mman.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/gmap.h>
 #include <asm/tlb.h>
--- a/arch/s390/mm/kasan_init.c~mm-introduce-include-linux-pgtableh
+++ a/arch/s390/mm/kasan_init.c
@@ -3,7 +3,7 @@
 #include <linux/sched/task.h>
 #include <linux/memblock.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/kasan.h>
 #include <asm/mem_detect.h>
 #include <asm/processor.h>
--- a/arch/sh/include/asm/io.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sh/include/asm/io.h
@@ -17,7 +17,7 @@
 #include <asm/cache.h>
 #include <asm/addrspace.h>
 #include <asm/machvec.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm-generic/iomap.h>
 
 #ifdef __KERNEL__
--- a/arch/sh/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sh/include/asm/pgtable.h
@@ -168,6 +168,4 @@ static inline bool pte_access_permitted(
 #define HAVE_ARCH_UNMAPPED_AREA
 #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 
-#include <asm-generic/pgtable.h>
-
 #endif /* __ASM_SH_PGTABLE_H */
--- a/arch/sh/mm/pmb.c~mm-introduce-include-linux-pgtableh
+++ a/arch/sh/mm/pmb.c
@@ -26,7 +26,7 @@
 #include <asm/cacheflush.h>
 #include <linux/sizes.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
--- a/arch/sparc/include/asm/floppy_32.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/floppy_32.h
@@ -10,7 +10,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/idprom.h>
 #include <asm/oplib.h>
 #include <asm/auxio.h>
--- a/arch/sparc/include/asm/highmem.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/highmem.h
@@ -24,7 +24,7 @@
 #include <linux/interrupt.h>
 #include <asm/vaddrs.h>
 #include <asm/kmap_types.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgtsrmmu.h>
 
 /* declarations for highmem.c */
--- a/arch/sparc/include/asm/ide.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/ide.h
@@ -18,7 +18,7 @@
 #include <asm/cacheflush.h>
 #include <asm/page.h>
 #else
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/psr.h>
 #endif
 
--- a/arch/sparc/include/asm/io-unit.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/io-unit.h
@@ -8,7 +8,7 @@
 
 #include <linux/spinlock.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* The io-unit handles all virtual to physical address translations
  * that occur between the SBUS and physical memory.  Access by
--- a/arch/sparc/include/asm/pgalloc_32.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/pgalloc_32.h
@@ -6,7 +6,7 @@
 #include <linux/sched.h>
 
 #include <asm/pgtsrmmu.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/vaddrs.h>
 #include <asm/page.h>
 
--- a/arch/sparc/include/asm/pgtable_32.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/pgtable_32.h
@@ -440,8 +440,6 @@ static inline int io_remap_pfn_range(str
 	__changed;							  \
 })
 
-#include <asm-generic/pgtable.h>
-
 #endif /* !(__ASSEMBLY__) */
 
 #define VMALLOC_START           _AC(0xfe600000,UL)
--- a/arch/sparc/include/asm/pgtable_64.h~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/include/asm/pgtable_64.h
@@ -1122,7 +1122,6 @@ static inline bool pte_access_permitted(
 #define pte_access_permitted pte_access_permitted
 
 #include <asm/tlbflush.h>
-#include <asm-generic/pgtable.h>
 
 /* We provide our own get_unmapped_area to cope with VA holes and
  * SHM area cache aliasing for userland.
--- a/arch/sparc/kernel/cpu.c~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/cpu.c
@@ -13,7 +13,7 @@
 #include <linux/threads.h>
 
 #include <asm/spitfire.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/setup.h>
 #include <asm/page.h>
--- a/arch/sparc/kernel/entry.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/entry.S
@@ -20,7 +20,7 @@
 #include <asm/psr.h>
 #include <asm/vaddrs.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/winmacro.h>
 #include <asm/signal.h>
 #include <asm/obio.h>
--- a/arch/sparc/kernel/head_64.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/head_64.S
@@ -18,7 +18,7 @@
 #include <asm/ptrace.h>
 #include <asm/spitfire.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/errno.h>
 #include <asm/signal.h>
 #include <asm/processor.h>
--- a/arch/sparc/kernel/ktlb.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/ktlb.S
@@ -10,7 +10,7 @@
 #include <asm/head.h>
 #include <asm/asi.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tsb.h>
 
 	.text
--- a/arch/sparc/kernel/pci.c~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/pci.c
@@ -23,7 +23,7 @@
 #include <linux/of_device.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/prom.h>
 #include <asm/apb.h>
--- a/arch/sparc/kernel/sun4m_irq.c~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/sun4m_irq.c
@@ -16,7 +16,7 @@
 #include <asm/timer.h>
 #include <asm/traps.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/cacheflush.h>
--- a/arch/sparc/kernel/trampoline_64.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/trampoline_64.S
@@ -13,7 +13,7 @@
 #include <asm/dcu.h>
 #include <asm/pstate.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/spitfire.h>
 #include <asm/processor.h>
 #include <asm/thread_info.h>
--- a/arch/sparc/kernel/traps_32.c~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/kernel/traps_32.c
@@ -23,7 +23,7 @@
 #include <asm/ptrace.h>
 #include <asm/oplib.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/unistd.h>
 #include <asm/traps.h>
 
--- a/arch/sparc/lib/clear_page.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/lib/clear_page.S
@@ -8,7 +8,7 @@
 #include <asm/visasm.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/spitfire.h>
 #include <asm/head.h>
 #include <asm/export.h>
--- a/arch/sparc/lib/copy_page.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/lib/copy_page.S
@@ -8,7 +8,7 @@
 #include <asm/visasm.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/spitfire.h>
 #include <asm/head.h>
 #include <asm/export.h>
--- a/arch/sparc/mm/tsb.c~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/mm/tsb.c
@@ -10,7 +10,7 @@
 #include <linux/mm_types.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/setup.h>
 #include <asm/tsb.h>
--- a/arch/sparc/mm/ultra.S~mm-introduce-include-linux-pgtableh
+++ a/arch/sparc/mm/ultra.S
@@ -6,7 +6,7 @@
  */
 
 #include <asm/asi.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/spitfire.h>
 #include <asm/mmu_context.h>
--- a/arch/um/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/um/include/asm/pgtable.h
@@ -353,8 +353,6 @@ extern pte_t *virt_to_pte(struct mm_stru
 
 #define kern_addr_valid(addr) (1)
 
-#include <asm-generic/pgtable.h>
-
 /* Clear a kernel PTE and flush it from the TLB */
 #define kpte_clear_flush(ptep, vaddr)		\
 do {						\
--- a/arch/unicore32/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/unicore32/include/asm/pgtable.h
@@ -279,8 +279,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD
 /* FIXME: this is not correct */
 #define kern_addr_valid(addr)	(1)
 
-#include <asm-generic/pgtable.h>
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __UNICORE_PGTABLE_H__ */
--- a/arch/unicore32/kernel/hibernate_asm.S~mm-introduce-include-linux-pgtableh
+++ a/arch/unicore32/kernel/hibernate_asm.S
@@ -13,7 +13,7 @@
 #include <linux/linkage.h>
 #include <generated/asm-offsets.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 
 @ restore_image(pgd_t *resume_pg_dir, struct pbe *restore_pblist)
--- a/arch/unicore32/kernel/hibernate.c~mm-introduce-include-linux-pgtableh
+++ a/arch/unicore32/kernel/hibernate.c
@@ -13,7 +13,7 @@
 #include <linux/memblock.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/unicore32/mm/alignment.c~mm-introduce-include-linux-pgtableh
+++ a/arch/unicore32/mm/alignment.c
@@ -19,7 +19,7 @@
 #include <linux/sched.h>
 #include <linux/uaccess.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/unaligned.h>
 
--- a/arch/unicore32/mm/proc-ucv2.S~mm-introduce-include-linux-pgtableh
+++ a/arch/unicore32/mm/proc-ucv2.S
@@ -11,7 +11,7 @@
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "proc-macros.S"
 
--- a/arch/x86/boot/compressed/kaslr_64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/boot/compressed/kaslr_64.c
@@ -23,7 +23,7 @@
 
 /* These actually do the work of building the kernel identity maps. */
 #include <asm/init.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 /* Use the static base for this part of the boot process */
 #undef __PAGE_OFFSET
 #define __PAGE_OFFSET __PAGE_OFFSET_BASE
--- a/arch/x86/include/asm/agp.h~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/include/asm/agp.h
@@ -2,7 +2,7 @@
 #ifndef _ASM_X86_AGP_H
 #define _ASM_X86_AGP_H
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 /*
--- a/arch/x86/include/asm/asm-prototypes.h~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/include/asm/asm-prototypes.h
@@ -7,7 +7,7 @@
 
 #include <asm-generic/asm-prototypes.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/special_insns.h>
 #include <asm/preempt.h>
 #include <asm/asm.h>
--- a/arch/x86/include/asm/efi.h~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/include/asm/efi.h
@@ -3,7 +3,7 @@
 #define _ASM_X86_EFI_H
 
 #include <asm/fpu/api.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor-flags.h>
 #include <asm/tlb.h>
 #include <asm/nospec-branch.h>
--- a/arch/x86/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/include/asm/pgtable.h
@@ -802,7 +802,7 @@ static inline int pmd_present(pmd_t pmd)
 #ifdef CONFIG_NUMA_BALANCING
 /*
  * These work without NUMA balancing but the kernel does not care. See the
- * comment in include/asm-generic/pgtable.h
+ * comment in include/linux/pgtable.h
  */
 static inline int pte_protnone(pte_t pte)
 {
@@ -1546,7 +1546,6 @@ static inline bool arch_faults_on_old_pt
 	return false;
 }
 
-#include <asm-generic/pgtable.h>
 #endif	/* __ASSEMBLY__ */
 
 #endif /* _ASM_X86_PGTABLE_H */
--- a/arch/x86/include/asm/xen/hypercall.h~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/include/asm/xen/hypercall.h
@@ -42,7 +42,7 @@
 #include <trace/events/xen.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/smap.h>
 #include <asm/nospec-branch.h>
 
--- a/arch/x86/kernel/acpi/boot.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/acpi/boot.c
@@ -24,7 +24,7 @@
 #include <asm/e820/api.h>
 #include <asm/irqdomain.h>
 #include <asm/pci_x86.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
 #include <asm/io.h>
--- a/arch/x86/kernel/acpi/sleep.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/acpi/sleep.c
@@ -12,7 +12,7 @@
 #include <linux/cpumask.h>
 #include <asm/segment.h>
 #include <asm/desc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/realmode.h>
 
--- a/arch/x86/kernel/apic/apic_numachip.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/apic/apic_numachip.c
@@ -16,7 +16,7 @@
 #include <asm/numachip/numachip.h>
 #include <asm/numachip/numachip_csr.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "local.h"
 
--- a/arch/x86/kernel/cpu/bugs.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/cpu/bugs.c
@@ -26,7 +26,7 @@
 #include <asm/vmx.h>
 #include <asm/paravirt.h>
 #include <asm/alternative.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/intel-family.h>
 #include <asm/e820/api.h>
--- a/arch/x86/kernel/cpu/common.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/cpu/common.c
@@ -35,7 +35,7 @@
 #include <asm/vsyscall.h>
 #include <linux/topology.h>
 #include <linux/cpumask.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/atomic.h>
 #include <asm/proto.h>
 #include <asm/setup.h>
--- a/arch/x86/kernel/cpu/intel.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/cpu/intel.c
@@ -11,7 +11,7 @@
 #include <linux/uaccess.h>
 
 #include <asm/cpufeature.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/msr.h>
 #include <asm/bugs.h>
 #include <asm/cpu.h>
--- a/arch/x86/kernel/crash_core_32.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/crash_core_32.c
@@ -2,7 +2,7 @@
 
 #include <linux/crash_core.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/setup.h>
 
 void arch_crash_save_vmcoreinfo(void)
--- a/arch/x86/kernel/crash_core_64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/crash_core_64.c
@@ -2,7 +2,7 @@
 
 #include <linux/crash_core.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/setup.h>
 
 void arch_crash_save_vmcoreinfo(void)
--- a/arch/x86/kernel/early_printk.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/early_printk.c
@@ -15,7 +15,7 @@
 #include <xen/hvc-console.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/usb/ehci_def.h>
 #include <linux/usb/xhci-dbgp.h>
 #include <asm/pci_x86.h>
--- a/arch/x86/kernel/espfix_64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/espfix_64.c
@@ -29,7 +29,7 @@
 #include <linux/percpu.h>
 #include <linux/gfp.h>
 #include <linux/random.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/setup.h>
 #include <asm/espfix.h>
--- a/arch/x86/kernel/head64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/head64.c
@@ -26,7 +26,7 @@
 #include <asm/smp.h>
 #include <asm/setup.h>
 #include <asm/desc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
 #include <asm/kdebug.h>
--- a/arch/x86/kernel/head_64.S~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/head_64.S
@@ -14,7 +14,7 @@
 #include <linux/threads.h>
 #include <linux/init.h>
 #include <asm/segment.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/msr.h>
 #include <asm/cache.h>
--- a/arch/x86/kernel/i8259.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/i8259.c
@@ -19,7 +19,7 @@
 #include <linux/atomic.h>
 #include <asm/timer.h>
 #include <asm/hw_irq.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/desc.h>
 #include <asm/apic.h>
 #include <asm/i8259.h>
--- a/arch/x86/kernel/irqinit.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/irqinit.c
@@ -20,7 +20,7 @@
 #include <linux/atomic.h>
 #include <asm/timer.h>
 #include <asm/hw_irq.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/desc.h>
 #include <asm/apic.h>
 #include <asm/setup.h>
--- a/arch/x86/kernel/kprobes/core.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/kprobes/core.c
@@ -45,7 +45,7 @@
 #include <asm/text-patching.h>
 #include <asm/cacheflush.h>
 #include <asm/desc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/alternative.h>
 #include <asm/insn.h>
--- a/arch/x86/kernel/kprobes/opt.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/kprobes/opt.c
@@ -20,7 +20,7 @@
 #include <asm/text-patching.h>
 #include <asm/cacheflush.h>
 #include <asm/desc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/alternative.h>
 #include <asm/insn.h>
--- a/arch/x86/kernel/paravirt.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/paravirt.c
@@ -19,7 +19,7 @@
 #include <asm/debugreg.h>
 #include <asm/desc.h>
 #include <asm/setup.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/time.h>
 #include <asm/pgalloc.h>
 #include <asm/irq.h>
--- a/arch/x86/kernel/reboot.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/reboot.c
@@ -17,7 +17,7 @@
 #include <asm/io_apic.h>
 #include <asm/desc.h>
 #include <asm/hpet.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/proto.h>
 #include <asm/reboot_fixups.h>
 #include <asm/reboot.h>
--- a/arch/x86/kernel/smpboot.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/kernel/smpboot.c
@@ -63,7 +63,7 @@
 #include <asm/realmode.h>
 #include <asm/cpu.h>
 #include <asm/numa.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/mtrr.h>
 #include <asm/mwait.h>
--- a/arch/x86/mm/cpu_entry_area.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/cpu_entry_area.c
@@ -6,7 +6,7 @@
 #include <linux/kcore.h>
 
 #include <asm/cpu_entry_area.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/fixmap.h>
 #include <asm/desc.h>
 
--- a/arch/x86/mm/debug_pagetables.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/debug_pagetables.c
@@ -3,7 +3,7 @@
 #include <linux/efi.h>
 #include <linux/module.h>
 #include <linux/seq_file.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 static int ptdump_show(struct seq_file *m, void *v)
 {
--- a/arch/x86/mm/ioremap.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/ioremap.c
@@ -21,7 +21,7 @@
 #include <asm/e820/api.h>
 #include <asm/efi.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/pgalloc.h>
 #include <asm/memtype.h>
--- a/arch/x86/mm/kaslr.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/kaslr.c
@@ -26,7 +26,7 @@
 #include <linux/memblock.h>
 
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/setup.h>
 #include <asm/kaslr.h>
 
--- a/arch/x86/mm/mem_encrypt_boot.S~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/mem_encrypt_boot.S
@@ -8,7 +8,7 @@
  */
 
 #include <linux/linkage.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/processor-flags.h>
 #include <asm/msr-index.h>
--- a/arch/x86/mm/mmio-mod.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/mmio-mod.c
@@ -17,7 +17,7 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/mmiotrace.h>
 #include <asm/e820/api.h> /* for ISA_START_ADDRESS */
 #include <linux/atomic.h>
--- a/arch/x86/mm/pat/memtype_interval.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/pat/memtype_interval.c
@@ -15,7 +15,7 @@
 #include <linux/sched.h>
 #include <linux/gfp.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/memtype.h>
 
 #include "memtype.h"
--- a/arch/x86/mm/setup_nx.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/mm/setup_nx.c
@@ -3,7 +3,7 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/proto.h>
 #include <asm/cpufeature.h>
 
--- a/arch/x86/platform/efi/efi_32.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/platform/efi/efi_32.c
@@ -28,7 +28,7 @@
 #include <asm/io.h>
 #include <asm/desc.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/efi.h>
 
--- a/arch/x86/platform/olpc/olpc_ofw.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/platform/olpc/olpc_ofw.c
@@ -8,7 +8,7 @@
 #include <asm/io.h>
 #include <asm/cpufeature.h>
 #include <asm/special_insns.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/olpc_ofw.h>
 
 /* address of OFW callback interface; will be NULL if OFW isn't found */
--- a/arch/x86/power/cpu.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/power/cpu.c
@@ -14,7 +14,7 @@
 #include <linux/tboot.h>
 #include <linux/dmi.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/proto.h>
 #include <asm/mtrr.h>
 #include <asm/page.h>
--- a/arch/x86/power/hibernate_32.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/power/hibernate_32.c
@@ -10,7 +10,7 @@
 #include <linux/memblock.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mmzone.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/x86/power/hibernate_64.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/power/hibernate_64.c
@@ -19,7 +19,7 @@
 #include <asm/init.h>
 #include <asm/proto.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mtrr.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/x86/power/hibernate.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/power/hibernate.c
@@ -19,7 +19,7 @@
 #include <asm/init.h>
 #include <asm/proto.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mtrr.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/x86/realmode/init.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/realmode/init.c
@@ -5,7 +5,7 @@
 #include <linux/mem_encrypt.h>
 
 #include <asm/set_memory.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/realmode.h>
 #include <asm/tlbflush.h>
 #include <asm/crash.h>
--- a/arch/x86/xen/mmu_pv.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/xen/mmu_pv.c
@@ -57,7 +57,7 @@
 
 #include <trace/events/xen.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/fixmap.h>
 #include <asm/mmu_context.h>
--- a/arch/x86/xen/smp_pv.c~mm-introduce-include-linux-pgtableh
+++ a/arch/x86/xen/smp_pv.c
@@ -26,7 +26,6 @@
 
 #include <asm/paravirt.h>
 #include <asm/desc.h>
-#include <asm/pgtable.h>
 #include <asm/cpu.h>
 
 #include <xen/interface/xen.h>
--- a/arch/xtensa/include/asm/fixmap.h~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/include/asm/fixmap.h
@@ -13,7 +13,7 @@
 #ifndef _ASM_FIXMAP_H
 #define _ASM_FIXMAP_H
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
--- a/arch/xtensa/include/asm/highmem.h~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/include/asm/highmem.h
@@ -16,7 +16,7 @@
 #include <asm/cacheflush.h>
 #include <asm/fixmap.h>
 #include <asm/kmap_types.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #define PKMAP_BASE		((FIXADDR_START - \
 				  (LAST_PKMAP + 1) * PAGE_SIZE) & PMD_MASK)
--- a/arch/xtensa/include/asm/initialize_mmu.h~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/include/asm/initialize_mmu.h
@@ -24,7 +24,7 @@
 #define _XTENSA_INITIALIZE_MMU_H
 
 #include <linux/init.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/vectors.h>
 
 #if XCHAL_HAVE_PTP_MMU
--- a/arch/xtensa/include/asm/mmu_context.h~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/include/asm/mmu_context.h
@@ -21,7 +21,7 @@
 
 #include <asm/vectors.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm-generic/mm_hooks.h>
--- a/arch/xtensa/include/asm/pgtable.h~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/include/asm/pgtable.h
@@ -438,6 +438,4 @@ typedef pte_t *pte_addr_t;
  */
 #define HAVE_ARCH_UNMAPPED_AREA
 
-#include <asm-generic/pgtable.h>
-
 #endif /* _XTENSA_PGTABLE_H */
--- a/arch/xtensa/kernel/entry.S~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/kernel/entry.S
@@ -22,7 +22,7 @@
 #include <asm/unistd.h>
 #include <asm/ptrace.h>
 #include <asm/current.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/signal.h>
 #include <asm/tlbflush.h>
--- a/arch/xtensa/kernel/traps.c~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/kernel/traps.c
@@ -39,7 +39,7 @@
 #include <asm/ptrace.h>
 #include <asm/timex.h>
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/traps.h>
 #include <asm/hw_breakpoint.h>
--- a/arch/xtensa/kernel/vectors.S~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/kernel/vectors.S
@@ -47,7 +47,7 @@
 #include <asm/ptrace.h>
 #include <asm/current.h>
 #include <asm/asm-offsets.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/thread_info.h>
--- a/arch/xtensa/mm/cache.c~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/mm/cache.c
@@ -31,7 +31,7 @@
 #include <asm/tlbflush.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* 
  * Note:
--- a/arch/xtensa/mm/ioremap.c~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/mm/ioremap.c
@@ -9,7 +9,7 @@
 #include <linux/vmalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 static void __iomem *xtensa_ioremap(unsigned long paddr, unsigned long size,
 				    pgprot_t prot)
--- a/arch/xtensa/mm/misc.S~mm-introduce-include-linux-pgtableh
+++ a/arch/xtensa/mm/misc.S
@@ -15,7 +15,7 @@
 
 #include <linux/linkage.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/cacheasm.h>
 #include <asm/tlbflush.h>
--- a/drivers/acpi/scan.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/acpi/scan.c
@@ -16,7 +16,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/platform_data/x86/apple.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "internal.h"
 
--- a/drivers/atm/fore200e.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/atm/fore200e.c
@@ -40,7 +40,7 @@
 #include <asm/idprom.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #endif
 
 #if defined(CONFIG_ATM_FORE200E_USE_TASKLET) /* defer interrupt work to a tasklet */
--- a/drivers/block/z2ram.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/block/z2ram.c
@@ -38,7 +38,7 @@
 
 #include <asm/setup.h>
 #include <asm/amigahw.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <linux/zorro.h>
 
--- a/drivers/firmware/efi/arm-runtime.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/firmware/efi/arm-runtime.c
@@ -23,7 +23,7 @@
 #include <asm/efi.h>
 #include <asm/mmu.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #if defined(CONFIG_PTDUMP_DEBUGFS) && defined(CONFIG_ARM64)
 #include <asm/ptdump.h>
--- a/drivers/gpu/drm/drm_vm.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/gpu/drm/drm_vm.c
@@ -44,7 +44,7 @@
 #endif
 #include <linux/mem_encrypt.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <drm/drm_agpsupport.h>
 #include <drm/drm_device.h>
--- a/drivers/infiniband/hw/qib/qib_file_ops.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -40,7 +40,7 @@
 #include <linux/highmem.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/delay.h>
 #include <linux/export.h>
 #include <linux/uio.h>
--- a/drivers/macintosh/macio-adb.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/macintosh/macio-adb.c
@@ -12,7 +12,7 @@
 #include <asm/prom.h>
 #include <linux/adb.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/hydra.h>
 #include <asm/irq.h>
 #include <linux/init.h>
--- a/drivers/macintosh/mediabay.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/macintosh/mediabay.c
@@ -17,7 +17,7 @@
 #include <linux/kthread.h>
 #include <linux/mutex.h>
 #include <asm/prom.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
--- a/drivers/macintosh/via-pmu.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/macintosh/via-pmu.c
@@ -52,7 +52,7 @@
 #include <linux/uaccess.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/irq.h>
 #ifdef CONFIG_PPC_PMAC
--- a/drivers/media/pci/bt8xx/bt878.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/media/pci/bt8xx/bt878.c
@@ -15,7 +15,7 @@
 #include <linux/pci.h>
 #include <asm/io.h>
 #include <linux/ioport.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
--- a/drivers/media/pci/bt8xx/btcx-risc.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/media/pci/bt8xx/btcx-risc.c
@@ -18,7 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/videodev2.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "btcx-risc.h"
 
--- a/drivers/media/pci/bt8xx/bttv-risc.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/media/pci/bt8xx/bttv-risc.c
@@ -21,7 +21,7 @@
 #include <linux/vmalloc.h>
 #include <linux/interrupt.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <media/v4l2-ioctl.h>
 
 #include "bttvp.h"
--- a/drivers/media/v4l2-core/videobuf-dma-sg.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/media/v4l2-core/videobuf-dma-sg.c
@@ -27,7 +27,7 @@
 #include <linux/pagemap.h>
 #include <linux/scatterlist.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <media/videobuf-dma-sg.h>
 
--- a/drivers/media/v4l2-core/videobuf-vmalloc.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/media/v4l2-core/videobuf-vmalloc.c
@@ -20,7 +20,7 @@
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <media/videobuf-vmalloc.h>
 
--- a/drivers/misc/genwqe/card_utils.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/misc/genwqe/card_utils.c
@@ -27,7 +27,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "genwqe_driver.h"
 #include "card_base.h"
--- a/drivers/mtd/ubi/ubi.h~mm-introduce-include-linux-pgtableh
+++ a/drivers/mtd/ubi/ubi.h
@@ -26,7 +26,7 @@
 #include <linux/notifier.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/ubi.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "ubi-media.h"
 
--- a/drivers/net/ethernet/amd/7990.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/amd/7990.c
@@ -35,7 +35,7 @@
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #ifdef CONFIG_HP300
 #include <asm/blinken.h>
 #endif
--- a/drivers/net/ethernet/amd/hplance.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/amd/hplance.c
@@ -24,7 +24,7 @@
 #include <linux/skbuff.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "hplance.h"
 
--- a/drivers/net/ethernet/amd/mvme147.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/amd/mvme147.c
@@ -24,7 +24,7 @@
 #include <linux/skbuff.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mvme147hw.h>
 
 /* We have 32K of RAM for the init block and buffers. This places
--- a/drivers/net/ethernet/amd/sun3lance.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/amd/sun3lance.c
@@ -42,7 +42,7 @@ static const char version[] =
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/dvma.h>
 #include <asm/idprom.h>
 #include <asm/machines.h>
--- a/drivers/net/ethernet/amd/sunlance.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/amd/sunlance.c
@@ -97,7 +97,7 @@ static char lancestr[] = "LANCE";
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/byteorder.h>	/* Used by the checksum routines */
 #include <asm/idprom.h>
 #include <asm/prom.h>
--- a/drivers/net/ethernet/apple/bmac.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/apple/bmac.c
@@ -28,7 +28,7 @@
 #include <asm/dbdma.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
 #include <asm/macio.h>
--- a/drivers/net/ethernet/apple/mace.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/apple/mace.c
@@ -22,7 +22,7 @@
 #include <asm/prom.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/macio.h>
 
 #include "mace.h"
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -42,7 +42,7 @@
 #include <linux/of_net.h>
 
 #include <linux/vmalloc.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <linux/uaccess.h>
 
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
@@ -40,7 +40,7 @@
 #include <asm/mpc8260.h>
 #include <asm/cpm2.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <linux/uaccess.h>
 
--- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
@@ -33,7 +33,7 @@
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <linux/uaccess.h>
 #include <asm/mpc5xxx.h>
--- a/drivers/net/ethernet/i825xx/82596.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/i825xx/82596.c
@@ -56,7 +56,7 @@
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 static char version[] __initdata =
--- a/drivers/net/ethernet/korina.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/korina.c
@@ -56,7 +56,7 @@
 
 #include <asm/bootinfo.h>
 #include <asm/bitops.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 
--- a/drivers/net/ethernet/marvell/pxa168_eth.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -32,7 +32,7 @@
 #include <linux/udp.h>
 #include <linux/workqueue.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 #define DRIVER_NAME	"pxa168-eth"
--- a/drivers/net/ethernet/natsemi/jazzsonic.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -38,7 +38,7 @@
 #include <linux/slab.h>
 
 #include <asm/bootinfo.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/jazz.h>
--- a/drivers/net/ethernet/natsemi/macsonic.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/natsemi/macsonic.c
@@ -52,7 +52,7 @@
 #include <linux/bitrev.h>
 #include <linux/slab.h>
 
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/hwtest.h>
 #include <asm/dma.h>
--- a/drivers/net/ethernet/natsemi/xtsonic.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/natsemi/xtsonic.c
@@ -37,7 +37,7 @@
 #include <linux/slab.h>
 
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/dma.h>
 
 static char xtsonic_string[] = "xtsonic";
--- a/drivers/net/ethernet/sun/sunbmac.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/sun/sunbmac.c
@@ -34,7 +34,7 @@
 #include <asm/io.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "sunbmac.h"
 
--- a/drivers/net/ethernet/sun/sunqe.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/net/ethernet/sun/sunqe.c
@@ -36,7 +36,7 @@
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/auxio.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 
 #include "sunqe.h"
--- a/drivers/scsi/53c700.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/53c700.c
@@ -118,7 +118,7 @@
 #include <linux/device.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/byteorder.h>
 
 #include <scsi/scsi.h>
--- a/drivers/scsi/arm/cumana_2.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/arm/cumana_2.c
@@ -27,7 +27,7 @@
 #include <asm/dma.h>
 #include <asm/ecard.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "../scsi.h"
 #include <scsi/scsi_host.h>
--- a/drivers/scsi/arm/eesox.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/arm/eesox.c
@@ -33,7 +33,7 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/ecard.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "../scsi.h"
 #include <scsi/scsi_host.h>
--- a/drivers/scsi/arm/powertec.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/arm/powertec.c
@@ -18,7 +18,7 @@
 #include <asm/dma.h>
 #include <asm/ecard.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "../scsi.h"
 #include <scsi/scsi_host.h>
--- a/drivers/scsi/dpt_i2o.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/dpt_i2o.c
@@ -55,7 +55,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Dri
 #include <linux/mutex.h>
 
 #include <asm/processor.h>	/* for boot_cpu_data */
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>		/* for virt_to_bus, etc. */
 
 #include <scsi/scsi.h>
--- a/drivers/scsi/mac53c94.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/mac53c94.c
@@ -22,7 +22,7 @@
 #include <linux/pci.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/macio.h>
 
--- a/drivers/scsi/mesh.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/mesh.c
@@ -33,7 +33,7 @@
 #include <linux/pci.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/irq.h>
 #include <asm/hydra.h>
--- a/drivers/scsi/qlogicpti.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/qlogicpti.c
@@ -37,7 +37,7 @@
 
 #include <asm/dma.h>
 #include <asm/ptrace.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/io.h>
 #include <asm/irq.h>
--- a/drivers/scsi/zorro_esp.c~mm-introduce-include-linux-pgtableh
+++ a/drivers/scsi/zorro_esp.c
@@ -36,7 +36,7 @@
 #include <linux/slab.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/amigahw.h>
 #include <asm/amigaints.h>
--- a/include/asm-generic/io.h~mm-introduce-include-linux-pgtableh
+++ a/include/asm-generic/io.h
@@ -972,7 +972,7 @@ static inline void iounmap(void __iomem
 }
 #endif
 #elif defined(CONFIG_GENERIC_IOREMAP)
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
 void iounmap(volatile void __iomem *addr);
--- a/include/asm-generic/pgtable.h
+++ /dev/null
@@ -1,1322 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_GENERIC_PGTABLE_H
-#define _ASM_GENERIC_PGTABLE_H
-
-#include <linux/pfn.h>
-
-#ifndef __ASSEMBLY__
-#ifdef CONFIG_MMU
-
-#include <linux/mm_types.h>
-#include <linux/bug.h>
-#include <linux/errno.h>
-#include <asm-generic/pgtable_uffd.h>
-
-#if 5 - defined(__PAGETABLE_P4D_FOLDED) - defined(__PAGETABLE_PUD_FOLDED) - \
-	defined(__PAGETABLE_PMD_FOLDED) != CONFIG_PGTABLE_LEVELS
-#error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED
-#endif
-
-/*
- * On almost all architectures and configurations, 0 can be used as the
- * upper ceiling to free_pgtables(): on many architectures it has the same
- * effect as using TASK_SIZE.  However, there is one configuration which
- * must impose a more careful limit, to avoid freeing kernel pgtables.
- */
-#ifndef USER_PGTABLES_CEILING
-#define USER_PGTABLES_CEILING	0UL
-#endif
-
-#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
-extern int ptep_set_access_flags(struct vm_area_struct *vma,
-				 unsigned long address, pte_t *ptep,
-				 pte_t entry, int dirty);
-#endif
-
-#ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-extern int pmdp_set_access_flags(struct vm_area_struct *vma,
-				 unsigned long address, pmd_t *pmdp,
-				 pmd_t entry, int dirty);
-extern int pudp_set_access_flags(struct vm_area_struct *vma,
-				 unsigned long address, pud_t *pudp,
-				 pud_t entry, int dirty);
-#else
-static inline int pmdp_set_access_flags(struct vm_area_struct *vma,
-					unsigned long address, pmd_t *pmdp,
-					pmd_t entry, int dirty)
-{
-	BUILD_BUG();
-	return 0;
-}
-static inline int pudp_set_access_flags(struct vm_area_struct *vma,
-					unsigned long address, pud_t *pudp,
-					pud_t entry, int dirty)
-{
-	BUILD_BUG();
-	return 0;
-}
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-#endif
-
-#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
-					    unsigned long address,
-					    pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	int r = 1;
-	if (!pte_young(pte))
-		r = 0;
-	else
-		set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte));
-	return r;
-}
-#endif
-
-#ifndef __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
-					    unsigned long address,
-					    pmd_t *pmdp)
-{
-	pmd_t pmd = *pmdp;
-	int r = 1;
-	if (!pmd_young(pmd))
-		r = 0;
-	else
-		set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));
-	return r;
-}
-#else
-static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
-					    unsigned long address,
-					    pmd_t *pmdp)
-{
-	BUILD_BUG();
-	return 0;
-}
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-#endif
-
-#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
-int ptep_clear_flush_young(struct vm_area_struct *vma,
-			   unsigned long address, pte_t *ptep);
-#endif
-
-#ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-extern int pmdp_clear_flush_young(struct vm_area_struct *vma,
-				  unsigned long address, pmd_t *pmdp);
-#else
-/*
- * Despite relevant to THP only, this API is called from generic rmap code
- * under PageTransHuge(), hence needs a dummy implementation for !THP
- */
-static inline int pmdp_clear_flush_young(struct vm_area_struct *vma,
-					 unsigned long address, pmd_t *pmdp)
-{
-	BUILD_BUG();
-	return 0;
-}
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-#endif
-
-#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
-static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
-				       unsigned long address,
-				       pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	pte_clear(mm, address, ptep);
-	return pte;
-}
-#endif
-
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-#ifndef __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
-static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
-					    unsigned long address,
-					    pmd_t *pmdp)
-{
-	pmd_t pmd = *pmdp;
-	pmd_clear(pmdp);
-	return pmd;
-}
-#endif /* __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR */
-#ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR
-static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm,
-					    unsigned long address,
-					    pud_t *pudp)
-{
-	pud_t pud = *pudp;
-
-	pud_clear(pudp);
-	return pud;
-}
-#endif /* __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR */
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-#ifndef __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR_FULL
-static inline pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma,
-					    unsigned long address, pmd_t *pmdp,
-					    int full)
-{
-	return pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp);
-}
-#endif
-
-#ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR_FULL
-static inline pud_t pudp_huge_get_and_clear_full(struct mm_struct *mm,
-					    unsigned long address, pud_t *pudp,
-					    int full)
-{
-	return pudp_huge_get_and_clear(mm, address, pudp);
-}
-#endif
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-
-#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
-static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
-					    unsigned long address, pte_t *ptep,
-					    int full)
-{
-	pte_t pte;
-	pte = ptep_get_and_clear(mm, address, ptep);
-	return pte;
-}
-#endif
-
-
-/*
- * If two threads concurrently fault at the same page, the thread that
- * won the race updates the PTE and its local TLB/Cache. The other thread
- * gives up, simply does nothing, and continues; on architectures where
- * software can update TLB,  local TLB can be updated here to avoid next page
- * fault. This function updates TLB only, do nothing with cache or others.
- * It is the difference with function update_mmu_cache.
- */
-#ifndef __HAVE_ARCH_UPDATE_MMU_TLB
-static inline void update_mmu_tlb(struct vm_area_struct *vma,
-				unsigned long address, pte_t *ptep)
-{
-}
-#define __HAVE_ARCH_UPDATE_MMU_TLB
-#endif
-
-/*
- * Some architectures may be able to avoid expensive synchronization
- * primitives when modifications are made to PTE's which are already
- * not present, or in the process of an address space destruction.
- */
-#ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL
-static inline void pte_clear_not_present_full(struct mm_struct *mm,
-					      unsigned long address,
-					      pte_t *ptep,
-					      int full)
-{
-	pte_clear(mm, address, ptep);
-}
-#endif
-
-#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
-extern pte_t ptep_clear_flush(struct vm_area_struct *vma,
-			      unsigned long address,
-			      pte_t *ptep);
-#endif
-
-#ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
-extern pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
-			      unsigned long address,
-			      pmd_t *pmdp);
-extern pud_t pudp_huge_clear_flush(struct vm_area_struct *vma,
-			      unsigned long address,
-			      pud_t *pudp);
-#endif
-
-#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
-struct mm_struct;
-static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
-{
-	pte_t old_pte = *ptep;
-	set_pte_at(mm, address, ptep, pte_wrprotect(old_pte));
-}
-#endif
-
-/*
- * On some architectures hardware does not set page access bit when accessing
- * memory page, it is responsibilty of software setting this bit. It brings
- * out extra page fault penalty to track page access bit. For optimization page
- * access bit can be set during all page fault flow on these arches.
- * To be differentiate with macro pte_mkyoung, this macro is used on platforms
- * where software maintains page access bit.
- */
-#ifndef pte_sw_mkyoung
-static inline pte_t pte_sw_mkyoung(pte_t pte)
-{
-	return pte;
-}
-#define pte_sw_mkyoung	pte_sw_mkyoung
-#endif
-
-#ifndef pte_savedwrite
-#define pte_savedwrite pte_write
-#endif
-
-#ifndef pte_mk_savedwrite
-#define pte_mk_savedwrite pte_mkwrite
-#endif
-
-#ifndef pte_clear_savedwrite
-#define pte_clear_savedwrite pte_wrprotect
-#endif
-
-#ifndef pmd_savedwrite
-#define pmd_savedwrite pmd_write
-#endif
-
-#ifndef pmd_mk_savedwrite
-#define pmd_mk_savedwrite pmd_mkwrite
-#endif
-
-#ifndef pmd_clear_savedwrite
-#define pmd_clear_savedwrite pmd_wrprotect
-#endif
-
-#ifndef __HAVE_ARCH_PMDP_SET_WRPROTECT
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-static inline void pmdp_set_wrprotect(struct mm_struct *mm,
-				      unsigned long address, pmd_t *pmdp)
-{
-	pmd_t old_pmd = *pmdp;
-	set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd));
-}
-#else
-static inline void pmdp_set_wrprotect(struct mm_struct *mm,
-				      unsigned long address, pmd_t *pmdp)
-{
-	BUILD_BUG();
-}
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-#endif
-#ifndef __HAVE_ARCH_PUDP_SET_WRPROTECT
-#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
-static inline void pudp_set_wrprotect(struct mm_struct *mm,
-				      unsigned long address, pud_t *pudp)
-{
-	pud_t old_pud = *pudp;
-
-	set_pud_at(mm, address, pudp, pud_wrprotect(old_pud));
-}
-#else
-static inline void pudp_set_wrprotect(struct mm_struct *mm,
-				      unsigned long address, pud_t *pudp)
-{
-	BUILD_BUG();
-}
-#endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
-#endif
-
-#ifndef pmdp_collapse_flush
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
-				 unsigned long address, pmd_t *pmdp);
-#else
-static inline pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
-					unsigned long address,
-					pmd_t *pmdp)
-{
-	BUILD_BUG();
-	return *pmdp;
-}
-#define pmdp_collapse_flush pmdp_collapse_flush
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-#endif
-
-#ifndef __HAVE_ARCH_PGTABLE_DEPOSIT
-extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
-				       pgtable_t pgtable);
-#endif
-
-#ifndef __HAVE_ARCH_PGTABLE_WITHDRAW
-extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
-#endif
-
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-/*
- * This is an implementation of pmdp_establish() that is only suitable for an
- * architecture that doesn't have hardware dirty/accessed bits. In this case we
- * can't race with CPU which sets these bits and non-atomic aproach is fine.
- */
-static inline pmd_t generic_pmdp_establish(struct vm_area_struct *vma,
-		unsigned long address, pmd_t *pmdp, pmd_t pmd)
-{
-	pmd_t old_pmd = *pmdp;
-	set_pmd_at(vma->vm_mm, address, pmdp, pmd);
-	return old_pmd;
-}
-#endif
-
-#ifndef __HAVE_ARCH_PMDP_INVALIDATE
-extern pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
-			    pmd_t *pmdp);
-#endif
-
-#ifndef __HAVE_ARCH_PTE_SAME
-static inline int pte_same(pte_t pte_a, pte_t pte_b)
-{
-	return pte_val(pte_a) == pte_val(pte_b);
-}
-#endif
-
-#ifndef __HAVE_ARCH_PTE_UNUSED
-/*
- * Some architectures provide facilities to virtualization guests
- * so that they can flag allocated pages as unused. This allows the
- * host to transparently reclaim unused pages. This function returns
- * whether the pte's page is unused.
- */
-static inline int pte_unused(pte_t pte)
-{
-	return 0;
-}
-#endif
-
-#ifndef pte_access_permitted
-#define pte_access_permitted(pte, write) \
-	(pte_present(pte) && (!(write) || pte_write(pte)))
-#endif
-
-#ifndef pmd_access_permitted
-#define pmd_access_permitted(pmd, write) \
-	(pmd_present(pmd) && (!(write) || pmd_write(pmd)))
-#endif
-
-#ifndef pud_access_permitted
-#define pud_access_permitted(pud, write) \
-	(pud_present(pud) && (!(write) || pud_write(pud)))
-#endif
-
-#ifndef p4d_access_permitted
-#define p4d_access_permitted(p4d, write) \
-	(p4d_present(p4d) && (!(write) || p4d_write(p4d)))
-#endif
-
-#ifndef pgd_access_permitted
-#define pgd_access_permitted(pgd, write) \
-	(pgd_present(pgd) && (!(write) || pgd_write(pgd)))
-#endif
-
-#ifndef __HAVE_ARCH_PMD_SAME
-static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
-{
-	return pmd_val(pmd_a) == pmd_val(pmd_b);
-}
-
-static inline int pud_same(pud_t pud_a, pud_t pud_b)
-{
-	return pud_val(pud_a) == pud_val(pud_b);
-}
-#endif
-
-#ifndef __HAVE_ARCH_P4D_SAME
-static inline int p4d_same(p4d_t p4d_a, p4d_t p4d_b)
-{
-	return p4d_val(p4d_a) == p4d_val(p4d_b);
-}
-#endif
-
-#ifndef __HAVE_ARCH_PGD_SAME
-static inline int pgd_same(pgd_t pgd_a, pgd_t pgd_b)
-{
-	return pgd_val(pgd_a) == pgd_val(pgd_b);
-}
-#endif
-
-/*
- * Use set_p*_safe(), and elide TLB flushing, when confident that *no*
- * TLB flush will be required as a result of the "set". For example, use
- * in scenarios where it is known ahead of time that the routine is
- * setting non-present entries, or re-setting an existing entry to the
- * same value. Otherwise, use the typical "set" helpers and flush the
- * TLB.
- */
-#define set_pte_safe(ptep, pte) \
-({ \
-	WARN_ON_ONCE(pte_present(*ptep) && !pte_same(*ptep, pte)); \
-	set_pte(ptep, pte); \
-})
-
-#define set_pmd_safe(pmdp, pmd) \
-({ \
-	WARN_ON_ONCE(pmd_present(*pmdp) && !pmd_same(*pmdp, pmd)); \
-	set_pmd(pmdp, pmd); \
-})
-
-#define set_pud_safe(pudp, pud) \
-({ \
-	WARN_ON_ONCE(pud_present(*pudp) && !pud_same(*pudp, pud)); \
-	set_pud(pudp, pud); \
-})
-
-#define set_p4d_safe(p4dp, p4d) \
-({ \
-	WARN_ON_ONCE(p4d_present(*p4dp) && !p4d_same(*p4dp, p4d)); \
-	set_p4d(p4dp, p4d); \
-})
-
-#define set_pgd_safe(pgdp, pgd) \
-({ \
-	WARN_ON_ONCE(pgd_present(*pgdp) && !pgd_same(*pgdp, pgd)); \
-	set_pgd(pgdp, pgd); \
-})
-
-#ifndef __HAVE_ARCH_DO_SWAP_PAGE
-/*
- * Some architectures support metadata associated with a page. When a
- * page is being swapped out, this metadata must be saved so it can be
- * restored when the page is swapped back in. SPARC M7 and newer
- * processors support an ADI (Application Data Integrity) tag for the
- * page as metadata for the page. arch_do_swap_page() can restore this
- * metadata when a page is swapped back in.
- */
-static inline void arch_do_swap_page(struct mm_struct *mm,
-				     struct vm_area_struct *vma,
-				     unsigned long addr,
-				     pte_t pte, pte_t oldpte)
-{
-
-}
-#endif
-
-#ifndef __HAVE_ARCH_UNMAP_ONE
-/*
- * Some architectures support metadata associated with a page. When a
- * page is being swapped out, this metadata must be saved so it can be
- * restored when the page is swapped back in. SPARC M7 and newer
- * processors support an ADI (Application Data Integrity) tag for the
- * page as metadata for the page. arch_unmap_one() can save this
- * metadata on a swap-out of a page.
- */
-static inline int arch_unmap_one(struct mm_struct *mm,
-				  struct vm_area_struct *vma,
-				  unsigned long addr,
-				  pte_t orig_pte)
-{
-	return 0;
-}
-#endif
-
-#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
-#define pgd_offset_gate(mm, addr)	pgd_offset(mm, addr)
-#endif
-
-#ifndef __HAVE_ARCH_MOVE_PTE
-#define move_pte(pte, prot, old_addr, new_addr)	(pte)
-#endif
-
-#ifndef pte_accessible
-# define pte_accessible(mm, pte)	((void)(pte), 1)
-#endif
-
-#ifndef flush_tlb_fix_spurious_fault
-#define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address)
-#endif
-
-#ifndef pgprot_nx
-#define pgprot_nx(prot)	(prot)
-#endif
-
-#ifndef pgprot_noncached
-#define pgprot_noncached(prot)	(prot)
-#endif
-
-#ifndef pgprot_writecombine
-#define pgprot_writecombine pgprot_noncached
-#endif
-
-#ifndef pgprot_writethrough
-#define pgprot_writethrough pgprot_noncached
-#endif
-
-#ifndef pgprot_device
-#define pgprot_device pgprot_noncached
-#endif
-
-#ifndef pgprot_modify
-#define pgprot_modify pgprot_modify
-static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
-{
-	if (pgprot_val(oldprot) == pgprot_val(pgprot_noncached(oldprot)))
-		newprot = pgprot_noncached(newprot);
-	if (pgprot_val(oldprot) == pgprot_val(pgprot_writecombine(oldprot)))
-		newprot = pgprot_writecombine(newprot);
-	if (pgprot_val(oldprot) == pgprot_val(pgprot_device(oldprot)))
-		newprot = pgprot_device(newprot);
-	return newprot;
-}
-#endif
-
-/*
- * When walking page tables, get the address of the next boundary,
- * or the end address of the range if that comes earlier.  Although no
- * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
- */
-
-#define pgd_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;	\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#ifndef p4d_addr_end
-#define p4d_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + P4D_SIZE) & P4D_MASK;	\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-#endif
-
-#ifndef pud_addr_end
-#define pud_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK;	\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-#endif
-
-#ifndef pmd_addr_end
-#define pmd_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;	\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-#endif
-
-/*
- * When walking page tables, we usually want to skip any p?d_none entries;
- * and any p?d_bad entries - reporting the error before resetting to none.
- * Do the tests inline, but report and clear the bad entry in mm/memory.c.
- */
-void pgd_clear_bad(pgd_t *);
-
-#ifndef __PAGETABLE_P4D_FOLDED
-void p4d_clear_bad(p4d_t *);
-#else
-#define p4d_clear_bad(p4d)        do { } while (0)
-#endif
-
-#ifndef __PAGETABLE_PUD_FOLDED
-void pud_clear_bad(pud_t *);
-#else
-#define pud_clear_bad(p4d)        do { } while (0)
-#endif
-
-void pmd_clear_bad(pmd_t *);
-
-static inline int pgd_none_or_clear_bad(pgd_t *pgd)
-{
-	if (pgd_none(*pgd))
-		return 1;
-	if (unlikely(pgd_bad(*pgd))) {
-		pgd_clear_bad(pgd);
-		return 1;
-	}
-	return 0;
-}
-
-static inline int p4d_none_or_clear_bad(p4d_t *p4d)
-{
-	if (p4d_none(*p4d))
-		return 1;
-	if (unlikely(p4d_bad(*p4d))) {
-		p4d_clear_bad(p4d);
-		return 1;
-	}
-	return 0;
-}
-
-static inline int pud_none_or_clear_bad(pud_t *pud)
-{
-	if (pud_none(*pud))
-		return 1;
-	if (unlikely(pud_bad(*pud))) {
-		pud_clear_bad(pud);
-		return 1;
-	}
-	return 0;
-}
-
-static inline int pmd_none_or_clear_bad(pmd_t *pmd)
-{
-	if (pmd_none(*pmd))
-		return 1;
-	if (unlikely(pmd_bad(*pmd))) {
-		pmd_clear_bad(pmd);
-		return 1;
-	}
-	return 0;
-}
-
-static inline pte_t __ptep_modify_prot_start(struct vm_area_struct *vma,
-					     unsigned long addr,
-					     pte_t *ptep)
-{
-	/*
-	 * Get the current pte state, but zero it out to make it
-	 * non-present, preventing the hardware from asynchronously
-	 * updating it.
-	 */
-	return ptep_get_and_clear(vma->vm_mm, addr, ptep);
-}
-
-static inline void __ptep_modify_prot_commit(struct vm_area_struct *vma,
-					     unsigned long addr,
-					     pte_t *ptep, pte_t pte)
-{
-	/*
-	 * The pte is non-present, so there's no hardware state to
-	 * preserve.
-	 */
-	set_pte_at(vma->vm_mm, addr, ptep, pte);
-}
-
-#ifndef __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
-/*
- * Start a pte protection read-modify-write transaction, which
- * protects against asynchronous hardware modifications to the pte.
- * The intention is not to prevent the hardware from making pte
- * updates, but to prevent any updates it may make from being lost.
- *
- * This does not protect against other software modifications of the
- * pte; the appropriate pte lock must be held over the transation.
- *
- * Note that this interface is intended to be batchable, meaning that
- * ptep_modify_prot_commit may not actually update the pte, but merely
- * queue the update to be done at some later time.  The update must be
- * actually committed before the pte lock is released, however.
- */
-static inline pte_t ptep_modify_prot_start(struct vm_area_struct *vma,
-					   unsigned long addr,
-					   pte_t *ptep)
-{
-	return __ptep_modify_prot_start(vma, addr, ptep);
-}
-
-/*
- * Commit an update to a pte, leaving any hardware-controlled bits in
- * the PTE unmodified.
- */
-static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,
-					   unsigned long addr,
-					   pte_t *ptep, pte_t old_pte, pte_t pte)
-{
-	__ptep_modify_prot_commit(vma, addr, ptep, pte);
-}
-#endif /* __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION */
-#endif /* CONFIG_MMU */
-
-/*
- * No-op macros that just return the current protection value. Defined here
- * because these macros can be used used even if CONFIG_MMU is not defined.
- */
-#ifndef pgprot_encrypted
-#define pgprot_encrypted(prot)	(prot)
-#endif
-
-#ifndef pgprot_decrypted
-#define pgprot_decrypted(prot)	(prot)
-#endif
-
-/*
- * A facility to provide lazy MMU batching.  This allows PTE updates and
- * page invalidations to be delayed until a call to leave lazy MMU mode
- * is issued.  Some architectures may benefit from doing this, and it is
- * beneficial for both shadow and direct mode hypervisors, which may batch
- * the PTE updates which happen during this window.  Note that using this
- * interface requires that read hazards be removed from the code.  A read
- * hazard could result in the direct mode hypervisor case, since the actual
- * write to the page tables may not yet have taken place, so reads though
- * a raw PTE pointer after it has been modified are not guaranteed to be
- * up to date.  This mode can only be entered and left under the protection of
- * the page table locks for all page tables which may be modified.  In the UP
- * case, this is required so that preemption is disabled, and in the SMP case,
- * it must synchronize the delayed page table writes properly on other CPUs.
- */
-#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
-#define arch_enter_lazy_mmu_mode()	do {} while (0)
-#define arch_leave_lazy_mmu_mode()	do {} while (0)
-#define arch_flush_lazy_mmu_mode()	do {} while (0)
-#endif
-
-/*
- * A facility to provide batching of the reload of page tables and
- * other process state with the actual context switch code for
- * paravirtualized guests.  By convention, only one of the batched
- * update (lazy) modes (CPU, MMU) should be active at any given time,
- * entry should never be nested, and entry and exits should always be
- * paired.  This is for sanity of maintaining and reasoning about the
- * kernel code.  In this case, the exit (end of the context switch) is
- * in architecture-specific code, and so doesn't need a generic
- * definition.
- */
-#ifndef __HAVE_ARCH_START_CONTEXT_SWITCH
-#define arch_start_context_switch(prev)	do {} while (0)
-#endif
-
-#ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
-#ifndef CONFIG_ARCH_ENABLE_THP_MIGRATION
-static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd)
-{
-	return pmd;
-}
-
-static inline int pmd_swp_soft_dirty(pmd_t pmd)
-{
-	return 0;
-}
-
-static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd)
-{
-	return pmd;
-}
-#endif
-#else /* !CONFIG_HAVE_ARCH_SOFT_DIRTY */
-static inline int pte_soft_dirty(pte_t pte)
-{
-	return 0;
-}
-
-static inline int pmd_soft_dirty(pmd_t pmd)
-{
-	return 0;
-}
-
-static inline pte_t pte_mksoft_dirty(pte_t pte)
-{
-	return pte;
-}
-
-static inline pmd_t pmd_mksoft_dirty(pmd_t pmd)
-{
-	return pmd;
-}
-
-static inline pte_t pte_clear_soft_dirty(pte_t pte)
-{
-	return pte;
-}
-
-static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd)
-{
-	return pmd;
-}
-
-static inline pte_t pte_swp_mksoft_dirty(pte_t pte)
-{
-	return pte;
-}
-
-static inline int pte_swp_soft_dirty(pte_t pte)
-{
-	return 0;
-}
-
-static inline pte_t pte_swp_clear_soft_dirty(pte_t pte)
-{
-	return pte;
-}
-
-static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd)
-{
-	return pmd;
-}
-
-static inline int pmd_swp_soft_dirty(pmd_t pmd)
-{
-	return 0;
-}
-
-static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd)
-{
-	return pmd;
-}
-#endif
-
-#ifndef __HAVE_PFNMAP_TRACKING
-/*
- * Interfaces that can be used by architecture code to keep track of
- * memory type of pfn mappings specified by the remap_pfn_range,
- * vmf_insert_pfn.
- */
-
-/*
- * track_pfn_remap is called when a _new_ pfn mapping is being established
- * by remap_pfn_range() for physical range indicated by pfn and size.
- */
-static inline int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
-				  unsigned long pfn, unsigned long addr,
-				  unsigned long size)
-{
-	return 0;
-}
-
-/*
- * track_pfn_insert is called when a _new_ single pfn is established
- * by vmf_insert_pfn().
- */
-static inline void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
-				    pfn_t pfn)
-{
-}
-
-/*
- * track_pfn_copy is called when vma that is covering the pfnmap gets
- * copied through copy_page_range().
- */
-static inline int track_pfn_copy(struct vm_area_struct *vma)
-{
-	return 0;
-}
-
-/*
- * untrack_pfn is called while unmapping a pfnmap for a region.
- * untrack can be called for a specific region indicated by pfn and size or
- * can be for the entire vma (in which case pfn, size are zero).
- */
-static inline void untrack_pfn(struct vm_area_struct *vma,
-			       unsigned long pfn, unsigned long size)
-{
-}
-
-/*
- * untrack_pfn_moved is called while mremapping a pfnmap for a new region.
- */
-static inline void untrack_pfn_moved(struct vm_area_struct *vma)
-{
-}
-#else
-extern int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
-			   unsigned long pfn, unsigned long addr,
-			   unsigned long size);
-extern void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
-			     pfn_t pfn);
-extern int track_pfn_copy(struct vm_area_struct *vma);
-extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
-			unsigned long size);
-extern void untrack_pfn_moved(struct vm_area_struct *vma);
-#endif
-
-#ifdef __HAVE_COLOR_ZERO_PAGE
-static inline int is_zero_pfn(unsigned long pfn)
-{
-	extern unsigned long zero_pfn;
-	unsigned long offset_from_zero_pfn = pfn - zero_pfn;
-	return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT);
-}
-
-#define my_zero_pfn(addr)	page_to_pfn(ZERO_PAGE(addr))
-
-#else
-static inline int is_zero_pfn(unsigned long pfn)
-{
-	extern unsigned long zero_pfn;
-	return pfn == zero_pfn;
-}
-
-static inline unsigned long my_zero_pfn(unsigned long addr)
-{
-	extern unsigned long zero_pfn;
-	return zero_pfn;
-}
-#endif
-
-#ifdef CONFIG_MMU
-
-#ifndef CONFIG_TRANSPARENT_HUGEPAGE
-static inline int pmd_trans_huge(pmd_t pmd)
-{
-	return 0;
-}
-#ifndef pmd_write
-static inline int pmd_write(pmd_t pmd)
-{
-	BUG();
-	return 0;
-}
-#endif /* pmd_write */
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
-
-#ifndef pud_write
-static inline int pud_write(pud_t pud)
-{
-	BUG();
-	return 0;
-}
-#endif /* pud_write */
-
-#if !defined(CONFIG_ARCH_HAS_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
-static inline int pmd_devmap(pmd_t pmd)
-{
-	return 0;
-}
-static inline int pud_devmap(pud_t pud)
-{
-	return 0;
-}
-static inline int pgd_devmap(pgd_t pgd)
-{
-	return 0;
-}
-#endif
-
-#if !defined(CONFIG_TRANSPARENT_HUGEPAGE) || \
-	(defined(CONFIG_TRANSPARENT_HUGEPAGE) && \
-	 !defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD))
-static inline int pud_trans_huge(pud_t pud)
-{
-	return 0;
-}
-#endif
-
-/* See pmd_none_or_trans_huge_or_clear_bad for discussion. */
-static inline int pud_none_or_trans_huge_or_dev_or_clear_bad(pud_t *pud)
-{
-	pud_t pudval = READ_ONCE(*pud);
-
-	if (pud_none(pudval) || pud_trans_huge(pudval) || pud_devmap(pudval))
-		return 1;
-	if (unlikely(pud_bad(pudval))) {
-		pud_clear_bad(pud);
-		return 1;
-	}
-	return 0;
-}
-
-/* See pmd_trans_unstable for discussion. */
-static inline int pud_trans_unstable(pud_t *pud)
-{
-#if defined(CONFIG_TRANSPARENT_HUGEPAGE) &&			\
-	defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)
-	return pud_none_or_trans_huge_or_dev_or_clear_bad(pud);
-#else
-	return 0;
-#endif
-}
-
-#ifndef pmd_read_atomic
-static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
-{
-	/*
-	 * Depend on compiler for an atomic pmd read. NOTE: this is
-	 * only going to work, if the pmdval_t isn't larger than
-	 * an unsigned long.
-	 */
-	return *pmdp;
-}
-#endif
-
-#ifndef arch_needs_pgtable_deposit
-#define arch_needs_pgtable_deposit() (false)
-#endif
-/*
- * This function is meant to be used by sites walking pagetables with
- * the mmap_sem hold in read mode to protect against MADV_DONTNEED and
- * transhuge page faults. MADV_DONTNEED can convert a transhuge pmd
- * into a null pmd and the transhuge page fault can convert a null pmd
- * into an hugepmd or into a regular pmd (if the hugepage allocation
- * fails). While holding the mmap_sem in read mode the pmd becomes
- * stable and stops changing under us only if it's not null and not a
- * transhuge pmd. When those races occurs and this function makes a
- * difference vs the standard pmd_none_or_clear_bad, the result is
- * undefined so behaving like if the pmd was none is safe (because it
- * can return none anyway). The compiler level barrier() is critically
- * important to compute the two checks atomically on the same pmdval.
- *
- * For 32bit kernels with a 64bit large pmd_t this automatically takes
- * care of reading the pmd atomically to avoid SMP race conditions
- * against pmd_populate() when the mmap_sem is hold for reading by the
- * caller (a special atomic read not done by "gcc" as in the generic
- * version above, is also needed when THP is disabled because the page
- * fault can populate the pmd from under us).
- */
-static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
-{
-	pmd_t pmdval = pmd_read_atomic(pmd);
-	/*
-	 * The barrier will stabilize the pmdval in a register or on
-	 * the stack so that it will stop changing under the code.
-	 *
-	 * When CONFIG_TRANSPARENT_HUGEPAGE=y on x86 32bit PAE,
-	 * pmd_read_atomic is allowed to return a not atomic pmdval
-	 * (for example pointing to an hugepage that has never been
-	 * mapped in the pmd). The below checks will only care about
-	 * the low part of the pmd with 32bit PAE x86 anyway, with the
-	 * exception of pmd_none(). So the important thing is that if
-	 * the low part of the pmd is found null, the high part will
-	 * be also null or the pmd_none() check below would be
-	 * confused.
-	 */
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	barrier();
-#endif
-	/*
-	 * !pmd_present() checks for pmd migration entries
-	 *
-	 * The complete check uses is_pmd_migration_entry() in linux/swapops.h
-	 * But using that requires moving current function and pmd_trans_unstable()
-	 * to linux/swapops.h to resovle dependency, which is too much code move.
-	 *
-	 * !pmd_present() is equivalent to is_pmd_migration_entry() currently,
-	 * because !pmd_present() pages can only be under migration not swapped
-	 * out.
-	 *
-	 * pmd_none() is preseved for future condition checks on pmd migration
-	 * entries and not confusing with this function name, although it is
-	 * redundant with !pmd_present().
-	 */
-	if (pmd_none(pmdval) || pmd_trans_huge(pmdval) ||
-		(IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION) && !pmd_present(pmdval)))
-		return 1;
-	if (unlikely(pmd_bad(pmdval))) {
-		pmd_clear_bad(pmd);
-		return 1;
-	}
-	return 0;
-}
-
-/*
- * This is a noop if Transparent Hugepage Support is not built into
- * the kernel. Otherwise it is equivalent to
- * pmd_none_or_trans_huge_or_clear_bad(), and shall only be called in
- * places that already verified the pmd is not none and they want to
- * walk ptes while holding the mmap sem in read mode (write mode don't
- * need this). If THP is not enabled, the pmd can't go away under the
- * code even if MADV_DONTNEED runs, but if THP is enabled we need to
- * run a pmd_trans_unstable before walking the ptes after
- * split_huge_pmd returns (because it may have run when the pmd become
- * null, but then a page fault can map in a THP and not a regular page).
- */
-static inline int pmd_trans_unstable(pmd_t *pmd)
-{
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	return pmd_none_or_trans_huge_or_clear_bad(pmd);
-#else
-	return 0;
-#endif
-}
-
-#ifndef CONFIG_NUMA_BALANCING
-/*
- * Technically a PTE can be PROTNONE even when not doing NUMA balancing but
- * the only case the kernel cares is for NUMA balancing and is only ever set
- * when the VMA is accessible. For PROT_NONE VMAs, the PTEs are not marked
- * _PAGE_PROTNONE so by by default, implement the helper as "always no". It
- * is the responsibility of the caller to distinguish between PROT_NONE
- * protections and NUMA hinting fault protections.
- */
-static inline int pte_protnone(pte_t pte)
-{
-	return 0;
-}
-
-static inline int pmd_protnone(pmd_t pmd)
-{
-	return 0;
-}
-#endif /* CONFIG_NUMA_BALANCING */
-
-#endif /* CONFIG_MMU */
-
-#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
-
-#ifndef __PAGETABLE_P4D_FOLDED
-int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot);
-int p4d_clear_huge(p4d_t *p4d);
-#else
-static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
-{
-	return 0;
-}
-static inline int p4d_clear_huge(p4d_t *p4d)
-{
-	return 0;
-}
-#endif /* !__PAGETABLE_P4D_FOLDED */
-
-int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot);
-int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);
-int pud_clear_huge(pud_t *pud);
-int pmd_clear_huge(pmd_t *pmd);
-int p4d_free_pud_page(p4d_t *p4d, unsigned long addr);
-int pud_free_pmd_page(pud_t *pud, unsigned long addr);
-int pmd_free_pte_page(pmd_t *pmd, unsigned long addr);
-#else	/* !CONFIG_HAVE_ARCH_HUGE_VMAP */
-static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
-{
-	return 0;
-}
-static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
-{
-	return 0;
-}
-static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
-{
-	return 0;
-}
-static inline int p4d_clear_huge(p4d_t *p4d)
-{
-	return 0;
-}
-static inline int pud_clear_huge(pud_t *pud)
-{
-	return 0;
-}
-static inline int pmd_clear_huge(pmd_t *pmd)
-{
-	return 0;
-}
-static inline int p4d_free_pud_page(p4d_t *p4d, unsigned long addr)
-{
-	return 0;
-}
-static inline int pud_free_pmd_page(pud_t *pud, unsigned long addr)
-{
-	return 0;
-}
-static inline int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)
-{
-	return 0;
-}
-#endif	/* CONFIG_HAVE_ARCH_HUGE_VMAP */
-
-#ifndef __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-/*
- * ARCHes with special requirements for evicting THP backing TLB entries can
- * implement this. Otherwise also, it can help optimize normal TLB flush in
- * THP regime. stock flush_tlb_range() typically has optimization to nuke the
- * entire TLB TLB if flush span is greater than a threshold, which will
- * likely be true for a single huge page. Thus a single thp flush will
- * invalidate the entire TLB which is not desitable.
- * e.g. see arch/arc: flush_pmd_tlb_range
- */
-#define flush_pmd_tlb_range(vma, addr, end)	flush_tlb_range(vma, addr, end)
-#define flush_pud_tlb_range(vma, addr, end)	flush_tlb_range(vma, addr, end)
-#else
-#define flush_pmd_tlb_range(vma, addr, end)	BUILD_BUG()
-#define flush_pud_tlb_range(vma, addr, end)	BUILD_BUG()
-#endif
-#endif
-
-struct file;
-int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
-			unsigned long size, pgprot_t *vma_prot);
-
-#ifndef CONFIG_X86_ESPFIX64
-static inline void init_espfix_bsp(void) { }
-#endif
-
-extern void __init pgtable_cache_init(void);
-
-#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
-static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
-{
-	return true;
-}
-
-static inline bool arch_has_pfn_modify_check(void)
-{
-	return false;
-}
-#endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */
-
-/*
- * Architecture PAGE_KERNEL_* fallbacks
- *
- * Some architectures don't define certain PAGE_KERNEL_* flags. This is either
- * because they really don't support them, or the port needs to be updated to
- * reflect the required functionality. Below are a set of relatively safe
- * fallbacks, as best effort, which we can count on in lieu of the architectures
- * not defining them on their own yet.
- */
-
-#ifndef PAGE_KERNEL_RO
-# define PAGE_KERNEL_RO PAGE_KERNEL
-#endif
-
-#ifndef PAGE_KERNEL_EXEC
-# define PAGE_KERNEL_EXEC PAGE_KERNEL
-#endif
-
-/*
- * Page Table Modification bits for pgtbl_mod_mask.
- *
- * These are used by the p?d_alloc_track*() set of functions an in the generic
- * vmalloc/ioremap code to track at which page-table levels entries have been
- * modified. Based on that the code can better decide when vmalloc and ioremap
- * mapping changes need to be synchronized to other page-tables in the system.
- */
-#define		__PGTBL_PGD_MODIFIED	0
-#define		__PGTBL_P4D_MODIFIED	1
-#define		__PGTBL_PUD_MODIFIED	2
-#define		__PGTBL_PMD_MODIFIED	3
-#define		__PGTBL_PTE_MODIFIED	4
-
-#define		PGTBL_PGD_MODIFIED	BIT(__PGTBL_PGD_MODIFIED)
-#define		PGTBL_P4D_MODIFIED	BIT(__PGTBL_P4D_MODIFIED)
-#define		PGTBL_PUD_MODIFIED	BIT(__PGTBL_PUD_MODIFIED)
-#define		PGTBL_PMD_MODIFIED	BIT(__PGTBL_PMD_MODIFIED)
-#define		PGTBL_PTE_MODIFIED	BIT(__PGTBL_PTE_MODIFIED)
-
-/* Page-Table Modification Mask */
-typedef unsigned int pgtbl_mod_mask;
-
-#endif /* !__ASSEMBLY__ */
-
-#ifndef io_remap_pfn_range
-#define io_remap_pfn_range remap_pfn_range
-#endif
-
-#ifndef has_transparent_hugepage
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-#define has_transparent_hugepage() 1
-#else
-#define has_transparent_hugepage() 0
-#endif
-#endif
-
-/*
- * On some architectures it depends on the mm if the p4d/pud or pmd
- * layer of the page table hierarchy is folded or not.
- */
-#ifndef mm_p4d_folded
-#define mm_p4d_folded(mm)	__is_defined(__PAGETABLE_P4D_FOLDED)
-#endif
-
-#ifndef mm_pud_folded
-#define mm_pud_folded(mm)	__is_defined(__PAGETABLE_PUD_FOLDED)
-#endif
-
-#ifndef mm_pmd_folded
-#define mm_pmd_folded(mm)	__is_defined(__PAGETABLE_PMD_FOLDED)
-#endif
-
-/*
- * p?d_leaf() - true if this entry is a final mapping to a physical address.
- * This differs from p?d_huge() by the fact that they are always available (if
- * the architecture supports large pages at the appropriate level) even
- * if CONFIG_HUGETLB_PAGE is not defined.
- * Only meaningful when called on a valid entry.
- */
-#ifndef pgd_leaf
-#define pgd_leaf(x)	0
-#endif
-#ifndef p4d_leaf
-#define p4d_leaf(x)	0
-#endif
-#ifndef pud_leaf
-#define pud_leaf(x)	0
-#endif
-#ifndef pmd_leaf
-#define pmd_leaf(x)	0
-#endif
-
-#endif /* _ASM_GENERIC_PGTABLE_H */
--- a/include/linux/crash_dump.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/crash_dump.h
@@ -7,7 +7,7 @@
 #include <linux/elf.h>
 #include <uapi/linux/vmcore.h>
 
-#include <asm/pgtable.h> /* for pgprot_t */
+#include <linux/pgtable.h> /* for pgprot_t */
 
 #ifdef CONFIG_CRASH_DUMP
 #define ELFCORE_ADDR_MAX	(-1ULL)
--- a/include/linux/dma-noncoherent.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/dma-noncoherent.h
@@ -3,7 +3,7 @@
 #define _LINUX_DMA_NONCOHERENT_H 1
 
 #include <linux/dma-mapping.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
 #include <asm/dma-coherence.h>
--- a/include/linux/hmm.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/hmm.h
@@ -10,7 +10,7 @@
 #define LINUX_HMM_H
 
 #include <linux/kconfig.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <linux/device.h>
 #include <linux/migrate.h>
--- a/include/linux/hugetlb.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/hugetlb.h
@@ -9,7 +9,7 @@
 #include <linux/cgroup.h>
 #include <linux/list.h>
 #include <linux/kref.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 struct ctl_table;
 struct user_struct;
--- a/include/linux/io-mapping.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/io-mapping.h
@@ -99,7 +99,7 @@ io_mapping_unmap(void __iomem *vaddr)
 #else
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 /* Create the io_mapping object*/
 static inline struct io_mapping *
--- a/include/linux/kasan.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/kasan.h
@@ -12,7 +12,7 @@ struct task_struct;
 #ifdef CONFIG_KASAN
 
 #include <asm/kasan.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 extern unsigned char kasan_early_shadow_page[PAGE_SIZE];
 extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE];
--- a/include/linux/mm.h~mm-introduce-include-linux-pgtableh
+++ a/include/linux/mm.h
@@ -92,7 +92,7 @@ extern int mmap_rnd_compat_bits __read_m
 #endif
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 
 /*
--- /dev/null
+++ a/include/linux/pgtable.h
@@ -0,0 +1,1323 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_PGTABLE_H
+#define _LINUX_PGTABLE_H
+
+#include <linux/pfn.h>
+#include <asm/pgtable.h>
+
+#ifndef __ASSEMBLY__
+#ifdef CONFIG_MMU
+
+#include <linux/mm_types.h>
+#include <linux/bug.h>
+#include <linux/errno.h>
+#include <asm-generic/pgtable_uffd.h>
+
+#if 5 - defined(__PAGETABLE_P4D_FOLDED) - defined(__PAGETABLE_PUD_FOLDED) - \
+	defined(__PAGETABLE_PMD_FOLDED) != CONFIG_PGTABLE_LEVELS
+#error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED
+#endif
+
+/*
+ * On almost all architectures and configurations, 0 can be used as the
+ * upper ceiling to free_pgtables(): on many architectures it has the same
+ * effect as using TASK_SIZE.  However, there is one configuration which
+ * must impose a more careful limit, to avoid freeing kernel pgtables.
+ */
+#ifndef USER_PGTABLES_CEILING
+#define USER_PGTABLES_CEILING	0UL
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+extern int ptep_set_access_flags(struct vm_area_struct *vma,
+				 unsigned long address, pte_t *ptep,
+				 pte_t entry, int dirty);
+#endif
+
+#ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+extern int pmdp_set_access_flags(struct vm_area_struct *vma,
+				 unsigned long address, pmd_t *pmdp,
+				 pmd_t entry, int dirty);
+extern int pudp_set_access_flags(struct vm_area_struct *vma,
+				 unsigned long address, pud_t *pudp,
+				 pud_t entry, int dirty);
+#else
+static inline int pmdp_set_access_flags(struct vm_area_struct *vma,
+					unsigned long address, pmd_t *pmdp,
+					pmd_t entry, int dirty)
+{
+	BUILD_BUG();
+	return 0;
+}
+static inline int pudp_set_access_flags(struct vm_area_struct *vma,
+					unsigned long address, pud_t *pudp,
+					pud_t entry, int dirty)
+{
+	BUILD_BUG();
+	return 0;
+}
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
+					    unsigned long address,
+					    pte_t *ptep)
+{
+	pte_t pte = *ptep;
+	int r = 1;
+	if (!pte_young(pte))
+		r = 0;
+	else
+		set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte));
+	return r;
+}
+#endif
+
+#ifndef __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
+					    unsigned long address,
+					    pmd_t *pmdp)
+{
+	pmd_t pmd = *pmdp;
+	int r = 1;
+	if (!pmd_young(pmd))
+		r = 0;
+	else
+		set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));
+	return r;
+}
+#else
+static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
+					    unsigned long address,
+					    pmd_t *pmdp)
+{
+	BUILD_BUG();
+	return 0;
+}
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
+int ptep_clear_flush_young(struct vm_area_struct *vma,
+			   unsigned long address, pte_t *ptep);
+#endif
+
+#ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+extern int pmdp_clear_flush_young(struct vm_area_struct *vma,
+				  unsigned long address, pmd_t *pmdp);
+#else
+/*
+ * Despite relevant to THP only, this API is called from generic rmap code
+ * under PageTransHuge(), hence needs a dummy implementation for !THP
+ */
+static inline int pmdp_clear_flush_young(struct vm_area_struct *vma,
+					 unsigned long address, pmd_t *pmdp)
+{
+	BUILD_BUG();
+	return 0;
+}
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
+static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
+				       unsigned long address,
+				       pte_t *ptep)
+{
+	pte_t pte = *ptep;
+	pte_clear(mm, address, ptep);
+	return pte;
+}
+#endif
+
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+#ifndef __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
+static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
+					    unsigned long address,
+					    pmd_t *pmdp)
+{
+	pmd_t pmd = *pmdp;
+	pmd_clear(pmdp);
+	return pmd;
+}
+#endif /* __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR */
+#ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR
+static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm,
+					    unsigned long address,
+					    pud_t *pudp)
+{
+	pud_t pud = *pudp;
+
+	pud_clear(pudp);
+	return pud;
+}
+#endif /* __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR */
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+#ifndef __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR_FULL
+static inline pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma,
+					    unsigned long address, pmd_t *pmdp,
+					    int full)
+{
+	return pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp);
+}
+#endif
+
+#ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR_FULL
+static inline pud_t pudp_huge_get_and_clear_full(struct mm_struct *mm,
+					    unsigned long address, pud_t *pudp,
+					    int full)
+{
+	return pudp_huge_get_and_clear(mm, address, pudp);
+}
+#endif
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+
+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
+static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
+					    unsigned long address, pte_t *ptep,
+					    int full)
+{
+	pte_t pte;
+	pte = ptep_get_and_clear(mm, address, ptep);
+	return pte;
+}
+#endif
+
+
+/*
+ * If two threads concurrently fault at the same page, the thread that
+ * won the race updates the PTE and its local TLB/Cache. The other thread
+ * gives up, simply does nothing, and continues; on architectures where
+ * software can update TLB,  local TLB can be updated here to avoid next page
+ * fault. This function updates TLB only, do nothing with cache or others.
+ * It is the difference with function update_mmu_cache.
+ */
+#ifndef __HAVE_ARCH_UPDATE_MMU_TLB
+static inline void update_mmu_tlb(struct vm_area_struct *vma,
+				unsigned long address, pte_t *ptep)
+{
+}
+#define __HAVE_ARCH_UPDATE_MMU_TLB
+#endif
+
+/*
+ * Some architectures may be able to avoid expensive synchronization
+ * primitives when modifications are made to PTE's which are already
+ * not present, or in the process of an address space destruction.
+ */
+#ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL
+static inline void pte_clear_not_present_full(struct mm_struct *mm,
+					      unsigned long address,
+					      pte_t *ptep,
+					      int full)
+{
+	pte_clear(mm, address, ptep);
+}
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
+extern pte_t ptep_clear_flush(struct vm_area_struct *vma,
+			      unsigned long address,
+			      pte_t *ptep);
+#endif
+
+#ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
+extern pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
+			      unsigned long address,
+			      pmd_t *pmdp);
+extern pud_t pudp_huge_clear_flush(struct vm_area_struct *vma,
+			      unsigned long address,
+			      pud_t *pudp);
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
+struct mm_struct;
+static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
+{
+	pte_t old_pte = *ptep;
+	set_pte_at(mm, address, ptep, pte_wrprotect(old_pte));
+}
+#endif
+
+/*
+ * On some architectures hardware does not set page access bit when accessing
+ * memory page, it is responsibilty of software setting this bit. It brings
+ * out extra page fault penalty to track page access bit. For optimization page
+ * access bit can be set during all page fault flow on these arches.
+ * To be differentiate with macro pte_mkyoung, this macro is used on platforms
+ * where software maintains page access bit.
+ */
+#ifndef pte_sw_mkyoung
+static inline pte_t pte_sw_mkyoung(pte_t pte)
+{
+	return pte;
+}
+#define pte_sw_mkyoung	pte_sw_mkyoung
+#endif
+
+#ifndef pte_savedwrite
+#define pte_savedwrite pte_write
+#endif
+
+#ifndef pte_mk_savedwrite
+#define pte_mk_savedwrite pte_mkwrite
+#endif
+
+#ifndef pte_clear_savedwrite
+#define pte_clear_savedwrite pte_wrprotect
+#endif
+
+#ifndef pmd_savedwrite
+#define pmd_savedwrite pmd_write
+#endif
+
+#ifndef pmd_mk_savedwrite
+#define pmd_mk_savedwrite pmd_mkwrite
+#endif
+
+#ifndef pmd_clear_savedwrite
+#define pmd_clear_savedwrite pmd_wrprotect
+#endif
+
+#ifndef __HAVE_ARCH_PMDP_SET_WRPROTECT
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+				      unsigned long address, pmd_t *pmdp)
+{
+	pmd_t old_pmd = *pmdp;
+	set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd));
+}
+#else
+static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+				      unsigned long address, pmd_t *pmdp)
+{
+	BUILD_BUG();
+}
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+#endif
+#ifndef __HAVE_ARCH_PUDP_SET_WRPROTECT
+#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
+static inline void pudp_set_wrprotect(struct mm_struct *mm,
+				      unsigned long address, pud_t *pudp)
+{
+	pud_t old_pud = *pudp;
+
+	set_pud_at(mm, address, pudp, pud_wrprotect(old_pud));
+}
+#else
+static inline void pudp_set_wrprotect(struct mm_struct *mm,
+				      unsigned long address, pud_t *pudp)
+{
+	BUILD_BUG();
+}
+#endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
+#endif
+
+#ifndef pmdp_collapse_flush
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
+				 unsigned long address, pmd_t *pmdp);
+#else
+static inline pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
+					unsigned long address,
+					pmd_t *pmdp)
+{
+	BUILD_BUG();
+	return *pmdp;
+}
+#define pmdp_collapse_flush pmdp_collapse_flush
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+#endif
+
+#ifndef __HAVE_ARCH_PGTABLE_DEPOSIT
+extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
+				       pgtable_t pgtable);
+#endif
+
+#ifndef __HAVE_ARCH_PGTABLE_WITHDRAW
+extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
+#endif
+
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+/*
+ * This is an implementation of pmdp_establish() that is only suitable for an
+ * architecture that doesn't have hardware dirty/accessed bits. In this case we
+ * can't race with CPU which sets these bits and non-atomic aproach is fine.
+ */
+static inline pmd_t generic_pmdp_establish(struct vm_area_struct *vma,
+		unsigned long address, pmd_t *pmdp, pmd_t pmd)
+{
+	pmd_t old_pmd = *pmdp;
+	set_pmd_at(vma->vm_mm, address, pmdp, pmd);
+	return old_pmd;
+}
+#endif
+
+#ifndef __HAVE_ARCH_PMDP_INVALIDATE
+extern pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
+			    pmd_t *pmdp);
+#endif
+
+#ifndef __HAVE_ARCH_PTE_SAME
+static inline int pte_same(pte_t pte_a, pte_t pte_b)
+{
+	return pte_val(pte_a) == pte_val(pte_b);
+}
+#endif
+
+#ifndef __HAVE_ARCH_PTE_UNUSED
+/*
+ * Some architectures provide facilities to virtualization guests
+ * so that they can flag allocated pages as unused. This allows the
+ * host to transparently reclaim unused pages. This function returns
+ * whether the pte's page is unused.
+ */
+static inline int pte_unused(pte_t pte)
+{
+	return 0;
+}
+#endif
+
+#ifndef pte_access_permitted
+#define pte_access_permitted(pte, write) \
+	(pte_present(pte) && (!(write) || pte_write(pte)))
+#endif
+
+#ifndef pmd_access_permitted
+#define pmd_access_permitted(pmd, write) \
+	(pmd_present(pmd) && (!(write) || pmd_write(pmd)))
+#endif
+
+#ifndef pud_access_permitted
+#define pud_access_permitted(pud, write) \
+	(pud_present(pud) && (!(write) || pud_write(pud)))
+#endif
+
+#ifndef p4d_access_permitted
+#define p4d_access_permitted(p4d, write) \
+	(p4d_present(p4d) && (!(write) || p4d_write(p4d)))
+#endif
+
+#ifndef pgd_access_permitted
+#define pgd_access_permitted(pgd, write) \
+	(pgd_present(pgd) && (!(write) || pgd_write(pgd)))
+#endif
+
+#ifndef __HAVE_ARCH_PMD_SAME
+static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
+{
+	return pmd_val(pmd_a) == pmd_val(pmd_b);
+}
+
+static inline int pud_same(pud_t pud_a, pud_t pud_b)
+{
+	return pud_val(pud_a) == pud_val(pud_b);
+}
+#endif
+
+#ifndef __HAVE_ARCH_P4D_SAME
+static inline int p4d_same(p4d_t p4d_a, p4d_t p4d_b)
+{
+	return p4d_val(p4d_a) == p4d_val(p4d_b);
+}
+#endif
+
+#ifndef __HAVE_ARCH_PGD_SAME
+static inline int pgd_same(pgd_t pgd_a, pgd_t pgd_b)
+{
+	return pgd_val(pgd_a) == pgd_val(pgd_b);
+}
+#endif
+
+/*
+ * Use set_p*_safe(), and elide TLB flushing, when confident that *no*
+ * TLB flush will be required as a result of the "set". For example, use
+ * in scenarios where it is known ahead of time that the routine is
+ * setting non-present entries, or re-setting an existing entry to the
+ * same value. Otherwise, use the typical "set" helpers and flush the
+ * TLB.
+ */
+#define set_pte_safe(ptep, pte) \
+({ \
+	WARN_ON_ONCE(pte_present(*ptep) && !pte_same(*ptep, pte)); \
+	set_pte(ptep, pte); \
+})
+
+#define set_pmd_safe(pmdp, pmd) \
+({ \
+	WARN_ON_ONCE(pmd_present(*pmdp) && !pmd_same(*pmdp, pmd)); \
+	set_pmd(pmdp, pmd); \
+})
+
+#define set_pud_safe(pudp, pud) \
+({ \
+	WARN_ON_ONCE(pud_present(*pudp) && !pud_same(*pudp, pud)); \
+	set_pud(pudp, pud); \
+})
+
+#define set_p4d_safe(p4dp, p4d) \
+({ \
+	WARN_ON_ONCE(p4d_present(*p4dp) && !p4d_same(*p4dp, p4d)); \
+	set_p4d(p4dp, p4d); \
+})
+
+#define set_pgd_safe(pgdp, pgd) \
+({ \
+	WARN_ON_ONCE(pgd_present(*pgdp) && !pgd_same(*pgdp, pgd)); \
+	set_pgd(pgdp, pgd); \
+})
+
+#ifndef __HAVE_ARCH_DO_SWAP_PAGE
+/*
+ * Some architectures support metadata associated with a page. When a
+ * page is being swapped out, this metadata must be saved so it can be
+ * restored when the page is swapped back in. SPARC M7 and newer
+ * processors support an ADI (Application Data Integrity) tag for the
+ * page as metadata for the page. arch_do_swap_page() can restore this
+ * metadata when a page is swapped back in.
+ */
+static inline void arch_do_swap_page(struct mm_struct *mm,
+				     struct vm_area_struct *vma,
+				     unsigned long addr,
+				     pte_t pte, pte_t oldpte)
+{
+
+}
+#endif
+
+#ifndef __HAVE_ARCH_UNMAP_ONE
+/*
+ * Some architectures support metadata associated with a page. When a
+ * page is being swapped out, this metadata must be saved so it can be
+ * restored when the page is swapped back in. SPARC M7 and newer
+ * processors support an ADI (Application Data Integrity) tag for the
+ * page as metadata for the page. arch_unmap_one() can save this
+ * metadata on a swap-out of a page.
+ */
+static inline int arch_unmap_one(struct mm_struct *mm,
+				  struct vm_area_struct *vma,
+				  unsigned long addr,
+				  pte_t orig_pte)
+{
+	return 0;
+}
+#endif
+
+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
+#define pgd_offset_gate(mm, addr)	pgd_offset(mm, addr)
+#endif
+
+#ifndef __HAVE_ARCH_MOVE_PTE
+#define move_pte(pte, prot, old_addr, new_addr)	(pte)
+#endif
+
+#ifndef pte_accessible
+# define pte_accessible(mm, pte)	((void)(pte), 1)
+#endif
+
+#ifndef flush_tlb_fix_spurious_fault
+#define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address)
+#endif
+
+#ifndef pgprot_nx
+#define pgprot_nx(prot)	(prot)
+#endif
+
+#ifndef pgprot_noncached
+#define pgprot_noncached(prot)	(prot)
+#endif
+
+#ifndef pgprot_writecombine
+#define pgprot_writecombine pgprot_noncached
+#endif
+
+#ifndef pgprot_writethrough
+#define pgprot_writethrough pgprot_noncached
+#endif
+
+#ifndef pgprot_device
+#define pgprot_device pgprot_noncached
+#endif
+
+#ifndef pgprot_modify
+#define pgprot_modify pgprot_modify
+static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
+{
+	if (pgprot_val(oldprot) == pgprot_val(pgprot_noncached(oldprot)))
+		newprot = pgprot_noncached(newprot);
+	if (pgprot_val(oldprot) == pgprot_val(pgprot_writecombine(oldprot)))
+		newprot = pgprot_writecombine(newprot);
+	if (pgprot_val(oldprot) == pgprot_val(pgprot_device(oldprot)))
+		newprot = pgprot_device(newprot);
+	return newprot;
+}
+#endif
+
+/*
+ * When walking page tables, get the address of the next boundary,
+ * or the end address of the range if that comes earlier.  Although no
+ * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
+ */
+
+#define pgd_addr_end(addr, end)						\
+({	unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;	\
+	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
+})
+
+#ifndef p4d_addr_end
+#define p4d_addr_end(addr, end)						\
+({	unsigned long __boundary = ((addr) + P4D_SIZE) & P4D_MASK;	\
+	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
+})
+#endif
+
+#ifndef pud_addr_end
+#define pud_addr_end(addr, end)						\
+({	unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK;	\
+	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
+})
+#endif
+
+#ifndef pmd_addr_end
+#define pmd_addr_end(addr, end)						\
+({	unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;	\
+	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
+})
+#endif
+
+/*
+ * When walking page tables, we usually want to skip any p?d_none entries;
+ * and any p?d_bad entries - reporting the error before resetting to none.
+ * Do the tests inline, but report and clear the bad entry in mm/memory.c.
+ */
+void pgd_clear_bad(pgd_t *);
+
+#ifndef __PAGETABLE_P4D_FOLDED
+void p4d_clear_bad(p4d_t *);
+#else
+#define p4d_clear_bad(p4d)        do { } while (0)
+#endif
+
+#ifndef __PAGETABLE_PUD_FOLDED
+void pud_clear_bad(pud_t *);
+#else
+#define pud_clear_bad(p4d)        do { } while (0)
+#endif
+
+void pmd_clear_bad(pmd_t *);
+
+static inline int pgd_none_or_clear_bad(pgd_t *pgd)
+{
+	if (pgd_none(*pgd))
+		return 1;
+	if (unlikely(pgd_bad(*pgd))) {
+		pgd_clear_bad(pgd);
+		return 1;
+	}
+	return 0;
+}
+
+static inline int p4d_none_or_clear_bad(p4d_t *p4d)
+{
+	if (p4d_none(*p4d))
+		return 1;
+	if (unlikely(p4d_bad(*p4d))) {
+		p4d_clear_bad(p4d);
+		return 1;
+	}
+	return 0;
+}
+
+static inline int pud_none_or_clear_bad(pud_t *pud)
+{
+	if (pud_none(*pud))
+		return 1;
+	if (unlikely(pud_bad(*pud))) {
+		pud_clear_bad(pud);
+		return 1;
+	}
+	return 0;
+}
+
+static inline int pmd_none_or_clear_bad(pmd_t *pmd)
+{
+	if (pmd_none(*pmd))
+		return 1;
+	if (unlikely(pmd_bad(*pmd))) {
+		pmd_clear_bad(pmd);
+		return 1;
+	}
+	return 0;
+}
+
+static inline pte_t __ptep_modify_prot_start(struct vm_area_struct *vma,
+					     unsigned long addr,
+					     pte_t *ptep)
+{
+	/*
+	 * Get the current pte state, but zero it out to make it
+	 * non-present, preventing the hardware from asynchronously
+	 * updating it.
+	 */
+	return ptep_get_and_clear(vma->vm_mm, addr, ptep);
+}
+
+static inline void __ptep_modify_prot_commit(struct vm_area_struct *vma,
+					     unsigned long addr,
+					     pte_t *ptep, pte_t pte)
+{
+	/*
+	 * The pte is non-present, so there's no hardware state to
+	 * preserve.
+	 */
+	set_pte_at(vma->vm_mm, addr, ptep, pte);
+}
+
+#ifndef __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
+/*
+ * Start a pte protection read-modify-write transaction, which
+ * protects against asynchronous hardware modifications to the pte.
+ * The intention is not to prevent the hardware from making pte
+ * updates, but to prevent any updates it may make from being lost.
+ *
+ * This does not protect against other software modifications of the
+ * pte; the appropriate pte lock must be held over the transation.
+ *
+ * Note that this interface is intended to be batchable, meaning that
+ * ptep_modify_prot_commit may not actually update the pte, but merely
+ * queue the update to be done at some later time.  The update must be
+ * actually committed before the pte lock is released, however.
+ */
+static inline pte_t ptep_modify_prot_start(struct vm_area_struct *vma,
+					   unsigned long addr,
+					   pte_t *ptep)
+{
+	return __ptep_modify_prot_start(vma, addr, ptep);
+}
+
+/*
+ * Commit an update to a pte, leaving any hardware-controlled bits in
+ * the PTE unmodified.
+ */
+static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,
+					   unsigned long addr,
+					   pte_t *ptep, pte_t old_pte, pte_t pte)
+{
+	__ptep_modify_prot_commit(vma, addr, ptep, pte);
+}
+#endif /* __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION */
+#endif /* CONFIG_MMU */
+
+/*
+ * No-op macros that just return the current protection value. Defined here
+ * because these macros can be used used even if CONFIG_MMU is not defined.
+ */
+#ifndef pgprot_encrypted
+#define pgprot_encrypted(prot)	(prot)
+#endif
+
+#ifndef pgprot_decrypted
+#define pgprot_decrypted(prot)	(prot)
+#endif
+
+/*
+ * A facility to provide lazy MMU batching.  This allows PTE updates and
+ * page invalidations to be delayed until a call to leave lazy MMU mode
+ * is issued.  Some architectures may benefit from doing this, and it is
+ * beneficial for both shadow and direct mode hypervisors, which may batch
+ * the PTE updates which happen during this window.  Note that using this
+ * interface requires that read hazards be removed from the code.  A read
+ * hazard could result in the direct mode hypervisor case, since the actual
+ * write to the page tables may not yet have taken place, so reads though
+ * a raw PTE pointer after it has been modified are not guaranteed to be
+ * up to date.  This mode can only be entered and left under the protection of
+ * the page table locks for all page tables which may be modified.  In the UP
+ * case, this is required so that preemption is disabled, and in the SMP case,
+ * it must synchronize the delayed page table writes properly on other CPUs.
+ */
+#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
+#define arch_enter_lazy_mmu_mode()	do {} while (0)
+#define arch_leave_lazy_mmu_mode()	do {} while (0)
+#define arch_flush_lazy_mmu_mode()	do {} while (0)
+#endif
+
+/*
+ * A facility to provide batching of the reload of page tables and
+ * other process state with the actual context switch code for
+ * paravirtualized guests.  By convention, only one of the batched
+ * update (lazy) modes (CPU, MMU) should be active at any given time,
+ * entry should never be nested, and entry and exits should always be
+ * paired.  This is for sanity of maintaining and reasoning about the
+ * kernel code.  In this case, the exit (end of the context switch) is
+ * in architecture-specific code, and so doesn't need a generic
+ * definition.
+ */
+#ifndef __HAVE_ARCH_START_CONTEXT_SWITCH
+#define arch_start_context_switch(prev)	do {} while (0)
+#endif
+
+#ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
+#ifndef CONFIG_ARCH_ENABLE_THP_MIGRATION
+static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd)
+{
+	return pmd;
+}
+
+static inline int pmd_swp_soft_dirty(pmd_t pmd)
+{
+	return 0;
+}
+
+static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd)
+{
+	return pmd;
+}
+#endif
+#else /* !CONFIG_HAVE_ARCH_SOFT_DIRTY */
+static inline int pte_soft_dirty(pte_t pte)
+{
+	return 0;
+}
+
+static inline int pmd_soft_dirty(pmd_t pmd)
+{
+	return 0;
+}
+
+static inline pte_t pte_mksoft_dirty(pte_t pte)
+{
+	return pte;
+}
+
+static inline pmd_t pmd_mksoft_dirty(pmd_t pmd)
+{
+	return pmd;
+}
+
+static inline pte_t pte_clear_soft_dirty(pte_t pte)
+{
+	return pte;
+}
+
+static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd)
+{
+	return pmd;
+}
+
+static inline pte_t pte_swp_mksoft_dirty(pte_t pte)
+{
+	return pte;
+}
+
+static inline int pte_swp_soft_dirty(pte_t pte)
+{
+	return 0;
+}
+
+static inline pte_t pte_swp_clear_soft_dirty(pte_t pte)
+{
+	return pte;
+}
+
+static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd)
+{
+	return pmd;
+}
+
+static inline int pmd_swp_soft_dirty(pmd_t pmd)
+{
+	return 0;
+}
+
+static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd)
+{
+	return pmd;
+}
+#endif
+
+#ifndef __HAVE_PFNMAP_TRACKING
+/*
+ * Interfaces that can be used by architecture code to keep track of
+ * memory type of pfn mappings specified by the remap_pfn_range,
+ * vmf_insert_pfn.
+ */
+
+/*
+ * track_pfn_remap is called when a _new_ pfn mapping is being established
+ * by remap_pfn_range() for physical range indicated by pfn and size.
+ */
+static inline int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
+				  unsigned long pfn, unsigned long addr,
+				  unsigned long size)
+{
+	return 0;
+}
+
+/*
+ * track_pfn_insert is called when a _new_ single pfn is established
+ * by vmf_insert_pfn().
+ */
+static inline void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
+				    pfn_t pfn)
+{
+}
+
+/*
+ * track_pfn_copy is called when vma that is covering the pfnmap gets
+ * copied through copy_page_range().
+ */
+static inline int track_pfn_copy(struct vm_area_struct *vma)
+{
+	return 0;
+}
+
+/*
+ * untrack_pfn is called while unmapping a pfnmap for a region.
+ * untrack can be called for a specific region indicated by pfn and size or
+ * can be for the entire vma (in which case pfn, size are zero).
+ */
+static inline void untrack_pfn(struct vm_area_struct *vma,
+			       unsigned long pfn, unsigned long size)
+{
+}
+
+/*
+ * untrack_pfn_moved is called while mremapping a pfnmap for a new region.
+ */
+static inline void untrack_pfn_moved(struct vm_area_struct *vma)
+{
+}
+#else
+extern int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
+			   unsigned long pfn, unsigned long addr,
+			   unsigned long size);
+extern void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
+			     pfn_t pfn);
+extern int track_pfn_copy(struct vm_area_struct *vma);
+extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
+			unsigned long size);
+extern void untrack_pfn_moved(struct vm_area_struct *vma);
+#endif
+
+#ifdef __HAVE_COLOR_ZERO_PAGE
+static inline int is_zero_pfn(unsigned long pfn)
+{
+	extern unsigned long zero_pfn;
+	unsigned long offset_from_zero_pfn = pfn - zero_pfn;
+	return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT);
+}
+
+#define my_zero_pfn(addr)	page_to_pfn(ZERO_PAGE(addr))
+
+#else
+static inline int is_zero_pfn(unsigned long pfn)
+{
+	extern unsigned long zero_pfn;
+	return pfn == zero_pfn;
+}
+
+static inline unsigned long my_zero_pfn(unsigned long addr)
+{
+	extern unsigned long zero_pfn;
+	return zero_pfn;
+}
+#endif
+
+#ifdef CONFIG_MMU
+
+#ifndef CONFIG_TRANSPARENT_HUGEPAGE
+static inline int pmd_trans_huge(pmd_t pmd)
+{
+	return 0;
+}
+#ifndef pmd_write
+static inline int pmd_write(pmd_t pmd)
+{
+	BUG();
+	return 0;
+}
+#endif /* pmd_write */
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+
+#ifndef pud_write
+static inline int pud_write(pud_t pud)
+{
+	BUG();
+	return 0;
+}
+#endif /* pud_write */
+
+#if !defined(CONFIG_ARCH_HAS_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
+static inline int pmd_devmap(pmd_t pmd)
+{
+	return 0;
+}
+static inline int pud_devmap(pud_t pud)
+{
+	return 0;
+}
+static inline int pgd_devmap(pgd_t pgd)
+{
+	return 0;
+}
+#endif
+
+#if !defined(CONFIG_TRANSPARENT_HUGEPAGE) || \
+	(defined(CONFIG_TRANSPARENT_HUGEPAGE) && \
+	 !defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD))
+static inline int pud_trans_huge(pud_t pud)
+{
+	return 0;
+}
+#endif
+
+/* See pmd_none_or_trans_huge_or_clear_bad for discussion. */
+static inline int pud_none_or_trans_huge_or_dev_or_clear_bad(pud_t *pud)
+{
+	pud_t pudval = READ_ONCE(*pud);
+
+	if (pud_none(pudval) || pud_trans_huge(pudval) || pud_devmap(pudval))
+		return 1;
+	if (unlikely(pud_bad(pudval))) {
+		pud_clear_bad(pud);
+		return 1;
+	}
+	return 0;
+}
+
+/* See pmd_trans_unstable for discussion. */
+static inline int pud_trans_unstable(pud_t *pud)
+{
+#if defined(CONFIG_TRANSPARENT_HUGEPAGE) &&			\
+	defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)
+	return pud_none_or_trans_huge_or_dev_or_clear_bad(pud);
+#else
+	return 0;
+#endif
+}
+
+#ifndef pmd_read_atomic
+static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
+{
+	/*
+	 * Depend on compiler for an atomic pmd read. NOTE: this is
+	 * only going to work, if the pmdval_t isn't larger than
+	 * an unsigned long.
+	 */
+	return *pmdp;
+}
+#endif
+
+#ifndef arch_needs_pgtable_deposit
+#define arch_needs_pgtable_deposit() (false)
+#endif
+/*
+ * This function is meant to be used by sites walking pagetables with
+ * the mmap_sem hold in read mode to protect against MADV_DONTNEED and
+ * transhuge page faults. MADV_DONTNEED can convert a transhuge pmd
+ * into a null pmd and the transhuge page fault can convert a null pmd
+ * into an hugepmd or into a regular pmd (if the hugepage allocation
+ * fails). While holding the mmap_sem in read mode the pmd becomes
+ * stable and stops changing under us only if it's not null and not a
+ * transhuge pmd. When those races occurs and this function makes a
+ * difference vs the standard pmd_none_or_clear_bad, the result is
+ * undefined so behaving like if the pmd was none is safe (because it
+ * can return none anyway). The compiler level barrier() is critically
+ * important to compute the two checks atomically on the same pmdval.
+ *
+ * For 32bit kernels with a 64bit large pmd_t this automatically takes
+ * care of reading the pmd atomically to avoid SMP race conditions
+ * against pmd_populate() when the mmap_sem is hold for reading by the
+ * caller (a special atomic read not done by "gcc" as in the generic
+ * version above, is also needed when THP is disabled because the page
+ * fault can populate the pmd from under us).
+ */
+static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
+{
+	pmd_t pmdval = pmd_read_atomic(pmd);
+	/*
+	 * The barrier will stabilize the pmdval in a register or on
+	 * the stack so that it will stop changing under the code.
+	 *
+	 * When CONFIG_TRANSPARENT_HUGEPAGE=y on x86 32bit PAE,
+	 * pmd_read_atomic is allowed to return a not atomic pmdval
+	 * (for example pointing to an hugepage that has never been
+	 * mapped in the pmd). The below checks will only care about
+	 * the low part of the pmd with 32bit PAE x86 anyway, with the
+	 * exception of pmd_none(). So the important thing is that if
+	 * the low part of the pmd is found null, the high part will
+	 * be also null or the pmd_none() check below would be
+	 * confused.
+	 */
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+	barrier();
+#endif
+	/*
+	 * !pmd_present() checks for pmd migration entries
+	 *
+	 * The complete check uses is_pmd_migration_entry() in linux/swapops.h
+	 * But using that requires moving current function and pmd_trans_unstable()
+	 * to linux/swapops.h to resovle dependency, which is too much code move.
+	 *
+	 * !pmd_present() is equivalent to is_pmd_migration_entry() currently,
+	 * because !pmd_present() pages can only be under migration not swapped
+	 * out.
+	 *
+	 * pmd_none() is preseved for future condition checks on pmd migration
+	 * entries and not confusing with this function name, although it is
+	 * redundant with !pmd_present().
+	 */
+	if (pmd_none(pmdval) || pmd_trans_huge(pmdval) ||
+		(IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION) && !pmd_present(pmdval)))
+		return 1;
+	if (unlikely(pmd_bad(pmdval))) {
+		pmd_clear_bad(pmd);
+		return 1;
+	}
+	return 0;
+}
+
+/*
+ * This is a noop if Transparent Hugepage Support is not built into
+ * the kernel. Otherwise it is equivalent to
+ * pmd_none_or_trans_huge_or_clear_bad(), and shall only be called in
+ * places that already verified the pmd is not none and they want to
+ * walk ptes while holding the mmap sem in read mode (write mode don't
+ * need this). If THP is not enabled, the pmd can't go away under the
+ * code even if MADV_DONTNEED runs, but if THP is enabled we need to
+ * run a pmd_trans_unstable before walking the ptes after
+ * split_huge_pmd returns (because it may have run when the pmd become
+ * null, but then a page fault can map in a THP and not a regular page).
+ */
+static inline int pmd_trans_unstable(pmd_t *pmd)
+{
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+	return pmd_none_or_trans_huge_or_clear_bad(pmd);
+#else
+	return 0;
+#endif
+}
+
+#ifndef CONFIG_NUMA_BALANCING
+/*
+ * Technically a PTE can be PROTNONE even when not doing NUMA balancing but
+ * the only case the kernel cares is for NUMA balancing and is only ever set
+ * when the VMA is accessible. For PROT_NONE VMAs, the PTEs are not marked
+ * _PAGE_PROTNONE so by by default, implement the helper as "always no". It
+ * is the responsibility of the caller to distinguish between PROT_NONE
+ * protections and NUMA hinting fault protections.
+ */
+static inline int pte_protnone(pte_t pte)
+{
+	return 0;
+}
+
+static inline int pmd_protnone(pmd_t pmd)
+{
+	return 0;
+}
+#endif /* CONFIG_NUMA_BALANCING */
+
+#endif /* CONFIG_MMU */
+
+#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
+
+#ifndef __PAGETABLE_P4D_FOLDED
+int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot);
+int p4d_clear_huge(p4d_t *p4d);
+#else
+static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
+{
+	return 0;
+}
+static inline int p4d_clear_huge(p4d_t *p4d)
+{
+	return 0;
+}
+#endif /* !__PAGETABLE_P4D_FOLDED */
+
+int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot);
+int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);
+int pud_clear_huge(pud_t *pud);
+int pmd_clear_huge(pmd_t *pmd);
+int p4d_free_pud_page(p4d_t *p4d, unsigned long addr);
+int pud_free_pmd_page(pud_t *pud, unsigned long addr);
+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr);
+#else	/* !CONFIG_HAVE_ARCH_HUGE_VMAP */
+static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
+{
+	return 0;
+}
+static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
+{
+	return 0;
+}
+static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
+{
+	return 0;
+}
+static inline int p4d_clear_huge(p4d_t *p4d)
+{
+	return 0;
+}
+static inline int pud_clear_huge(pud_t *pud)
+{
+	return 0;
+}
+static inline int pmd_clear_huge(pmd_t *pmd)
+{
+	return 0;
+}
+static inline int p4d_free_pud_page(p4d_t *p4d, unsigned long addr)
+{
+	return 0;
+}
+static inline int pud_free_pmd_page(pud_t *pud, unsigned long addr)
+{
+	return 0;
+}
+static inline int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)
+{
+	return 0;
+}
+#endif	/* CONFIG_HAVE_ARCH_HUGE_VMAP */
+
+#ifndef __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+/*
+ * ARCHes with special requirements for evicting THP backing TLB entries can
+ * implement this. Otherwise also, it can help optimize normal TLB flush in
+ * THP regime. stock flush_tlb_range() typically has optimization to nuke the
+ * entire TLB TLB if flush span is greater than a threshold, which will
+ * likely be true for a single huge page. Thus a single thp flush will
+ * invalidate the entire TLB which is not desitable.
+ * e.g. see arch/arc: flush_pmd_tlb_range
+ */
+#define flush_pmd_tlb_range(vma, addr, end)	flush_tlb_range(vma, addr, end)
+#define flush_pud_tlb_range(vma, addr, end)	flush_tlb_range(vma, addr, end)
+#else
+#define flush_pmd_tlb_range(vma, addr, end)	BUILD_BUG()
+#define flush_pud_tlb_range(vma, addr, end)	BUILD_BUG()
+#endif
+#endif
+
+struct file;
+int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
+			unsigned long size, pgprot_t *vma_prot);
+
+#ifndef CONFIG_X86_ESPFIX64
+static inline void init_espfix_bsp(void) { }
+#endif
+
+extern void __init pgtable_cache_init(void);
+
+#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
+static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
+{
+	return true;
+}
+
+static inline bool arch_has_pfn_modify_check(void)
+{
+	return false;
+}
+#endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */
+
+/*
+ * Architecture PAGE_KERNEL_* fallbacks
+ *
+ * Some architectures don't define certain PAGE_KERNEL_* flags. This is either
+ * because they really don't support them, or the port needs to be updated to
+ * reflect the required functionality. Below are a set of relatively safe
+ * fallbacks, as best effort, which we can count on in lieu of the architectures
+ * not defining them on their own yet.
+ */
+
+#ifndef PAGE_KERNEL_RO
+# define PAGE_KERNEL_RO PAGE_KERNEL
+#endif
+
+#ifndef PAGE_KERNEL_EXEC
+# define PAGE_KERNEL_EXEC PAGE_KERNEL
+#endif
+
+/*
+ * Page Table Modification bits for pgtbl_mod_mask.
+ *
+ * These are used by the p?d_alloc_track*() set of functions an in the generic
+ * vmalloc/ioremap code to track at which page-table levels entries have been
+ * modified. Based on that the code can better decide when vmalloc and ioremap
+ * mapping changes need to be synchronized to other page-tables in the system.
+ */
+#define		__PGTBL_PGD_MODIFIED	0
+#define		__PGTBL_P4D_MODIFIED	1
+#define		__PGTBL_PUD_MODIFIED	2
+#define		__PGTBL_PMD_MODIFIED	3
+#define		__PGTBL_PTE_MODIFIED	4
+
+#define		PGTBL_PGD_MODIFIED	BIT(__PGTBL_PGD_MODIFIED)
+#define		PGTBL_P4D_MODIFIED	BIT(__PGTBL_P4D_MODIFIED)
+#define		PGTBL_PUD_MODIFIED	BIT(__PGTBL_PUD_MODIFIED)
+#define		PGTBL_PMD_MODIFIED	BIT(__PGTBL_PMD_MODIFIED)
+#define		PGTBL_PTE_MODIFIED	BIT(__PGTBL_PTE_MODIFIED)
+
+/* Page-Table Modification Mask */
+typedef unsigned int pgtbl_mod_mask;
+
+#endif /* !__ASSEMBLY__ */
+
+#ifndef io_remap_pfn_range
+#define io_remap_pfn_range remap_pfn_range
+#endif
+
+#ifndef has_transparent_hugepage
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+#define has_transparent_hugepage() 1
+#else
+#define has_transparent_hugepage() 0
+#endif
+#endif
+
+/*
+ * On some architectures it depends on the mm if the p4d/pud or pmd
+ * layer of the page table hierarchy is folded or not.
+ */
+#ifndef mm_p4d_folded
+#define mm_p4d_folded(mm)	__is_defined(__PAGETABLE_P4D_FOLDED)
+#endif
+
+#ifndef mm_pud_folded
+#define mm_pud_folded(mm)	__is_defined(__PAGETABLE_PUD_FOLDED)
+#endif
+
+#ifndef mm_pmd_folded
+#define mm_pmd_folded(mm)	__is_defined(__PAGETABLE_PMD_FOLDED)
+#endif
+
+/*
+ * p?d_leaf() - true if this entry is a final mapping to a physical address.
+ * This differs from p?d_huge() by the fact that they are always available (if
+ * the architecture supports large pages at the appropriate level) even
+ * if CONFIG_HUGETLB_PAGE is not defined.
+ * Only meaningful when called on a valid entry.
+ */
+#ifndef pgd_leaf
+#define pgd_leaf(x)	0
+#endif
+#ifndef p4d_leaf
+#define p4d_leaf(x)	0
+#endif
+#ifndef pud_leaf
+#define pud_leaf(x)	0
+#endif
+#ifndef pmd_leaf
+#define pmd_leaf(x)	0
+#endif
+
+#endif /* _LINUX_PGTABLE_H */
--- a/include/xen/arm/page.h~mm-introduce-include-linux-pgtableh
+++ a/include/xen/arm/page.h
@@ -3,7 +3,7 @@
 #define _ASM_ARM_XEN_PAGE_H
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include <linux/pfn.h>
 #include <linux/types.h>
--- a/kernel/bpf/syscall.c~mm-introduce-include-linux-pgtableh
+++ a/kernel/bpf/syscall.c
@@ -25,7 +25,7 @@
 #include <linux/nospec.h>
 #include <linux/audit.h>
 #include <uapi/linux/btf.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/bpf_lsm.h>
 #include <linux/poll.h>
 #include <linux/bpf-netns.h>
--- a/mm/init-mm.c~mm-introduce-include-linux-pgtableh
+++ a/mm/init-mm.c
@@ -9,7 +9,7 @@
 
 #include <linux/atomic.h>
 #include <linux/user_namespace.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/mmu.h>
 
 #ifndef INIT_MM_CONTEXT
--- a/mm/mincore.c~mm-introduce-include-linux-pgtableh
+++ a/mm/mincore.c
@@ -19,7 +19,7 @@
 #include <linux/hugetlb.h>
 
 #include <linux/uaccess.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 static int mincore_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr,
 			unsigned long end, struct mm_walk *walk)
--- a/mm/mprotect.c~mm-introduce-include-linux-pgtableh
+++ a/mm/mprotect.c
@@ -28,7 +28,7 @@
 #include <linux/ksm.h>
 #include <linux/uaccess.h>
 #include <linux/mm_inline.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/mmu_context.h>
 #include <asm/tlbflush.h>
--- a/mm/page_reporting.h~mm-introduce-include-linux-pgtableh
+++ a/mm/page_reporting.h
@@ -7,7 +7,7 @@
 #include <linux/page-isolation.h>
 #include <linux/jump_label.h>
 #include <linux/slab.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/scatterlist.h>
 
 #define PAGE_REPORTING_MIN_ORDER	pageblock_order
--- a/mm/pgtable-generic.c~mm-introduce-include-linux-pgtableh
+++ a/mm/pgtable-generic.c
@@ -2,15 +2,15 @@
 /*
  *  mm/pgtable-generic.c
  *
- *  Generic pgtable methods declared in asm-generic/pgtable.h
+ *  Generic pgtable methods declared in linux/pgtable.h
  *
  *  Copyright (C) 2010  Linus Torvalds
  */
 
 #include <linux/pagemap.h>
 #include <linux/hugetlb.h>
+#include <linux/pgtable.h>
 #include <asm/tlb.h>
-#include <asm-generic/pgtable.h>
 
 /*
  * If a p?d_bad entry is found while walking page tables, report
@@ -53,7 +53,7 @@ void pmd_clear_bad(pmd_t *pmd)
 
 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 /*
- * Only sets the access flags (dirty, accessed), as well as write 
+ * Only sets the access flags (dirty, accessed), as well as write
  * permission. Furthermore, we know it always gets set to a "more
  * permissive" setting, which allows most architectures to optimize
  * this. We return whether the PTE actually changed, which in turn
--- a/mm/zsmalloc.c~mm-introduce-include-linux-pgtableh
+++ a/mm/zsmalloc.c
@@ -40,7 +40,7 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <asm/tlbflush.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <linux/cpumask.h>
 #include <linux/cpu.h>
 #include <linux/vmalloc.h>
--- a/sound/pci/hda/hda_intel.c~mm-introduce-include-linux-pgtableh
+++ a/sound/pci/hda/hda_intel.c
@@ -39,7 +39,7 @@
 
 #ifdef CONFIG_X86
 /* for snoop control */
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/cpufeature.h>
 #endif
--- a/sound/soc/intel/common/sst-firmware.c~mm-introduce-include-linux-pgtableh
+++ a/sound/soc/intel/common/sst-firmware.c
@@ -21,7 +21,7 @@
 #include <linux/dma/dw.h>
 
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 
 #include "sst-dsp.h"
 #include "sst-dsp-priv.h"
--- a/sound/soc/intel/haswell/sst-haswell-pcm.c~mm-introduce-include-linux-pgtableh
+++ a/sound/soc/intel/haswell/sst-haswell-pcm.c
@@ -11,7 +11,7 @@
 #include <linux/delay.h>
 #include <linux/pm_runtime.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 53/93] mm: reorder includes after introduction of linux/pgtable.h
  2020-06-09  4:29 incoming Andrew Morton
                   ` (51 preceding siblings ...)
  2020-06-09  4:32 ` [patch 52/93] mm: introduce include/linux/pgtable.h Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 54/93] csky: replace definitions of __pXd_offset() with pXd_index() Andrew Morton
                   ` (42 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: mm: reorder includes after introduction of linux/pgtable.h

The replacement of <asm/pgrable.h> with <linux/pgtable.h> made the include
of the latter in the middle of asm includes.  Fix this up with the aid of
the below script and manual adjustments here and there.

	import sys
	import re

	if len(sys.argv) is not 3:
	    print "USAGE: %s <file> <header>" % (sys.argv[0])
	    sys.exit(1)

	hdr_to_move="#include <linux/%s>" % sys.argv[2]
	moved = False
	in_hdrs = False

	with open(sys.argv[1], "r") as f:
	    lines = f.readlines()
	    for _line in lines:
		line = _line.rstrip('
')
		if line == hdr_to_move:
		    continue
		if line.startswith("#include <linux/"):
		    in_hdrs = True
		elif not moved and in_hdrs:
		    moved = True
		    print hdr_to_move
		print line

Link: http://lkml.kernel.org/r/20200514170327.31389-4-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/kernel/proto.h                             |    2 --
 arch/arc/mm/highmem.c                                 |    2 +-
 arch/arc/mm/tlbex.S                                   |    2 +-
 arch/arm/include/asm/efi.h                            |    1 -
 arch/arm/include/asm/fixmap.h                         |    2 +-
 arch/arm/kernel/head.S                                |    2 +-
 arch/arm/kernel/suspend.c                             |    2 +-
 arch/arm/kernel/vmlinux.lds.S                         |    2 +-
 arch/arm/mach-integrator/core.c                       |    2 +-
 arch/arm/mach-keystone/platsmp.c                      |    2 +-
 arch/arm/mach-sa1100/hackkit.c                        |    2 +-
 arch/arm/mach-zynq/common.c                           |    2 +-
 arch/arm/mm/idmap.c                                   |    2 +-
 arch/arm/mm/mm.h                                      |    1 -
 arch/arm/mm/proc-arm1020.S                            |    2 +-
 arch/arm/mm/proc-arm1020e.S                           |    2 +-
 arch/arm/mm/proc-arm1022.S                            |    2 +-
 arch/arm/mm/proc-arm1026.S                            |    2 +-
 arch/arm/mm/proc-arm720.S                             |    2 +-
 arch/arm/mm/proc-arm740.S                             |    2 +-
 arch/arm/mm/proc-arm7tdmi.S                           |    2 +-
 arch/arm/mm/proc-arm920.S                             |    2 +-
 arch/arm/mm/proc-arm922.S                             |    2 +-
 arch/arm/mm/proc-arm925.S                             |    2 +-
 arch/arm/mm/proc-arm926.S                             |    2 +-
 arch/arm/mm/proc-arm940.S                             |    2 +-
 arch/arm/mm/proc-arm946.S                             |    2 +-
 arch/arm/mm/proc-arm9tdmi.S                           |    2 +-
 arch/arm/mm/proc-fa526.S                              |    2 +-
 arch/arm/mm/proc-feroceon.S                           |    2 +-
 arch/arm/mm/proc-mohawk.S                             |    2 +-
 arch/arm/mm/proc-sa110.S                              |    2 +-
 arch/arm/mm/proc-sa1100.S                             |    2 +-
 arch/arm/mm/proc-v6.S                                 |    2 +-
 arch/arm/mm/proc-v7.S                                 |    2 +-
 arch/arm/mm/proc-xsc3.S                               |    2 +-
 arch/arm/mm/proc-xscale.S                             |    2 +-
 arch/arm/mm/pv-fixup-asm.S                            |    2 +-
 arch/arm64/include/asm/io.h                           |    2 +-
 arch/arm64/include/asm/kvm_mmu.h                      |    2 +-
 arch/arm64/include/asm/mmu_context.h                  |    2 +-
 arch/arm64/include/asm/vmap_stack.h                   |    2 +-
 arch/arm64/kernel/acpi.c                              |    2 +-
 arch/arm64/kernel/head.S                              |    2 +-
 arch/arm64/kernel/kaslr.c                             |    2 +-
 arch/arm64/kernel/suspend.c                           |    2 +-
 arch/arm64/kernel/vmlinux.lds.S                       |    1 -
 arch/arm64/mm/proc.S                                  |    2 +-
 arch/ia64/kernel/entry.S                              |    2 +-
 arch/ia64/kernel/head.S                               |    3 ++-
 arch/ia64/kernel/irq_ia64.c                           |    2 +-
 arch/ia64/kernel/ivt.S                                |    2 +-
 arch/ia64/kernel/kprobes.c                            |    2 +-
 arch/ia64/kernel/mca_asm.S                            |    2 +-
 arch/ia64/kernel/relocate_kernel.S                    |    4 +---
 arch/ia64/kernel/setup.c                              |    2 +-
 arch/ia64/kernel/uncached.c                           |    2 +-
 arch/ia64/kernel/vmlinux.lds.S                        |    2 +-
 arch/m68k/68000/m68VZ328.c                            |    2 +-
 arch/m68k/include/asm/sun3xflop.h                     |    2 +-
 arch/m68k/kernel/head.S                               |    2 +-
 arch/microblaze/include/asm/pgalloc.h                 |    2 +-
 arch/microblaze/kernel/hw_exception_handler.S         |    2 +-
 arch/microblaze/kernel/module.c                       |    2 +-
 arch/microblaze/kernel/setup.c                        |    2 +-
 arch/microblaze/mm/pgtable.c                          |    2 +-
 arch/mips/jazz/irq.c                                  |    2 +-
 arch/mips/jazz/setup.c                                |    2 +-
 arch/mips/kvm/mips.c                                  |    2 +-
 arch/mips/mm/tlbex.c                                  |    2 +-
 arch/nds32/include/asm/highmem.h                      |    1 -
 arch/nds32/kernel/head.S                              |    2 +-
 arch/nios2/kernel/nios2_ksyms.c                       |    2 +-
 arch/openrisc/include/asm/io.h                        |    1 -
 arch/openrisc/kernel/entry.S                          |    2 +-
 arch/openrisc/kernel/head.S                           |    2 +-
 arch/openrisc/kernel/or32_ksyms.c                     |    2 +-
 arch/openrisc/mm/ioremap.c                            |    2 +-
 arch/parisc/kernel/asm-offsets.c                      |    2 +-
 arch/parisc/kernel/entry.S                            |    2 +-
 arch/parisc/kernel/head.S                             |    2 +-
 arch/parisc/kernel/pacache.S                          |    2 +-
 arch/parisc/kernel/pdt.c                              |    2 +-
 arch/powerpc/include/asm/fixmap.h                     |    2 +-
 arch/powerpc/kernel/btext.c                           |    2 +-
 arch/powerpc/kernel/fpu.S                             |    1 -
 arch/powerpc/kernel/head_32.S                         |    2 +-
 arch/powerpc/kernel/head_40x.S                        |    2 +-
 arch/powerpc/kernel/head_44x.S                        |    2 +-
 arch/powerpc/kernel/head_8xx.S                        |    2 +-
 arch/powerpc/kernel/head_fsl_booke.S                  |    2 +-
 arch/powerpc/kernel/io-workarounds.c                  |    2 +-
 arch/powerpc/kernel/irq.c                             |    2 +-
 arch/powerpc/kernel/mce_power.c                       |    2 +-
 arch/powerpc/kernel/paca.c                            |    2 +-
 arch/powerpc/kernel/prom.c                            |    2 +-
 arch/powerpc/kernel/prom_init.c                       |    2 +-
 arch/powerpc/kernel/rtas_pci.c                        |    2 +-
 arch/powerpc/kernel/setup-common.c                    |    2 +-
 arch/powerpc/kernel/setup_32.c                        |    2 +-
 arch/powerpc/kernel/setup_64.c                        |    2 +-
 arch/powerpc/kernel/smp.c                             |    2 +-
 arch/powerpc/kvm/book3s_64_mmu_radix.c                |    2 +-
 arch/powerpc/kvm/book3s_hv_nested.c                   |    2 +-
 arch/powerpc/kvm/book3s_hv_rm_xics.c                  |    2 +-
 arch/powerpc/kvm/book3s_hv_rm_xive.c                  |    2 +-
 arch/powerpc/kvm/fpu.S                                |    2 +-
 arch/powerpc/mm/book3s32/hash_low.S                   |    2 +-
 arch/powerpc/mm/book3s64/hash_native.c                |    2 +-
 arch/powerpc/mm/book3s64/hash_utils.c                 |    2 +-
 arch/powerpc/mm/book3s64/slb.c                        |    2 +-
 arch/powerpc/mm/init-common.c                         |    2 +-
 arch/powerpc/mm/nohash/tlb_low_64e.S                  |    2 +-
 arch/powerpc/mm/ptdump/bats.c                         |    2 +-
 arch/powerpc/platforms/85xx/corenet_generic.c         |    2 +-
 arch/powerpc/platforms/85xx/mpc85xx_cds.c             |    2 +-
 arch/powerpc/platforms/85xx/qemu_e500.c               |    2 +-
 arch/powerpc/platforms/85xx/sbc8548.c                 |    2 +-
 arch/powerpc/platforms/85xx/smp.c                     |    2 +-
 arch/powerpc/platforms/86xx/mpc86xx_smp.c             |    2 +-
 arch/powerpc/platforms/cell/cbe_regs.c                |    2 +-
 arch/powerpc/platforms/cell/interrupt.c               |    2 +-
 arch/powerpc/platforms/cell/pervasive.c               |    2 +-
 arch/powerpc/platforms/cell/smp.c                     |    2 +-
 arch/powerpc/platforms/cell/spider-pic.c              |    2 +-
 arch/powerpc/platforms/chrp/pci.c                     |    2 +-
 arch/powerpc/platforms/chrp/smp.c                     |    2 +-
 arch/powerpc/platforms/powermac/smp.c                 |    2 +-
 arch/powerpc/platforms/pseries/lpar.c                 |    2 +-
 arch/powerpc/platforms/pseries/smp.c                  |    2 +-
 arch/powerpc/sysdev/mpic.c                            |    2 +-
 arch/riscv/include/asm/fixmap.h                       |    2 +-
 arch/riscv/include/asm/io.h                           |    2 +-
 arch/riscv/include/asm/kasan.h                        |    2 --
 arch/riscv/mm/cacheflush.c                            |    1 -
 arch/riscv/mm/kasan_init.c                            |    2 +-
 arch/s390/boot/ipl_parm.c                             |    2 +-
 arch/s390/boot/kaslr.c                                |    2 +-
 arch/s390/include/asm/hugetlb.h                       |    2 +-
 arch/s390/include/asm/kasan.h                         |    2 --
 arch/s390/kernel/asm-offsets.c                        |    2 +-
 arch/s390/kvm/gaccess.c                               |    2 +-
 arch/s390/kvm/kvm-s390.c                              |    2 +-
 arch/s390/kvm/priv.c                                  |    2 +-
 arch/s390/mm/extmem.c                                 |    2 +-
 arch/s390/mm/gmap.c                                   |    2 +-
 arch/s390/mm/kasan_init.c                             |    2 +-
 arch/sh/mm/pmb.c                                      |    2 +-
 arch/sparc/include/asm/floppy_32.h                    |    2 +-
 arch/sparc/include/asm/highmem.h                      |    2 +-
 arch/sparc/include/asm/io-unit.h                      |    2 +-
 arch/sparc/include/asm/pgalloc_32.h                   |    2 +-
 arch/sparc/kernel/cpu.c                               |    2 +-
 arch/sparc/kernel/entry.S                             |    2 +-
 arch/sparc/kernel/head_64.S                           |    2 +-
 arch/sparc/kernel/ktlb.S                              |    2 +-
 arch/sparc/kernel/pci.c                               |    2 +-
 arch/sparc/kernel/sun4m_irq.c                         |    2 +-
 arch/sparc/kernel/trampoline_64.S                     |    2 +-
 arch/sparc/kernel/traps_32.c                          |    2 +-
 arch/sparc/lib/clear_page.S                           |    2 +-
 arch/sparc/mm/tsb.c                                   |    2 +-
 arch/sparc/mm/ultra.S                                 |    2 +-
 arch/unicore32/kernel/hibernate.c                     |    2 +-
 arch/unicore32/kernel/hibernate_asm.S                 |    2 +-
 arch/unicore32/mm/alignment.c                         |    2 +-
 arch/unicore32/mm/proc-ucv2.S                         |    2 +-
 arch/x86/boot/compressed/kaslr_64.c                   |    2 +-
 arch/x86/include/asm/asm-prototypes.h                 |    2 +-
 arch/x86/include/asm/efi.h                            |    2 +-
 arch/x86/include/asm/xen/hypercall.h                  |    2 +-
 arch/x86/kernel/acpi/boot.c                           |    2 +-
 arch/x86/kernel/acpi/sleep.c                          |    2 +-
 arch/x86/kernel/apic/apic_numachip.c                  |    2 +-
 arch/x86/kernel/cpu/bugs.c                            |    2 +-
 arch/x86/kernel/cpu/common.c                          |    2 +-
 arch/x86/kernel/cpu/intel.c                           |    2 +-
 arch/x86/kernel/crash_core_32.c                       |    2 +-
 arch/x86/kernel/crash_core_64.c                       |    2 +-
 arch/x86/kernel/early_printk.c                        |    2 +-
 arch/x86/kernel/head64.c                              |    2 +-
 arch/x86/kernel/head_64.S                             |    2 +-
 arch/x86/kernel/i8259.c                               |    2 +-
 arch/x86/kernel/irqinit.c                             |    2 +-
 arch/x86/kernel/kprobes/core.c                        |    2 +-
 arch/x86/kernel/kprobes/opt.c                         |    2 +-
 arch/x86/kernel/paravirt.c                            |    2 +-
 arch/x86/kernel/reboot.c                              |    2 +-
 arch/x86/kernel/smpboot.c                             |    2 +-
 arch/x86/mm/cpu_entry_area.c                          |    2 +-
 arch/x86/mm/ioremap.c                                 |    2 +-
 arch/x86/mm/kaslr.c                                   |    2 +-
 arch/x86/mm/mmio-mod.c                                |    2 +-
 arch/x86/mm/pat/memtype_interval.c                    |    2 +-
 arch/x86/mm/setup_nx.c                                |    2 +-
 arch/x86/platform/efi/efi_32.c                        |    2 +-
 arch/x86/platform/olpc/olpc_ofw.c                     |    2 +-
 arch/x86/power/cpu.c                                  |    2 +-
 arch/x86/power/hibernate.c                            |    2 +-
 arch/x86/power/hibernate_32.c                         |    2 +-
 arch/x86/power/hibernate_64.c                         |    2 +-
 arch/x86/realmode/init.c                              |    2 +-
 arch/x86/xen/mmu_pv.c                                 |    2 +-
 arch/x86/xen/smp_pv.c                                 |    1 +
 arch/xtensa/include/asm/fixmap.h                      |    2 +-
 arch/xtensa/include/asm/highmem.h                     |    2 +-
 arch/xtensa/include/asm/mmu_context.h                 |    2 +-
 arch/xtensa/kernel/entry.S                            |    2 +-
 arch/xtensa/kernel/traps.c                            |    2 +-
 arch/xtensa/kernel/vectors.S                          |    2 +-
 arch/xtensa/mm/cache.c                                |    2 +-
 arch/xtensa/mm/ioremap.c                              |    2 +-
 arch/xtensa/mm/misc.S                                 |    2 +-
 drivers/acpi/scan.c                                   |    1 -
 drivers/atm/fore200e.c                                |    2 +-
 drivers/block/z2ram.c                                 |    2 +-
 drivers/firmware/efi/arm-runtime.c                    |    2 +-
 drivers/gpu/drm/drm_vm.c                              |    2 +-
 drivers/infiniband/hw/qib/qib_file_ops.c              |    2 +-
 drivers/macintosh/macio-adb.c                         |    2 +-
 drivers/macintosh/mediabay.c                          |    2 +-
 drivers/macintosh/via-pmu.c                           |    2 +-
 drivers/media/pci/bt8xx/bt878.c                       |    2 +-
 drivers/media/pci/bt8xx/btcx-risc.c                   |    2 +-
 drivers/media/pci/bt8xx/bttv-risc.c                   |    2 +-
 drivers/media/v4l2-core/videobuf-dma-sg.c             |    2 +-
 drivers/media/v4l2-core/videobuf-vmalloc.c            |    2 +-
 drivers/net/ethernet/amd/7990.c                       |    2 +-
 drivers/net/ethernet/amd/hplance.c                    |    2 +-
 drivers/net/ethernet/amd/mvme147.c                    |    2 +-
 drivers/net/ethernet/amd/sun3lance.c                  |    2 +-
 drivers/net/ethernet/amd/sunlance.c                   |    2 +-
 drivers/net/ethernet/apple/bmac.c                     |    2 +-
 drivers/net/ethernet/apple/mace.c                     |    2 +-
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |    2 +-
 drivers/net/ethernet/freescale/fs_enet/mac-fcc.c      |    2 +-
 drivers/net/ethernet/freescale/fs_enet/mii-fec.c      |    2 +-
 drivers/net/ethernet/i825xx/82596.c                   |    2 +-
 drivers/net/ethernet/korina.c                         |    2 +-
 drivers/net/ethernet/marvell/pxa168_eth.c             |    2 +-
 drivers/net/ethernet/natsemi/jazzsonic.c              |    2 +-
 drivers/net/ethernet/natsemi/macsonic.c               |    2 +-
 drivers/net/ethernet/natsemi/xtsonic.c                |    2 +-
 drivers/net/ethernet/sun/sunbmac.c                    |    2 +-
 drivers/net/ethernet/sun/sunqe.c                      |    2 +-
 drivers/scsi/53c700.c                                 |    2 +-
 drivers/scsi/arm/cumana_2.c                           |    2 +-
 drivers/scsi/arm/eesox.c                              |    2 +-
 drivers/scsi/arm/powertec.c                           |    2 +-
 drivers/scsi/dpt_i2o.c                                |    2 +-
 drivers/scsi/mac53c94.c                               |    2 +-
 drivers/scsi/mesh.c                                   |    2 +-
 drivers/scsi/qlogicpti.c                              |    2 +-
 drivers/scsi/zorro_esp.c                              |    2 +-
 include/linux/crash_dump.h                            |    1 +
 include/linux/io-mapping.h                            |    2 +-
 include/linux/kasan.h                                 |    2 +-
 include/linux/mm.h                                    |    2 +-
 include/xen/arm/page.h                                |    2 +-
 mm/init-mm.c                                          |    2 +-
 mm/mincore.c                                          |    2 +-
 mm/zsmalloc.c                                         |    2 +-
 sound/pci/hda/hda_intel.c                             |    2 +-
 sound/soc/intel/common/sst-firmware.c                 |    2 +-
 sound/soc/intel/haswell/sst-haswell-pcm.c             |    2 +-
 265 files changed, 255 insertions(+), 268 deletions(-)

--- a/arch/alpha/kernel/proto.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/alpha/kernel/proto.h
@@ -2,8 +2,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 
-#include <linux/pgtable.h>
-
 /* Prototypes of functions used across modules here in this directory.  */
 
 #define vucp	volatile unsigned char  *
--- a/arch/arc/mm/highmem.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arc/mm/highmem.c
@@ -6,8 +6,8 @@
 #include <linux/memblock.h>
 #include <linux/export.h>
 #include <linux/highmem.h>
-#include <asm/processor.h>
 #include <linux/pgtable.h>
+#include <asm/processor.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
--- a/arch/arc/mm/tlbex.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arc/mm/tlbex.S
@@ -33,9 +33,9 @@
  */
 
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/entry.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/arcregs.h>
 #include <asm/cache.h>
 #include <asm/processor.h>
--- a/arch/arm64/include/asm/io.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/include/asm/io.h
@@ -9,11 +9,11 @@
 #define __ASM_IO_H
 
 #include <linux/types.h>
+#include <linux/pgtable.h>
 
 #include <asm/byteorder.h>
 #include <asm/barrier.h>
 #include <asm/memory.h>
-#include <linux/pgtable.h>
 #include <asm/early_ioremap.h>
 #include <asm/alternative.h>
 #include <asm/cpufeature.h>
--- a/arch/arm64/include/asm/kvm_mmu.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/include/asm/kvm_mmu.h
@@ -83,11 +83,11 @@ alternative_cb_end
 
 #else
 
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/cache.h>
 #include <asm/cacheflush.h>
 #include <asm/mmu_context.h>
-#include <linux/pgtable.h>
 
 void kvm_update_va_mask(struct alt_instr *alt,
 			__le32 *origptr, __le32 *updptr, int nr_inst);
--- a/arch/arm64/include/asm/mmu_context.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/include/asm/mmu_context.h
@@ -14,13 +14,13 @@
 #include <linux/sched.h>
 #include <linux/sched/hotplug.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/cacheflush.h>
 #include <asm/cpufeature.h>
 #include <asm/proc-fns.h>
 #include <asm-generic/mm_hooks.h>
 #include <asm/cputype.h>
-#include <linux/pgtable.h>
 #include <asm/sysreg.h>
 #include <asm/tlbflush.h>
 
--- a/arch/arm64/include/asm/vmap_stack.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/include/asm/vmap_stack.h
@@ -7,8 +7,8 @@
 #include <linux/gfp.h>
 #include <linux/kconfig.h>
 #include <linux/vmalloc.h>
-#include <asm/memory.h>
 #include <linux/pgtable.h>
+#include <asm/memory.h>
 #include <asm/thread_info.h>
 
 /*
--- a/arch/arm64/kernel/acpi.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/kernel/acpi.c
@@ -24,12 +24,12 @@
 #include <linux/of_fdt.h>
 #include <linux/smp.h>
 #include <linux/serial_core.h>
+#include <linux/pgtable.h>
 
 #include <acpi/ghes.h>
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
 #include <asm/daifflags.h>
-#include <linux/pgtable.h>
 #include <asm/smp_plat.h>
 
 int acpi_noirq = 1;		/* skip ACPI IRQ initialization */
--- a/arch/arm64/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/kernel/head.S
@@ -12,6 +12,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/irqchip/arm-gic-v3.h>
+#include <linux/pgtable.h>
 
 #include <asm/asm_pointer_auth.h>
 #include <asm/assembler.h>
@@ -26,7 +27,6 @@
 #include <asm/kvm_arm.h>
 #include <asm/memory.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/scs.h>
 #include <asm/smp.h>
--- a/arch/arm64/kernel/kaslr.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/kernel/kaslr.c
@@ -10,6 +10,7 @@
 #include <linux/mm_types.h>
 #include <linux/sched.h>
 #include <linux/types.h>
+#include <linux/pgtable.h>
 
 #include <asm/archrandom.h>
 #include <asm/cacheflush.h>
@@ -17,7 +18,6 @@
 #include <asm/kernel-pgtable.h>
 #include <asm/memory.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/sections.h>
 
 enum kaslr_status {
--- a/arch/arm64/kernel/suspend.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/kernel/suspend.c
@@ -3,13 +3,13 @@
 #include <linux/percpu.h>
 #include <linux/slab.h>
 #include <linux/uaccess.h>
+#include <linux/pgtable.h>
 #include <asm/alternative.h>
 #include <asm/cacheflush.h>
 #include <asm/cpufeature.h>
 #include <asm/daifflags.h>
 #include <asm/debug-monitors.h>
 #include <asm/exec.h>
-#include <linux/pgtable.h>
 #include <asm/memory.h>
 #include <asm/mmu_context.h>
 #include <asm/smp_plat.h>
--- a/arch/arm64/kernel/vmlinux.lds.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/kernel/vmlinux.lds.S
@@ -13,7 +13,6 @@
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include "image.h"
 
--- a/arch/arm64/mm/proc.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm64/mm/proc.S
@@ -9,11 +9,11 @@
 
 #include <linux/init.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/asm_pointer_auth.h>
 #include <asm/hwcap.h>
-#include <linux/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/cpufeature.h>
 #include <asm/alternative.h>
--- a/arch/arm/include/asm/efi.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/include/asm/efi.h
@@ -13,7 +13,6 @@
 #include <asm/highmem.h>
 #include <asm/mach/map.h>
 #include <asm/mmu_context.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #ifdef CONFIG_EFI
--- a/arch/arm/include/asm/fixmap.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/include/asm/fixmap.h
@@ -6,8 +6,8 @@
 #define FIXADDR_END		0xfff00000UL
 #define FIXADDR_TOP		(FIXADDR_END - PAGE_SIZE)
 
-#include <asm/kmap_types.h>
 #include <linux/pgtable.h>
+#include <asm/kmap_types.h>
 
 enum fixed_addresses {
 	FIX_EARLYCON_MEM_BASE,
--- a/arch/arm/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/kernel/head.S
@@ -10,6 +10,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 #include <asm/assembler.h>
 #include <asm/cp15.h>
@@ -18,7 +19,6 @@
 #include <asm/asm-offsets.h>
 #include <asm/memory.h>
 #include <asm/thread_info.h>
-#include <linux/pgtable.h>
 
 #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
 #include CONFIG_DEBUG_LL_INCLUDE
--- a/arch/arm/kernel/suspend.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/kernel/suspend.c
@@ -2,12 +2,12 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/bugs.h>
 #include <asm/cacheflush.h>
 #include <asm/idmap.h>
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 #include <asm/memory.h>
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
--- a/arch/arm/kernel/vmlinux.lds.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/kernel/vmlinux.lds.S
@@ -8,13 +8,13 @@
 #include "vmlinux-xip.lds.S"
 #else
 
+#include <linux/pgtable.h>
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/mpu.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include "vmlinux.lds.h"
 
--- a/arch/arm/mach-integrator/core.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mach-integrator/core.c
@@ -21,10 +21,10 @@
 #include <linux/stat.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/pgtable.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/time.h>
-#include <linux/pgtable.h>
 
 #include "hardware.h"
 #include "cm.h"
--- a/arch/arm/mach-keystone/platsmp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mach-keystone/platsmp.c
@@ -12,11 +12,11 @@
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/pgtable.h>
 
 #include <asm/smp_plat.h>
 #include <asm/prom.h>
 #include <asm/tlbflush.h>
-#include <linux/pgtable.h>
 
 #include "keystone.h"
 
--- a/arch/arm/mach-sa1100/hackkit.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mach-sa1100/hackkit.c
@@ -22,11 +22,11 @@
 #include <linux/gpio.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
+#include <linux/pgtable.h>
 
 #include <asm/mach-types.h>
 #include <asm/setup.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
--- a/arch/arm/mach-zynq/common.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mach-zynq/common.c
@@ -24,13 +24,13 @@
 #include <linux/irqchip/arm-gic.h>
 #include <linux/slab.h>
 #include <linux/sys_soc.h>
+#include <linux/pgtable.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/smp_scu.h>
 #include <asm/system_info.h>
 #include <asm/hardware/cache-l2x0.h>
--- a/arch/arm/mm/idmap.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/idmap.c
@@ -3,12 +3,12 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/cputype.h>
 #include <asm/idmap.h>
 #include <asm/hwcap.h>
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/system_info.h>
 
--- a/arch/arm/mm/mm.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/mm.h
@@ -2,7 +2,6 @@
 #ifdef CONFIG_MMU
 #include <linux/list.h>
 #include <linux/vmalloc.h>
-
 #include <linux/pgtable.h>
 
 /* the upper-most page table pointer */
--- a/arch/arm/mm/proc-arm1020e.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1020e.S
@@ -11,11 +11,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm1020.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1020.S
@@ -11,11 +11,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm1022.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1022.S
@@ -11,11 +11,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm1026.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm1026.S
@@ -11,11 +11,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm720.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm720.S
@@ -20,11 +20,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm740.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm740.S
@@ -6,11 +6,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm7tdmi.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm7tdmi.S
@@ -6,11 +6,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm920.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm920.S
@@ -13,10 +13,10 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm922.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm922.S
@@ -14,10 +14,10 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm925.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm925.S
@@ -37,10 +37,10 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm926.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm926.S
@@ -13,10 +13,10 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-arm940.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm940.S
@@ -6,10 +6,10 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-arm946.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm946.S
@@ -8,10 +8,10 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-arm9tdmi.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-arm9tdmi.S
@@ -6,11 +6,11 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-fa526.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-fa526.S
@@ -11,10 +11,10 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 
--- a/arch/arm/mm/proc-feroceon.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-feroceon.S
@@ -8,10 +8,10 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-mohawk.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-mohawk.S
@@ -9,10 +9,10 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-sa1100.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-sa1100.S
@@ -17,12 +17,12 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <mach/hardware.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-sa110.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-sa110.S
@@ -12,12 +12,12 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <mach/hardware.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-v6.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-v6.S
@@ -9,11 +9,11 @@
  */
 #include <linux/init.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 
 #include "proc-macros.S"
 
--- a/arch/arm/mm/proc-v7.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-v7.S
@@ -9,11 +9,11 @@
 #include <linux/arm-smccc.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 #include <asm/memory.h>
 
 #include "proc-macros.S"
--- a/arch/arm/mm/proc-xsc3.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-xsc3.S
@@ -23,9 +23,9 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
-#include <linux/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
--- a/arch/arm/mm/proc-xscale.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/proc-xscale.S
@@ -19,9 +19,9 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
-#include <linux/pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
--- a/arch/arm/mm/pv-fixup-asm.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/arm/mm/pv-fixup-asm.S
@@ -6,10 +6,10 @@
  * for Keystone 2
  */
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/asm-offsets.h>
 #include <asm/cp15.h>
 #include <asm/memory.h>
-#include <linux/pgtable.h>
 
 	.section ".idmap.text", "ax"
 
--- a/arch/ia64/kernel/entry.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/entry.S
@@ -38,12 +38,12 @@
  */
 
 
+#include <linux/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/cache.h>
 #include <asm/errno.h>
 #include <asm/kregs.h>
 #include <asm/asm-offsets.h>
-#include <linux/pgtable.h>
 #include <asm/percpu.h>
 #include <asm/processor.h>
 #include <asm/thread_info.h>
--- a/arch/ia64/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/head.S
@@ -21,18 +21,19 @@
  */
 
 
+#include <linux/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/fpu.h>
 #include <asm/kregs.h>
 #include <asm/mmu_context.h>
 #include <asm/asm-offsets.h>
 #include <asm/pal.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/mca_asm.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/export.h>
 
 #ifdef CONFIG_HOTPLUG_CPU
--- a/arch/ia64/kernel/irq_ia64.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/irq_ia64.c
@@ -16,6 +16,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pgtable.h>
 
 #include <linux/jiffies.h>
 #include <linux/errno.h>
@@ -37,7 +38,6 @@
 #include <asm/intrinsics.h>
 #include <asm/io.h>
 #include <asm/hw_irq.h>
-#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 
 #ifdef CONFIG_PERFMON
--- a/arch/ia64/kernel/ivt.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/ivt.S
@@ -48,11 +48,11 @@
  */
 
 
+#include <linux/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/break.h>
 #include <asm/kregs.h>
 #include <asm/asm-offsets.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
--- a/arch/ia64/kernel/kprobes.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/kprobes.c
@@ -17,8 +17,8 @@
 #include <linux/preempt.h>
 #include <linux/extable.h>
 #include <linux/kdebug.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/sections.h>
 #include <asm/exception.h>
 
--- a/arch/ia64/kernel/mca_asm.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/mca_asm.S
@@ -25,9 +25,9 @@
  *		Use per cpu MCA/INIT stacks for all data.
  */
 #include <linux/threads.h>
+#include <linux/pgtable.h>
 
 #include <asm/asmmacro.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mca_asm.h>
 #include <asm/mca.h>
--- a/arch/ia64/kernel/relocate_kernel.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/relocate_kernel.S
@@ -8,10 +8,10 @@
  * Copyright (C) 2005 Khalid Aziz  <khalid.aziz@hp.com>
  * Copyright (C) 2005 Intel Corp,  Zou Nan hai <nanhai.zou@intel.com>
  */
+#include <linux/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/kregs.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/mca_asm.h>
 
        /* Must be relocatable PIC code callable as a C function
@@ -319,5 +319,3 @@ GLOBAL_ENTRY(ia64_dump_cpu_regs)
         ;;
         br.ret.sptk.many rp
 END(ia64_dump_cpu_regs)
-
-
--- a/arch/ia64/kernel/setup.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/setup.c
@@ -25,6 +25,7 @@
  */
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 #include <linux/acpi.h>
 #include <linux/console.h>
@@ -56,7 +57,6 @@
 #include <asm/meminit.h>
 #include <asm/page.h>
 #include <asm/patch.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/sal.h>
 #include <asm/sections.h>
--- a/arch/ia64/kernel/uncached.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/uncached.c
@@ -19,9 +19,9 @@
 #include <linux/nmi.h>
 #include <linux/genalloc.h>
 #include <linux/gfp.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/pal.h>
-#include <linux/pgtable.h>
 #include <linux/atomic.h>
 #include <asm/tlbflush.h>
 
--- a/arch/ia64/kernel/vmlinux.lds.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/ia64/kernel/vmlinux.lds.S
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
+#include <linux/pgtable.h>
 #include <asm/cache.h>
 #include <asm/ptrace.h>
-#include <linux/pgtable.h>
 #include <asm/thread_info.h>
 
 #define EMITS_PT_NOTE
--- a/arch/m68k/68000/m68VZ328.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/m68k/68000/m68VZ328.c
@@ -22,8 +22,8 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/rtc.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/machdep.h>
 #include <asm/MC68VZ328.h>
 #include <asm/bootstd.h>
--- a/arch/m68k/include/asm/sun3xflop.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/m68k/include/asm/sun3xflop.h
@@ -10,8 +10,8 @@
 #ifndef __ASM_SUN3X_FLOPPY_H
 #define __ASM_SUN3X_FLOPPY_H
 
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 #include <asm/irq.h>
 #include <asm/sun3x.h>
 
--- a/arch/m68k/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/m68k/kernel/head.S
@@ -255,6 +255,7 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-amiga.h>
 #include <asm/bootinfo-atari.h>
@@ -264,7 +265,6 @@
 #include <asm/bootinfo-vme.h>
 #include <asm/setup.h>
 #include <asm/entry.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
 #ifdef CONFIG_MAC
--- a/arch/microblaze/include/asm/pgalloc.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/microblaze/include/asm/pgalloc.h
@@ -12,11 +12,11 @@
 
 #include <linux/kernel.h>	/* For min/max macros */
 #include <linux/highmem.h>
+#include <linux/pgtable.h>
 #include <asm/setup.h>
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/cache.h>
-#include <linux/pgtable.h>
 
 #define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
 #include <asm-generic/pgalloc.h>
--- a/arch/microblaze/kernel/hw_exception_handler.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/microblaze/kernel/hw_exception_handler.S
@@ -68,9 +68,9 @@
 #include <asm/entry.h>
 #include <asm/current.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/signal.h>
 #include <asm/registers.h>
 #include <asm/asm-offsets.h>
--- a/arch/microblaze/kernel/module.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/microblaze/kernel/module.c
@@ -11,8 +11,8 @@
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
 #include <linux/string.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/cacheflush.h>
 
 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
--- a/arch/microblaze/kernel/setup.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/microblaze/kernel/setup.c
@@ -18,6 +18,7 @@
 #include <linux/console.h>
 #include <linux/debugfs.h>
 #include <linux/of_fdt.h>
+#include <linux/pgtable.h>
 
 #include <asm/setup.h>
 #include <asm/sections.h>
@@ -33,7 +34,6 @@
 #include <asm/entry.h>
 #include <asm/cpuinfo.h>
 
-#include <linux/pgtable.h>
 
 DEFINE_PER_CPU(unsigned int, KSP);	/* Saved kernel stack pointer */
 DEFINE_PER_CPU(unsigned int, KM);	/* Kernel/user mode */
--- a/arch/microblaze/mm/pgtable.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/microblaze/mm/pgtable.c
@@ -32,8 +32,8 @@
 #include <linux/vmalloc.h>
 #include <linux/init.h>
 #include <linux/mm_types.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/pgalloc.h>
 #include <linux/io.h>
 #include <asm/mmu.h>
--- a/arch/mips/jazz/irq.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/mips/jazz/irq.c
@@ -14,12 +14,12 @@
 #include <linux/smp.h>
 #include <linux/spinlock.h>
 #include <linux/irq.h>
+#include <linux/pgtable.h>
 
 #include <asm/irq_cpu.h>
 #include <asm/i8259.h>
 #include <asm/io.h>
 #include <asm/jazz.h>
-#include <linux/pgtable.h>
 #include <asm/tlbmisc.h>
 
 static DEFINE_RAW_SPINLOCK(r4030_lock);
--- a/arch/mips/jazz/setup.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/mips/jazz/setup.c
@@ -17,11 +17,11 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/dma-mapping.h>
+#include <linux/pgtable.h>
 
 #include <asm/jazz.h>
 #include <asm/jazzdma.h>
 #include <asm/reboot.h>
-#include <linux/pgtable.h>
 #include <asm/tlbmisc.h>
 
 extern asmlinkage void jazz_handle_int(void);
--- a/arch/mips/kvm/mips.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/mips/kvm/mips.c
@@ -19,13 +19,13 @@
 #include <linux/sched/signal.h>
 #include <linux/fs.h>
 #include <linux/memblock.h>
+#include <linux/pgtable.h>
 
 #include <asm/fpu.h>
 #include <asm/page.h>
 #include <asm/cacheflush.h>
 #include <asm/mmu_context.h>
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 
 #include <linux/kvm_host.h>
 
--- a/arch/mips/mm/tlbex.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/mips/mm/tlbex.c
@@ -28,11 +28,11 @@
 #include <linux/smp.h>
 #include <linux/string.h>
 #include <linux/cache.h>
+#include <linux/pgtable.h>
 
 #include <asm/cacheflush.h>
 #include <asm/cpu-type.h>
 #include <asm/mmu_context.h>
-#include <linux/pgtable.h>
 #include <asm/war.h>
 #include <asm/uasm.h>
 #include <asm/setup.h>
--- a/arch/nds32/include/asm/highmem.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/nds32/include/asm/highmem.h
@@ -7,7 +7,6 @@
 #include <asm/proc-fns.h>
 #include <asm/kmap_types.h>
 #include <asm/fixmap.h>
-#include <linux/pgtable.h>
 
 /*
  * Right now we initialize only a single pte table. It can be extended
--- a/arch/nds32/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/nds32/kernel/head.S
@@ -3,10 +3,10 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/ptrace.h>
 #include <asm/asm-offsets.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <linux/sizes.h>
 #include <asm/thread_info.h>
 
--- a/arch/nios2/kernel/nios2_ksyms.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/nios2/kernel/nios2_ksyms.c
@@ -8,9 +8,9 @@
 
 #include <linux/export.h>
 #include <linux/string.h>
+#include <linux/pgtable.h>
 
 #include <asm/cacheflush.h>
-#include <linux/pgtable.h>
 
 /* string functions */
 
--- a/arch/openrisc/include/asm/io.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/openrisc/include/asm/io.h
@@ -26,7 +26,6 @@
 #define PIO_MASK		0
 
 #include <asm-generic/io.h>
-#include <linux/pgtable.h>
 
 void __iomem *ioremap(phys_addr_t offset, unsigned long size);
 extern void iounmap(void *addr);
--- a/arch/openrisc/kernel/entry.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/openrisc/kernel/entry.S
@@ -13,6 +13,7 @@
  */
 
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 
 #include <asm/processor.h>
 #include <asm/unistd.h>
@@ -21,7 +22,6 @@
 #include <asm/spr_defs.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/asm-offsets.h>
 
 #define DISABLE_INTERRUPTS(t1,t2)			\
--- a/arch/openrisc/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/openrisc/kernel/head.S
@@ -16,10 +16,10 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/serial_reg.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/thread_info.h>
 #include <asm/cache.h>
 #include <asm/spr_defs.h>
--- a/arch/openrisc/kernel/or32_ksyms.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/openrisc/kernel/or32_ksyms.c
@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/vmalloc.h>
 #include <linux/semaphore.h>
+#include <linux/pgtable.h>
 
 #include <asm/processor.h>
 #include <linux/uaccess.h>
@@ -26,7 +27,6 @@
 #include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 
 #define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name)
 
--- a/arch/openrisc/mm/ioremap.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/openrisc/mm/ioremap.c
@@ -13,11 +13,11 @@
 
 #include <linux/vmalloc.h>
 #include <linux/io.h>
+#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/kmap_types.h>
 #include <asm/fixmap.h>
 #include <asm/bug.h>
-#include <linux/pgtable.h>
 #include <linux/sched.h>
 #include <asm/tlbflush.h>
 
--- a/arch/parisc/kernel/asm-offsets.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/parisc/kernel/asm-offsets.c
@@ -20,8 +20,8 @@
 #include <linux/ptrace.h>
 #include <linux/hardirq.h>
 #include <linux/kbuild.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/ptrace.h>
 #include <asm/processor.h>
 #include <asm/pdc.h>
--- a/arch/parisc/kernel/entry.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/parisc/kernel/entry.S
@@ -19,7 +19,6 @@
 #include <asm/psw.h>
 #include <asm/cache.h>		/* for L1_CACHE_SHIFT */
 #include <asm/assembly.h>	/* for LDREG/STREG defines */
-#include <linux/pgtable.h>
 #include <asm/signal.h>
 #include <asm/unistd.h>
 #include <asm/ldcw.h>
@@ -28,6 +27,7 @@
 #include <asm/alternative.h>
 
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 
 #ifdef CONFIG_64BIT
 	.level 2.0w
--- a/arch/parisc/kernel/head.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/parisc/kernel/head.S
@@ -17,10 +17,10 @@
 #include <asm/pdc.h>
 	
 #include <asm/assembly.h>
-#include <linux/pgtable.h>
 
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 	.level	PA_ASM_LEVEL
 
--- a/arch/parisc/kernel/pacache.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/parisc/kernel/pacache.S
@@ -21,12 +21,12 @@
 
 #include <asm/psw.h>
 #include <asm/assembly.h>
-#include <linux/pgtable.h>
 #include <asm/cache.h>
 #include <asm/ldcw.h>
 #include <asm/alternative.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 	.section .text.hot
 	.align	16
--- a/arch/parisc/kernel/pdt.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/parisc/kernel/pdt.c
@@ -17,11 +17,11 @@
 #include <linux/seq_file.h>
 #include <linux/kthread.h>
 #include <linux/initrd.h>
+#include <linux/pgtable.h>
 
 #include <asm/pdc.h>
 #include <asm/pdcpat.h>
 #include <asm/sections.h>
-#include <linux/pgtable.h>
 
 enum pdt_access_type {
 	PDT_NONE,
--- a/arch/powerpc/include/asm/fixmap.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/include/asm/fixmap.h
@@ -16,8 +16,8 @@
 
 #ifndef __ASSEMBLY__
 #include <linux/sizes.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
--- a/arch/powerpc/kernel/btext.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/btext.c
@@ -9,13 +9,13 @@
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/memblock.h>
+#include <linux/pgtable.h>
 
 #include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/btext.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/udbg.h>
--- a/arch/powerpc/kernel/fpu.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/fpu.S
@@ -12,7 +12,6 @@
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/kernel/head_32.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/head_32.S
@@ -17,10 +17,10 @@
  */
 
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/kernel/head_40x.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/head_40x.S
@@ -26,10 +26,10 @@
  */
 
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/head_44x.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/head_44x.S
@@ -25,10 +25,10 @@
  */
 
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/head_8xx.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/head_8xx.S
@@ -16,12 +16,12 @@
 
 #include <linux/init.h>
 #include <linux/magic.h>
+#include <linux/pgtable.h>
 #include <linux/sizes.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/cache.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/head_fsl_booke.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/head_fsl_booke.S
@@ -28,10 +28,10 @@
 
 #include <linux/init.h>
 #include <linux/threads.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
--- a/arch/powerpc/kernel/io-workarounds.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/io-workarounds.c
@@ -10,10 +10,10 @@
 
 #include <linux/kernel.h>
 #include <linux/sched/mm.h>	/* for init_mm */
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/machdep.h>
-#include <linux/pgtable.h>
 #include <asm/ppc-pci.h>
 #include <asm/io-workarounds.h>
 #include <asm/pte-walk.h>
--- a/arch/powerpc/kernel/irq.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/irq.c
@@ -51,10 +51,10 @@
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/vmalloc.h>
+#include <linux/pgtable.h>
 
 #include <linux/uaccess.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/cache.h>
 #include <asm/prom.h>
--- a/arch/powerpc/kernel/mce_power.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/mce_power.c
@@ -12,10 +12,10 @@
 #include <linux/types.h>
 #include <linux/ptrace.h>
 #include <linux/extable.h>
+#include <linux/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mce.h>
 #include <asm/machdep.h>
-#include <linux/pgtable.h>
 #include <asm/pte-walk.h>
 #include <asm/sstep.h>
 #include <asm/exception-64s.h>
--- a/arch/powerpc/kernel/paca.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/paca.c
@@ -8,11 +8,11 @@
 #include <linux/memblock.h>
 #include <linux/sched/task.h>
 #include <linux/numa.h>
+#include <linux/pgtable.h>
 
 #include <asm/lppaca.h>
 #include <asm/paca.h>
 #include <asm/sections.h>
-#include <linux/pgtable.h>
 #include <asm/kexec.h>
 #include <asm/svm.h>
 #include <asm/ultravisor.h>
--- a/arch/powerpc/kernel/prom.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/prom.c
@@ -30,6 +30,7 @@
 #include <linux/of_fdt.h>
 #include <linux/libfdt.h>
 #include <linux/cpu.h>
+#include <linux/pgtable.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
@@ -41,7 +42,6 @@
 #include <asm/smp.h>
 #include <asm/mmu.h>
 #include <asm/paca.h>
-#include <linux/pgtable.h>
 #include <asm/powernv.h>
 #include <asm/iommu.h>
 #include <asm/btext.h>
--- a/arch/powerpc/kernel/prom_init.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/prom_init.c
@@ -26,6 +26,7 @@
 #include <linux/delay.h>
 #include <linux/initrd.h>
 #include <linux/bitops.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/page.h>
@@ -34,7 +35,6 @@
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/iommu.h>
 #include <asm/btext.h>
 #include <asm/sections.h>
--- a/arch/powerpc/kernel/rtas_pci.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/rtas_pci.c
@@ -13,9 +13,9 @@
 #include <linux/pci.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/kernel/setup_32.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/setup_32.c
@@ -19,11 +19,11 @@
 #include <linux/memblock.h>
 #include <linux/export.h>
 #include <linux/nvram.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
-#include <linux/pgtable.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
--- a/arch/powerpc/kernel/setup_64.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/setup_64.c
@@ -30,13 +30,13 @@
 #include <linux/lockdep.h>
 #include <linux/memory.h>
 #include <linux/nmi.h>
+#include <linux/pgtable.h>
 
 #include <asm/debugfs.h>
 #include <asm/io.h>
 #include <asm/kdump.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
-#include <linux/pgtable.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/kernel/setup-common.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/setup-common.c
@@ -31,13 +31,13 @@
 #include <linux/memblock.h>
 #include <linux/of_platform.h>
 #include <linux/hugetlb.h>
+#include <linux/pgtable.h>
 #include <asm/debugfs.h>
 #include <asm/io.h>
 #include <asm/paca.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
 #include <asm/vdso_datapage.h>
-#include <linux/pgtable.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/kernel/smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kernel/smp.c
@@ -33,6 +33,7 @@
 #include <linux/processor.h>
 #include <linux/random.h>
 #include <linux/stackprotector.h>
+#include <linux/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <linux/atomic.h>
@@ -41,7 +42,6 @@
 #include <asm/kvm_ppc.h>
 #include <asm/dbell.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
 #include <asm/time.h>
--- a/arch/powerpc/kvm/book3s_64_mmu_radix.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_64_mmu_radix.c
@@ -11,12 +11,12 @@
 #include <linux/anon_inodes.h>
 #include <linux/file.h>
 #include <linux/debugfs.h>
+#include <linux/pgtable.h>
 
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/pte-walk.h>
 #include <asm/ultravisor.h>
--- a/arch/powerpc/kvm/book3s_hv_nested.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_hv_nested.c
@@ -11,11 +11,11 @@
 #include <linux/kernel.h>
 #include <linux/kvm_host.h>
 #include <linux/llist.h>
+#include <linux/pgtable.h>
 
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/pte-walk.h>
 #include <asm/reg.h>
--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_hv_rm_xics.c
@@ -8,6 +8,7 @@
 #include <linux/kvm_host.h>
 #include <linux/err.h>
 #include <linux/kernel_stat.h>
+#include <linux/pgtable.h>
 
 #include <asm/kvm_book3s.h>
 #include <asm/kvm_ppc.h>
@@ -15,7 +16,6 @@
 #include <asm/xics.h>
 #include <asm/synch.h>
 #include <asm/cputhreads.h>
-#include <linux/pgtable.h>
 #include <asm/ppc-opcode.h>
 #include <asm/pnv-pci.h>
 #include <asm/opal.h>
--- a/arch/powerpc/kvm/book3s_hv_rm_xive.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kvm/book3s_hv_rm_xive.c
@@ -3,6 +3,7 @@
 #include <linux/kvm_host.h>
 #include <linux/err.h>
 #include <linux/kernel_stat.h>
+#include <linux/pgtable.h>
 
 #include <asm/kvm_book3s.h>
 #include <asm/kvm_ppc.h>
@@ -11,7 +12,6 @@
 #include <asm/debug.h>
 #include <asm/synch.h>
 #include <asm/cputhreads.h>
-#include <linux/pgtable.h>
 #include <asm/ppc-opcode.h>
 #include <asm/pnv-pci.h>
 #include <asm/opal.h>
--- a/arch/powerpc/kvm/fpu.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/kvm/fpu.S
@@ -5,10 +5,10 @@
  *    Copyright (C) 2010 Alexander Graf (agraf@suse.de)
  */
 
+#include <linux/pgtable.h>
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/mm/book3s32/hash_low.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/book3s32/hash_low.S
@@ -14,9 +14,9 @@
  *  hash table, so this file is not used on them.)
  */
 
+#include <linux/pgtable.h>
 #include <asm/reg.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
 #include <asm/thread_info.h>
--- a/arch/powerpc/mm/book3s64/hash_native.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/hash_native.c
@@ -14,11 +14,11 @@
 #include <linux/processor.h>
 #include <linux/threads.h>
 #include <linux/smp.h>
+#include <linux/pgtable.h>
 
 #include <asm/machdep.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
-#include <linux/pgtable.h>
 #include <asm/trace.h>
 #include <asm/tlb.h>
 #include <asm/cputable.h>
--- a/arch/powerpc/mm/book3s64/hash_utils.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/hash_utils.c
@@ -35,10 +35,10 @@
 #include <linux/pkeys.h>
 #include <linux/hugetlb.h>
 #include <linux/cpu.h>
+#include <linux/pgtable.h>
 
 #include <asm/debugfs.h>
 #include <asm/processor.h>
-#include <linux/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/page.h>
--- a/arch/powerpc/mm/book3s64/slb.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/book3s64/slb.c
@@ -10,7 +10,6 @@
  */
 
 #include <asm/asm-prototypes.h>
-#include <linux/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/paca.h>
@@ -21,6 +20,7 @@
 #include <linux/compiler.h>
 #include <linux/context_tracking.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/udbg.h>
 #include <asm/code-patching.h>
--- a/arch/powerpc/mm/init-common.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/init-common.c
@@ -17,8 +17,8 @@
 #undef DEBUG
 
 #include <linux/string.h>
-#include <asm/pgalloc.h>
 #include <linux/pgtable.h>
+#include <asm/pgalloc.h>
 #include <asm/kup.h>
 
 phys_addr_t memstart_addr __ro_after_init = (phys_addr_t)~0ull;
--- a/arch/powerpc/mm/nohash/tlb_low_64e.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/nohash/tlb_low_64e.S
@@ -6,6 +6,7 @@
  *      Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp.
  */
 
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/reg.h>
 #include <asm/page.h>
@@ -13,7 +14,6 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/cputable.h>
-#include <linux/pgtable.h>
 #include <asm/exception-64e.h>
 #include <asm/ppc-opcode.h>
 #include <asm/kvm_asm.h>
--- a/arch/powerpc/mm/ptdump/bats.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/mm/ptdump/bats.c
@@ -6,8 +6,8 @@
  * This dumps the content of BATS
  */
 
-#include <asm/debugfs.h>
 #include <linux/pgtable.h>
+#include <asm/debugfs.h>
 #include <asm/cpu_has_feature.h>
 
 #include "ptdump.h"
--- a/arch/powerpc/platforms/85xx/corenet_generic.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -12,11 +12,11 @@
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/pgtable.h>
 
 #include <asm/time.h>
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
-#include <linux/pgtable.h>
 #include <asm/ppc-pci.h>
 #include <mm/mmu_decl.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -22,8 +22,8 @@
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
 #include <linux/of_platform.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/page.h>
 #include <linux/atomic.h>
 #include <asm/time.h>
--- a/arch/powerpc/platforms/85xx/qemu_e500.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/qemu_e500.c
@@ -13,8 +13,8 @@
 
 #include <linux/kernel.h>
 #include <linux/of_fdt.h>
-#include <asm/machdep.h>
 #include <linux/pgtable.h>
+#include <asm/machdep.h>
 #include <asm/time.h>
 #include <asm/udbg.h>
 #include <asm/mpic.h>
--- a/arch/powerpc/platforms/85xx/sbc8548.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/sbc8548.c
@@ -24,8 +24,8 @@
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
 #include <linux/of_platform.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/page.h>
 #include <linux/atomic.h>
 #include <asm/time.h>
--- a/arch/powerpc/platforms/85xx/smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/85xx/smp.c
@@ -16,9 +16,9 @@
 #include <linux/highmem.h>
 #include <linux/cpu.h>
 #include <linux/fsl/guts.h>
+#include <linux/pgtable.h>
 
 #include <asm/machdep.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/mpic.h>
 #include <asm/cacheflush.h>
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -10,10 +10,10 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/pgtable.h>
 
 #include <asm/code-patching.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/pci-bridge.h>
 #include <asm/mpic.h>
 #include <asm/cacheflush.h>
--- a/arch/powerpc/platforms/cell/cbe_regs.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/cbe_regs.c
@@ -12,9 +12,9 @@
 #include <linux/export.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/ptrace.h>
 #include <asm/cell-regs.h>
--- a/arch/powerpc/platforms/cell/interrupt.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/interrupt.c
@@ -23,9 +23,9 @@
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/kernel_stat.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/ptrace.h>
 #include <asm/machdep.h>
--- a/arch/powerpc/platforms/cell/pervasive.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/pervasive.c
@@ -15,11 +15,11 @@
 #include <linux/percpu.h>
 #include <linux/types.h>
 #include <linux/kallsyms.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/machdep.h>
 #include <asm/prom.h>
-#include <linux/pgtable.h>
 #include <asm/reg.h>
 #include <asm/cell-regs.h>
 #include <asm/cpu_has_feature.h>
--- a/arch/powerpc/platforms/cell/smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/smp.c
@@ -21,12 +21,12 @@
 #include <linux/err.h>
 #include <linux/device.h>
 #include <linux/cpu.h>
+#include <linux/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
--- a/arch/powerpc/platforms/cell/spider-pic.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/cell/spider-pic.c
@@ -10,8 +10,8 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/ioport.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/prom.h>
 #include <asm/io.h>
 
--- a/arch/powerpc/platforms/chrp/pci.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/chrp/pci.c
@@ -8,9 +8,9 @@
 #include <linux/delay.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/hydra.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/chrp/smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/chrp/smp.c
@@ -16,12 +16,12 @@
 #include <linux/kernel_stat.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
+#include <linux/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/powermac/smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/powermac/smp.c
@@ -30,13 +30,13 @@
 #include <linux/hardirq.h>
 #include <linux/cpu.h>
 #include <linux/compiler.h>
+#include <linux/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <linux/atomic.h>
 #include <asm/code-patching.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
--- a/arch/powerpc/platforms/pseries/lpar.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/pseries/lpar.c
@@ -21,10 +21,10 @@
 #include <linux/cpuhotplug.h>
 #include <linux/workqueue.h>
 #include <linux/proc_fs.h>
+#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/mmu_context.h>
 #include <asm/iommu.h>
--- a/arch/powerpc/platforms/pseries/smp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/platforms/pseries/smp.c
@@ -20,12 +20,12 @@
 #include <linux/err.h>
 #include <linux/device.h>
 #include <linux/cpu.h>
+#include <linux/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
--- a/arch/powerpc/sysdev/mpic.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/powerpc/sysdev/mpic.c
@@ -29,11 +29,11 @@
 #include <linux/slab.h>
 #include <linux/syscore_ops.h>
 #include <linux/ratelimit.h>
+#include <linux/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <asm/signal.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/machdep.h>
 #include <asm/mpic.h>
--- a/arch/riscv/include/asm/fixmap.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/riscv/include/asm/fixmap.h
@@ -8,8 +8,8 @@
 
 #include <linux/kernel.h>
 #include <linux/sizes.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 
 #ifdef CONFIG_MMU
 /*
--- a/arch/riscv/include/asm/io.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/riscv/include/asm/io.h
@@ -12,8 +12,8 @@
 #define _ASM_RISCV_IO_H
 
 #include <linux/types.h>
-#include <asm/mmiowb.h>
 #include <linux/pgtable.h>
+#include <asm/mmiowb.h>
 
 /*
  * MMIO access functions are separated out to break dependency cycles
--- a/arch/riscv/include/asm/kasan.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/riscv/include/asm/kasan.h
@@ -8,8 +8,6 @@
 
 #ifdef CONFIG_KASAN
 
-#include <linux/pgtable.h>
-
 #define KASAN_SHADOW_SCALE_SHIFT	3
 
 #define KASAN_SHADOW_SIZE	(UL(1) << (38 - KASAN_SHADOW_SCALE_SHIFT))
--- a/arch/riscv/mm/cacheflush.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/riscv/mm/cacheflush.c
@@ -3,7 +3,6 @@
  * Copyright (C) 2017 SiFive
  */
 
-#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 #ifdef CONFIG_SMP
--- a/arch/riscv/mm/kasan_init.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/riscv/mm/kasan_init.c
@@ -6,8 +6,8 @@
 #include <linux/kasan.h>
 #include <linux/kernel.h>
 #include <linux/memblock.h>
-#include <asm/tlbflush.h>
 #include <linux/pgtable.h>
+#include <asm/tlbflush.h>
 #include <asm/fixmap.h>
 
 extern pgd_t early_pg_dir[PTRS_PER_PGD];
--- a/arch/s390/boot/ipl_parm.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/boot/ipl_parm.c
@@ -2,12 +2,12 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/ctype.h>
+#include <linux/pgtable.h>
 #include <asm/ebcdic.h>
 #include <asm/sclp.h>
 #include <asm/sections.h>
 #include <asm/boot_data.h>
 #include <asm/facility.h>
-#include <linux/pgtable.h>
 #include <asm/uv.h>
 #include "boot.h"
 
--- a/arch/s390/boot/kaslr.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/boot/kaslr.c
@@ -2,8 +2,8 @@
 /*
  * Copyright IBM Corp. 2019
  */
-#include <asm/mem_detect.h>
 #include <linux/pgtable.h>
+#include <asm/mem_detect.h>
 #include <asm/cpacf.h>
 #include <asm/timex.h>
 #include <asm/sclp.h>
--- a/arch/s390/include/asm/hugetlb.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/include/asm/hugetlb.h
@@ -9,8 +9,8 @@
 #ifndef _ASM_S390_HUGETLB_H
 #define _ASM_S390_HUGETLB_H
 
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 
 #define hugetlb_free_pgd_range			free_pgd_range
 #define hugepages_supported()			(MACHINE_HAS_EDAT1)
--- a/arch/s390/include/asm/kasan.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/include/asm/kasan.h
@@ -2,8 +2,6 @@
 #ifndef __ASM_KASAN_H
 #define __ASM_KASAN_H
 
-#include <linux/pgtable.h>
-
 #ifdef CONFIG_KASAN
 
 #define KASAN_SHADOW_SCALE_SHIFT 3
--- a/arch/s390/kernel/asm-offsets.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/kernel/asm-offsets.c
@@ -11,9 +11,9 @@
 #include <linux/kvm_host.h>
 #include <linux/sched.h>
 #include <linux/purgatory.h>
+#include <linux/pgtable.h>
 #include <asm/idle.h>
 #include <asm/vdso.h>
-#include <linux/pgtable.h>
 #include <asm/gmap.h>
 #include <asm/nmi.h>
 #include <asm/stacktrace.h>
--- a/arch/s390/kvm/gaccess.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/kvm/gaccess.c
@@ -9,8 +9,8 @@
 #include <linux/vmalloc.h>
 #include <linux/mm_types.h>
 #include <linux/err.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/gmap.h>
 #include "kvm-s390.h"
 #include "gaccess.h"
--- a/arch/s390/kvm/kvm-s390.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/kvm/kvm-s390.c
@@ -31,11 +31,11 @@
 #include <linux/bitmap.h>
 #include <linux/sched/signal.h>
 #include <linux/string.h>
+#include <linux/pgtable.h>
 
 #include <asm/asm-offsets.h>
 #include <asm/lowcore.h>
 #include <asm/stp.h>
-#include <linux/pgtable.h>
 #include <asm/gmap.h>
 #include <asm/nmi.h>
 #include <asm/switch_to.h>
--- a/arch/s390/kvm/priv.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/kvm/priv.c
@@ -13,6 +13,7 @@
 #include <linux/errno.h>
 #include <linux/compat.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/asm-offsets.h>
 #include <asm/facility.h>
@@ -20,7 +21,6 @@
 #include <asm/debug.h>
 #include <asm/ebcdic.h>
 #include <asm/sysinfo.h>
-#include <linux/pgtable.h>
 #include <asm/page-states.h>
 #include <asm/pgalloc.h>
 #include <asm/gmap.h>
--- a/arch/s390/mm/extmem.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/mm/extmem.c
@@ -20,9 +20,9 @@
 #include <linux/ctype.h>
 #include <linux/ioport.h>
 #include <linux/refcount.h>
+#include <linux/pgtable.h>
 #include <asm/diag.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/ebcdic.h>
 #include <asm/errno.h>
 #include <asm/extmem.h>
--- a/arch/s390/mm/gmap.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/mm/gmap.c
@@ -17,8 +17,8 @@
 #include <linux/swapops.h>
 #include <linux/ksm.h>
 #include <linux/mman.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/pgalloc.h>
 #include <asm/gmap.h>
 #include <asm/tlb.h>
--- a/arch/s390/mm/kasan_init.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/s390/mm/kasan_init.c
@@ -2,8 +2,8 @@
 #include <linux/kasan.h>
 #include <linux/sched/task.h>
 #include <linux/memblock.h>
-#include <asm/pgalloc.h>
 #include <linux/pgtable.h>
+#include <asm/pgalloc.h>
 #include <asm/kasan.h>
 #include <asm/mem_detect.h>
 #include <asm/processor.h>
--- a/arch/sh/mm/pmb.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sh/mm/pmb.c
@@ -23,10 +23,10 @@
 #include <linux/io.h>
 #include <linux/spinlock.h>
 #include <linux/vmalloc.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <linux/sizes.h>
 #include <linux/uaccess.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
--- a/arch/sparc/include/asm/floppy_32.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/include/asm/floppy_32.h
@@ -9,8 +9,8 @@
 
 #include <linux/of.h>
 #include <linux/of_device.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/idprom.h>
 #include <asm/oplib.h>
 #include <asm/auxio.h>
--- a/arch/sparc/include/asm/highmem.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/include/asm/highmem.h
@@ -22,9 +22,9 @@
 #ifdef __KERNEL__
 
 #include <linux/interrupt.h>
+#include <linux/pgtable.h>
 #include <asm/vaddrs.h>
 #include <asm/kmap_types.h>
-#include <linux/pgtable.h>
 #include <asm/pgtsrmmu.h>
 
 /* declarations for highmem.c */
--- a/arch/sparc/include/asm/io-unit.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/include/asm/io-unit.h
@@ -7,8 +7,8 @@
 #define _SPARC_IO_UNIT_H
 
 #include <linux/spinlock.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 
 /* The io-unit handles all virtual to physical address translations
  * that occur between the SBUS and physical memory.  Access by
--- a/arch/sparc/include/asm/pgalloc_32.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/include/asm/pgalloc_32.h
@@ -4,9 +4,9 @@
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/pgtable.h>
 
 #include <asm/pgtsrmmu.h>
-#include <linux/pgtable.h>
 #include <asm/vaddrs.h>
 #include <asm/page.h>
 
--- a/arch/sparc/kernel/cpu.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/cpu.c
@@ -11,9 +11,9 @@
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
+#include <linux/pgtable.h>
 
 #include <asm/spitfire.h>
-#include <linux/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/setup.h>
 #include <asm/page.h>
--- a/arch/sparc/kernel/entry.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/entry.S
@@ -10,6 +10,7 @@
 
 #include <linux/linkage.h>
 #include <linux/errno.h>
+#include <linux/pgtable.h>
 
 #include <asm/head.h>
 #include <asm/asi.h>
@@ -20,7 +21,6 @@
 #include <asm/psr.h>
 #include <asm/vaddrs.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/winmacro.h>
 #include <asm/signal.h>
 #include <asm/obio.h>
--- a/arch/sparc/kernel/head_64.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/head_64.S
@@ -12,13 +12,13 @@
 #include <linux/threads.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/thread_info.h>
 #include <asm/asi.h>
 #include <asm/pstate.h>
 #include <asm/ptrace.h>
 #include <asm/spitfire.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/errno.h>
 #include <asm/signal.h>
 #include <asm/processor.h>
--- a/arch/sparc/kernel/ktlb.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/ktlb.S
@@ -7,10 +7,10 @@
  * Copyright (C) 1996,98,99 Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
  */
 
+#include <linux/pgtable.h>
 #include <asm/head.h>
 #include <asm/asi.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/tsb.h>
 
 	.text
--- a/arch/sparc/kernel/pci.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/pci.c
@@ -21,9 +21,9 @@
 #include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/pgtable.h>
 
 #include <linux/uaccess.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/prom.h>
 #include <asm/apb.h>
--- a/arch/sparc/kernel/sun4m_irq.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/sun4m_irq.c
@@ -12,11 +12,11 @@
 
 #include <linux/slab.h>
 #include <linux/sched/debug.h>
+#include <linux/pgtable.h>
 
 #include <asm/timer.h>
 #include <asm/traps.h>
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/cacheflush.h>
--- a/arch/sparc/kernel/trampoline_64.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/trampoline_64.S
@@ -6,6 +6,7 @@
  */
 
 
+#include <linux/pgtable.h>
 #include <asm/head.h>
 #include <asm/asi.h>
 #include <asm/lsu.h>
@@ -13,7 +14,6 @@
 #include <asm/dcu.h>
 #include <asm/pstate.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/spitfire.h>
 #include <asm/processor.h>
 #include <asm/thread_info.h>
--- a/arch/sparc/kernel/traps_32.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/kernel/traps_32.c
@@ -18,12 +18,12 @@
 #include <linux/smp.h>
 #include <linux/kdebug.h>
 #include <linux/export.h>
+#include <linux/pgtable.h>
 
 #include <asm/delay.h>
 #include <asm/ptrace.h>
 #include <asm/oplib.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/unistd.h>
 #include <asm/traps.h>
 
--- a/arch/sparc/lib/clear_page.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/lib/clear_page.S
@@ -5,10 +5,10 @@
  * Copyright (C) 1997 Jakub Jelinek (jakub@redhat.com)
  */
 
+#include <linux/pgtable.h>
 #include <asm/visasm.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/spitfire.h>
 #include <asm/head.h>
 #include <asm/export.h>
--- a/arch/sparc/mm/tsb.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/mm/tsb.c
@@ -8,9 +8,9 @@
 #include <linux/preempt.h>
 #include <linux/slab.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/setup.h>
 #include <asm/tsb.h>
--- a/arch/sparc/mm/ultra.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/sparc/mm/ultra.S
@@ -5,8 +5,8 @@
  * Copyright (C) 1997, 2000, 2008 David S. Miller (davem@davemloft.net)
  */
 
-#include <asm/asi.h>
 #include <linux/pgtable.h>
+#include <asm/asi.h>
 #include <asm/page.h>
 #include <asm/spitfire.h>
 #include <asm/mmu_context.h>
--- a/arch/unicore32/kernel/hibernate_asm.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/unicore32/kernel/hibernate_asm.S
@@ -11,9 +11,9 @@
 #include <linux/sys.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <generated/asm-offsets.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/assembler.h>
 
 @ restore_image(pgd_t *resume_pg_dir, struct pbe *restore_pblist)
--- a/arch/unicore32/kernel/hibernate.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/unicore32/kernel/hibernate.c
@@ -11,9 +11,9 @@
 #include <linux/gfp.h>
 #include <linux/suspend.h>
 #include <linux/memblock.h>
+#include <linux/pgtable.h>
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/unicore32/mm/alignment.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/unicore32/mm/alignment.c
@@ -18,8 +18,8 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/uaccess.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/tlbflush.h>
 #include <asm/unaligned.h>
 
--- a/arch/unicore32/mm/proc-ucv2.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/unicore32/mm/proc-ucv2.S
@@ -8,10 +8,10 @@
  */
 #include <linux/init.h>
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/assembler.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
-#include <linux/pgtable.h>
 
 #include "proc-macros.S"
 
--- a/arch/x86/boot/compressed/kaslr_64.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/boot/compressed/kaslr_64.c
@@ -22,8 +22,8 @@
 #include "misc.h"
 
 /* These actually do the work of building the kernel identity maps. */
-#include <asm/init.h>
 #include <linux/pgtable.h>
+#include <asm/init.h>
 /* Use the static base for this part of the boot process */
 #undef __PAGE_OFFSET
 #define __PAGE_OFFSET __PAGE_OFFSET_BASE
--- a/arch/x86/include/asm/asm-prototypes.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/include/asm/asm-prototypes.h
@@ -1,13 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #include <asm/ftrace.h>
 #include <linux/uaccess.h>
+#include <linux/pgtable.h>
 #include <asm/string.h>
 #include <asm/page.h>
 #include <asm/checksum.h>
 
 #include <asm-generic/asm-prototypes.h>
 
-#include <linux/pgtable.h>
 #include <asm/special_insns.h>
 #include <asm/preempt.h>
 #include <asm/asm.h>
--- a/arch/x86/include/asm/efi.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/include/asm/efi.h
@@ -3,13 +3,13 @@
 #define _ASM_X86_EFI_H
 
 #include <asm/fpu/api.h>
-#include <linux/pgtable.h>
 #include <asm/processor-flags.h>
 #include <asm/tlb.h>
 #include <asm/nospec-branch.h>
 #include <asm/mmu_context.h>
 #include <linux/build_bug.h>
 #include <linux/kernel.h>
+#include <linux/pgtable.h>
 
 extern unsigned long efi_fw_vendor, efi_config_table;
 
--- a/arch/x86/include/asm/xen/hypercall.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/include/asm/xen/hypercall.h
@@ -38,11 +38,11 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/types.h>
+#include <linux/pgtable.h>
 
 #include <trace/events/xen.h>
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/smap.h>
 #include <asm/nospec-branch.h>
 
--- a/arch/x86/kernel/acpi/boot.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/acpi/boot.c
@@ -20,11 +20,11 @@
 #include <linux/pci.h>
 #include <linux/efi-bgrt.h>
 #include <linux/serial_core.h>
+#include <linux/pgtable.h>
 
 #include <asm/e820/api.h>
 #include <asm/irqdomain.h>
 #include <asm/pci_x86.h>
-#include <linux/pgtable.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
 #include <asm/io.h>
--- a/arch/x86/kernel/acpi/sleep.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/acpi/sleep.c
@@ -10,9 +10,9 @@
 #include <linux/memblock.h>
 #include <linux/dmi.h>
 #include <linux/cpumask.h>
+#include <linux/pgtable.h>
 #include <asm/segment.h>
 #include <asm/desc.h>
-#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/realmode.h>
 
--- a/arch/x86/kernel/apic/apic_numachip.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/apic/apic_numachip.c
@@ -12,11 +12,11 @@
  */
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 
 #include <asm/numachip/numachip.h>
 #include <asm/numachip/numachip_csr.h>
 
-#include <linux/pgtable.h>
 
 #include "local.h"
 
--- a/arch/x86/kernel/cpu/bugs.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/cpu/bugs.c
@@ -15,6 +15,7 @@
 #include <linux/nospec.h>
 #include <linux/prctl.h>
 #include <linux/sched/smt.h>
+#include <linux/pgtable.h>
 
 #include <asm/spec-ctrl.h>
 #include <asm/cmdline.h>
@@ -26,7 +27,6 @@
 #include <asm/vmx.h>
 #include <asm/paravirt.h>
 #include <asm/alternative.h>
-#include <linux/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/intel-family.h>
 #include <asm/e820/api.h>
--- a/arch/x86/kernel/cpu/common.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/cpu/common.c
@@ -21,6 +21,7 @@
 #include <linux/smp.h>
 #include <linux/io.h>
 #include <linux/syscore_ops.h>
+#include <linux/pgtable.h>
 
 #include <asm/stackprotector.h>
 #include <asm/perf_event.h>
@@ -35,7 +36,6 @@
 #include <asm/vsyscall.h>
 #include <linux/topology.h>
 #include <linux/cpumask.h>
-#include <linux/pgtable.h>
 #include <linux/atomic.h>
 #include <asm/proto.h>
 #include <asm/setup.h>
--- a/arch/x86/kernel/cpu/intel.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/cpu/intel.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/kernel.h>
+#include <linux/pgtable.h>
 
 #include <linux/string.h>
 #include <linux/bitops.h>
@@ -11,7 +12,6 @@
 #include <linux/uaccess.h>
 
 #include <asm/cpufeature.h>
-#include <linux/pgtable.h>
 #include <asm/msr.h>
 #include <asm/bugs.h>
 #include <asm/cpu.h>
--- a/arch/x86/kernel/crash_core_32.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/crash_core_32.c
@@ -1,8 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <linux/crash_core.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/setup.h>
 
 void arch_crash_save_vmcoreinfo(void)
--- a/arch/x86/kernel/crash_core_64.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/crash_core_64.c
@@ -1,8 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <linux/crash_core.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/setup.h>
 
 void arch_crash_save_vmcoreinfo(void)
--- a/arch/x86/kernel/early_printk.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/early_printk.c
@@ -8,6 +8,7 @@
 #include <linux/pci_regs.h>
 #include <linux/pci_ids.h>
 #include <linux/errno.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fcntl.h>
@@ -15,7 +16,6 @@
 #include <xen/hvc-console.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
-#include <linux/pgtable.h>
 #include <linux/usb/ehci_def.h>
 #include <linux/usb/xhci-dbgp.h>
 #include <asm/pci_x86.h>
--- a/arch/x86/kernel/head64.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/head64.c
@@ -20,13 +20,13 @@
 #include <linux/io.h>
 #include <linux/memblock.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pgtable.h>
 
 #include <asm/processor.h>
 #include <asm/proto.h>
 #include <asm/smp.h>
 #include <asm/setup.h>
 #include <asm/desc.h>
-#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
 #include <asm/kdebug.h>
--- a/arch/x86/kernel/head_64.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/head_64.S
@@ -13,8 +13,8 @@
 #include <linux/linkage.h>
 #include <linux/threads.h>
 #include <linux/init.h>
-#include <asm/segment.h>
 #include <linux/pgtable.h>
+#include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/msr.h>
 #include <asm/cache.h>
--- a/arch/x86/kernel/i8259.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/i8259.c
@@ -15,11 +15,11 @@
 #include <linux/acpi.h>
 #include <linux/io.h>
 #include <linux/delay.h>
+#include <linux/pgtable.h>
 
 #include <linux/atomic.h>
 #include <asm/timer.h>
 #include <asm/hw_irq.h>
-#include <linux/pgtable.h>
 #include <asm/desc.h>
 #include <asm/apic.h>
 #include <asm/i8259.h>
--- a/arch/x86/kernel/irqinit.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/irqinit.c
@@ -16,11 +16,11 @@
 #include <linux/acpi.h>
 #include <linux/io.h>
 #include <linux/delay.h>
+#include <linux/pgtable.h>
 
 #include <linux/atomic.h>
 #include <asm/timer.h>
 #include <asm/hw_irq.h>
-#include <linux/pgtable.h>
 #include <asm/desc.h>
 #include <asm/apic.h>
 #include <asm/setup.h>
--- a/arch/x86/kernel/kprobes/core.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/kprobes/core.c
@@ -41,11 +41,11 @@
 #include <linux/kasan.h>
 #include <linux/moduleloader.h>
 #include <linux/vmalloc.h>
+#include <linux/pgtable.h>
 
 #include <asm/text-patching.h>
 #include <asm/cacheflush.h>
 #include <asm/desc.h>
-#include <linux/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/alternative.h>
 #include <asm/insn.h>
--- a/arch/x86/kernel/kprobes/opt.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/kprobes/opt.c
@@ -16,11 +16,11 @@
 #include <linux/kallsyms.h>
 #include <linux/ftrace.h>
 #include <linux/frame.h>
+#include <linux/pgtable.h>
 
 #include <asm/text-patching.h>
 #include <asm/cacheflush.h>
 #include <asm/desc.h>
-#include <linux/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/alternative.h>
 #include <asm/insn.h>
--- a/arch/x86/kernel/paravirt.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/paravirt.c
@@ -13,13 +13,13 @@
 #include <linux/bcd.h>
 #include <linux/highmem.h>
 #include <linux/kprobes.h>
+#include <linux/pgtable.h>
 
 #include <asm/bug.h>
 #include <asm/paravirt.h>
 #include <asm/debugreg.h>
 #include <asm/desc.h>
 #include <asm/setup.h>
-#include <linux/pgtable.h>
 #include <asm/time.h>
 #include <asm/pgalloc.h>
 #include <asm/irq.h>
--- a/arch/x86/kernel/reboot.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/reboot.c
@@ -11,13 +11,13 @@
 #include <linux/tboot.h>
 #include <linux/delay.h>
 #include <linux/frame.h>
+#include <linux/pgtable.h>
 #include <acpi/reboot.h>
 #include <asm/io.h>
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #include <asm/desc.h>
 #include <asm/hpet.h>
-#include <linux/pgtable.h>
 #include <asm/proto.h>
 #include <asm/reboot_fixups.h>
 #include <asm/reboot.h>
--- a/arch/x86/kernel/smpboot.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/kernel/smpboot.c
@@ -55,6 +55,7 @@
 #include <linux/gfp.h>
 #include <linux/cpuidle.h>
 #include <linux/numa.h>
+#include <linux/pgtable.h>
 
 #include <asm/acpi.h>
 #include <asm/desc.h>
@@ -63,7 +64,6 @@
 #include <asm/realmode.h>
 #include <asm/cpu.h>
 #include <asm/numa.h>
-#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/mtrr.h>
 #include <asm/mwait.h>
--- a/arch/x86/mm/cpu_entry_area.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/mm/cpu_entry_area.c
@@ -4,9 +4,9 @@
 #include <linux/percpu.h>
 #include <linux/kallsyms.h>
 #include <linux/kcore.h>
+#include <linux/pgtable.h>
 
 #include <asm/cpu_entry_area.h>
-#include <linux/pgtable.h>
 #include <asm/fixmap.h>
 #include <asm/desc.h>
 
--- a/arch/x86/mm/ioremap.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/mm/ioremap.c
@@ -16,12 +16,12 @@
 #include <linux/mmiotrace.h>
 #include <linux/mem_encrypt.h>
 #include <linux/efi.h>
+#include <linux/pgtable.h>
 
 #include <asm/set_memory.h>
 #include <asm/e820/api.h>
 #include <asm/efi.h>
 #include <asm/fixmap.h>
-#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/pgalloc.h>
 #include <asm/memtype.h>
--- a/arch/x86/mm/kaslr.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/mm/kaslr.c
@@ -24,9 +24,9 @@
 #include <linux/init.h>
 #include <linux/random.h>
 #include <linux/memblock.h>
+#include <linux/pgtable.h>
 
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 #include <asm/setup.h>
 #include <asm/kaslr.h>
 
--- a/arch/x86/mm/mmio-mod.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/mm/mmio-mod.c
@@ -17,8 +17,8 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
-#include <linux/pgtable.h>
 #include <linux/mmiotrace.h>
+#include <linux/pgtable.h>
 #include <asm/e820/api.h> /* for ISA_START_ADDRESS */
 #include <linux/atomic.h>
 #include <linux/percpu.h>
--- a/arch/x86/mm/pat/memtype_interval.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/mm/pat/memtype_interval.c
@@ -14,8 +14,8 @@
 #include <linux/interval_tree_generic.h>
 #include <linux/sched.h>
 #include <linux/gfp.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/memtype.h>
 
 #include "memtype.h"
--- a/arch/x86/mm/setup_nx.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/mm/setup_nx.c
@@ -2,8 +2,8 @@
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/init.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/proto.h>
 #include <asm/cpufeature.h>
 
--- a/arch/x86/platform/efi/efi_32.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/platform/efi/efi_32.c
@@ -24,11 +24,11 @@
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/efi.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/desc.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/efi.h>
 
--- a/arch/x86/platform/olpc/olpc_ofw.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/platform/olpc/olpc_ofw.c
@@ -3,12 +3,12 @@
 #include <linux/export.h>
 #include <linux/spinlock_types.h>
 #include <linux/init.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/setup.h>
 #include <asm/io.h>
 #include <asm/cpufeature.h>
 #include <asm/special_insns.h>
-#include <linux/pgtable.h>
 #include <asm/olpc_ofw.h>
 
 /* address of OFW callback interface; will be NULL if OFW isn't found */
--- a/arch/x86/power/cpu.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/power/cpu.c
@@ -13,8 +13,8 @@
 #include <linux/perf_event.h>
 #include <linux/tboot.h>
 #include <linux/dmi.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/proto.h>
 #include <asm/mtrr.h>
 #include <asm/page.h>
--- a/arch/x86/power/hibernate_32.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/power/hibernate_32.c
@@ -8,9 +8,9 @@
 #include <linux/gfp.h>
 #include <linux/suspend.h>
 #include <linux/memblock.h>
+#include <linux/pgtable.h>
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/mmzone.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/x86/power/hibernate_64.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/power/hibernate_64.c
@@ -12,6 +12,7 @@
 #include <linux/suspend.h>
 #include <linux/scatterlist.h>
 #include <linux/kdebug.h>
+#include <linux/pgtable.h>
 
 #include <crypto/hash.h>
 
@@ -19,7 +20,6 @@
 #include <asm/init.h>
 #include <asm/proto.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/mtrr.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/x86/power/hibernate.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/power/hibernate.c
@@ -12,6 +12,7 @@
 #include <linux/scatterlist.h>
 #include <linux/kdebug.h>
 #include <linux/cpu.h>
+#include <linux/pgtable.h>
 
 #include <crypto/hash.h>
 
@@ -19,7 +20,6 @@
 #include <asm/init.h>
 #include <asm/proto.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/mtrr.h>
 #include <asm/sections.h>
 #include <asm/suspend.h>
--- a/arch/x86/realmode/init.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/realmode/init.c
@@ -3,9 +3,9 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pgtable.h>
 
 #include <asm/set_memory.h>
-#include <linux/pgtable.h>
 #include <asm/realmode.h>
 #include <asm/tlbflush.h>
 #include <asm/crash.h>
--- a/arch/x86/xen/mmu_pv.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/xen/mmu_pv.c
@@ -51,13 +51,13 @@
 #include <linux/memblock.h>
 #include <linux/seq_file.h>
 #include <linux/crash_dump.h>
+#include <linux/pgtable.h>
 #ifdef CONFIG_KEXEC_CORE
 #include <linux/kexec.h>
 #endif
 
 #include <trace/events/xen.h>
 
-#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/fixmap.h>
 #include <asm/mmu_context.h>
--- a/arch/x86/xen/smp_pv.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/x86/xen/smp_pv.c
@@ -23,6 +23,7 @@
 #include <linux/nmi.h>
 #include <linux/cpuhotplug.h>
 #include <linux/stackprotector.h>
+#include <linux/pgtable.h>
 
 #include <asm/paravirt.h>
 #include <asm/desc.h>
--- a/arch/xtensa/include/asm/fixmap.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/include/asm/fixmap.h
@@ -13,9 +13,9 @@
 #ifndef _ASM_FIXMAP_H
 #define _ASM_FIXMAP_H
 
-#include <linux/pgtable.h>
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
+#include <linux/pgtable.h>
 #include <asm/kmap_types.h>
 #endif
 
--- a/arch/xtensa/include/asm/highmem.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/include/asm/highmem.h
@@ -13,10 +13,10 @@
 #define _XTENSA_HIGHMEM_H
 
 #include <linux/wait.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/fixmap.h>
 #include <asm/kmap_types.h>
-#include <linux/pgtable.h>
 
 #define PKMAP_BASE		((FIXADDR_START - \
 				  (LAST_PKMAP + 1) * PAGE_SIZE) & PMD_MASK)
--- a/arch/xtensa/include/asm/mmu_context.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/include/asm/mmu_context.h
@@ -18,10 +18,10 @@
 #include <linux/stringify.h>
 #include <linux/sched.h>
 #include <linux/mm_types.h>
+#include <linux/pgtable.h>
 
 #include <asm/vectors.h>
 
-#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm-generic/mm_hooks.h>
--- a/arch/xtensa/kernel/entry.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/kernel/entry.S
@@ -13,6 +13,7 @@
  */
 
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/asm-offsets.h>
 #include <asm/asmmacro.h>
 #include <asm/processor.h>
@@ -22,7 +23,6 @@
 #include <asm/unistd.h>
 #include <asm/ptrace.h>
 #include <asm/current.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <asm/signal.h>
 #include <asm/tlbflush.h>
--- a/arch/xtensa/kernel/traps.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/kernel/traps.c
@@ -34,12 +34,12 @@
 #include <linux/delay.h>
 #include <linux/hardirq.h>
 #include <linux/ratelimit.h>
+#include <linux/pgtable.h>
 
 #include <asm/stacktrace.h>
 #include <asm/ptrace.h>
 #include <asm/timex.h>
 #include <linux/uaccess.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/traps.h>
 #include <asm/hw_breakpoint.h>
--- a/arch/xtensa/kernel/vectors.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/kernel/vectors.S
@@ -43,11 +43,11 @@
  */
 
 #include <linux/linkage.h>
+#include <linux/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/ptrace.h>
 #include <asm/current.h>
 #include <asm/asm-offsets.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/thread_info.h>
--- a/arch/xtensa/mm/cache.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/mm/cache.c
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/swap.h>
 #include <linux/pagemap.h>
+#include <linux/pgtable.h>
 
 #include <asm/bootparam.h>
 #include <asm/mmu_context.h>
@@ -31,7 +32,6 @@
 #include <asm/tlbflush.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <linux/pgtable.h>
 
 /* 
  * Note:
--- a/arch/xtensa/mm/ioremap.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/mm/ioremap.c
@@ -7,9 +7,9 @@
 
 #include <linux/io.h>
 #include <linux/vmalloc.h>
+#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 
 static void __iomem *xtensa_ioremap(unsigned long paddr, unsigned long size,
 				    pgprot_t prot)
--- a/arch/xtensa/mm/misc.S~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/arch/xtensa/mm/misc.S
@@ -14,8 +14,8 @@
 
 
 #include <linux/linkage.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 #include <asm/asmmacro.h>
 #include <asm/cacheasm.h>
 #include <asm/tlbflush.h>
--- a/drivers/acpi/scan.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/acpi/scan.c
@@ -15,7 +15,6 @@
 #include <linux/nls.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_data/x86/apple.h>
-
 #include <linux/pgtable.h>
 
 #include "internal.h"
--- a/drivers/atm/fore200e.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/atm/fore200e.c
@@ -25,6 +25,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/delay.h>
 #include <linux/firmware.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/string.h>
 #include <asm/page.h>
@@ -40,7 +41,6 @@
 #include <asm/idprom.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <linux/pgtable.h>
 #endif
 
 #if defined(CONFIG_ATM_FORE200E_USE_TASKLET) /* defer interrupt work to a tasklet */
--- a/drivers/block/z2ram.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/block/z2ram.c
@@ -35,10 +35,10 @@
 #include <linux/bitops.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
+#include <linux/pgtable.h>
 
 #include <asm/setup.h>
 #include <asm/amigahw.h>
-#include <linux/pgtable.h>
 
 #include <linux/zorro.h>
 
--- a/drivers/firmware/efi/arm-runtime.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/firmware/efi/arm-runtime.c
@@ -18,12 +18,12 @@
 #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>
-#include <linux/pgtable.h>
 
 #if defined(CONFIG_PTDUMP_DEBUGFS) && defined(CONFIG_ARM64)
 #include <asm/ptdump.h>
--- a/drivers/gpu/drm/drm_vm.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/gpu/drm/drm_vm.c
@@ -37,6 +37,7 @@
 #include <linux/pci.h>
 #include <linux/seq_file.h>
 #include <linux/vmalloc.h>
+#include <linux/pgtable.h>
 
 #if defined(__ia64__)
 #include <linux/efi.h>
@@ -44,7 +45,6 @@
 #endif
 #include <linux/mem_encrypt.h>
 
-#include <linux/pgtable.h>
 
 #include <drm/drm_agpsupport.h>
 #include <drm/drm_device.h>
--- a/drivers/infiniband/hw/qib/qib_file_ops.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -40,10 +40,10 @@
 #include <linux/highmem.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
-#include <linux/pgtable.h>
 #include <linux/delay.h>
 #include <linux/export.h>
 #include <linux/uio.h>
+#include <linux/pgtable.h>
 
 #include <rdma/ib.h>
 
--- a/drivers/macintosh/macio-adb.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/macintosh/macio-adb.c
@@ -9,10 +9,10 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <linux/adb.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/hydra.h>
 #include <asm/irq.h>
 #include <linux/init.h>
--- a/drivers/macintosh/mediabay.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/macintosh/mediabay.c
@@ -16,8 +16,8 @@
 #include <linux/init.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>
-#include <asm/prom.h>
 #include <linux/pgtable.h>
+#include <asm/prom.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
--- a/drivers/macintosh/via-pmu.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/macintosh/via-pmu.c
@@ -50,9 +50,9 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/uaccess.h>
+#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/sections.h>
 #include <asm/irq.h>
 #ifdef CONFIG_PPC_PMAC
--- a/drivers/media/pci/bt8xx/bt878.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/media/pci/bt8xx/bt878.c
@@ -13,9 +13,9 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
+#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <linux/ioport.h>
-#include <linux/pgtable.h>
 #include <asm/page.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
--- a/drivers/media/pci/bt8xx/btcx-risc.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/media/pci/bt8xx/btcx-risc.c
@@ -17,8 +17,8 @@
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/videodev2.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 
 #include "btcx-risc.h"
 
--- a/drivers/media/pci/bt8xx/bttv-risc.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/media/pci/bt8xx/bttv-risc.c
@@ -20,8 +20,8 @@
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
 #include <linux/interrupt.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 #include <media/v4l2-ioctl.h>
 
 #include "bttvp.h"
--- a/drivers/media/v4l2-core/videobuf-dma-sg.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/media/v4l2-core/videobuf-dma-sg.c
@@ -21,13 +21,13 @@
 #include <linux/sched/mm.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/pgtable.h>
 
 #include <linux/dma-mapping.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/scatterlist.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include <media/videobuf-dma-sg.h>
 
--- a/drivers/media/v4l2-core/videobuf-vmalloc.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/media/v4l2-core/videobuf-vmalloc.c
@@ -15,12 +15,12 @@
 #include <linux/moduleparam.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/pgtable.h>
 
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include <media/videobuf-vmalloc.h>
 
--- a/drivers/net/ethernet/amd/7990.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/amd/7990.c
@@ -28,6 +28,7 @@
 #include <linux/route.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
+#include <linux/pgtable.h>
 #include <asm/irq.h>
 /* Used for the temporal inet entries and routing */
 #include <linux/socket.h>
@@ -35,7 +36,6 @@
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <linux/pgtable.h>
 #ifdef CONFIG_HP300
 #include <asm/blinken.h>
 #endif
--- a/drivers/net/ethernet/amd/hplance.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/amd/hplance.c
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/errno.h>
+#include <linux/pgtable.h>
 /* Used for the temporal inet entries and routing */
 #include <linux/socket.h>
 #include <linux/route.h>
@@ -24,7 +25,6 @@
 #include <linux/skbuff.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 
 #include "hplance.h"
 
--- a/drivers/net/ethernet/amd/mvme147.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/amd/mvme147.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/gfp.h>
+#include <linux/pgtable.h>
 /* Used for the temporal inet entries and routing */
 #include <linux/socket.h>
 #include <linux/route.h>
@@ -24,7 +25,6 @@
 #include <linux/skbuff.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/mvme147hw.h>
 
 /* We have 32K of RAM for the init block and buffers. This places
--- a/drivers/net/ethernet/amd/sun3lance.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/amd/sun3lance.c
@@ -37,12 +37,12 @@ static const char version[] =
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/bitops.h>
+#include <linux/pgtable.h>
 
 #include <asm/cacheflush.h>
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/dvma.h>
 #include <asm/idprom.h>
 #include <asm/machines.h>
--- a/drivers/net/ethernet/amd/sunlance.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/amd/sunlance.c
@@ -94,10 +94,10 @@ static char lancestr[] = "LANCE";
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/gfp.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <linux/pgtable.h>
 #include <asm/byteorder.h>	/* Used by the checksum routines */
 #include <asm/idprom.h>
 #include <asm/prom.h>
--- a/drivers/net/ethernet/apple/bmac.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/apple/bmac.c
@@ -24,11 +24,11 @@
 #include <linux/bitrev.h>
 #include <linux/ethtool.h>
 #include <linux/slab.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
 #include <asm/macio.h>
--- a/drivers/net/ethernet/apple/mace.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/apple/mace.c
@@ -19,10 +19,10 @@
 #include <linux/spinlock.h>
 #include <linux/bitrev.h>
 #include <linux/slab.h>
+#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/macio.h>
 
 #include "mace.h"
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -40,9 +40,9 @@
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/of_net.h>
+#include <linux/pgtable.h>
 
 #include <linux/vmalloc.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <linux/uaccess.h>
 
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
@@ -35,12 +35,12 @@
 #include <linux/of_device.h>
 #include <linux/of_irq.h>
 #include <linux/gfp.h>
+#include <linux/pgtable.h>
 
 #include <asm/immap_cpm2.h>
 #include <asm/mpc8260.h>
 #include <asm/cpm2.h>
 
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 #include <linux/uaccess.h>
 
--- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
@@ -32,8 +32,8 @@
 #include <linux/platform_device.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/irq.h>
 #include <linux/uaccess.h>
 #include <asm/mpc5xxx.h>
--- a/drivers/net/ethernet/i825xx/82596.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/i825xx/82596.c
@@ -53,10 +53,10 @@
 #include <linux/init.h>
 #include <linux/bitops.h>
 #include <linux/gfp.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 
 static char version[] __initdata =
--- a/drivers/net/ethernet/korina.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/korina.c
@@ -53,10 +53,10 @@
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/crc32.h>
+#include <linux/pgtable.h>
 
 #include <asm/bootinfo.h>
 #include <asm/bitops.h>
-#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 
--- a/drivers/net/ethernet/marvell/pxa168_eth.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -31,8 +31,8 @@
 #include <linux/types.h>
 #include <linux/udp.h>
 #include <linux/workqueue.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/cacheflush.h>
 
 #define DRIVER_NAME	"pxa168-eth"
--- a/drivers/net/ethernet/natsemi/jazzsonic.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -36,9 +36,9 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
+#include <linux/pgtable.h>
 
 #include <asm/bootinfo.h>
-#include <linux/pgtable.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/jazz.h>
--- a/drivers/net/ethernet/natsemi/macsonic.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/natsemi/macsonic.c
@@ -51,8 +51,8 @@
 #include <linux/dma-mapping.h>
 #include <linux/bitrev.h>
 #include <linux/slab.h>
-
 #include <linux/pgtable.h>
+
 #include <asm/io.h>
 #include <asm/hwtest.h>
 #include <asm/dma.h>
--- a/drivers/net/ethernet/natsemi/xtsonic.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/natsemi/xtsonic.c
@@ -35,9 +35,9 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/dma.h>
 
 static char xtsonic_string[] = "xtsonic";
--- a/drivers/net/ethernet/sun/sunbmac.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/sun/sunbmac.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pgtable.h>
 
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -34,7 +35,6 @@
 #include <asm/io.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <linux/pgtable.h>
 
 #include "sunbmac.h"
 
--- a/drivers/net/ethernet/sun/sunqe.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/net/ethernet/sun/sunqe.c
@@ -28,6 +28,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -36,7 +37,6 @@
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/auxio.h>
-#include <linux/pgtable.h>
 #include <asm/irq.h>
 
 #include "sunqe.h"
--- a/drivers/scsi/53c700.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/53c700.c
@@ -116,9 +116,9 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
+#include <linux/pgtable.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/byteorder.h>
 
 #include <scsi/scsi.h>
--- a/drivers/scsi/arm/cumana_2.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/arm/cumana_2.c
@@ -23,11 +23,11 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
+#include <linux/pgtable.h>
 
 #include <asm/dma.h>
 #include <asm/ecard.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 
 #include "../scsi.h"
 #include <scsi/scsi_host.h>
--- a/drivers/scsi/arm/eesox.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/arm/eesox.c
@@ -29,11 +29,11 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
+#include <linux/pgtable.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/ecard.h>
-#include <linux/pgtable.h>
 
 #include "../scsi.h"
 #include <scsi/scsi_host.h>
--- a/drivers/scsi/arm/powertec.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/arm/powertec.c
@@ -14,11 +14,11 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
+#include <linux/pgtable.h>
 
 #include <asm/dma.h>
 #include <asm/ecard.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 
 #include "../scsi.h"
 #include <scsi/scsi_host.h>
--- a/drivers/scsi/dpt_i2o.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/dpt_i2o.c
@@ -27,6 +27,7 @@
 /*#define UARTDELAY 1 */
 
 #include <linux/module.h>
+#include <linux/pgtable.h>
 
 MODULE_AUTHOR("Deanna Bonds, with _lots_ of help from Mark Salyzyn");
 MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
@@ -55,7 +56,6 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Dri
 #include <linux/mutex.h>
 
 #include <asm/processor.h>	/* for boot_cpu_data */
-#include <linux/pgtable.h>
 #include <asm/io.h>		/* for virt_to_bus, etc. */
 
 #include <scsi/scsi.h>
--- a/drivers/scsi/mac53c94.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/mac53c94.c
@@ -20,9 +20,9 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/pgtable.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/macio.h>
 
--- a/drivers/scsi/mesh.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/mesh.c
@@ -31,9 +31,9 @@
 #include <linux/reboot.h>
 #include <linux/spinlock.h>
 #include <linux/pci.h>
+#include <linux/pgtable.h>
 #include <asm/dbdma.h>
 #include <asm/io.h>
-#include <linux/pgtable.h>
 #include <asm/prom.h>
 #include <asm/irq.h>
 #include <asm/hydra.h>
--- a/drivers/scsi/qlogicpti.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/qlogicpti.c
@@ -30,6 +30,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/firmware.h>
+#include <linux/pgtable.h>
 
 #include <asm/byteorder.h>
 
@@ -37,7 +38,6 @@
 
 #include <asm/dma.h>
 #include <asm/ptrace.h>
-#include <linux/pgtable.h>
 #include <asm/oplib.h>
 #include <asm/io.h>
 #include <asm/irq.h>
--- a/drivers/scsi/zorro_esp.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/drivers/scsi/zorro_esp.c
@@ -34,9 +34,9 @@
 #include <linux/delay.h>
 #include <linux/zorro.h>
 #include <linux/slab.h>
+#include <linux/pgtable.h>
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/amigahw.h>
 #include <asm/amigaints.h>
--- a/include/linux/crash_dump.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/include/linux/crash_dump.h
@@ -5,6 +5,7 @@
 #include <linux/kexec.h>
 #include <linux/proc_fs.h>
 #include <linux/elf.h>
+#include <linux/pgtable.h>
 #include <uapi/linux/vmcore.h>
 
 #include <linux/pgtable.h> /* for pgprot_t */
--- a/include/linux/io-mapping.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/include/linux/io-mapping.h
@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <linux/bug.h>
 #include <linux/io.h>
+#include <linux/pgtable.h>
 #include <asm/page.h>
 
 /*
@@ -99,7 +100,6 @@ io_mapping_unmap(void __iomem *vaddr)
 #else
 
 #include <linux/uaccess.h>
-#include <linux/pgtable.h>
 
 /* Create the io_mapping object*/
 static inline struct io_mapping *
--- a/include/linux/kasan.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/include/linux/kasan.h
@@ -11,8 +11,8 @@ struct task_struct;
 
 #ifdef CONFIG_KASAN
 
-#include <asm/kasan.h>
 #include <linux/pgtable.h>
+#include <asm/kasan.h>
 
 extern unsigned char kasan_early_shadow_page[PAGE_SIZE];
 extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE];
--- a/include/linux/mm.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/include/linux/mm.h
@@ -28,6 +28,7 @@
 #include <linux/overflow.h>
 #include <linux/sizes.h>
 #include <linux/sched.h>
+#include <linux/pgtable.h>
 
 struct mempolicy;
 struct anon_vma;
@@ -92,7 +93,6 @@ extern int mmap_rnd_compat_bits __read_m
 #endif
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 #include <asm/processor.h>
 
 /*
--- a/include/xen/arm/page.h~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/include/xen/arm/page.h
@@ -3,11 +3,11 @@
 #define _ASM_ARM_XEN_PAGE_H
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include <linux/pfn.h>
 #include <linux/types.h>
 #include <linux/dma-mapping.h>
+#include <linux/pgtable.h>
 
 #include <xen/xen.h>
 #include <xen/interface/grant_table.h>
--- a/mm/init-mm.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/mm/init-mm.c
@@ -6,10 +6,10 @@
 #include <linux/list.h>
 #include <linux/cpumask.h>
 #include <linux/mman.h>
+#include <linux/pgtable.h>
 
 #include <linux/atomic.h>
 #include <linux/user_namespace.h>
-#include <linux/pgtable.h>
 #include <asm/mmu.h>
 
 #ifndef INIT_MM_CONTEXT
--- a/mm/mincore.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/mm/mincore.c
@@ -17,9 +17,9 @@
 #include <linux/swapops.h>
 #include <linux/shmem_fs.h>
 #include <linux/hugetlb.h>
+#include <linux/pgtable.h>
 
 #include <linux/uaccess.h>
-#include <linux/pgtable.h>
 
 static int mincore_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr,
 			unsigned long end, struct mm_walk *walk)
--- a/mm/zsmalloc.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/mm/zsmalloc.c
@@ -39,8 +39,8 @@
 #include <linux/highmem.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <asm/tlbflush.h>
 #include <linux/pgtable.h>
+#include <asm/tlbflush.h>
 #include <linux/cpumask.h>
 #include <linux/cpu.h>
 #include <linux/vmalloc.h>
--- a/sound/pci/hda/hda_intel.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/sound/pci/hda/hda_intel.c
@@ -36,10 +36,10 @@
 #include <linux/time.h>
 #include <linux/completion.h>
 #include <linux/acpi.h>
+#include <linux/pgtable.h>
 
 #ifdef CONFIG_X86
 /* for snoop control */
-#include <linux/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/cpufeature.h>
 #endif
--- a/sound/soc/intel/common/sst-firmware.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/sound/soc/intel/common/sst-firmware.c
@@ -16,12 +16,12 @@
 #include <linux/dmaengine.h>
 #include <linux/pci.h>
 #include <linux/acpi.h>
+#include <linux/pgtable.h>
 
 /* supported DMA engine drivers */
 #include <linux/dma/dw.h>
 
 #include <asm/page.h>
-#include <linux/pgtable.h>
 
 #include "sst-dsp.h"
 #include "sst-dsp-priv.h"
--- a/sound/soc/intel/haswell/sst-haswell-pcm.c~mm-reorder-includes-after-introduction-of-linux-pgtableh
+++ a/sound/soc/intel/haswell/sst-haswell-pcm.c
@@ -10,8 +10,8 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/pm_runtime.h>
-#include <asm/page.h>
 #include <linux/pgtable.h>
+#include <asm/page.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 54/93] csky: replace definitions of __pXd_offset() with pXd_index()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (52 preceding siblings ...)
  2020-06-09  4:32 ` [patch 53/93] mm: reorder includes after introduction of linux/pgtable.h Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 55/93] m68k/mm/motorola: move comment about page table allocation funcitons Andrew Morton
                   ` (41 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: csky: replace definitions of __pXd_offset() with pXd_index()

All architectures use pXd_index() to get an entry in the page table page
corresponding to a virtual address.

Align csky with other architectures.

Link: http://lkml.kernel.org/r/20200514170327.31389-5-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/csky/include/asm/pgtable.h |    5 ++---
 arch/csky/mm/fault.c            |    2 +-
 arch/csky/mm/highmem.c          |    2 +-
 arch/csky/mm/init.c             |    6 +++---
 4 files changed, 7 insertions(+), 8 deletions(-)

--- a/arch/csky/include/asm/pgtable.h~csky-replace-definitions-of-__pxd_offset-with-pxd_index
+++ a/arch/csky/include/asm/pgtable.h
@@ -229,9 +229,8 @@ static inline pte_t pte_mkyoung(pte_t pt
 	return pte;
 }
 
-#define __pgd_offset(address)	pgd_index(address)
-#define __pud_offset(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-#define __pmd_offset(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define pud_index(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
+#define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(address)	pgd_offset(&init_mm, address)
--- a/arch/csky/mm/fault.c~csky-replace-definitions-of-__pxd_offset-with-pxd_index
+++ a/arch/csky/mm/fault.c
@@ -78,7 +78,7 @@ asmlinkage void do_page_fault(struct pt_
 		 * Do _not_ use "tsk" here. We might be inside
 		 * an interrupt in the middle of a task switch..
 		 */
-		int offset = __pgd_offset(address);
+		int offset = pgd_index(address);
 		pgd_t *pgd, *pgd_k;
 		pud_t *pud, *pud_k;
 		pmd_t *pmd, *pmd_k;
--- a/arch/csky/mm/highmem.c~csky-replace-definitions-of-__pxd_offset-with-pxd_index
+++ a/arch/csky/mm/highmem.c
@@ -92,7 +92,7 @@ static void __init kmap_pages_init(void)
 	vaddr = PKMAP_BASE;
 	fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, swapper_pg_dir);
 
-	pgd = swapper_pg_dir + __pgd_offset(vaddr);
+	pgd = swapper_pg_dir + pgd_index(vaddr);
 	pud = (pud_t *)pgd;
 	pmd = pmd_offset(pud, vaddr);
 	pte = pte_offset_kernel(pmd, vaddr);
--- a/arch/csky/mm/init.c~csky-replace-definitions-of-__pxd_offset-with-pxd_index
+++ a/arch/csky/mm/init.c
@@ -157,9 +157,9 @@ void __init fixrange_init(unsigned long
 	unsigned long vaddr;
 
 	vaddr = start;
-	i = __pgd_offset(vaddr);
-	j = __pud_offset(vaddr);
-	k = __pmd_offset(vaddr);
+	i = pgd_index(vaddr);
+	j = pud_index(vaddr);
+	k = pmd_index(vaddr);
 	pgd = pgd_base + i;
 
 	for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 55/93] m68k/mm/motorola: move comment about page table allocation funcitons
  2020-06-09  4:29 incoming Andrew Morton
                   ` (53 preceding siblings ...)
  2020-06-09  4:32 ` [patch 54/93] csky: replace definitions of __pXd_offset() with pXd_index() Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:32 ` [patch 56/93] m68k/mm: move {cache,nocahe}_page() definitions close to their user Andrew Morton
                   ` (40 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: m68k/mm/motorola: move comment about page table allocation funcitons

The comment about page table allocation functions resides in
include/asm/motorola_pgtable.h while the functions live in
include/asm/motorola_pgaloc.h.

Move the comment close to the code.

Link: http://lkml.kernel.org/r/20200514170327.31389-6-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/m68k/include/asm/motorola_pgalloc.h |    6 ++++++
 arch/m68k/include/asm/motorola_pgtable.h |    6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

--- a/arch/m68k/include/asm/motorola_pgalloc.h~m68k-mm-motorola-move-comment-about-page-table-allocation-funcitons
+++ a/arch/m68k/include/asm/motorola_pgalloc.h
@@ -18,6 +18,12 @@ extern void init_pointer_table(void *tab
 extern void *get_pointer_table(int type);
 extern int free_pointer_table(void *table, int type);
 
+/*
+ * Allocate and free page tables. The xxx_kernel() versions are
+ * used to allocate a kernel page table - this turns on ASN bits
+ * if any.
+ */
+
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 {
 	return get_pointer_table(TABLE_PTE);
--- a/arch/m68k/include/asm/motorola_pgtable.h~m68k-mm-motorola-move-comment-about-page-table-allocation-funcitons
+++ a/arch/m68k/include/asm/motorola_pgtable.h
@@ -227,12 +227,6 @@ static inline pte_t *pte_offset_kernel(p
 #define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
 #define pte_unmap(pte)		((void)0)
 
-/*
- * Allocate and free page tables. The xxx_kernel() versions are
- * used to allocate a kernel page table - this turns on ASN bits
- * if any.
- */
-
 /* Prior to calling these routines, the page should have been flushed
  * from both the cache and ATC, or the CPU might not notice that the
  * cache setting for the page has been changed. -jskov
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 56/93] m68k/mm: move {cache,nocahe}_page() definitions close to their user
  2020-06-09  4:29 incoming Andrew Morton
                   ` (54 preceding siblings ...)
  2020-06-09  4:32 ` [patch 55/93] m68k/mm/motorola: move comment about page table allocation funcitons Andrew Morton
@ 2020-06-09  4:32 ` Andrew Morton
  2020-06-09  4:33 ` [patch 57/93] x86/mm: simplify init_trampoline() and surrounding logic Andrew Morton
                   ` (39 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:32 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: m68k/mm: move {cache,nocahe}_page() definitions close to their user

The cache_page() and nocache_page() functions are only used by the
motorola MMU variant for setting caching attributes for the page table
pages.

Move the definitions of these functions from
arch/m68k/include/asm/motorola_pgtable.h closer to their usage in
arch/m68k/mm/motorola.c and drop unused definition in
arch/m68k/include/asm/mcf_pgtable.h.

Link: http://lkml.kernel.org/r/20200514170327.31389-7-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Greg Ungerer <gerg@linux-m68k.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: 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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/m68k/include/asm/mcf_pgtable.h      |   40 -------------------
 arch/m68k/include/asm/motorola_pgtable.h |   44 ---------------------
 arch/m68k/mm/motorola.c                  |   43 ++++++++++++++++++++
 3 files changed, 43 insertions(+), 84 deletions(-)

--- a/arch/m68k/include/asm/mcf_pgtable.h~m68k-mm-move-cachenocahe_page-definitions-close-to-their-user
+++ a/arch/m68k/include/asm/mcf_pgtable.h
@@ -329,46 +329,6 @@ extern pgd_t kernel_pg_dir[PTRS_PER_PGD]
 	((pte_t *) __pmd_page(*(dir)) + __pte_offset(address))
 
 /*
- * Disable caching for page at given kernel virtual address.
- */
-static inline void nocache_page(void *vaddr)
-{
-	pgd_t *dir;
-	p4d_t *p4dp;
-	pud_t *pudp;
-	pmd_t *pmdp;
-	pte_t *ptep;
-	unsigned long addr = (unsigned long) vaddr;
-
-	dir = pgd_offset_k(addr);
-	p4dp = p4d_offset(dir, addr);
-	pudp = pud_offset(p4dp, addr);
-	pmdp = pmd_offset(pudp, addr);
-	ptep = pte_offset_kernel(pmdp, addr);
-	*ptep = pte_mknocache(*ptep);
-}
-
-/*
- * Enable caching for page at given kernel virtual address.
- */
-static inline void cache_page(void *vaddr)
-{
-	pgd_t *dir;
-	p4d_t *p4dp;
-	pud_t *pudp;
-	pmd_t *pmdp;
-	pte_t *ptep;
-	unsigned long addr = (unsigned long) vaddr;
-
-	dir = pgd_offset_k(addr);
-	p4dp = p4d_offset(dir, addr);
-	pudp = pud_offset(p4dp, addr);
-	pmdp = pmd_offset(pudp, addr);
-	ptep = pte_offset_kernel(pmdp, addr);
-	*ptep = pte_mkcache(*ptep);
-}
-
-/*
  * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e))
  */
 #define __swp_type(x)		((x).val & 0xFF)
--- a/arch/m68k/include/asm/motorola_pgtable.h~m68k-mm-move-cachenocahe_page-definitions-close-to-their-user
+++ a/arch/m68k/include/asm/motorola_pgtable.h
@@ -227,50 +227,6 @@ static inline pte_t *pte_offset_kernel(p
 #define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
 #define pte_unmap(pte)		((void)0)
 
-/* Prior to calling these routines, the page should have been flushed
- * from both the cache and ATC, or the CPU might not notice that the
- * cache setting for the page has been changed. -jskov
- */
-static inline void nocache_page(void *vaddr)
-{
-	unsigned long addr = (unsigned long)vaddr;
-
-	if (CPU_IS_040_OR_060) {
-		pgd_t *dir;
-		p4d_t *p4dp;
-		pud_t *pudp;
-		pmd_t *pmdp;
-		pte_t *ptep;
-
-		dir = pgd_offset_k(addr);
-		p4dp = p4d_offset(dir, addr);
-		pudp = pud_offset(p4dp, addr);
-		pmdp = pmd_offset(pudp, addr);
-		ptep = pte_offset_kernel(pmdp, addr);
-		*ptep = pte_mknocache(*ptep);
-	}
-}
-
-static inline void cache_page(void *vaddr)
-{
-	unsigned long addr = (unsigned long)vaddr;
-
-	if (CPU_IS_040_OR_060) {
-		pgd_t *dir;
-		p4d_t *p4dp;
-		pud_t *pudp;
-		pmd_t *pmdp;
-		pte_t *ptep;
-
-		dir = pgd_offset_k(addr);
-		p4dp = p4d_offset(dir, addr);
-		pudp = pud_offset(p4dp, addr);
-		pmdp = pmd_offset(pudp, addr);
-		ptep = pte_offset_kernel(pmdp, addr);
-		*ptep = pte_mkcache(*ptep);
-	}
-}
-
 /* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */
 #define __swp_type(x)		(((x).val >> 4) & 0xff)
 #define __swp_offset(x)		((x).val >> 12)
--- a/arch/m68k/mm/motorola.c~m68k-mm-move-cachenocahe_page-definitions-close-to-their-user
+++ a/arch/m68k/mm/motorola.c
@@ -45,6 +45,49 @@ unsigned long mm_cachebits;
 EXPORT_SYMBOL(mm_cachebits);
 #endif
 
+/* Prior to calling these routines, the page should have been flushed
+ * from both the cache and ATC, or the CPU might not notice that the
+ * cache setting for the page has been changed. -jskov
+ */
+static inline void nocache_page(void *vaddr)
+{
+	unsigned long addr = (unsigned long)vaddr;
+
+	if (CPU_IS_040_OR_060) {
+		pgd_t *dir;
+		p4d_t *p4dp;
+		pud_t *pudp;
+		pmd_t *pmdp;
+		pte_t *ptep;
+
+		dir = pgd_offset_k(addr);
+		p4dp = p4d_offset(dir, addr);
+		pudp = pud_offset(p4dp, addr);
+		pmdp = pmd_offset(pudp, addr);
+		ptep = pte_offset_kernel(pmdp, addr);
+		*ptep = pte_mknocache(*ptep);
+	}
+}
+
+static inline void cache_page(void *vaddr)
+{
+	unsigned long addr = (unsigned long)vaddr;
+
+	if (CPU_IS_040_OR_060) {
+		pgd_t *dir;
+		p4d_t *p4dp;
+		pud_t *pudp;
+		pmd_t *pmdp;
+		pte_t *ptep;
+
+		dir = pgd_offset_k(addr);
+		p4dp = p4d_offset(dir, addr);
+		pudp = pud_offset(p4dp, addr);
+		pmdp = pmd_offset(pudp, addr);
+		ptep = pte_offset_kernel(pmdp, addr);
+		*ptep = pte_mkcache(*ptep);
+	}
+}
 
 /*
  * Motorola 680x0 user's manual recommends using uncached memory for address
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 57/93] x86/mm: simplify init_trampoline() and surrounding logic
  2020-06-09  4:29 incoming Andrew Morton
                   ` (55 preceding siblings ...)
  2020-06-09  4:32 ` [patch 56/93] m68k/mm: move {cache,nocahe}_page() definitions close to their user Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 58/93] mm: pgtable: add shortcuts for accessing kernel PMD and PTE Andrew Morton
                   ` (38 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: x86/mm: simplify init_trampoline() and surrounding logic

There are three cases for the trampoline initialization:
* 32-bit does nothing
* 64-bit with kaslr disabled simply copies a PGD entry from the direct map
  to the trampoline PGD
* 64-bit with kaslr enabled maps the real mode trampoline at PUD level

These cases are currently differentiated by a bunch of ifdefs inside
asm/include/pgtable.h and the case of 64-bits with kaslr on uses
pgd_index() helper.

Replacing the ifdefs with a static function in arch/x86/mm/init.c gives
clearer code and allows moving pgd_index() to the generic implementation
in include/linux/pgtable.h

[rppt@linux.ibm.com: take CONFIG_RANDOMIZE_MEMORY into account in kaslr_enabled()]
  Link: http://lkml.kernel.org/r/20200525104045.GB13212@linux.ibm.com
Link: http://lkml.kernel.org/r/20200514170327.31389-8-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/include/asm/kaslr.h   |    2 +
 arch/x86/include/asm/pgtable.h |   15 --------------
 arch/x86/include/asm/setup.h   |   12 ++++++++++-
 arch/x86/mm/init.c             |   22 ++++++++++++++++++++
 arch/x86/mm/kaslr.c            |   33 -------------------------------
 5 files changed, 37 insertions(+), 47 deletions(-)

--- a/arch/x86/include/asm/kaslr.h~x86-mm-simplify-init_trampoline-and-surrounding-logic
+++ a/arch/x86/include/asm/kaslr.h
@@ -6,8 +6,10 @@ unsigned long kaslr_get_random_long(cons
 
 #ifdef CONFIG_RANDOMIZE_MEMORY
 void kernel_randomize_memory(void);
+void init_trampoline_kaslr(void);
 #else
 static inline void kernel_randomize_memory(void) { }
+static inline void init_trampoline_kaslr(void) {}
 #endif /* CONFIG_RANDOMIZE_MEMORY */
 
 #endif
--- a/arch/x86/include/asm/pgtable.h~x86-mm-simplify-init_trampoline-and-surrounding-logic
+++ a/arch/x86/include/asm/pgtable.h
@@ -1071,27 +1071,14 @@ void init_mem_mapping(void);
 void early_alloc_pgt_buf(void);
 extern void memblock_find_dma_reserve(void);
 
+
 #ifdef CONFIG_X86_64
-/* Realmode trampoline initialization. */
 extern pgd_t trampoline_pgd_entry;
-static inline void __meminit init_trampoline_default(void)
-{
-	/* Default trampoline pgd value */
-	trampoline_pgd_entry = init_top_pgt[pgd_index(__PAGE_OFFSET)];
-}
 
 void __init poking_init(void);
 
 unsigned long init_memory_mapping(unsigned long start,
 				  unsigned long end, pgprot_t prot);
-
-# ifdef CONFIG_RANDOMIZE_MEMORY
-void __meminit init_trampoline(void);
-# else
-#  define init_trampoline init_trampoline_default
-# endif
-#else
-static inline void init_trampoline(void) { }
 #endif
 
 /* local pte updates need not use xchg for locking */
--- a/arch/x86/include/asm/setup.h~x86-mm-simplify-init_trampoline-and-surrounding-logic
+++ a/arch/x86/include/asm/setup.h
@@ -75,7 +75,17 @@ extern char _text[];
 
 static inline bool kaslr_enabled(void)
 {
-	return !!(boot_params.hdr.loadflags & KASLR_FLAG);
+	return IS_ENABLED(CONFIG_RANDOMIZE_MEMORY) &&
+		!!(boot_params.hdr.loadflags & KASLR_FLAG);
+}
+
+/*
+ * Apply no randomization if KASLR was disabled at boot or if KASAN
+ * is enabled. KASAN shadow mappings rely on regions being PGD aligned.
+ */
+static inline bool kaslr_memory_enabled(void)
+{
+	return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN);
 }
 
 static inline unsigned long kaslr_offset(void)
--- a/arch/x86/mm/init.c~x86-mm-simplify-init_trampoline-and-surrounding-logic
+++ a/arch/x86/mm/init.c
@@ -680,6 +680,28 @@ static void __init memory_map_bottom_up(
 	}
 }
 
+/*
+ * The real mode trampoline, which is required for bootstrapping CPUs
+ * occupies only a small area under the low 1MB.  See reserve_real_mode()
+ * for details.
+ *
+ * If KASLR is disabled the first PGD entry of the direct mapping is copied
+ * to map the real mode trampoline.
+ *
+ * If KASLR is enabled, copy only the PUD which covers the low 1MB
+ * area. This limits the randomization granularity to 1GB for both 4-level
+ * and 5-level paging.
+ */
+static void __init init_trampoline(void)
+{
+#ifdef CONFIG_X86_64
+	if (!kaslr_memory_enabled())
+		trampoline_pgd_entry = init_top_pgt[pgd_index(__PAGE_OFFSET)];
+	else
+		init_trampoline_kaslr();
+#endif
+}
+
 void __init init_mem_mapping(void)
 {
 	unsigned long end;
--- a/arch/x86/mm/kaslr.c~x86-mm-simplify-init_trampoline-and-surrounding-logic
+++ a/arch/x86/mm/kaslr.c
@@ -61,15 +61,6 @@ static inline unsigned long get_padding(
 	return (region->size_tb << TB_SHIFT);
 }
 
-/*
- * Apply no randomization if KASLR was disabled at boot or if KASAN
- * is enabled. KASAN shadow mappings rely on regions being PGD aligned.
- */
-static inline bool kaslr_memory_enabled(void)
-{
-	return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN);
-}
-
 /* Initialize base and padding for each memory region randomized with KASLR */
 void __init kernel_randomize_memory(void)
 {
@@ -148,7 +139,7 @@ void __init kernel_randomize_memory(void
 	}
 }
 
-static void __meminit init_trampoline_pud(void)
+void __meminit init_trampoline_kaslr(void)
 {
 	pud_t *pud_page_tramp, *pud, *pud_tramp;
 	p4d_t *p4d_page_tramp, *p4d, *p4d_tramp;
@@ -189,25 +180,3 @@ static void __meminit init_trampoline_pu
 			__pgd(_KERNPG_TABLE | __pa(pud_page_tramp)));
 	}
 }
-
-/*
- * The real mode trampoline, which is required for bootstrapping CPUs
- * occupies only a small area under the low 1MB.  See reserve_real_mode()
- * for details.
- *
- * If KASLR is disabled the first PGD entry of the direct mapping is copied
- * to map the real mode trampoline.
- *
- * If KASLR is enabled, copy only the PUD which covers the low 1MB
- * area. This limits the randomization granularity to 1GB for both 4-level
- * and 5-level paging.
- */
-void __meminit init_trampoline(void)
-{
-	if (!kaslr_memory_enabled()) {
-		init_trampoline_default();
-		return;
-	}
-
-	init_trampoline_pud();
-}
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 58/93] mm: pgtable: add shortcuts for accessing kernel PMD and PTE
  2020-06-09  4:29 incoming Andrew Morton
                   ` (56 preceding siblings ...)
  2020-06-09  4:33 ` [patch 57/93] x86/mm: simplify init_trampoline() and surrounding logic Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 59/93] mm: consolidate pte_index() and pte_offset_*() definitions Andrew Morton
                   ` (37 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, shorne, tglx, tony.luck, torvalds,
	tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: mm: pgtable: add shortcuts for accessing kernel PMD and PTE

The powerpc 32-bit implementation of pgtable has nice shortcuts for
accessing kernel PMD and PTE for a given virtual address.  Make these
helpers available for all architectures.

[rppt@linux.ibm.com: microblaze: fix page table traversal in setup_rt_frame()]
  Link: http://lkml.kernel.org/r/20200518191511.GD1118872@kernel.org
[akpm@linux-foundation.org: s/pmd_ptr_k/pmd_off_k/ in various powerpc places]
Link: http://lkml.kernel.org/r/20200514170327.31389-9-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arc/mm/highmem.c                 |   10 -------
 arch/arm/mach-sa1100/assabet.c        |    2 -
 arch/arm/mm/highmem.c                 |    4 +--
 arch/arm/mm/ioremap.c                 |   31 +++---------------------
 arch/arm/mm/mm.h                      |    5 ---
 arch/arm/mm/mmu.c                     |    7 -----
 arch/hexagon/include/asm/fixmap.h     |    4 ---
 arch/m68k/mm/motorola.c               |   22 +----------------
 arch/microblaze/kernel/signal.c       |    8 ------
 arch/microblaze/mm/init.c             |    9 ------
 arch/mips/include/asm/fixmap.h        |    3 --
 arch/mips/mm/c-r3k.c                  |   10 +------
 arch/mips/mm/c-r4k.c                  |   10 +------
 arch/mips/mm/c-tx39.c                 |   10 +------
 arch/mips/mm/highmem.c                |    2 -
 arch/nds32/include/asm/pgtable.h      |    2 -
 arch/nds32/mm/init.c                  |   13 +---------
 arch/nds32/mm/proc.c                  |    6 ----
 arch/parisc/mm/fixmap.c               |    6 ----
 arch/powerpc/include/asm/pgtable.h    |   19 --------------
 arch/powerpc/mm/book3s32/mmu.c        |    2 -
 arch/powerpc/mm/book3s32/tlb.c        |    4 +--
 arch/powerpc/mm/kasan/8xx.c           |    4 +--
 arch/powerpc/mm/kasan/book3s_32.c     |    2 -
 arch/powerpc/mm/kasan/kasan_init_32.c |    8 +++---
 arch/powerpc/mm/nohash/40x.c          |    4 +--
 arch/powerpc/mm/nohash/8xx.c          |    2 -
 arch/powerpc/mm/pgtable_32.c          |    4 +--
 arch/s390/mm/pageattr.c               |   10 -------
 arch/sh/mm/cache-sh4.c                |    8 ------
 arch/sh/mm/kmap.c                     |    5 ---
 arch/sparc/mm/highmem.c               |   12 +--------
 arch/sparc/mm/init_64.c               |    6 ----
 arch/sparc/mm/io-unit.c               |   10 +------
 arch/sparc/mm/iommu.c                 |    8 ------
 arch/um/kernel/mem.c                  |   10 -------
 arch/um/kernel/trap.c                 |    8 ------
 arch/unicore32/mm/mm.h                |   10 -------
 arch/x86/mm/init_32.c                 |   26 ++------------------
 arch/xtensa/include/asm/fixmap.h      |    8 ------
 arch/xtensa/mm/highmem.c              |    2 -
 arch/xtensa/mm/kasan_init.c           |   10 +------
 arch/xtensa/mm/mmu.c                  |    5 ---
 include/linux/pgtable.h               |   24 ++++++++++++++++++
 44 files changed, 80 insertions(+), 295 deletions(-)

--- a/arch/arc/mm/highmem.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/arc/mm/highmem.c
@@ -92,17 +92,9 @@ EXPORT_SYMBOL(kunmap_atomic_high);
 
 static noinline pte_t * __init alloc_kmap_pgtable(unsigned long kvaddr)
 {
-	pgd_t *pgd_k;
-	p4d_t *p4d_k;
-	pud_t *pud_k;
-	pmd_t *pmd_k;
+	pmd_t *pmd_k = pmd_off_k(kvaddr);
 	pte_t *pte_k;
 
-	pgd_k = pgd_offset_k(kvaddr);
-	p4d_k = p4d_offset(pgd_k, kvaddr);
-	pud_k = pud_offset(p4d_k, kvaddr);
-	pmd_k = pmd_offset(pud_k, kvaddr);
-
 	pte_k = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
 	if (!pte_k)
 		panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
--- a/arch/arm/mach-sa1100/assabet.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/arm/mach-sa1100/assabet.c
@@ -632,7 +632,7 @@ static void __init map_sa1100_gpio_regs(
 	int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
 	pmd_t *pmd;
 
-	pmd = pmd_offset(pud_offset(p4d_offset(pgd_offset_k(virt), virt), virt), virt);
+	pmd = pmd_off_k(virt);
 	*pmd = __pmd(phys | prot);
 	flush_pmd_entry(pmd);
 }
--- a/arch/arm/mm/highmem.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/arm/mm/highmem.c
@@ -18,7 +18,7 @@
 static inline void set_fixmap_pte(int idx, pte_t pte)
 {
 	unsigned long vaddr = __fix_to_virt(idx);
-	pte_t *ptep = pte_offset_kernel(pmd_off_k(vaddr), vaddr);
+	pte_t *ptep = virt_to_kpte(vaddr);
 
 	set_pte_ext(ptep, pte, 0);
 	local_flush_tlb_kernel_page(vaddr);
@@ -26,7 +26,7 @@ static inline void set_fixmap_pte(int id
 
 static inline pte_t get_fixmap_pte(unsigned long vaddr)
 {
-	pte_t *ptep = pte_offset_kernel(pmd_off_k(vaddr), vaddr);
+	pte_t *ptep = virt_to_kpte(vaddr);
 
 	return *ptep;
 }
--- a/arch/arm/mm/ioremap.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/arm/mm/ioremap.c
@@ -141,16 +141,8 @@ void __check_vmalloc_seq(struct mm_struc
 static void unmap_area_sections(unsigned long virt, unsigned long size)
 {
 	unsigned long addr = virt, end = virt + (size & ~(SZ_1M - 1));
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *pmdp;
-
-	flush_cache_vunmap(addr, end);
-	pgd = pgd_offset_k(addr);
-	p4d = p4d_offset(pgd, addr);
-	pud = pud_offset(p4d, addr);
-	pmdp = pmd_offset(pud, addr);
+	pmd_t *pmdp = pmd_off_k(addr);
+
 	do {
 		pmd_t pmd = *pmdp;
 
@@ -191,10 +183,7 @@ remap_area_sections(unsigned long virt,
 		    size_t size, const struct mem_type *type)
 {
 	unsigned long addr = virt, end = virt + size;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *pmd;
+	pmd_t *pmd = pmd_off_k(addr);
 
 	/*
 	 * Remove and free any PTE-based mapping, and
@@ -202,10 +191,6 @@ remap_area_sections(unsigned long virt,
 	 */
 	unmap_area_sections(virt, size);
 
-	pgd = pgd_offset_k(addr);
-	p4d = p4d_offset(pgd, addr);
-	pud = pud_offset(p4d, addr);
-	pmd = pmd_offset(pud, addr);
 	do {
 		pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
 		pfn += SZ_1M >> PAGE_SHIFT;
@@ -225,21 +210,13 @@ remap_area_supersections(unsigned long v
 			 size_t size, const struct mem_type *type)
 {
 	unsigned long addr = virt, end = virt + size;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *pmd;
+	pmd_t *pmd = pmd_off_k(addr);
 
 	/*
 	 * Remove and free any PTE-based mapping, and
 	 * sync the current kernel mapping.
 	 */
 	unmap_area_sections(virt, size);
-
-	pgd = pgd_offset_k(virt);
-	p4d = p4d_offset(pgd, addr);
-	pud = pud_offset(p4d, addr);
-	pmd = pmd_offset(pud, addr);
 	do {
 		unsigned long super_pmd_val, i;
 
--- a/arch/arm/mm/mm.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/arm/mm/mm.h
@@ -35,11 +35,6 @@ static inline pte_t get_top_pte(unsigned
 	return *ptep;
 }
 
-static inline pmd_t *pmd_off_k(unsigned long virt)
-{
-	return pmd_offset(pud_offset(p4d_offset(pgd_offset_k(virt), virt), virt), virt);
-}
-
 struct mem_type {
 	pteval_t prot_pte;
 	pteval_t prot_pte_s2;
--- a/arch/arm/mm/mmu.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/arm/mm/mmu.c
@@ -356,12 +356,7 @@ static pte_t *pte_offset_late_fixmap(pmd
 
 static inline pmd_t * __init fixmap_pmd(unsigned long addr)
 {
-	pgd_t *pgd = pgd_offset_k(addr);
-	p4d_t *p4d = p4d_offset(pgd, addr);
-	pud_t *pud = pud_offset(p4d, addr);
-	pmd_t *pmd = pmd_offset(pud, addr);
-
-	return pmd;
+	return pmd_off_k(addr);
 }
 
 void __init early_fixmap_init(void)
--- a/arch/hexagon/include/asm/fixmap.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/hexagon/include/asm/fixmap.h
@@ -15,8 +15,4 @@
 
 #include <asm-generic/fixmap.h>
 
-#define kmap_get_fixmap_pte(vaddr) \
-	pte_offset_kernel(pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), \
-				(vaddr)), (vaddr)), (vaddr)), (vaddr))
-
 #endif
--- a/arch/m68k/mm/motorola.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/m68k/mm/motorola.c
@@ -54,17 +54,8 @@ static inline void nocache_page(void *va
 	unsigned long addr = (unsigned long)vaddr;
 
 	if (CPU_IS_040_OR_060) {
-		pgd_t *dir;
-		p4d_t *p4dp;
-		pud_t *pudp;
-		pmd_t *pmdp;
-		pte_t *ptep;
+		pte_t *ptep = virt_to_kpte(addr);
 
-		dir = pgd_offset_k(addr);
-		p4dp = p4d_offset(dir, addr);
-		pudp = pud_offset(p4dp, addr);
-		pmdp = pmd_offset(pudp, addr);
-		ptep = pte_offset_kernel(pmdp, addr);
 		*ptep = pte_mknocache(*ptep);
 	}
 }
@@ -74,17 +65,8 @@ static inline void cache_page(void *vadd
 	unsigned long addr = (unsigned long)vaddr;
 
 	if (CPU_IS_040_OR_060) {
-		pgd_t *dir;
-		p4d_t *p4dp;
-		pud_t *pudp;
-		pmd_t *pmdp;
-		pte_t *ptep;
+		pte_t *ptep = virt_to_kpte(addr);
 
-		dir = pgd_offset_k(addr);
-		p4dp = p4d_offset(dir, addr);
-		pudp = pud_offset(p4dp, addr);
-		pmdp = pmd_offset(pudp, addr);
-		ptep = pte_offset_kernel(pmdp, addr);
 		*ptep = pte_mkcache(*ptep);
 	}
 }
--- a/arch/microblaze/kernel/signal.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/microblaze/kernel/signal.c
@@ -159,9 +159,6 @@ static int setup_rt_frame(struct ksignal
 	int err = 0, sig = ksig->sig;
 	unsigned long address = 0;
 #ifdef CONFIG_MMU
-	pgd_t *pgdp;
-	p4d_t *p4dp;
-	pud_t *pudp;
 	pmd_t *pmdp;
 	pte_t *ptep;
 #endif
@@ -197,10 +194,7 @@ static int setup_rt_frame(struct ksignal
 
 	address = ((unsigned long)frame->tramp);
 #ifdef CONFIG_MMU
-	pgdp = pgd_offset(current->mm, address);
-	p4dp = p4d_offset(pgdp, address);
-	pudp = pud_offset(p4dp, address);
-	pmdp = pmd_offset(pudp, address);
+	pmdp = pmd_off(current->mm, address);
 
 	preempt_disable();
 	ptep = pte_offset_map(pmdp, address);
--- a/arch/microblaze/mm/init.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/microblaze/mm/init.c
@@ -50,15 +50,6 @@ unsigned long lowmem_size;
 pte_t *kmap_pte;
 EXPORT_SYMBOL(kmap_pte);
 
-static inline pte_t *virt_to_kpte(unsigned long vaddr)
-{
-	pgd_t *pgd = pgd_offset_k(vaddr);
-	p4d_t *p4d = p4d_offset(pgd, vaddr);
-	pud_t *pud = pud_offset(p4d, vaddr);
-
-	return pte_offset_kernel(pmd_offset(pud, vaddr), vaddr);
-}
-
 static void __init highmem_init(void)
 {
 	pr_debug("%x\n", (u32)PKMAP_BASE);
--- a/arch/mips/include/asm/fixmap.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/mips/include/asm/fixmap.h
@@ -69,9 +69,6 @@ enum fixed_addresses {
 
 #include <asm-generic/fixmap.h>
 
-#define kmap_get_fixmap_pte(vaddr)					\
-	pte_offset_kernel(pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)), (vaddr))
-
 /*
  * Called from pgtable_init()
  */
--- a/arch/mips/mm/c-r3k.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/mips/mm/c-r3k.c
@@ -239,9 +239,6 @@ static void r3k_flush_cache_page(struct
 	unsigned long kaddr = KSEG0ADDR(pfn << PAGE_SHIFT);
 	int exec = vma->vm_flags & VM_EXEC;
 	struct mm_struct *mm = vma->vm_mm;
-	pgd_t *pgdp;
-	p4d_t *p4dp;
-	pud_t *pudp;
 	pmd_t *pmdp;
 	pte_t *ptep;
 
@@ -252,11 +249,8 @@ static void r3k_flush_cache_page(struct
 	if (cpu_context(smp_processor_id(), mm) == 0)
 		return;
 
-	pgdp = pgd_offset(mm, addr);
-	p4dp = p4d_offset(pgdp, addr);
-	pudp = pud_offset(p4dp, addr);
-	pmdp = pmd_offset(pudp, addr);
-	ptep = pte_offset(pmdp, addr);
+	pmdp = pmd_off(mm, addr);
+	ptep = pte_offset_kernel(pmdp, addr);
 
 	/* Invalid => no such page in the cache.  */
 	if (!(pte_val(*ptep) & _PAGE_PRESENT))
--- a/arch/mips/mm/c-r4k.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/mips/mm/c-r4k.c
@@ -652,9 +652,6 @@ static inline void local_r4k_flush_cache
 	int exec = vma->vm_flags & VM_EXEC;
 	struct mm_struct *mm = vma->vm_mm;
 	int map_coherent = 0;
-	pgd_t *pgdp;
-	p4d_t *p4dp;
-	pud_t *pudp;
 	pmd_t *pmdp;
 	pte_t *ptep;
 	void *vaddr;
@@ -667,11 +664,8 @@ static inline void local_r4k_flush_cache
 		return;
 
 	addr &= PAGE_MASK;
-	pgdp = pgd_offset(mm, addr);
-	p4dp = p4d_offset(pgdp, addr);
-	pudp = pud_offset(p4dp, addr);
-	pmdp = pmd_offset(pudp, addr);
-	ptep = pte_offset(pmdp, addr);
+	pmdp = pmd_off(mm, addr);
+	ptep = pte_offset_kernel(pmdp, addr);
 
 	/*
 	 * If the page isn't marked valid, the page cannot possibly be
--- a/arch/mips/mm/c-tx39.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/mips/mm/c-tx39.c
@@ -168,9 +168,6 @@ static void tx39_flush_cache_page(struct
 {
 	int exec = vma->vm_flags & VM_EXEC;
 	struct mm_struct *mm = vma->vm_mm;
-	pgd_t *pgdp;
-	p4d_t *p4dp;
-	pud_t *pudp;
 	pmd_t *pmdp;
 	pte_t *ptep;
 
@@ -182,11 +179,8 @@ static void tx39_flush_cache_page(struct
 		return;
 
 	page &= PAGE_MASK;
-	pgdp = pgd_offset(mm, page);
-	p4dp = p4d_offset(pgdp, page);
-	pudp = pud_offset(p4dp, page);
-	pmdp = pmd_offset(pudp, page);
-	ptep = pte_offset(pmdp, page);
+	pmdp = pmd_off(mm, page);
+	ptep = pte_offset_kernel(pmdp, page);
 
 	/*
 	 * If the page isn't marked valid, the page cannot possibly be
--- a/arch/mips/mm/highmem.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/mips/mm/highmem.c
@@ -90,5 +90,5 @@ void __init kmap_init(void)
 
 	/* cache the first kmap pte */
 	kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
-	kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
+	kmap_pte = virt_to_kpte(kmap_vstart);
 }
--- a/arch/nds32/include/asm/pgtable.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/nds32/include/asm/pgtable.h
@@ -195,8 +195,6 @@ extern void paging_init(void);
 #define pte_unmap(pte)		do { } while (0)
 #define pte_unmap_nested(pte)	do { } while (0)
 
-#define pmd_off_k(address)	pmd_offset(pud_offset(p4d_offset(pgd_offset_k(address), (address)), (address)), (address))
-
 #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
 /*
  * Set a level 1 translation table entry, and clean it out of
--- a/arch/nds32/mm/init.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/nds32/mm/init.c
@@ -98,9 +98,6 @@ static pmd_t *fixmap_pmd_p;
 static void __init fixedrange_init(void)
 {
 	unsigned long vaddr;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
 	pmd_t *pmd;
 #ifdef CONFIG_HIGHMEM
 	pte_t *pte;
@@ -110,10 +107,7 @@ static void __init fixedrange_init(void)
 	 * Fixed mappings:
 	 */
 	vaddr = __fix_to_virt(__end_of_fixed_addresses - 1);
-	pgd = swapper_pg_dir + pgd_index(vaddr);
-	p4d = p4d_offset(pgd, vaddr);
-	pud = pud_offset(p4d, vaddr);
-	pmd = pmd_offset(pud, vaddr);
+	pmd = pmd_off_k(vaddr);
 	fixmap_pmd_p = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
 	if (!fixmap_pmd_p)
 		panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
@@ -126,10 +120,7 @@ static void __init fixedrange_init(void)
 	 */
 	vaddr = PKMAP_BASE;
 
-	pgd = swapper_pg_dir + pgd_index(vaddr);
-	p4d = p4d_offset(pgd, vaddr);
-	pud = pud_offset(p4d, vaddr);
-	pmd = pmd_offset(pud, vaddr);
+	pmd = pmd_off_k(vaddr);
 	pte = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
 	if (!pte)
 		panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
--- a/arch/nds32/mm/proc.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/nds32/mm/proc.c
@@ -15,14 +15,10 @@ extern struct cache_info L1_cache_info[2
 
 int va_kernel_present(unsigned long addr)
 {
-	p4d_t *p4d;
-	pud_t *pud;
 	pmd_t *pmd;
 	pte_t *ptep, pte;
 
-	p4d = p4d_offset(pgd_offset_k(addr), addr);
-	pud = pud_offset(p4d, addr);
-	pmd = pmd_offset(pud, addr);
+	pmd = pmd_off_k(addr);
 	if (!pmd_none(*pmd)) {
 		ptep = pte_offset_map(pmd, addr);
 		pte = *ptep;
--- a/arch/parisc/mm/fixmap.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/parisc/mm/fixmap.c
@@ -33,11 +33,7 @@ void notrace set_fixmap(enum fixed_addre
 void notrace clear_fixmap(enum fixed_addresses idx)
 {
 	unsigned long vaddr = __fix_to_virt(idx);
-	pgd_t *pgd = pgd_offset_k(vaddr);
-	p4d_t *p4d = p4d_offset(pgd, vaddr);
-	pud_t *pud = pud_offset(p4d, vaddr);
-	pmd_t *pmd = pmd_offset(pud, vaddr);
-	pte_t *pte = pte_offset_kernel(pmd, vaddr);
+	pte_t *pte = virt_to_kpte(vaddr);
 
 	if (WARN_ON(pte_none(*pte)))
 		return;
--- a/arch/powerpc/include/asm/pgtable.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/include/asm/pgtable.h
@@ -41,25 +41,6 @@ struct mm_struct;
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_PPC32
-static inline pmd_t *pmd_ptr(struct mm_struct *mm, unsigned long va)
-{
-	return pmd_offset(pud_offset(p4d_offset(pgd_offset(mm, va), va), va), va);
-}
-
-static inline pmd_t *pmd_ptr_k(unsigned long va)
-{
-	return pmd_offset(pud_offset(p4d_offset(pgd_offset_k(va), va), va), va);
-}
-
-static inline pte_t *virt_to_kpte(unsigned long vaddr)
-{
-	pmd_t *pmd = pmd_ptr_k(vaddr);
-
-	return pmd_none(*pmd) ? NULL : pte_offset_kernel(pmd, vaddr);
-}
-#endif
-
 #include <asm/tlbflush.h>
 
 /* Keep these as a macros to avoid include dependency mess */
--- a/arch/powerpc/mm/book3s32/mmu.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/book3s32/mmu.c
@@ -320,7 +320,7 @@ void hash_preload(struct mm_struct *mm,
 
 	if (!Hash)
 		return;
-	pmd = pmd_ptr(mm, ea);
+	pmd = pmd_off(mm, ea);
 	if (!pmd_none(*pmd))
 		add_hash_page(mm->context.id, ea, pmd_val(*pmd));
 }
--- a/arch/powerpc/mm/book3s32/tlb.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/book3s32/tlb.c
@@ -90,7 +90,7 @@ static void flush_range(struct mm_struct
 	if (start >= end)
 		return;
 	end = (end - 1) | ~PAGE_MASK;
-	pmd = pmd_ptr(mm, start);
+	pmd = pmd_off(mm, start);
 	for (;;) {
 		pmd_end = ((start + PGDIR_SIZE) & PGDIR_MASK) - 1;
 		if (pmd_end > end)
@@ -148,7 +148,7 @@ void flush_tlb_page(struct vm_area_struc
 		return;
 	}
 	mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
-	pmd = pmd_ptr(mm, vmaddr);
+	pmd = pmd_off(mm, vmaddr);
 	if (!pmd_none(*pmd))
 		flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
 }
--- a/arch/powerpc/mm/kasan/8xx.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/kasan/8xx.c
@@ -10,7 +10,7 @@
 static int __init
 kasan_init_shadow_8M(unsigned long k_start, unsigned long k_end, void *block)
 {
-	pmd_t *pmd = pmd_ptr_k(k_start);
+	pmd_t *pmd = pmd_off_k(k_start);
 	unsigned long k_cur, k_next;
 
 	for (k_cur = k_start; k_cur != k_end; k_cur = k_next, pmd += 2, block += SZ_8M) {
@@ -59,7 +59,7 @@ int __init kasan_init_region(void *start
 		return ret;
 
 	for (; k_cur < k_end; k_cur += PAGE_SIZE) {
-		pmd_t *pmd = pmd_ptr_k(k_cur);
+		pmd_t *pmd = pmd_off_k(k_cur);
 		void *va = block + k_cur - k_start;
 		pte_t pte = pfn_pte(PHYS_PFN(__pa(va)), PAGE_KERNEL);
 
--- a/arch/powerpc/mm/kasan/book3s_32.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/kasan/book3s_32.c
@@ -46,7 +46,7 @@ int __init kasan_init_region(void *start
 	kasan_update_early_region(k_start, k_cur, __pte(0));
 
 	for (; k_cur < k_end; k_cur += PAGE_SIZE) {
-		pmd_t *pmd = pmd_ptr_k(k_cur);
+		pmd_t *pmd = pmd_off_k(k_cur);
 		void *va = block + k_cur - k_start;
 		pte_t pte = pfn_pte(PHYS_PFN(__pa(va)), PAGE_KERNEL);
 
--- a/arch/powerpc/mm/kasan/kasan_init_32.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/kasan/kasan_init_32.c
@@ -33,7 +33,7 @@ int __init kasan_init_shadow_page_tables
 	pmd_t *pmd;
 	unsigned long k_cur, k_next;
 
-	pmd = pmd_ptr_k(k_start);
+	pmd = pmd_off_k(k_start);
 
 	for (k_cur = k_start; k_cur != k_end; k_cur = k_next, pmd++) {
 		pte_t *new;
@@ -69,7 +69,7 @@ int __init __weak kasan_init_region(void
 		return -ENOMEM;
 
 	for (k_cur = k_start & PAGE_MASK; k_cur < k_end; k_cur += PAGE_SIZE) {
-		pmd_t *pmd = pmd_ptr_k(k_cur);
+		pmd_t *pmd = pmd_off_k(k_cur);
 		void *va = block + k_cur - k_start;
 		pte_t pte = pfn_pte(PHYS_PFN(__pa(va)), PAGE_KERNEL);
 
@@ -86,7 +86,7 @@ kasan_update_early_region(unsigned long
 	phys_addr_t pa = __pa(kasan_early_shadow_page);
 
 	for (k_cur = k_start; k_cur != k_end; k_cur += PAGE_SIZE) {
-		pmd_t *pmd = pmd_ptr_k(k_cur);
+		pmd_t *pmd = pmd_off_k(k_cur);
 		pte_t *ptep = pte_offset_kernel(pmd, k_cur);
 
 		if ((pte_val(*ptep) & PTE_RPN_MASK) != pa)
@@ -184,7 +184,7 @@ void __init kasan_early_init(void)
 	unsigned long addr = KASAN_SHADOW_START;
 	unsigned long end = KASAN_SHADOW_END;
 	unsigned long next;
-	pmd_t *pmd = pmd_ptr_k(addr);
+	pmd_t *pmd = pmd_off_k(addr);
 
 	BUILD_BUG_ON(KASAN_SHADOW_START & ~PGDIR_MASK);
 
--- a/arch/powerpc/mm/nohash/40x.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/nohash/40x.c
@@ -103,7 +103,7 @@ unsigned long __init mmu_mapin_ram(unsig
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_16M | _PAGE_EXEC | _PAGE_RW;
 
-		pmdp = pmd_ptr_k(v);
+		pmdp = pmd_off_k(v);
 		*pmdp++ = __pmd(val);
 		*pmdp++ = __pmd(val);
 		*pmdp++ = __pmd(val);
@@ -118,7 +118,7 @@ unsigned long __init mmu_mapin_ram(unsig
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_4M | _PAGE_EXEC | _PAGE_RW;
 
-		pmdp = pmd_ptr_k(v);
+		pmdp = pmd_off_k(v);
 		*pmdp = __pmd(val);
 
 		v += LARGE_PAGE_SIZE_4M;
--- a/arch/powerpc/mm/nohash/8xx.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/nohash/8xx.c
@@ -74,7 +74,7 @@ static pte_t __init *early_hugepd_alloc_
 static int __ref __early_map_kernel_hugepage(unsigned long va, phys_addr_t pa,
 					     pgprot_t prot, int psize, bool new)
 {
-	pmd_t *pmdp = pmd_ptr_k(va);
+	pmd_t *pmdp = pmd_off_k(va);
 	pte_t *ptep;
 
 	if (WARN_ON(psize != MMU_PAGE_512K && psize != MMU_PAGE_8M))
--- a/arch/powerpc/mm/pgtable_32.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/powerpc/mm/pgtable_32.c
@@ -40,7 +40,7 @@ notrace void __init early_ioremap_init(v
 {
 	unsigned long addr = ALIGN_DOWN(FIXADDR_START, PGDIR_SIZE);
 	pte_t *ptep = (pte_t *)early_fixmap_pagetable;
-	pmd_t *pmdp = pmd_ptr_k(addr);
+	pmd_t *pmdp = pmd_off_k(addr);
 
 	for (; (s32)(FIXADDR_TOP - addr) > 0;
 	     addr += PGDIR_SIZE, ptep += PTRS_PER_PTE, pmdp++)
@@ -78,7 +78,7 @@ int __ref map_kernel_page(unsigned long
 	int err = -ENOMEM;
 
 	/* Use upper 10 bits of VA to index the first level map */
-	pd = pmd_ptr_k(va);
+	pd = pmd_off_k(va);
 	/* Use middle 10 bits of VA to index the second-level map */
 	if (likely(slab_is_available()))
 		pg = pte_alloc_kernel(pd, va);
--- a/arch/s390/mm/pageattr.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/s390/mm/pageattr.c
@@ -337,19 +337,11 @@ void __kernel_map_pages(struct page *pag
 {
 	unsigned long address;
 	int nr, i, j;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *pmd;
 	pte_t *pte;
 
 	for (i = 0; i < numpages;) {
 		address = page_to_phys(page + i);
-		pgd = pgd_offset_k(address);
-		p4d = p4d_offset(pgd, address);
-		pud = pud_offset(p4d, address);
-		pmd = pmd_offset(pud, address);
-		pte = pte_offset_kernel(pmd, address);
+		pte = virt_to_kpte(address);
 		nr = (unsigned long)pte >> ilog2(sizeof(long));
 		nr = PTRS_PER_PTE - (nr & (PTRS_PER_PTE - 1));
 		nr = min(numpages - i, nr);
--- a/arch/sh/mm/cache-sh4.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/sh/mm/cache-sh4.c
@@ -207,9 +207,6 @@ static void sh4_flush_cache_page(void *a
 	struct page *page;
 	unsigned long address, pfn, phys;
 	int map_coherent = 0;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
 	pmd_t *pmd;
 	pte_t *pte;
 	void *vaddr;
@@ -223,10 +220,7 @@ static void sh4_flush_cache_page(void *a
 	if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
 		return;
 
-	pgd = pgd_offset(vma->vm_mm, address);
-	p4d = p4d_offset(pgd, address);
-	pud = pud_offset(p4d, address);
-	pmd = pmd_offset(pud, address);
+	pmd = pmd_off(vma->vm_mm, address);
 	pte = pte_offset_kernel(pmd, address);
 
 	/* If the page isn't present, there is nothing to do here. */
--- a/arch/sh/mm/kmap.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/sh/mm/kmap.c
@@ -14,9 +14,6 @@
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 
-#define kmap_get_fixmap_pte(vaddr)                                     \
-	pte_offset_kernel(pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)), vaddr)
-
 static pte_t *kmap_coherent_pte;
 
 void __init kmap_coherent_init(void)
@@ -25,7 +22,7 @@ void __init kmap_coherent_init(void)
 
 	/* cache the first coherent kmap pte */
 	vaddr = __fix_to_virt(FIX_CMAP_BEGIN);
-	kmap_coherent_pte = kmap_get_fixmap_pte(vaddr);
+	kmap_coherent_pte = virt_to_kpte(vaddr);
 }
 
 void *kmap_coherent(struct page *page, unsigned long addr)
--- a/arch/sparc/mm/highmem.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/sparc/mm/highmem.c
@@ -36,18 +36,10 @@ static pte_t *kmap_pte;
 
 void __init kmap_init(void)
 {
-	unsigned long address;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *dir;
-
-	address = __fix_to_virt(FIX_KMAP_BEGIN);
-	p4d = p4d_offset(pgd_offset_k(address), address);
-	pud = pud_offset(p4d, address);
-	dir = pmd_offset(pud, address);
+	unsigned long address = __fix_to_virt(FIX_KMAP_BEGIN);
 
         /* cache the first kmap pte */
-        kmap_pte = pte_offset_kernel(dir, address);
+        kmap_pte = virt_to_kpte(address);
 }
 
 void *kmap_atomic_high_prot(struct page *page, pgprot_t prot)
--- a/arch/sparc/mm/init_64.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/sparc/mm/init_64.c
@@ -503,11 +503,7 @@ void __kprobes flush_icache_range(unsign
 			if (kaddr >= PAGE_OFFSET)
 				paddr = kaddr & mask;
 			else {
-				pgd_t *pgdp = pgd_offset_k(kaddr);
-				p4d_t *p4dp = p4d_offset(pgdp, kaddr);
-				pud_t *pudp = pud_offset(p4dp, kaddr);
-				pmd_t *pmdp = pmd_offset(pudp, kaddr);
-				pte_t *ptep = pte_offset_kernel(pmdp, kaddr);
+				pte_t *ptep = virt_to_kpte(kaddr);
 
 				paddr = pte_val(*ptep) & mask;
 			}
--- a/arch/sparc/mm/iommu.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/sparc/mm/iommu.c
@@ -348,9 +348,6 @@ static void *sbus_iommu_alloc(struct dev
 	while(addr < end) {
 		page = va;
 		{
-			pgd_t *pgdp;
-			p4d_t *p4dp;
-			pud_t *pudp;
 			pmd_t *pmdp;
 			pte_t *ptep;
 
@@ -361,10 +358,7 @@ static void *sbus_iommu_alloc(struct dev
 			else
 				__flush_page_to_ram(page);
 
-			pgdp = pgd_offset(&init_mm, addr);
-			p4dp = p4d_offset(pgdp, addr);
-			pudp = pud_offset(p4dp, addr);
-			pmdp = pmd_offset(pudp, addr);
+			pmdp = pmd_off_k(addr);
 			ptep = pte_offset_map(pmdp, addr);
 
 			set_pte(ptep, mk_pte(virt_to_page(page), dvma_prot));
--- a/arch/sparc/mm/io-unit.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/sparc/mm/io-unit.c
@@ -240,21 +240,15 @@ static void *iounit_alloc(struct device
 	while(addr < end) {
 		page = va;
 		{
-			pgd_t *pgdp;
-			p4d_t *p4dp;
-			pud_t *pudp;
 			pmd_t *pmdp;
 			pte_t *ptep;
 			long i;
 
-			pgdp = pgd_offset(&init_mm, addr);
-			p4dp = p4d_offset(pgdp, addr);
-			pudp = pud_offset(p4dp, addr);
-			pmdp = pmd_offset(pudp, addr);
+			pmdp = pmd_off_k(addr);
 			ptep = pte_offset_map(pmdp, addr);
 
 			set_pte(ptep, mk_pte(virt_to_page(page), dvma_prot));
-			
+
 			i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
 
 			iopte = iounit->page_table + i;
--- a/arch/um/kernel/mem.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/um/kernel/mem.c
@@ -125,10 +125,6 @@ static void __init fixaddr_user_init( vo
 {
 #ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
 	long size = FIXADDR_USER_END - FIXADDR_USER_START;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *pmd;
 	pte_t *pte;
 	phys_t p;
 	unsigned long v, vaddr = FIXADDR_USER_START;
@@ -146,11 +142,7 @@ static void __init fixaddr_user_init( vo
 	p = __pa(v);
 	for ( ; size > 0; size -= PAGE_SIZE, vaddr += PAGE_SIZE,
 		      p += PAGE_SIZE) {
-		pgd = swapper_pg_dir + pgd_index(vaddr);
-		p4d = p4d_offset(pgd, vaddr);
-		pud = pud_offset(p4d, vaddr);
-		pmd = pmd_offset(pud, vaddr);
-		pte = pte_offset_kernel(pmd, vaddr);
+		pte = virt_to_kpte(vaddr);
 		pte_set_val(*pte, p, PAGE_READONLY);
 	}
 #endif
--- a/arch/um/kernel/trap.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/um/kernel/trap.c
@@ -26,9 +26,6 @@ int handle_page_fault(unsigned long addr
 {
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *vma;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
 	pmd_t *pmd;
 	pte_t *pte;
 	int err = -EFAULT;
@@ -102,10 +99,7 @@ good_area:
 			}
 		}
 
-		pgd = pgd_offset(mm, address);
-		p4d = p4d_offset(pgd, address);
-		pud = pud_offset(p4d, address);
-		pmd = pmd_offset(pud, address);
+		pmd = pmd_off(mm, address);
 		pte = pte_offset_kernel(pmd, address);
 	} while (!pte_present(*pte));
 	err = 0;
--- a/arch/unicore32/mm/mm.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/unicore32/mm/mm.h
@@ -14,16 +14,6 @@ extern int sysctl_overcommit_memory;
 
 #define TOP_PTE(x)	pte_offset_kernel(top_pmd, x)
 
-static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
-{
-	return pmd_offset((pud_t *)pgd, virt);
-}
-
-static inline pmd_t *pmd_off_k(unsigned long virt)
-{
-	return pmd_off(pgd_offset_k(virt), virt);
-}
-
 struct mem_type {
 	unsigned int prot_pte;
 	unsigned int prot_l1;
--- a/arch/x86/mm/init_32.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/x86/mm/init_32.c
@@ -395,15 +395,6 @@ repeat:
 
 pte_t *kmap_pte;
 
-static inline pte_t *kmap_get_fixmap_pte(unsigned long vaddr)
-{
-	pgd_t *pgd = pgd_offset_k(vaddr);
-	p4d_t *p4d = p4d_offset(pgd, vaddr);
-	pud_t *pud = pud_offset(p4d, vaddr);
-	pmd_t *pmd = pmd_offset(pud, vaddr);
-	return pte_offset_kernel(pmd, vaddr);
-}
-
 static void __init kmap_init(void)
 {
 	unsigned long kmap_vstart;
@@ -412,28 +403,17 @@ static void __init kmap_init(void)
 	 * Cache the first kmap pte:
 	 */
 	kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
-	kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
+	kmap_pte = virt_to_kpte(kmap_vstart);
 }
 
 #ifdef CONFIG_HIGHMEM
 static void __init permanent_kmaps_init(pgd_t *pgd_base)
 {
-	unsigned long vaddr;
-	pgd_t *pgd;
-	p4d_t *p4d;
-	pud_t *pud;
-	pmd_t *pmd;
-	pte_t *pte;
+	unsigned long vaddr = PKMAP_BASE;
 
-	vaddr = PKMAP_BASE;
 	page_table_range_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
 
-	pgd = swapper_pg_dir + pgd_index(vaddr);
-	p4d = p4d_offset(pgd, vaddr);
-	pud = pud_offset(p4d, vaddr);
-	pmd = pmd_offset(pud, vaddr);
-	pte = pte_offset_kernel(pmd, vaddr);
-	pkmap_page_table = pte;
+	pkmap_page_table = virt_to_kpte(vaddr);
 }
 
 void __init add_highpages_with_active_regions(int nid,
--- a/arch/xtensa/include/asm/fixmap.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/xtensa/include/asm/fixmap.h
@@ -76,12 +76,4 @@ static inline unsigned long virt_to_fix(
 
 #endif
 
-#define kmap_get_fixmap_pte(vaddr) \
-	pte_offset_kernel( \
-		pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), \
-						 (vaddr)), \
-				      (vaddr)), \
-			   (vaddr)), \
-		(vaddr))
-
 #endif
--- a/arch/xtensa/mm/highmem.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/xtensa/mm/highmem.c
@@ -86,6 +86,6 @@ void __init kmap_init(void)
 	BUILD_BUG_ON(PKMAP_BASE < TLBTEMP_BASE_1 + TLBTEMP_SIZE);
 	/* cache the first kmap pte */
 	kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
-	kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
+	kmap_pte = virt_to_kpte(kmap_vstart);
 	kmap_waitqueues_init();
 }
--- a/arch/xtensa/mm/kasan_init.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/xtensa/mm/kasan_init.c
@@ -19,10 +19,7 @@
 void __init kasan_early_init(void)
 {
 	unsigned long vaddr = KASAN_SHADOW_START;
-	pgd_t *pgd = pgd_offset_k(vaddr);
-	p4d_t *p4d = p4d_offset(pgd, vaddr);
-	pud_t *pud = pud_offset(p4d, vaddr);
-	pmd_t *pmd = pmd_offset(pud, vaddr);
+	pmd_t *pmd = pmd_off_k(vaddr);
 	int i;
 
 	for (i = 0; i < PTRS_PER_PTE; ++i)
@@ -43,10 +40,7 @@ static void __init populate(void *start,
 	unsigned long n_pmds = n_pages / PTRS_PER_PTE;
 	unsigned long i, j;
 	unsigned long vaddr = (unsigned long)start;
-	pgd_t *pgd = pgd_offset_k(vaddr);
-	p4d_t *p4d = p4d_offset(pgd, vaddr);
-	pud_t *pud = pud_offset(p4d, vaddr);
-	pmd_t *pmd = pmd_offset(pud, vaddr);
+	pmd_t *pmd = pmd_off_k(vaddr);
 	pte_t *pte = memblock_alloc(n_pages * sizeof(pte_t), PAGE_SIZE);
 
 	if (!pte)
--- a/arch/xtensa/mm/mmu.c~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/arch/xtensa/mm/mmu.c
@@ -21,10 +21,7 @@
 #if defined(CONFIG_HIGHMEM)
 static void * __init init_pmd(unsigned long vaddr, unsigned long n_pages)
 {
-	pgd_t *pgd = pgd_offset_k(vaddr);
-	p4d_t *p4d = p4d_offset(pgd, vaddr);
-	pud_t *pud = pud_offset(p4d, vaddr);
-	pmd_t *pmd = pmd_offset(pud, vaddr);
+	pmd_t *pmd = pmd_off_k(vaddr);
 	pte_t *pte;
 	unsigned long i;
 
--- a/include/linux/pgtable.h~mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte
+++ a/include/linux/pgtable.h
@@ -28,6 +28,30 @@
 #define USER_PGTABLES_CEILING	0UL
 #endif
 
+/*
+ * In many cases it is known that a virtual address is mapped at PMD or PTE
+ * level, so instead of traversing all the page table levels, we can get a
+ * pointer to the PMD entry in user or kernel page table or translate a virtual
+ * address to the pointer in the PTE in the kernel page tables with simple
+ * helpers.
+ */
+static inline pmd_t *pmd_off(struct mm_struct *mm, unsigned long va)
+{
+	return pmd_offset(pud_offset(p4d_offset(pgd_offset(mm, va), va), va), va);
+}
+
+static inline pmd_t *pmd_off_k(unsigned long va)
+{
+	return pmd_offset(pud_offset(p4d_offset(pgd_offset_k(va), va), va), va);
+}
+
+static inline pte_t *virt_to_kpte(unsigned long vaddr)
+{
+	pmd_t *pmd = pmd_off_k(vaddr);
+
+	return pmd_none(*pmd) ? NULL : pte_offset_kernel(pmd, vaddr);
+}
+
 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 extern int ptep_set_access_flags(struct vm_area_struct *vma,
 				 unsigned long address, pte_t *ptep,
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 59/93] mm: consolidate pte_index() and pte_offset_*() definitions
  2020-06-09  4:29 incoming Andrew Morton
                   ` (57 preceding siblings ...)
  2020-06-09  4:33 ` [patch 58/93] mm: pgtable: add shortcuts for accessing kernel PMD and PTE Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 60/93] mmap locking API: initial implementation as rwsem wrappers Andrew Morton
                   ` (36 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, arnd, bcain, bp, catalin.marinas, chris, dalias, davem,
	deanbo422, deller, geert, gerg, green.hu, guoren, gxt,
	heiko.carstens, jcmvbkbc, ley.foon.tan, linux-mm, linux,
	mattst88, mingo, mm-commits, monstr, mpe, msalter, nickhu,
	paul.walmsley, richard, rppt, sfr, shorne, tglx, tony.luck,
	torvalds, tsbogend, vgupta, will, willy, ysato

From: Mike Rapoport <rppt@linux.ibm.com>
Subject: mm: consolidate pte_index() and pte_offset_*() definitions

All architectures define pte_index() as

	(address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)

and all architectures define pte_offset_kernel() as an entry in the array
of PTEs indexed by the pte_index().

For the most architectures the pte_offset_kernel() implementation relies
on the availability of pmd_page_vaddr() that converts a PMD entry value to
the virtual address of the page containing PTEs array.

Let's move x86 definitions of the PTE accessors to the generic place in
<linux/pgtable.h> and then simply drop the respective definitions from the
other architectures.

The architectures that didn't provide pmd_page_vaddr() are updated to have
that defined.

The generic implementation of pte_offset_kernel() can be overridden by an
architecture and alpha makes use of this because it has special ordering
requirements for its version of pte_offset_kernel().

[rppt@linux.ibm.com: v2]
  Link: http://lkml.kernel.org/r/20200514170327.31389-11-rppt@kernel.org
[rppt@linux.ibm.com: update]
  Link: http://lkml.kernel.org/r/20200514170327.31389-12-rppt@kernel.org
[rppt@linux.ibm.com: update]
  Link: http://lkml.kernel.org/r/20200514170327.31389-13-rppt@kernel.org
[akpm@linux-foundation.org: fix x86 warning]
[sfr@canb.auug.org.au: fix powerpc build]
  Link: http://lkml.kernel.org/r/20200607153443.GB738695@linux.ibm.com
Link: http://lkml.kernel.org/r/20200514170327.31389-10-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
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: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/include/asm/pgtable.h                |   14 --
 arch/arc/include/asm/pgtable.h                  |   22 ---
 arch/arm/include/asm/pgtable-2level.h           |    1 
 arch/arm/include/asm/pgtable-3level.h           |    7 -
 arch/arm/include/asm/pgtable-nommu.h            |    1 
 arch/arm/include/asm/pgtable.h                  |   23 ---
 arch/arm64/include/asm/pgtable.h                |   36 ++---
 arch/arm64/kernel/hibernate.c                   |    4 
 arch/arm64/mm/kasan_init.c                      |    2 
 arch/arm64/mm/mmu.c                             |    8 -
 arch/c6x/include/asm/pgtable.h                  |    1 
 arch/csky/include/asm/pgtable.h                 |   30 ----
 arch/hexagon/include/asm/pgtable.h              |   52 --------
 arch/ia64/include/asm/pgtable.h                 |   33 -----
 arch/m68k/include/asm/mcf_pgtable.h             |   23 ---
 arch/m68k/include/asm/motorola_pgalloc.h        |    2 
 arch/m68k/include/asm/motorola_pgtable.h        |   34 -----
 arch/m68k/include/asm/sun3_pgtable.h            |   24 ---
 arch/m68k/mm/init.c                             |    2 
 arch/microblaze/include/asm/pgtable.h           |   21 ---
 arch/mips/include/asm/pgtable-32.h              |   22 ---
 arch/mips/include/asm/pgtable-64.h              |   32 ----
 arch/mips/kvm/mmu.c                             |   20 +--
 arch/mips/kvm/trap_emul.c                       |    2 
 arch/nds32/include/asm/pgtable.h                |   18 --
 arch/nios2/include/asm/pgtable.h                |   22 ---
 arch/openrisc/include/asm/pgtable.h             |   31 ----
 arch/parisc/include/asm/pgtable.h               |   32 ----
 arch/parisc/kernel/pci-dma.c                    |    2 
 arch/powerpc/include/asm/book3s/32/pgtable.h    |   20 ---
 arch/powerpc/include/asm/book3s/64/pgtable.h    |   43 ------
 arch/powerpc/include/asm/nohash/32/pgtable.h    |   17 --
 arch/powerpc/include/asm/nohash/64/pgtable-4k.h |    4 
 arch/powerpc/include/asm/nohash/64/pgtable.h    |   22 ---
 arch/powerpc/include/asm/pgtable.h              |    7 +
 arch/riscv/include/asm/pgtable-64.h             |    7 -
 arch/riscv/include/asm/pgtable.h                |   20 ---
 arch/riscv/mm/init.c                            |   30 ++--
 arch/s390/include/asm/pgtable.h                 |   13 --
 arch/s390/mm/pageattr.c                         |    2 
 arch/sh/include/asm/pgtable-3level.h            |    7 -
 arch/sh/include/asm/pgtable_32.h                |   25 ---
 arch/sparc/include/asm/pgalloc_64.h             |    2 
 arch/sparc/include/asm/pgtable_32.h             |   32 +---
 arch/sparc/include/asm/pgtable_64.h             |   31 ----
 arch/um/include/asm/pgtable-3level.h            |    4 
 arch/um/include/asm/pgtable.h                   |   67 ++--------
 arch/unicore32/include/asm/pgtable.h            |   17 --
 arch/x86/include/asm/pgtable.h                  |   71 ----------
 arch/x86/include/asm/pgtable_32.h               |   11 -
 arch/x86/include/asm/pgtable_64.h               |    4 
 arch/xtensa/include/asm/pgtable.h               |   18 --
 include/asm-generic/pgtable-nopmd.h             |    1 
 include/asm-generic/pgtable-nopud.h             |    1 
 include/linux/pgtable.h                         |   91 ++++++++++++++
 55 files changed, 228 insertions(+), 860 deletions(-)

--- a/arch/alpha/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/alpha/include/asm/pgtable.h
@@ -276,15 +276,6 @@ extern inline pte_t pte_mkwrite(pte_t pt
 extern inline pte_t pte_mkdirty(pte_t pte)	{ pte_val(pte) |= __DIRTY_BITS; return pte; }
 extern inline pte_t pte_mkyoung(pte_t pte)	{ pte_val(pte) |= __ACCESS_BITS; return pte; }
 
-#define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, (address))
-
-/* to find an entry in a page-table-directory. */
-#define pgd_index(address)	(((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define pgd_offset(mm, address)	((mm)->pgd+pgd_index(address))
-
 /*
  * The smp_read_barrier_depends() in the following functions are required to
  * order the load of *dir (the pointer in the top level page table) with any
@@ -305,6 +296,7 @@ extern inline pmd_t * pmd_offset(pud_t *
 	smp_read_barrier_depends(); /* see above */
 	return ret;
 }
+#define pmd_offset pmd_offset
 
 /* Find an entry in the third-level page table.. */
 extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address)
@@ -314,9 +306,7 @@ extern inline pte_t * pte_offset_kernel(
 	smp_read_barrier_depends(); /* see above */
 	return ret;
 }
-
-#define pte_offset_map(dir,addr)	pte_offset_kernel((dir),(addr))
-#define pte_unmap(pte)			do { } while (0)
+#define pte_offset_kernel pte_offset_kernel
 
 extern pgd_t swapper_pg_dir[1024];
 
--- a/arch/arc/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arc/include/asm/pgtable.h
@@ -248,9 +248,6 @@
 extern char empty_zero_page[PAGE_SIZE];
 #define ZERO_PAGE(vaddr)	(virt_to_page(empty_zero_page))
 
-#define pte_unmap(pte)		do { } while (0)
-#define pte_unmap_nested(pte)		do { } while (0)
-
 #define set_pte(pteptr, pteval)	((*(pteptr)) = (pteval))
 #define set_pmd(pmdptr, pmdval)	(*(pmdptr) = pmdval)
 
@@ -282,18 +279,6 @@ static inline void pmd_set(pmd_t *pmdp,
 
 /* Don't use virt_to_pfn for macros below: could cause truncations for PAE40*/
 #define pte_pfn(pte)		(pte_val(pte) >> PAGE_SHIFT)
-#define __pte_index(addr)	(((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
-/*
- * pte_offset gets a @ptr to PMD entry (PGD in our 2-tier paging system)
- * and returns ptr to PTE entry corresponding to @addr
- */
-#define pte_offset(dir, addr) ((pte_t *)(pmd_page_vaddr(*dir)) +\
-					 __pte_index(addr))
-
-/* No mapping of Page Tables in high mem etc, so following same as above */
-#define pte_offset_kernel(dir, addr)		pte_offset(dir, addr)
-#define pte_offset_map(dir, addr)		pte_offset(dir, addr)
 
 /* Zoo of pte_xxx function */
 #define pte_read(pte)		(pte_val(pte) & _PAGE_READ)
@@ -332,13 +317,6 @@ static inline void set_pte_at(struct mm_
 }
 
 /*
- * All kernel related VM pages are in init's mm.
- */
-#define pgd_offset_k(address)	pgd_offset(&init_mm, address)
-#define pgd_index(addr)		((addr) >> PGDIR_SHIFT)
-#define pgd_offset(mm, addr)	(((mm)->pgd)+pgd_index(addr))
-
-/*
  * Macro to quickly access the PGD entry, utlising the fact that some
  * arch may cache the pointer to Page Directory of "current" task
  * in a MMU register
--- a/arch/arm64/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm64/include/asm/pgtable.h
@@ -506,15 +506,13 @@ static inline phys_addr_t pmd_page_paddr
 	return __pmd_to_phys(pmd);
 }
 
-static inline void pte_unmap(pte_t *pte) { }
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return (unsigned long)__va(pmd_page_paddr(pmd));
+}
 
 /* Find an entry in the third-level page table. */
-#define pte_index(addr)		(((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
 #define pte_offset_phys(dir,addr)	(pmd_page_paddr(READ_ONCE(*(dir))) + pte_index(addr) * sizeof(pte_t))
-#define pte_offset_kernel(dir,addr)	((pte_t *)__va(pte_offset_phys((dir), (addr))))
-
-#define pte_offset_map(dir,addr)	pte_offset_kernel((dir), (addr))
 
 #define pte_set_fixmap(addr)		((pte_t *)set_fixmap_offset(FIX_PTE, addr))
 #define pte_set_fixmap_offset(pmd, addr)	pte_set_fixmap(pte_offset_phys(pmd, addr))
@@ -568,11 +566,13 @@ static inline phys_addr_t pud_page_paddr
 	return __pud_to_phys(pud);
 }
 
-/* Find an entry in the second-level page table. */
-#define pmd_index(addr)		(((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
+static inline unsigned long pud_page_vaddr(pud_t pud)
+{
+	return (unsigned long)__va(pud_page_paddr(pud));
+}
 
+/* Find an entry in the second-level page table. */
 #define pmd_offset_phys(dir, addr)	(pud_page_paddr(READ_ONCE(*(dir))) + pmd_index(addr) * sizeof(pmd_t))
-#define pmd_offset(dir, addr)		((pmd_t *)__va(pmd_offset_phys((dir), (addr))))
 
 #define pmd_set_fixmap(addr)		((pmd_t *)set_fixmap_offset(FIX_PMD, addr))
 #define pmd_set_fixmap_offset(pud, addr)	pmd_set_fixmap(pmd_offset_phys(pud, addr))
@@ -626,11 +626,13 @@ static inline phys_addr_t p4d_page_paddr
 	return __p4d_to_phys(p4d);
 }
 
-/* Find an entry in the frst-level page table. */
-#define pud_index(addr)		(((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
+static inline unsigned long p4d_page_vaddr(p4d_t p4d)
+{
+	return (unsigned long)__va(p4d_page_paddr(p4d));
+}
 
+/* Find an entry in the frst-level page table. */
 #define pud_offset_phys(dir, addr)	(p4d_page_paddr(READ_ONCE(*(dir))) + pud_index(addr) * sizeof(pud_t))
-#define pud_offset(dir, addr)		((pud_t *)__va(pud_offset_phys((dir), (addr))))
 
 #define pud_set_fixmap(addr)		((pud_t *)set_fixmap_offset(FIX_PUD, addr))
 #define pud_set_fixmap_offset(p4d, addr)	pud_set_fixmap(pud_offset_phys(p4d, addr))
@@ -657,16 +659,6 @@ static inline phys_addr_t p4d_page_paddr
 
 #define pgd_ERROR(pgd)		__pgd_error(__FILE__, __LINE__, pgd_val(pgd))
 
-/* to find an entry in a page-table-directory */
-#define pgd_index(addr)		(((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
-
-#define pgd_offset_raw(pgd, addr)	((pgd) + pgd_index(addr))
-
-#define pgd_offset(mm, addr)	(pgd_offset_raw((mm)->pgd, (addr)))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
-
 #define pgd_set_fixmap(addr)	((pgd_t *)set_fixmap_offset(FIX_PGD, addr))
 #define pgd_clear_fixmap()	clear_fixmap(FIX_PGD)
 
--- a/arch/arm64/kernel/hibernate.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm64/kernel/hibernate.c
@@ -188,7 +188,7 @@ static int trans_pgd_map_page(pgd_t *tra
 	pmd_t *pmdp;
 	pte_t *ptep;
 
-	pgdp = pgd_offset_raw(trans_pgd, dst_addr);
+	pgdp = pgd_offset_pgd(trans_pgd, dst_addr);
 	if (pgd_none(READ_ONCE(*pgdp))) {
 		pudp = (void *)get_safe_page(GFP_ATOMIC);
 		if (!pudp)
@@ -490,7 +490,7 @@ static int copy_page_tables(pgd_t *dst_p
 	unsigned long addr = start;
 	pgd_t *src_pgdp = pgd_offset_k(start);
 
-	dst_pgdp = pgd_offset_raw(dst_pgdp, start);
+	dst_pgdp = pgd_offset_pgd(dst_pgdp, start);
 	do {
 		next = pgd_addr_end(addr, end);
 		if (pgd_none(READ_ONCE(*src_pgdp)))
--- a/arch/arm64/mm/kasan_init.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm64/mm/kasan_init.c
@@ -190,7 +190,7 @@ void __init kasan_copy_shadow(pgd_t *pgd
 
 	pgdp = pgd_offset_k(KASAN_SHADOW_START);
 	pgdp_end = pgd_offset_k(KASAN_SHADOW_END);
-	pgdp_new = pgd_offset_raw(pgdir, KASAN_SHADOW_START);
+	pgdp_new = pgd_offset_pgd(pgdir, KASAN_SHADOW_START);
 	do {
 		set_pgd(pgdp_new, READ_ONCE(*pgdp));
 	} while (pgdp++, pgdp_new++, pgdp != pgdp_end);
--- a/arch/arm64/mm/mmu.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm64/mm/mmu.c
@@ -341,7 +341,7 @@ static void __create_pgd_mapping(pgd_t *
 				 int flags)
 {
 	unsigned long addr, end, next;
-	pgd_t *pgdp = pgd_offset_raw(pgdir, virt);
+	pgd_t *pgdp = pgd_offset_pgd(pgdir, virt);
 
 	/*
 	 * If the virtual and physical address don't have the same offset
@@ -663,13 +663,13 @@ static void __init map_kernel(pgd_t *pgd
 			   &vmlinux_initdata, 0, VM_NO_GUARD);
 	map_kernel_segment(pgdp, _data, _end, PAGE_KERNEL, &vmlinux_data, 0, 0);
 
-	if (!READ_ONCE(pgd_val(*pgd_offset_raw(pgdp, FIXADDR_START)))) {
+	if (!READ_ONCE(pgd_val(*pgd_offset_pgd(pgdp, FIXADDR_START)))) {
 		/*
 		 * The fixmap falls in a separate pgd to the kernel, and doesn't
 		 * live in the carveout for the swapper_pg_dir. We can simply
 		 * re-use the existing dir for the fixmap.
 		 */
-		set_pgd(pgd_offset_raw(pgdp, FIXADDR_START),
+		set_pgd(pgd_offset_pgd(pgdp, FIXADDR_START),
 			READ_ONCE(*pgd_offset_k(FIXADDR_START)));
 	} else if (CONFIG_PGTABLE_LEVELS > 3) {
 		pgd_t *bm_pgdp;
@@ -682,7 +682,7 @@ static void __init map_kernel(pgd_t *pgd
 		 * entry instead.
 		 */
 		BUG_ON(!IS_ENABLED(CONFIG_ARM64_16K_PAGES));
-		bm_pgdp = pgd_offset_raw(pgdp, FIXADDR_START);
+		bm_pgdp = pgd_offset_pgd(pgdp, FIXADDR_START);
 		bm_p4dp = p4d_offset(bm_pgdp, FIXADDR_START);
 		bm_pudp = pud_set_fixmap_offset(bm_p4dp, FIXADDR_START);
 		pud_populate(&init_mm, bm_pudp, lm_alias(bm_pmd));
--- a/arch/arm/include/asm/pgtable-2level.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm/include/asm/pgtable-2level.h
@@ -187,6 +187,7 @@ static inline pmd_t *pmd_offset(pud_t *p
 {
 	return (pmd_t *)pud;
 }
+#define pmd_offset pmd_offset
 
 #define pmd_large(pmd)		(pmd_val(pmd) & 2)
 #define pmd_leaf(pmd)		(pmd_val(pmd) & 2)
--- a/arch/arm/include/asm/pgtable-3level.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm/include/asm/pgtable-3level.h
@@ -133,13 +133,6 @@ static inline pmd_t *pud_page_vaddr(pud_
 	return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);
 }
 
-/* Find an entry in the second-level page table.. */
-#define pmd_index(addr)		(((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
-static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
-{
-	return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);
-}
-
 #define pmd_bad(pmd)		(!(pmd_val(pmd) & 2))
 
 #define copy_pmd(pmdpd,pmdps)		\
--- a/arch/arm/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm/include/asm/pgtable.h
@@ -166,14 +166,6 @@ extern struct page *empty_zero_page;
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 
-/* to find an entry in a page-table-directory */
-#define pgd_index(addr)		((addr) >> PGDIR_SHIFT)
-
-#define pgd_offset(mm, addr)	((mm)->pgd + pgd_index(addr))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
-
 #define pmd_none(pmd)		(!pmd_val(pmd))
 
 static inline pte_t *pmd_page_vaddr(pmd_t pmd)
@@ -183,21 +175,6 @@ static inline pte_t *pmd_page_vaddr(pmd_
 
 #define pmd_page(pmd)		pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
 
-#ifndef CONFIG_HIGHPTE
-#define __pte_map(pmd)		pmd_page_vaddr(*(pmd))
-#define __pte_unmap(pte)	do { } while (0)
-#else
-#define __pte_map(pmd)		(pte_t *)kmap_atomic(pmd_page(*(pmd)))
-#define __pte_unmap(pte)	kunmap_atomic(pte)
-#endif
-
-#define pte_index(addr)		(((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
-#define pte_offset_kernel(pmd,addr)	(pmd_page_vaddr(*(pmd)) + pte_index(addr))
-
-#define pte_offset_map(pmd,addr)	(__pte_map(pmd) + pte_index(addr))
-#define pte_unmap(pte)			__pte_unmap(pte)
-
 #define pte_pfn(pte)		((pte_val(pte) & PHYS_MASK) >> PAGE_SHIFT)
 #define pfn_pte(pfn,prot)	__pte(__pfn_to_phys(pfn) | pgprot_val(prot))
 
--- a/arch/arm/include/asm/pgtable-nommu.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/arm/include/asm/pgtable-nommu.h
@@ -22,7 +22,6 @@
 #define pgd_bad(pgd)		(0)
 #define pgd_clear(pgdp)
 #define kern_addr_valid(addr)	(1)
-#define	pmd_offset(a, b)	((void *)0)
 /* FIXME */
 /*
  * PMD_SHIFT determines the size of the area a second-level page table can map
--- a/arch/c6x/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/c6x/include/asm/pgtable.h
@@ -26,7 +26,6 @@
 #define pgd_clear(pgdp)
 #define kern_addr_valid(addr) (1)
 
-#define pmd_offset(a, b)	((void *)0)
 #define pmd_none(x)		(!pmd_val(x))
 #define pmd_present(x)		(pmd_val(x))
 #define pmd_clear(xp)		do { set_pmd(xp, __pmd(0)); } while (0)
--- a/arch/csky/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/csky/include/asm/pgtable.h
@@ -32,13 +32,6 @@
 #define pgd_ERROR(e) \
 	pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
-/* Find an entry in the third-level page table.. */
-#define __pte_offset_t(address) \
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address) \
-	(pmd_page_vaddr(*(dir)) + __pte_offset_t(address))
-#define pte_offset_map(dir, address) \
-	((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset_t(address))
 #define pmd_page(pmd)	(pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
 #define pte_clear(mm, addr, ptep)	set_pte((ptep), \
 	(((unsigned int) addr & PAGE_OFFSET) ? __pte(_PAGE_GLOBAL) : __pte(0)))
@@ -54,8 +47,6 @@
 #define _PAGE_CHG_MASK	(PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | \
 			 _CACHE_MASK)
 
-#define pte_unmap(pte)	((void)(pte))
-
 #define __swp_type(x)			(((x).val >> 4) & 0xff)
 #define __swp_offset(x)			((x).val >> 12)
 #define __swp_entry(type, offset)	((swp_entry_t) {((type) << 4) | \
@@ -229,14 +220,6 @@ static inline pte_t pte_mkyoung(pte_t pt
 	return pte;
 }
 
-#define pud_index(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-#define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address)	pgd_offset(&init_mm, address)
-
-#define pgd_index(address)	((address) >> PGDIR_SHIFT)
-
 #define __HAVE_PHYS_MEM_ACCESS_PROT
 struct file;
 extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
@@ -280,19 +263,6 @@ static inline pte_t pte_modify(pte_t pte
 		     (pgprot_val(newprot)));
 }
 
-/* to find an entry in a page-table-directory */
-static inline pgd_t *pgd_offset(struct mm_struct *mm, unsigned long address)
-{
-	return mm->pgd + pgd_index(address);
-}
-
-/* Find an entry in the third-level page table.. */
-static inline pte_t *pte_offset(pmd_t *dir, unsigned long address)
-{
-	return (pte_t *) (pmd_page_vaddr(*dir)) +
-		((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
-}
-
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 extern void paging_init(void);
 
--- a/arch/hexagon/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/hexagon/include/asm/pgtable.h
@@ -206,33 +206,6 @@ static inline void pte_clear(struct mm_s
 	pte_val(*ptep) = _NULL_PTE;
 }
 
-#ifdef NEED_PMD_INDEX_DESPITE_BEING_2_LEVEL
-/**
- * pmd_index - returns the index of the entry in the PMD page
- * which would control the given virtual address
- */
-#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-
-#endif
-
-/**
- * pgd_index - returns the index of the entry in the PGD page
- * which would control the given virtual address
- *
- * This returns the *index* for the address in the pgd_t
- */
-#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-
-/*
- * pgd_offset - find an offset in a page-table-directory
- */
-#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
-
-/*
- * pgd_offset_k - get kernel (init_mm) pgd entry pointer for addr
- */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
 /**
  * pmd_none - check if pmd_entry is mapped
  * @pmd_entry:  pmd entry
@@ -403,31 +376,14 @@ static inline int pte_exec(pte_t pte)
  */
 #define set_pte_at(mm, addr, ptep, pte) set_pte(ptep, pte)
 
-/*
- * May need to invoke the virtual machine as well...
- */
-#define pte_unmap(pte)		do { } while (0)
-#define pte_unmap_nested(pte)	do { } while (0)
-
-/*
- * pte_offset_map - returns the linear address of the page table entry
- * corresponding to an address
- */
-#define pte_offset_map(dir, address)                                    \
-	((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-
-#define pte_offset_map_nested(pmd, addr) pte_offset_map(pmd, addr)
-
-/* pte_offset_kernel - kernel version of pte_offset */
-#define pte_offset_kernel(dir, address) \
-	((pte_t *) (unsigned long) __va(pmd_val(*dir) & PAGE_MASK) \
-				+  __pte_offset(address))
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return (unsigned long)__va(pmd_val(pmd) & PAGE_MASK);
+}
 
 /* ZERO_PAGE - returns the globally shared zero page */
 #define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))
 
-#define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
 /*
  * Swap/file PTE definitions.  If _PAGE_PRESENT is zero, the rest of the PTE is
  * interpreted as swap information.  The remaining free bits are interpreted as
--- a/arch/ia64/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/ia64/include/asm/pgtable.h
@@ -364,44 +364,13 @@ pgd_index (unsigned long address)
 
 	return (region << (PAGE_SHIFT - 6)) | l1index;
 }
-
-/* The offset in the 1-level directory is given by the 3 region bits
-   (61..63) and the level-1 bits.  */
-static inline pgd_t*
-pgd_offset (const struct mm_struct *mm, unsigned long address)
-{
-	return mm->pgd + pgd_index(address);
-}
-
-/* In the kernel's mapped region we completely ignore the region number
-   (since we know it's in region number 5). */
-#define pgd_offset_k(addr) \
-	(init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
+#define pgd_index pgd_index
 
 /* Look up a pgd entry in the gate area.  On IA-64, the gate-area
    resides in the kernel-mapped segment, hence we use pgd_offset_k()
    here.  */
 #define pgd_offset_gate(mm, addr)	pgd_offset_k(addr)
 
-#if CONFIG_PGTABLE_LEVELS == 4
-/* Find an entry in the second-level page table.. */
-#define pud_offset(dir,addr) \
-	((pud_t *) p4d_page_vaddr(*(dir)) + (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
-#endif
-
-/* Find an entry in the third-level page table.. */
-#define pmd_offset(dir,addr) \
-	((pmd_t *) pud_page_vaddr(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
-
-/*
- * Find an entry in the third-level page table.  This looks more complicated than it
- * should be because some platforms place page tables in high memory.
- */
-#define pte_index(addr)	 	(((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir,addr)	((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir,addr)	pte_offset_kernel(dir, addr)
-#define pte_unmap(pte)			do { } while (0)
-
 /* atomic versions of the some PTE manipulations: */
 
 static inline int
--- a/arch/m68k/include/asm/mcf_pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/m68k/include/asm/mcf_pgtable.h
@@ -170,7 +170,7 @@ static inline void pgd_set(pgd_t *pgdp,
 }
 
 #define __pte_page(pte)	((unsigned long) (pte_val(pte) & PAGE_MASK))
-#define __pmd_page(pmd)	((unsigned long) (pmd_val(pmd)))
+#define pmd_page_vaddr(pmd)	((unsigned long) (pmd_val(pmd)))
 
 static inline int pte_none(pte_t pte)
 {
@@ -311,24 +311,6 @@ static inline pte_t pte_mkcache(pte_t pt
 extern pgd_t kernel_pg_dir[PTRS_PER_PGD];
 
 /*
- * Find an entry in a pagetable directory.
- */
-#define pgd_index(address)	((address) >> PGDIR_SHIFT)
-#define pgd_offset(mm, address)	((mm)->pgd + pgd_index(address))
-
-/*
- * Find an entry in a kernel pagetable directory.
- */
-#define pgd_offset_k(address)	pgd_offset(&init_mm, address)
-
-/*
- * Find an entry in the third-level pagetable.
- */
-#define __pte_offset(address)	((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address) \
-	((pte_t *) __pmd_page(*(dir)) + __pte_offset(address))
-
-/*
  * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e))
  */
 #define __swp_type(x)		((x).val & 0xFF)
@@ -340,9 +322,6 @@ extern pgd_t kernel_pg_dir[PTRS_PER_PGD]
 
 #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
 
-#define pte_offset_map(pmdp, addr) ((pte_t *)__pmd_page(*pmdp) + \
-				       __pte_offset(addr))
-#define pte_unmap(pte)		((void) 0)
 #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #define pte_pfn(pte)		(pte_val(pte) >> PAGE_SHIFT)
 
--- a/arch/m68k/include/asm/motorola_pgalloc.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/m68k/include/asm/motorola_pgalloc.h
@@ -88,7 +88,7 @@ static inline void pmd_populate(struct m
 {
 	pmd_set(pmd, page);
 }
-#define pmd_pgtable(pmd) ((pgtable_t)__pmd_page(pmd))
+#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))
 
 static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
 {
--- a/arch/m68k/include/asm/motorola_pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/m68k/include/asm/motorola_pgtable.h
@@ -128,7 +128,7 @@ static inline void pud_set(pud_t *pudp,
 }
 
 #define __pte_page(pte) ((unsigned long)__va(pte_val(pte) & PAGE_MASK))
-#define __pmd_page(pmd) ((unsigned long)__va(pmd_val(pmd) & _TABLE_MASK))
+#define pmd_page_vaddr(pmd) ((unsigned long)__va(pmd_val(pmd) & _TABLE_MASK))
 #define pud_page_vaddr(pud) ((unsigned long)__va(pud_val(pud) & _TABLE_MASK))
 
 
@@ -192,41 +192,9 @@ static inline pte_t pte_mkcache(pte_t pt
 	return pte;
 }
 
-#define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address))
-
-#define pgd_index(address)     ((address) >> PGDIR_SHIFT)
-
-/* to find an entry in a page-table-directory */
-static inline pgd_t *pgd_offset(const struct mm_struct *mm,
-				unsigned long address)
-{
-	return mm->pgd + pgd_index(address);
-}
-
 #define swapper_pg_dir kernel_pg_dir
 extern pgd_t kernel_pg_dir[128];
 
-static inline pgd_t *pgd_offset_k(unsigned long address)
-{
-	return kernel_pg_dir + (address >> PGDIR_SHIFT);
-}
-
-
-/* Find an entry in the second-level page table.. */
-static inline pmd_t *pmd_offset(pud_t *dir, unsigned long address)
-{
-	return (pmd_t *)pud_page_vaddr(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PMD-1));
-}
-
-/* Find an entry in the third-level page table.. */
-static inline pte_t *pte_offset_kernel(pmd_t *pmdp, unsigned long address)
-{
-	return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
-}
-
-#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-#define pte_unmap(pte)		((void)0)
-
 /* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */
 #define __swp_type(x)		(((x).val >> 4) & 0xff)
 #define __swp_offset(x)		((x).val >> 12)
--- a/arch/m68k/include/asm/sun3_pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/m68k/include/asm/sun3_pgtable.h
@@ -112,8 +112,11 @@ static inline pte_t pte_modify(pte_t pte
 
 #define __pte_page(pte) \
 ((unsigned long) __va ((pte_val (pte) & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT))
-#define __pmd_page(pmd) \
-((unsigned long) __va (pmd_val (pmd) & PAGE_MASK))
+
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return (unsigned long)__va(pmd_val(pmd) & PAGE_MASK);
+}
 
 static inline int pte_none (pte_t pte) { return !pte_val (pte); }
 static inline int pte_present (pte_t pte) { return pte_val (pte) & SUN3_PAGE_VALID; }
@@ -127,7 +130,7 @@ static inline void pte_clear (struct mm_
 ({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; })
 
 #define pte_page(pte)		virt_to_page(__pte_page(pte))
-#define pmd_page(pmd)		virt_to_page(__pmd_page(pmd))
+#define pmd_page(pmd)		virt_to_page(pmd_page_vaddr(pmd))
 
 
 static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); }
@@ -171,21 +174,6 @@ static inline pte_t pte_mkcache(pte_t pt
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 extern pgd_t kernel_pg_dir[PTRS_PER_PGD];
 
-/* Find an entry in a pagetable directory. */
-#define pgd_index(address)     ((address) >> PGDIR_SHIFT)
-
-#define pgd_offset(mm, address) \
-((mm)->pgd + pgd_index(address))
-
-/* Find an entry in a kernel pagetable directory. */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/* Find an entry in the third-level pagetable. */
-#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
-#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address))
-#define pte_offset_map(pmd, address) ((pte_t *)page_address(pmd_page(*pmd)) + pte_index(address))
-#define pte_unmap(pte) do { } while (0)
-
 /* Macros to (de)construct the fake PTEs representing swap pages. */
 #define __swp_type(x)		((x).val & 0x7F)
 #define __swp_offset(x)		(((x).val) >> 7)
--- a/arch/m68k/mm/init.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/m68k/mm/init.c
@@ -141,7 +141,7 @@ static inline void init_pointer_tables(v
 			if (!pmd_present(*pmd))
 				continue;
 
-			pte_dir = (pte_t *)__pmd_page(*pmd);
+			pte_dir = (pte_t *)pmd_page_vaddr(*pmd);
 			init_pointer_table(pte_dir, TABLE_PTE);
 		}
 	}
--- a/arch/microblaze/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/microblaze/include/asm/pgtable.h
@@ -21,7 +21,6 @@ extern int mem_init_done;
 #define pgd_bad(pgd)		(0)
 #define pgd_clear(pgdp)
 #define kern_addr_valid(addr)	(1)
-#define	pmd_offset(a, b)	((void *) 0)
 
 #define PAGE_NONE		__pgprot(0) /* these mean nothing to non MMU */
 #define PAGE_SHARED		__pgprot(0) /* these mean nothing to non MMU */
@@ -438,27 +437,15 @@ static inline void ptep_mkdirty(struct m
 /* Convert pmd entry to page */
 /* our pmd entry is an effective address of pte table*/
 /* returns effective address of the pmd entry*/
-#define pmd_page_kernel(pmd)	((unsigned long) (pmd_val(pmd) & PAGE_MASK))
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return ((unsigned long) (pmd_val(pmd) & PAGE_MASK));
+}
 
 /* returns struct *page of the pmd entry*/
 #define pmd_page(pmd)	(pfn_to_page(__pa(pmd_val(pmd)) >> PAGE_SHIFT))
 
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/* to find an entry in a page-table-directory */
-#define pgd_index(address)	 ((address) >> PGDIR_SHIFT)
-#define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
-
 /* Find an entry in the third-level page table.. */
-#define pte_index(address)		\
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, addr)	\
-	((pte_t *) pmd_page_kernel(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir, addr)		\
-	((pte_t *) kmap_atomic(pmd_page(*(dir))) + pte_index(addr))
-
-#define pte_unmap(pte)		kunmap_atomic(pte)
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 
--- a/arch/mips/include/asm/pgtable-32.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/mips/include/asm/pgtable-32.h
@@ -195,28 +195,6 @@ static inline pte_t pfn_pte(unsigned lon
 
 #define pte_page(x)		pfn_to_page(pte_pfn(x))
 
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-#define pgd_index(address)	(((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define pud_index(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-#define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-
-/* to find an entry in a page-table-directory */
-#define pgd_offset(mm, addr)	((mm)->pgd + pgd_index(addr))
-
-/* Find an entry in the third-level page table.. */
-#define __pte_offset(address)						\
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset(dir, address)					\
-	((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_kernel(dir, address)					\
-	((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-
-#define pte_offset_map(dir, address)					\
-	((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_unmap(pte) ((void)(pte))
-
 #if defined(CONFIG_CPU_R3K_TLB)
 
 /* Swap entries must have VALID bit cleared. */
--- a/arch/mips/include/asm/pgtable-64.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/mips/include/asm/pgtable-64.h
@@ -172,8 +172,6 @@
 
 extern pte_t invalid_pte_table[PTRS_PER_PTE];
 
-#define pud_index(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
-
 #ifndef __PAGETABLE_PUD_FOLDED
 /*
  * For 4-level pagetables we defines these ourselves, for 3-level the
@@ -222,11 +220,6 @@ static inline unsigned long p4d_page_vad
 
 #define p4d_index(address)	(((address) >> P4D_SHIFT) & (PTRS_PER_P4D - 1))
 
-static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
-{
-	return (pud_t *)p4d_page_vaddr(*p4d) + pud_index(address);
-}
-
 static inline void set_p4d(p4d_t *p4d, p4d_t p4dval)
 {
 	*p4d = p4dval;
@@ -320,15 +313,6 @@ static inline void pud_clear(pud_t *pudp
 #define pfn_pmd(pfn, prot)	__pmd(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
 #endif
 
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-#define pgd_index(address)	(((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-
-/* to find an entry in a page-table-directory */
-#define pgd_offset(mm, addr)	((mm)->pgd + pgd_index(addr))
-
 #ifndef __PAGETABLE_PMD_FOLDED
 static inline unsigned long pud_page_vaddr(pud_t pud)
 {
@@ -337,24 +321,8 @@ static inline unsigned long pud_page_vad
 #define pud_phys(pud)		virt_to_phys((void *)pud_val(pud))
 #define pud_page(pud)		(pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))
 
-/* Find an entry in the second-level page table.. */
-static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address)
-{
-	return (pmd_t *) pud_page_vaddr(*pud) + pmd_index(address);
-}
 #endif
 
-/* Find an entry in the third-level page table.. */
-#define __pte_offset(address)						\
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset(dir, address)					\
-	((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_kernel(dir, address)					\
-	((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_map(dir, address)					\
-	((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_unmap(pte) ((void)(pte))
-
 /*
  * Initialize a new pgd / pmd table with invalid pointers.
  */
--- a/arch/mips/kvm/mmu.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/mips/kvm/mmu.c
@@ -168,7 +168,7 @@ static pte_t *kvm_mips_walk_pgd(pgd_t *p
 		clear_page(new_pte);
 		pmd_populate_kernel(NULL, pmd, new_pte);
 	}
-	return pte_offset(pmd, addr);
+	return pte_offset_kernel(pmd, addr);
 }
 
 /* Caller must hold kvm->mm_lock */
@@ -187,8 +187,8 @@ static pte_t *kvm_mips_pte_for_gpa(struc
 static bool kvm_mips_flush_gpa_pte(pte_t *pte, unsigned long start_gpa,
 				   unsigned long end_gpa)
 {
-	int i_min = __pte_offset(start_gpa);
-	int i_max = __pte_offset(end_gpa);
+	int i_min = pte_index(start_gpa);
+	int i_max = pte_index(end_gpa);
 	bool safe_to_remove = (i_min == 0 && i_max == PTRS_PER_PTE - 1);
 	int i;
 
@@ -215,7 +215,7 @@ static bool kvm_mips_flush_gpa_pmd(pmd_t
 		if (!pmd_present(pmd[i]))
 			continue;
 
-		pte = pte_offset(pmd + i, 0);
+		pte = pte_offset_kernel(pmd + i, 0);
 		if (i == i_max)
 			end = end_gpa;
 
@@ -312,8 +312,8 @@ static int kvm_mips_##name##_pte(pte_t *
 				 unsigned long end)			\
 {									\
 	int ret = 0;							\
-	int i_min = __pte_offset(start);				\
-	int i_max = __pte_offset(end);					\
+	int i_min = pte_index(start);				\
+	int i_max = pte_index(end);					\
 	int i;								\
 	pte_t old, new;							\
 									\
@@ -346,7 +346,7 @@ static int kvm_mips_##name##_pmd(pmd_t *
 		if (!pmd_present(pmd[i]))				\
 			continue;					\
 									\
-		pte = pte_offset(pmd + i, 0);				\
+		pte = pte_offset_kernel(pmd + i, 0);				\
 		if (i == i_max)						\
 			cur_end = end;					\
 									\
@@ -842,8 +842,8 @@ void kvm_trap_emul_invalidate_gva(struct
 static bool kvm_mips_flush_gva_pte(pte_t *pte, unsigned long start_gva,
 				   unsigned long end_gva)
 {
-	int i_min = __pte_offset(start_gva);
-	int i_max = __pte_offset(end_gva);
+	int i_min = pte_index(start_gva);
+	int i_max = pte_index(end_gva);
 	bool safe_to_remove = (i_min == 0 && i_max == PTRS_PER_PTE - 1);
 	int i;
 
@@ -877,7 +877,7 @@ static bool kvm_mips_flush_gva_pmd(pmd_t
 		if (!pmd_present(pmd[i]))
 			continue;
 
-		pte = pte_offset(pmd + i, 0);
+		pte = pte_offset_kernel(pmd + i, 0);
 		if (i == i_max)
 			end = end_gva;
 
--- a/arch/mips/kvm/trap_emul.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/mips/kvm/trap_emul.c
@@ -594,7 +594,7 @@ static void kvm_mips_emul_free_gva_pt(pg
 				pmd_va = pud_va | (k << PMD_SHIFT);
 				if (pmd_va >= end)
 					break;
-				pte = pte_offset(pmd + k, 0);
+				pte = pte_offset_kernel(pmd + k, 0);
 				pte_free_kernel(NULL, pte);
 			}
 			pmd_free(NULL, pmd);
--- a/arch/nds32/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/nds32/include/asm/pgtable.h
@@ -186,14 +186,10 @@ extern void paging_init(void);
 #define pte_clear(mm,addr,ptep)	set_pte_at((mm),(addr),(ptep), __pte(0))
 #define pte_page(pte)		(pfn_to_page(pte_pfn(pte)))
 
-#define pte_index(address)                   (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address)	     ((pte_t *)pmd_page_kernel(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address)	     ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address)  pte_offset_map(dir, address)
-#define pmd_page_kernel(pmd)	  	     ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-
-#define pte_unmap(pte)		do { } while (0)
-#define pte_unmap_nested(pte)	do { } while (0)
+static unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK));
+}
 
 #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
 /*
@@ -344,12 +340,6 @@ static inline pmd_t __mk_pmd(pte_t * pte
  *
 */
 
-/* to find an entry in a page-table-directory */
-#define pgd_index(address)      (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
-#define pgd_offset(mm, address)	((mm)->pgd + pgd_index(address))
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(addr)      pgd_offset(&init_mm, addr)
-
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
 	const unsigned long mask = 0xfff;
--- a/arch/nios2/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/nios2/include/asm/pgtable.h
@@ -102,10 +102,6 @@ static inline void set_pmd(pmd_t *pmdptr
 	*pmdptr = pmdval;
 }
 
-/* to find an entry in a page-table-directory */
-#define pgd_index(addr)		(((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
-#define pgd_offset(mm, addr)	((mm)->pgd + pgd_index(addr))
-
 static inline int pte_write(pte_t pte)		\
 	{ return pte_val(pte) & _PAGE_WRITE; }
 static inline int pte_dirty(pte_t pte)		\
@@ -236,27 +232,17 @@ static inline void pte_clear(struct mm_s
  */
 #define mk_pte(page, prot)	(pfn_pte(page_to_pfn(page), prot))
 
-#define pte_unmap(pte)	do { } while (0)
-
 /*
  * Conversion functions: convert a page and protection to a page entry,
  * and a page entry and page directory to the page they refer to.
  */
 #define pmd_phys(pmd)		virt_to_phys((void *)pmd_val(pmd))
 #define pmd_page(pmd)		(pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
-#define pmd_page_vaddr(pmd)	pmd_val(pmd)
 
-#define pte_offset_map(dir, addr)			\
-	((pte_t *) page_address(pmd_page(*dir)) +	\
-	 (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
-
-/* Get the address to the PTE for a vaddr in specific directory */
-#define pte_offset_kernel(dir, addr)			\
-	((pte_t *) pmd_page_vaddr(*(dir)) +		\
-	 (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return pmd_val(pmd);
+}
 
 #define pte_ERROR(e) \
 	pr_err("%s:%d: bad pte %08lx.\n", \
--- a/arch/openrisc/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/openrisc/include/asm/pgtable.h
@@ -363,38 +363,15 @@ static inline void pmd_set(pmd_t *pmdp,
 }
 
 #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
-#define pmd_page_kernel(pmd)    ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
 
-/* to find an entry in a page-table-directory. */
-#define pgd_index(address)      ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-
-#define __pgd_offset(address)   pgd_index(address)
-
-#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK));
+}
 
 #define __pmd_offset(address) \
 	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
-/*
- * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
- *
- * this macro returns the index of the entry in the pte page which would
- * control the given virtual address
- */
-#define __pte_offset(address)                   \
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address)         \
-	((pte_t *) pmd_page_kernel(*(dir)) +  __pte_offset(address))
-#define pte_offset_map(dir, address)	        \
-	((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address)     \
-	pte_offset_map(dir, address)
-
-#define pte_unmap(pte)          do { } while (0)
-#define pte_unmap_nested(pte)   do { } while (0)
 #define pte_pfn(x)		((unsigned long)(((x).pte)) >> PAGE_SHIFT)
 #define pfn_pte(pfn, prot)  __pte((((pfn) << PAGE_SHIFT)) | pgprot_val(prot))
 
--- a/arch/parisc/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/parisc/include/asm/pgtable.h
@@ -427,40 +427,16 @@ static inline pte_t pte_modify(pte_t pte
 
 #define pte_page(pte)		(pfn_to_page(pte_pfn(pte)))
 
-#define pmd_page_vaddr(pmd)	((unsigned long) __va(pmd_address(pmd)))
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return ((unsigned long) __va(pmd_address(pmd)));
+}
 
 #define __pmd_page(pmd) ((unsigned long) __va(pmd_address(pmd)))
 #define pmd_page(pmd)	virt_to_page((void *)__pmd_page(pmd))
 
-#define pgd_index(address) ((address) >> PGDIR_SHIFT)
-
-/* to find an entry in a page-table-directory */
-#define pgd_offset(mm, address) \
-((mm)->pgd + ((address) >> PGDIR_SHIFT))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
 /* Find an entry in the second-level page table.. */
 
-#if CONFIG_PGTABLE_LEVELS == 3
-#define pmd_index(addr)         (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
-#define pmd_offset(dir,address) \
-((pmd_t *) pud_page_vaddr(*(dir)) + pmd_index(address))
-#else
-#define pmd_offset(dir,addr) ((pmd_t *) dir)
-#endif
-
-/* Find an entry in the third-level page table.. */ 
-#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
-#define pte_offset_kernel(pmd, address) \
-	((pte_t *) pmd_page_vaddr(*(pmd)) + pte_index(address))
-#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_unmap(pte) do { } while (0)
-
-#define pte_unmap(pte)			do { } while (0)
-#define pte_unmap_nested(pte)		do { } while (0)
-
 extern void paging_init (void);
 
 /* Used for deferring calls to flush_dcache_page() */
--- a/arch/parisc/kernel/pci-dma.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/parisc/kernel/pci-dma.c
@@ -201,7 +201,7 @@ static inline void unmap_uncached_pmd(pg
 		pgd_clear(dir);
 		return;
 	}
-	pmd = pmd_offset(dir, vaddr);
+	pmd = pmd_offset(pud_offset(p4d_offset(dir, vaddr), vaddr), vaddr);
 	vaddr &= ~PGDIR_MASK;
 	end = vaddr + size;
 	if (end > PGDIR_SIZE)
--- a/arch/powerpc/include/asm/book3s/32/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/powerpc/include/asm/book3s/32/pgtable.h
@@ -112,6 +112,9 @@ static inline bool pte_user(pte_t pte)
 #define PMD_TABLE_SIZE	0
 #define PUD_TABLE_SIZE	0
 #define PGD_TABLE_SIZE	(sizeof(pgd_t) << PGD_INDEX_SIZE)
+
+/* Bits to mask out from a PMD to get to the PTE page */
+#define PMD_MASKED_BITS		(PTE_TABLE_SIZE - 1)
 #endif	/* __ASSEMBLY__ */
 
 #define PTRS_PER_PTE	(1 << PTE_INDEX_SIZE)
@@ -332,26 +335,9 @@ static inline void __ptep_set_access_fla
 #define __HAVE_ARCH_PTE_SAME
 #define pte_same(A,B)	(((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)
 
-#define pmd_page_vaddr(pmd)	\
-	((unsigned long)__va(pmd_val(pmd) & ~(PTE_TABLE_SIZE - 1)))
 #define pmd_page(pmd)		\
 	pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
 
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/* to find an entry in a page-table-directory */
-#define pgd_index(address)	 ((address) >> PGDIR_SHIFT)
-#define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
-
-/* Find an entry in the third-level page table.. */
-#define pte_index(address)		\
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, addr)	\
-	((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir, addr)	pte_offset_kernel((dir), (addr))
-static inline void pte_unmap(pte_t *pte) { }
-
 /*
  * Encode and decode a swap entry.
  * Note that the bits we use in a PTE for representing a swap entry
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -1005,52 +1005,9 @@ extern struct page *p4d_page(p4d_t p4d);
 /* Pointers in the page table tree are physical addresses */
 #define __pgtable_ptr_val(ptr)	__pa(ptr)
 
-#define pmd_page_vaddr(pmd)	__va(pmd_val(pmd) & ~PMD_MASKED_BITS)
 #define pud_page_vaddr(pud)	__va(pud_val(pud) & ~PUD_MASKED_BITS)
 #define p4d_page_vaddr(p4d)	__va(p4d_val(p4d) & ~P4D_MASKED_BITS)
 
-static inline unsigned long pgd_index(unsigned long address)
-{
-	return (address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1);
-}
-
-static inline unsigned long pud_index(unsigned long address)
-{
-	return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
-}
-
-static inline unsigned long pmd_index(unsigned long address)
-{
-	return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
-}
-
-static inline unsigned long pte_index(unsigned long address)
-{
-	return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
-}
-
-/*
- * Find an entry in a page-table-directory.  We combine the address region
- * (the high order N bits) and the pgd portion of the address.
- */
-
-#define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
-
-#define pud_offset(p4dp, addr)	\
-	(((pud_t *) p4d_page_vaddr(*(p4dp))) + pud_index(addr))
-#define pmd_offset(pudp,addr) \
-	(((pmd_t *) pud_page_vaddr(*(pudp))) + pmd_index(addr))
-#define pte_offset_kernel(dir,addr) \
-	(((pte_t *) pmd_page_vaddr(*(dir))) + pte_index(addr))
-
-#define pte_offset_map(dir,addr)	pte_offset_kernel((dir), (addr))
-
-static inline void pte_unmap(pte_t *pte) { }
-
-/* to find an entry in a kernel page-table-directory */
-/* This now only contains the vmalloc pages */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
 #define pte_ERROR(e) \
 	pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 #define pmd_ERROR(e) \
--- a/arch/powerpc/include/asm/nohash/32/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/powerpc/include/asm/nohash/32/pgtable.h
@@ -28,6 +28,8 @@ extern int icache_44x_need_flush;
 #define PMD_TABLE_SIZE	0
 #define PUD_TABLE_SIZE	0
 #define PGD_TABLE_SIZE	(sizeof(pgd_t) << PGD_INDEX_SIZE)
+
+#define PMD_MASKED_BITS (PTE_TABLE_SIZE - 1)
 #endif	/* __ASSEMBLY__ */
 
 #define PTRS_PER_PTE	(1 << PTE_INDEX_SIZE)
@@ -203,10 +205,6 @@ static inline void pmd_clear(pmd_t *pmdp
 	*pmdp = __pmd(0);
 }
 
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
 /* to find an entry in a page-table-directory */
 #define pgd_index(address)	 ((address) >> PGDIR_SHIFT)
 #define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
@@ -330,8 +328,6 @@ static inline int pte_young(pte_t pte)
  * of the pte page.  -- paulus
  */
 #ifndef CONFIG_BOOKE
-#define pmd_page_vaddr(pmd)	\
-	((unsigned long)__va(pmd_val(pmd) & ~(PTE_TABLE_SIZE - 1)))
 #define pmd_page(pmd)		\
 	pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
 #else
@@ -341,15 +337,6 @@ static inline int pte_young(pte_t pte)
 	pfn_to_page((__pa(pmd_val(pmd)) >> PAGE_SHIFT))
 #endif
 
-/* Find an entry in the third-level page table.. */
-#define pte_index(address)		\
-	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, addr)	\
-	(pmd_bad(*(dir)) ? NULL : (pte_t *)pmd_page_vaddr(*(dir)) + \
-				  pte_index(addr))
-#define pte_offset_map(dir, addr)	pte_offset_kernel((dir), (addr))
-static inline void pte_unmap(pte_t *pte) { }
-
 /*
  * Encode and decode a swap entry.
  * Note that the bits we use in a PTE for representing a swap entry
--- a/arch/powerpc/include/asm/nohash/64/pgtable-4k.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/powerpc/include/asm/nohash/64/pgtable-4k.h
@@ -78,10 +78,6 @@ extern struct page *p4d_page(p4d_t p4d);
 
 #endif /* !__ASSEMBLY__ */
 
-#define pud_offset(p4dp, addr)	\
-  (((pud_t *) p4d_page_vaddr(*(p4dp))) + \
-    (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
-
 #define pud_ERROR(e) \
 	pr_err("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e))
 
--- a/arch/powerpc/include/asm/nohash/64/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/powerpc/include/asm/nohash/64/pgtable.h
@@ -182,28 +182,6 @@ static inline void p4d_set(p4d_t *p4dp,
 	*p4dp = __p4d(val);
 }
 
-/*
- * Find an entry in a page-table-directory.  We combine the address region
- * (the high order N bits) and the pgd portion of the address.
- */
-#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1))
-
-#define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
-
-#define pmd_offset(pudp,addr) \
-  (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
-
-#define pte_offset_kernel(dir,addr) \
-  (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-
-#define pte_offset_map(dir,addr)	pte_offset_kernel((dir), (addr))
-
-static inline void pte_unmap(pte_t *pte) { }
-
-/* to find an entry in a kernel page-table-directory */
-/* This now only contains the vmalloc pages */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
 /* Atomic PTE updates */
 static inline unsigned long pte_update(struct mm_struct *mm,
 				       unsigned long addr,
--- a/arch/powerpc/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/powerpc/include/asm/pgtable.h
@@ -57,6 +57,13 @@ static inline pgprot_t pte_pgprot(pte_t
 	return __pgprot(pte_flags);
 }
 
+#ifndef pmd_page_vaddr
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return ((unsigned long)__va(pmd_val(pmd) & ~PMD_MASKED_BITS));
+}
+#define pmd_page_vaddr pmd_page_vaddr
+#endif
 /*
  * ZERO_PAGE is a global shared page that is always zero: used
  * for zero-mapped memory areas etc..
--- a/arch/riscv/include/asm/pgtable-64.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/riscv/include/asm/pgtable-64.h
@@ -70,13 +70,6 @@ static inline struct page *pud_page(pud_
 	return pfn_to_page(pud_val(pud) >> _PAGE_PFN_SHIFT);
 }
 
-#define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
-
-static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
-{
-	return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);
-}
-
 static inline pmd_t pfn_pmd(unsigned long pfn, pgprot_t prot)
 {
 	return __pmd((pfn << _PAGE_PFN_SHIFT) | pgprot_val(prot));
--- a/arch/riscv/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/riscv/include/asm/pgtable.h
@@ -173,16 +173,6 @@ static inline unsigned long _pgd_pfn(pgd
 	return pgd_val(pgd) >> _PAGE_PFN_SHIFT;
 }
 
-#define pgd_index(addr) (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
-
-/* Locate an entry in the page global directory */
-static inline pgd_t *pgd_offset(const struct mm_struct *mm, unsigned long addr)
-{
-	return mm->pgd + pgd_index(addr);
-}
-/* Locate an entry in the kernel page global directory */
-#define pgd_offset_k(addr)      pgd_offset(&init_mm, (addr))
-
 static inline struct page *pmd_page(pmd_t pmd)
 {
 	return pfn_to_page(pmd_val(pmd) >> _PAGE_PFN_SHIFT);
@@ -209,16 +199,6 @@ static inline pte_t pfn_pte(unsigned lon
 
 #define mk_pte(page, prot)       pfn_pte(page_to_pfn(page), prot)
 
-#define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
-static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long addr)
-{
-	return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(addr);
-}
-
-#define pte_offset_map(dir, addr)	pte_offset_kernel((dir), (addr))
-#define pte_unmap(pte)			((void)(pte))
-
 static inline int pte_present(pte_t pte)
 {
 	return (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROT_NONE));
--- a/arch/riscv/mm/init.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/riscv/mm/init.c
@@ -235,12 +235,12 @@ static void __init create_pte_mapping(pt
 				      uintptr_t va, phys_addr_t pa,
 				      phys_addr_t sz, pgprot_t prot)
 {
-	uintptr_t pte_index = pte_index(va);
+	uintptr_t pte_idx = pte_index(va);
 
 	BUG_ON(sz != PAGE_SIZE);
 
-	if (pte_none(ptep[pte_index]))
-		ptep[pte_index] = pfn_pte(PFN_DOWN(pa), prot);
+	if (pte_none(ptep[pte_idx]))
+		ptep[pte_idx] = pfn_pte(PFN_DOWN(pa), prot);
 }
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -283,21 +283,21 @@ static void __init create_pmd_mapping(pm
 {
 	pte_t *ptep;
 	phys_addr_t pte_phys;
-	uintptr_t pmd_index = pmd_index(va);
+	uintptr_t pmd_idx = pmd_index(va);
 
 	if (sz == PMD_SIZE) {
-		if (pmd_none(pmdp[pmd_index]))
-			pmdp[pmd_index] = pfn_pmd(PFN_DOWN(pa), prot);
+		if (pmd_none(pmdp[pmd_idx]))
+			pmdp[pmd_idx] = pfn_pmd(PFN_DOWN(pa), prot);
 		return;
 	}
 
-	if (pmd_none(pmdp[pmd_index])) {
+	if (pmd_none(pmdp[pmd_idx])) {
 		pte_phys = alloc_pte(va);
-		pmdp[pmd_index] = pfn_pmd(PFN_DOWN(pte_phys), PAGE_TABLE);
+		pmdp[pmd_idx] = pfn_pmd(PFN_DOWN(pte_phys), PAGE_TABLE);
 		ptep = get_pte_virt(pte_phys);
 		memset(ptep, 0, PAGE_SIZE);
 	} else {
-		pte_phys = PFN_PHYS(_pmd_pfn(pmdp[pmd_index]));
+		pte_phys = PFN_PHYS(_pmd_pfn(pmdp[pmd_idx]));
 		ptep = get_pte_virt(pte_phys);
 	}
 
@@ -325,21 +325,21 @@ static void __init create_pgd_mapping(pg
 {
 	pgd_next_t *nextp;
 	phys_addr_t next_phys;
-	uintptr_t pgd_index = pgd_index(va);
+	uintptr_t pgd_idx = pgd_index(va);
 
 	if (sz == PGDIR_SIZE) {
-		if (pgd_val(pgdp[pgd_index]) == 0)
-			pgdp[pgd_index] = pfn_pgd(PFN_DOWN(pa), prot);
+		if (pgd_val(pgdp[pgd_idx]) == 0)
+			pgdp[pgd_idx] = pfn_pgd(PFN_DOWN(pa), prot);
 		return;
 	}
 
-	if (pgd_val(pgdp[pgd_index]) == 0) {
+	if (pgd_val(pgdp[pgd_idx]) == 0) {
 		next_phys = alloc_pgd_next(va);
-		pgdp[pgd_index] = pfn_pgd(PFN_DOWN(next_phys), PAGE_TABLE);
+		pgdp[pgd_idx] = pfn_pgd(PFN_DOWN(next_phys), PAGE_TABLE);
 		nextp = get_pgd_next_virt(next_phys);
 		memset(nextp, 0, PAGE_SIZE);
 	} else {
-		next_phys = PFN_PHYS(_pgd_pfn(pgdp[pgd_index]));
+		next_phys = PFN_PHYS(_pgd_pfn(pgdp[pgd_idx]));
 		nextp = get_pgd_next_virt(next_phys);
 	}
 
--- a/arch/s390/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/s390/include/asm/pgtable.h
@@ -1229,7 +1229,6 @@ static inline pte_t mk_pte(struct page *
 #define p4d_index(address) (((address) >> P4D_SHIFT) & (PTRS_PER_P4D-1))
 #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
 #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
 
 #define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN)
 #define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN)
@@ -1260,7 +1259,6 @@ static inline pgd_t *pgd_offset_raw(pgd_
 }
 
 #define pgd_offset(mm, address) pgd_offset_raw(READ_ONCE((mm)->pgd), address)
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
 static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
 {
@@ -1275,6 +1273,7 @@ static inline pud_t *pud_offset(p4d_t *p
 		return (pud_t *) p4d_deref(*p4d) + pud_index(address);
 	return (pud_t *) p4d;
 }
+#define pud_offset pud_offset
 
 static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
 {
@@ -1282,17 +1281,13 @@ static inline pmd_t *pmd_offset(pud_t *p
 		return (pmd_t *) pud_deref(*pud) + pmd_index(address);
 	return (pmd_t *) pud;
 }
+#define pmd_offset pmd_offset
 
-static inline pte_t *pte_offset(pmd_t *pmd, unsigned long address)
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
 {
-	return (pte_t *) pmd_deref(*pmd) + pte_index(address);
+	return (unsigned long) pmd_deref(pmd);
 }
 
-#define pte_offset_kernel(pmd, address) pte_offset(pmd, address)
-#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
-
-static inline void pte_unmap(pte_t *pte) { }
-
 static inline bool gup_fast_permitted(unsigned long start, unsigned long end)
 {
 	return end <= current->mm->context.asce_limit;
--- a/arch/s390/mm/pageattr.c~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/s390/mm/pageattr.c
@@ -85,7 +85,7 @@ static int walk_pte_level(pmd_t *pmdp, u
 {
 	pte_t *ptep, new;
 
-	ptep = pte_offset(pmdp, addr);
+	ptep = pte_offset_kernel(pmdp, addr);
 	do {
 		new = *ptep;
 		if (pte_none(new))
--- a/arch/sh/include/asm/pgtable_32.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/sh/include/asm/pgtable_32.h
@@ -401,27 +401,12 @@ static inline pte_t pte_modify(pte_t pte
 	return pte;
 }
 
-#define pmd_page_vaddr(pmd)	((unsigned long)pmd_val(pmd))
-#define pmd_page(pmd)		(virt_to_page(pmd_val(pmd)))
-
-/* to find an entry in a page-table-directory. */
-#define pgd_index(address)	(((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define pgd_offset(mm, address)	((mm)->pgd + pgd_index(address))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address)	pgd_offset(&init_mm, address)
-
-#define pud_index(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-#define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-
-/* Find an entry in the third-level page table.. */
-#define pte_index(address)	((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define __pte_offset(address)	pte_index(address)
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	return (unsigned long)pmd_val(pmd);
+}
 
-#define pte_offset_kernel(dir, address) \
-	((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address)		pte_offset_kernel(dir, address)
-#define pte_unmap(pte)		do { } while (0)
+#define pmd_page(pmd)		(virt_to_page(pmd_val(pmd)))
 
 #ifdef CONFIG_X2TLB
 #define pte_ERROR(e) \
--- a/arch/sh/include/asm/pgtable-3level.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/sh/include/asm/pgtable-3level.h
@@ -39,13 +39,6 @@ static inline unsigned long pud_page_vad
 
 /* only used by the stubbed out hugetlb gup code, should never be called */
 #define pud_page(pud)		NULL
-
-#define pmd_index(address)	(((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);
-}
-
 #define pud_none(x)	(!pud_val(x))
 #define pud_present(x)	(pud_val(x))
 #define pud_clear(xp)	do { set_pud(xp, __pud(0)); } while (0)
--- a/arch/sparc/include/asm/pgalloc_64.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/sparc/include/asm/pgalloc_64.h
@@ -67,7 +67,7 @@ void pte_free(struct mm_struct *mm, pgta
 
 #define pmd_populate_kernel(MM, PMD, PTE)	pmd_set(MM, PMD, PTE)
 #define pmd_populate(MM, PMD, PTE)		pmd_set(MM, PMD, PTE)
-#define pmd_pgtable(PMD)			((pte_t *)__pmd_page(PMD))
+#define pmd_pgtable(PMD)			((pte_t *)pmd_page_vaddr(PMD))
 
 void pgtable_free(void *table, bool is_page);
 
--- a/arch/sparc/include/asm/pgtable_32.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/sparc/include/asm/pgtable_32.h
@@ -146,6 +146,12 @@ static inline unsigned long __pmd_page(p
 	return (unsigned long)__nocache_va(v << 4);
 }
 
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
+{
+	unsigned long v = pmd_val(pmd) & SRMMU_PTD_PMASK;
+	return (unsigned long)__nocache_va(v << 4);
+}
+
 static inline unsigned long pud_page_vaddr(pud_t pud)
 {
 	if (srmmu_device_memory(pud_val(pud))) {
@@ -315,30 +321,6 @@ static inline pte_t pte_modify(pte_t pte
 		pgprot_val(newprot));
 }
 
-#define pgd_index(address) ((address) >> PGDIR_SHIFT)
-
-/* to find an entry in a page-table-directory */
-#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/* Find an entry in the second-level page table.. */
-static inline pmd_t *pmd_offset(pud_t * dir, unsigned long address)
-{
-	return (pmd_t *) pud_page_vaddr(*dir) +
-		((address >> PMD_SHIFT) & (PTRS_PER_PMD - 1));
-}
-
-/* Find an entry in the third-level page table.. */
-pte_t *pte_offset_kernel(pmd_t * dir, unsigned long address);
-
-/*
- * This shortcut works on sun4m (and sun4d) because the nocache area is static.
- */
-#define pte_offset_map(d, a)		pte_offset_kernel(d,a)
-#define pte_unmap(pte)		do{}while(0)
-
 struct seq_file;
 void mmu_info(struct seq_file *m);
 
@@ -427,7 +409,7 @@ static inline int io_remap_pfn_range(str
 
 	return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
 }
-#define io_remap_pfn_range io_remap_pfn_range 
+#define io_remap_pfn_range io_remap_pfn_range
 
 #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
--- a/arch/sparc/include/asm/pgtable_64.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/sparc/include/asm/pgtable_64.h
@@ -835,7 +835,7 @@ static inline void pmd_set(struct mm_str
 
 #define pud_set(pudp, pmdp)	\
 	(pud_val(*(pudp)) = (__pa((unsigned long) (pmdp))))
-static inline unsigned long __pmd_page(pmd_t pmd)
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
 {
 	pte_t pte = __pte(pmd_val(pmd));
 	unsigned long pfn;
@@ -855,7 +855,7 @@ static inline unsigned long pud_page_vad
 	return ((unsigned long) __va(pfn << PAGE_SHIFT));
 }
 
-#define pmd_page(pmd) 			virt_to_page((void *)__pmd_page(pmd))
+#define pmd_page(pmd) 			virt_to_page((void *)pmd_page_vaddr(pmd))
 #define pud_page(pud) 			virt_to_page((void *)pud_page_vaddr(pud))
 #define pmd_clear(pmdp)			(pmd_val(*(pmdp)) = 0UL)
 #define pud_present(pud)		(pud_val(pud) != 0U)
@@ -889,31 +889,6 @@ static inline unsigned long pud_pfn(pud_
 #define p4d_set(p4dp, pudp)	\
 	(p4d_val(*(p4dp)) = (__pa((unsigned long) (pudp))))
 
-/* to find an entry in a page-table-directory. */
-#define pgd_index(address)	(((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
-#define pgd_offset(mm, address)	((mm)->pgd + pgd_index(address))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/* Find an entry in the third-level page table.. */
-#define pud_index(address)	(((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
-#define pud_offset(p4dp, address)	\
-	((pud_t *) p4d_page_vaddr(*(p4dp)) + pud_index(address))
-
-/* Find an entry in the second-level page table.. */
-#define pmd_offset(pudp, address)	\
-	((pmd_t *) pud_page_vaddr(*(pudp)) + \
-	 (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)))
-
-/* Find an entry in the third-level page table.. */
-#define pte_index(address)			\
-	 ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address)	\
-	((pte_t *) __pmd_page(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address)	pte_offset_kernel((dir), (address))
-#define pte_unmap(pte)			do { } while (0)
-
 /* We cannot include <linux/mm_types.h> at this point yet: */
 extern struct mm_struct init_mm;
 
@@ -1078,7 +1053,7 @@ static inline int io_remap_pfn_range(str
 
 	return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
 }
-#define io_remap_pfn_range io_remap_pfn_range 
+#define io_remap_pfn_range io_remap_pfn_range
 
 static inline unsigned long __untagged_addr(unsigned long start)
 {
--- a/arch/um/include/asm/pgtable-3level.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/um/include/asm/pgtable-3level.h
@@ -89,10 +89,6 @@ static inline void pud_clear (pud_t *pud
 #define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK)
 #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PAGE_MASK))
 
-/* Find an entry in the second-level page table.. */
-#define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \
-			pmd_index(address))
-
 static inline unsigned long pte_pfn(pte_t pte)
 {
 	return phys_to_pfn(pte_val(pte));
--- a/arch/um/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/um/include/asm/pgtable.h
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/* 
+/*
  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Copyright 2003 PathScale, Inc.
  * Derived from include/asm-i386/pgtable.h
@@ -131,7 +131,7 @@ static inline int pte_none(pte_t pte)
  * Undefined behaviour if not..
  */
 static inline int pte_read(pte_t pte)
-{ 
+{
 	return((pte_get_bits(pte, _PAGE_USER)) &&
 	       !(pte_get_bits(pte, _PAGE_PROTNONE)));
 }
@@ -163,7 +163,7 @@ static inline int pte_newpage(pte_t pte)
 }
 
 static inline int pte_newprot(pte_t pte)
-{ 
+{
 	return(pte_present(pte) && (pte_get_bits(pte, _PAGE_NEWPROT)));
 }
 
@@ -185,31 +185,31 @@ static inline pte_t pte_mkclean(pte_t pt
 	return(pte);
 }
 
-static inline pte_t pte_mkold(pte_t pte)	
-{ 
+static inline pte_t pte_mkold(pte_t pte)
+{
 	pte_clear_bits(pte, _PAGE_ACCESSED);
 	return(pte);
 }
 
 static inline pte_t pte_wrprotect(pte_t pte)
-{ 
+{
 	if (likely(pte_get_bits(pte, _PAGE_RW)))
 		pte_clear_bits(pte, _PAGE_RW);
 	else
 		return pte;
-	return(pte_mknewprot(pte)); 
+	return(pte_mknewprot(pte));
 }
 
 static inline pte_t pte_mkread(pte_t pte)
-{ 
+{
 	if (unlikely(pte_get_bits(pte, _PAGE_USER)))
 		return pte;
 	pte_set_bits(pte, _PAGE_USER);
-	return(pte_mknewprot(pte)); 
+	return(pte_mknewprot(pte));
 }
 
 static inline pte_t pte_mkdirty(pte_t pte)
-{ 
+{
 	pte_set_bits(pte, _PAGE_DIRTY);
 	return(pte);
 }
@@ -220,20 +220,20 @@ static inline pte_t pte_mkyoung(pte_t pt
 	return(pte);
 }
 
-static inline pte_t pte_mkwrite(pte_t pte)	
+static inline pte_t pte_mkwrite(pte_t pte)
 {
 	if (unlikely(pte_get_bits(pte,  _PAGE_RW)))
 		return pte;
 	pte_set_bits(pte, _PAGE_RW);
-	return(pte_mknewprot(pte)); 
+	return(pte_mknewprot(pte));
 }
 
-static inline pte_t pte_mkuptodate(pte_t pte)	
+static inline pte_t pte_mkuptodate(pte_t pte)
 {
 	pte_clear_bits(pte, _PAGE_NEWPAGE);
 	if(pte_present(pte))
 		pte_clear_bits(pte, _PAGE_NEWPROT);
-	return(pte); 
+	return(pte);
 }
 
 static inline pte_t pte_mknewpage(pte_t pte)
@@ -288,53 +288,16 @@ static inline int pte_same(pte_t pte_a,
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
 	pte_set_val(pte, (pte_val(pte) & _PAGE_CHG_MASK), newprot);
-	return pte; 
+	return pte;
 }
 
 /*
- * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
- *
- * this macro returns the index of the entry in the pgd page which would
- * control the given virtual address
- */
-#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-
-/*
- * pgd_offset() returns a (pgd_t *)
- * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
- */
-#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
-
-/*
- * a shortcut which implies the use of the kernel's pgd, instead
- * of a process's
- */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/*
  * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
  *
  * this macro returns the index of the entry in the pmd page which would
  * control the given virtual address
  */
 #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-
-#define pmd_page_vaddr(pmd) \
-	((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-
-/*
- * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
- *
- * this macro returns the index of the entry in the pte page which would
- * control the given virtual address
- */
-#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address) \
-	((pte_t *) pmd_page_vaddr(*(dir)) +  pte_index(address))
-#define pte_offset_map(dir, address) \
-	((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_unmap(pte) do { } while (0)
 
 struct mm_struct;
 extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
--- a/arch/unicore32/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/unicore32/include/asm/pgtable.h
@@ -153,12 +153,6 @@ extern struct page *empty_zero_page;
 #define pte_none(pte)			(!pte_val(pte))
 #define pte_clear(mm, addr, ptep)	set_pte(ptep, __pte(0))
 #define pte_page(pte)			(pfn_to_page(pte_pfn(pte)))
-#define pte_offset_kernel(dir, addr)	(pmd_page_vaddr(*(dir)) \
-						+ __pte_index(addr))
-
-#define pte_offset_map(dir, addr)	(pmd_page_vaddr(*(dir)) \
-						+ __pte_index(addr))
-#define pte_unmap(pte)			do { } while (0)
 
 #define set_pte(ptep, pte)	cpu_set_pte(ptep, pte)
 
@@ -221,17 +215,6 @@ PTE_BIT_FUNC(mkyoung,   |= PTE_YOUNG);
  */
 #define mk_pte(page, prot)	pfn_pte(page_to_pfn(page), prot)
 
-/* to find an entry in a page-table-directory */
-#define pgd_index(addr)		((addr) >> PGDIR_SHIFT)
-
-#define pgd_offset(mm, addr)	((mm)->pgd+pgd_index(addr))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
-
-/* Find an entry in the third-level page table.. */
-#define __pte_index(addr)	(((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
 	const unsigned long mask = PTE_EXEC | PTE_WRITE | PTE_READ;
--- a/arch/x86/include/asm/pgtable_32.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/x86/include/asm/pgtable_32.h
@@ -45,17 +45,6 @@ void sync_initial_page_table(void);
 # include <asm/pgtable-2level.h>
 #endif
 
-#if defined(CONFIG_HIGHPTE)
-#define pte_offset_map(dir, address)					\
-	((pte_t *)kmap_atomic(pmd_page(*(dir))) +		\
-	 pte_index((address)))
-#define pte_unmap(pte) kunmap_atomic((pte))
-#else
-#define pte_offset_map(dir, address)					\
-	((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))
-#define pte_unmap(pte) do { } while (0)
-#endif
-
 /* Clear a kernel PTE and flush it from the TLB */
 #define kpte_clear_flush(ptep, vaddr)		\
 do {						\
--- a/arch/x86/include/asm/pgtable_64.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/x86/include/asm/pgtable_64.h
@@ -186,10 +186,6 @@ extern void sync_global_pgds(unsigned lo
 
 /* PTE - Level 1 access. */
 
-/* x86-64 always has all page tables mapped. */
-#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) ((void)(pte))/* NOP */
-
 /*
  * Encode and de-code a swap entry
  *
--- a/arch/x86/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/x86/include/asm/pgtable.h
@@ -837,17 +837,6 @@ static inline unsigned long pmd_page_vad
 #define pmd_page(pmd)	pfn_to_page(pmd_pfn(pmd))
 
 /*
- * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
- *
- * this macro returns the index of the entry in the pmd page which would
- * control the given virtual address
- */
-static inline unsigned long pmd_index(unsigned long address)
-{
-	return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
-}
-
-/*
  * Conversion functions: convert a page and protection to a page entry,
  * and a page entry and page directory to the page they refer to.
  *
@@ -856,25 +845,6 @@ static inline unsigned long pmd_index(un
  */
 #define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
 
-/*
- * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
- *
- * this function returns the index of the entry in the pte page which would
- * control the given virtual address
- *
- * Also define macro so we can test if pte_index is defined for arch.
- */
-#define pte_index pte_index
-static inline unsigned long pte_index(unsigned long address)
-{
-	return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
-}
-
-static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address)
-{
-	return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(address);
-}
-
 static inline int pmd_bad(pmd_t pmd)
 {
 	return (pmd_flags(pmd) & ~_PAGE_USER) != _KERNPG_TABLE;
@@ -907,12 +877,6 @@ static inline unsigned long pud_page_vad
  */
 #define pud_page(pud)	pfn_to_page(pud_pfn(pud))
 
-/* Find an entry in the second-level page table.. */
-static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
-{
-	return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
-}
-
 #define pud_leaf	pud_large
 static inline int pud_large(pud_t pud)
 {
@@ -932,11 +896,6 @@ static inline int pud_large(pud_t pud)
 }
 #endif	/* CONFIG_PGTABLE_LEVELS > 2 */
 
-static inline unsigned long pud_index(unsigned long address)
-{
-	return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
-}
-
 #if CONFIG_PGTABLE_LEVELS > 3
 static inline int p4d_none(p4d_t p4d)
 {
@@ -959,12 +918,6 @@ static inline unsigned long p4d_page_vad
  */
 #define p4d_page(p4d)	pfn_to_page(p4d_pfn(p4d))
 
-/* Find an entry in the third-level page table.. */
-static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
-{
-	return (pud_t *)p4d_page_vaddr(*p4d) + pud_index(address);
-}
-
 static inline int p4d_bad(p4d_t p4d)
 {
 	unsigned long ignore_flags = _KERNPG_TABLE | _PAGE_USER;
@@ -1037,30 +990,6 @@ static inline int pgd_none(pgd_t pgd)
 
 #endif	/* __ASSEMBLY__ */
 
-/*
- * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
- *
- * this macro returns the index of the entry in the pgd page which would
- * control the given virtual address
- */
-#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
-
-/*
- * pgd_offset() returns a (pgd_t *)
- * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
- */
-#define pgd_offset_pgd(pgd, address) (pgd + pgd_index((address)))
-/*
- * a shortcut to get a pgd_t in a given mm
- */
-#define pgd_offset(mm, address) pgd_offset_pgd((mm)->pgd, (address))
-/*
- * a shortcut which implies the use of the kernel's pgd, instead
- * of a process's
- */
-#define pgd_offset_k(address) pgd_offset(&init_mm, (address))
-
-
 #define KERNEL_PGD_BOUNDARY	pgd_index(PAGE_OFFSET)
 #define KERNEL_PGD_PTRS		(PTRS_PER_PGD - KERNEL_PGD_BOUNDARY)
 
--- a/arch/xtensa/include/asm/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/arch/xtensa/include/asm/pgtable.h
@@ -267,7 +267,7 @@ static inline int pte_write(pte_t pte) {
 static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
 static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
 
-static inline pte_t pte_wrprotect(pte_t pte)	
+static inline pte_t pte_wrprotect(pte_t pte)
 	{ pte_val(pte) &= ~(_PAGE_WRITABLE | _PAGE_HW_WRITE); return pte; }
 static inline pte_t pte_mkclean(pte_t pte)
 	{ pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HW_WRITE); return pte; }
@@ -359,22 +359,6 @@ ptep_set_wrprotect(struct mm_struct *mm,
 	update_pte(ptep, pte_wrprotect(pte));
 }
 
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address)	pgd_offset(&init_mm, address)
-
-/* to find an entry in a page-table-directory */
-#define pgd_offset(mm,address)	((mm)->pgd + pgd_index(address))
-
-#define pgd_index(address)	((address) >> PGDIR_SHIFT)
-
-/* Find an entry in the third-level page table.. */
-#define pte_index(address)	(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir,addr) 					\
-	((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir,addr)	pte_offset_kernel((dir),(addr))
-#define pte_unmap(pte)		do { } while (0)
-
-
 /*
  * Encode and decode a swap and file entry.
  */
--- a/include/asm-generic/pgtable-nopmd.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/include/asm-generic/pgtable-nopmd.h
@@ -45,6 +45,7 @@ static inline pmd_t * pmd_offset(pud_t *
 {
 	return (pmd_t *)pud;
 }
+#define pmd_offset pmd_offset
 
 #define pmd_val(x)				(pud_val((x).pud))
 #define __pmd(x)				((pmd_t) { __pud(x) } )
--- a/include/asm-generic/pgtable-nopud.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/include/asm-generic/pgtable-nopud.h
@@ -43,6 +43,7 @@ static inline pud_t *pud_offset(p4d_t *p
 {
 	return (pud_t *)p4d;
 }
+#define pud_offset pud_offset
 
 #define pud_val(x)				(p4d_val((x).p4d))
 #define __pud(x)				((pud_t) { __p4d(x) })
--- a/include/linux/pgtable.h~mm-consolidate-pte_index-and-pte_offset_-definitions
+++ a/include/linux/pgtable.h
@@ -29,6 +29,97 @@
 #endif
 
 /*
+ * A page table page can be thought of an array like this: pXd_t[PTRS_PER_PxD]
+ *
+ * The pXx_index() functions return the index of the entry in the page
+ * table page which would control the given virtual address
+ *
+ * As these functions may be used by the same code for different levels of
+ * the page table folding, they are always available, regardless of
+ * CONFIG_PGTABLE_LEVELS value. For the folded levels they simply return 0
+ * because in such cases PTRS_PER_PxD equals 1.
+ */
+
+static inline unsigned long pte_index(unsigned long address)
+{
+	return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
+}
+
+#ifndef pmd_index
+static inline unsigned long pmd_index(unsigned long address)
+{
+	return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
+}
+#define pmd_index pmd_index
+#endif
+
+#ifndef pud_index
+static inline unsigned long pud_index(unsigned long address)
+{
+	return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
+}
+#define pud_index pud_index
+#endif
+
+#ifndef pgd_index
+/* Must be a compile-time constant, so implement it as a macro */
+#define pgd_index(a)  (((a) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
+#endif
+
+#ifndef pte_offset_kernel
+static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address)
+{
+	return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(address);
+}
+#define pte_offset_kernel pte_offset_kernel
+#endif
+
+#if defined(CONFIG_HIGHPTE)
+#define pte_offset_map(dir, address)				\
+	((pte_t *)kmap_atomic(pmd_page(*(dir))) +		\
+	 pte_index((address)))
+#define pte_unmap(pte) kunmap_atomic((pte))
+#else
+#define pte_offset_map(dir, address)	pte_offset_kernel((dir), (address))
+#define pte_unmap(pte) ((void)(pte))	/* NOP */
+#endif
+
+/* Find an entry in the second-level page table.. */
+#ifndef pmd_offset
+static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
+{
+	return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
+}
+#define pmd_offset pmd_offset
+#endif
+
+#ifndef pud_offset
+static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
+{
+	return (pud_t *)p4d_page_vaddr(*p4d) + pud_index(address);
+}
+#define pud_offset pud_offset
+#endif
+
+static inline pgd_t *pgd_offset_pgd(pgd_t *pgd, unsigned long address)
+{
+	return (pgd + pgd_index(address));
+};
+
+/*
+ * a shortcut to get a pgd_t in a given mm
+ */
+#ifndef pgd_offset
+#define pgd_offset(mm, address)		pgd_offset_pgd((mm)->pgd, (address))
+#endif
+
+/*
+ * a shortcut which implies the use of the kernel's pgd, instead
+ * of a process's
+ */
+#define pgd_offset_k(address)		pgd_offset(&init_mm, (address))
+
+/*
  * In many cases it is known that a virtual address is mapped at PMD or PTE
  * level, so instead of traversing all the page table levels, we can get a
  * pointer to the PMD entry in user or kernel page table or translate a virtual
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 60/93] mmap locking API: initial implementation as rwsem wrappers
  2020-06-09  4:29 incoming Andrew Morton
                   ` (58 preceding siblings ...)
  2020-06-09  4:33 ` [patch 59/93] mm: consolidate pte_index() and pte_offset_*() definitions Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 61/93] MMU notifier: use the new mmap locking API Andrew Morton
                   ` (35 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: initial implementation as rwsem wrappers

This patch series adds a new mmap locking API replacing the existing
mmap_sem lock and unlocks.  Initially the API is just implemente in terms
of inlined rwsem calls, so it doesn't provide any new functionality.

There are two justifications for the new API:

- At first, it provides an easy hooking point to instrument mmap_sem
  locking latencies independently of any other rwsems.

- In the future, it may be a starting point for replacing the rwsem
  implementation with a different one, such as range locks.  This is
  something that is being explored, even though there is no wide concensus
  about this possible direction yet.  (see
  https://patchwork.kernel.org/cover/11401483/)


This patch (of 12):

This change wraps the existing mmap_sem related rwsem calls into a new
mmap locking API.  There are two justifications for the new API:

- At first, it provides an easy hooking point to instrument mmap_sem
  locking latencies independently of any other rwsems.

- In the future, it may be a starting point for replacing the rwsem
  implementation with a different one, such as range locks.

Link: http://lkml.kernel.org/r/20200520052908.204642-1-walken@google.com
Link: http://lkml.kernel.org/r/20200520052908.204642-2-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ying Han <yinghan@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/mm.h        |    1 
 include/linux/mmap_lock.h |   54 ++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)

--- /dev/null
+++ a/include/linux/mmap_lock.h
@@ -0,0 +1,54 @@
+#ifndef _LINUX_MMAP_LOCK_H
+#define _LINUX_MMAP_LOCK_H
+
+static inline void mmap_init_lock(struct mm_struct *mm)
+{
+	init_rwsem(&mm->mmap_sem);
+}
+
+static inline void mmap_write_lock(struct mm_struct *mm)
+{
+	down_write(&mm->mmap_sem);
+}
+
+static inline int mmap_write_lock_killable(struct mm_struct *mm)
+{
+	return down_write_killable(&mm->mmap_sem);
+}
+
+static inline bool mmap_write_trylock(struct mm_struct *mm)
+{
+	return down_write_trylock(&mm->mmap_sem) != 0;
+}
+
+static inline void mmap_write_unlock(struct mm_struct *mm)
+{
+	up_write(&mm->mmap_sem);
+}
+
+static inline void mmap_write_downgrade(struct mm_struct *mm)
+{
+	downgrade_write(&mm->mmap_sem);
+}
+
+static inline void mmap_read_lock(struct mm_struct *mm)
+{
+	down_read(&mm->mmap_sem);
+}
+
+static inline int mmap_read_lock_killable(struct mm_struct *mm)
+{
+	return down_read_killable(&mm->mmap_sem);
+}
+
+static inline bool mmap_read_trylock(struct mm_struct *mm)
+{
+	return down_read_trylock(&mm->mmap_sem) != 0;
+}
+
+static inline void mmap_read_unlock(struct mm_struct *mm)
+{
+	up_read(&mm->mmap_sem);
+}
+
+#endif /* _LINUX_MMAP_LOCK_H */
--- a/include/linux/mm.h~mmap-locking-api-initial-implementation-as-rwsem-wrappers
+++ a/include/linux/mm.h
@@ -15,6 +15,7 @@
 #include <linux/atomic.h>
 #include <linux/debug_locks.h>
 #include <linux/mm_types.h>
+#include <linux/mmap_lock.h>
 #include <linux/range.h>
 #include <linux/pfn.h>
 #include <linux/percpu-refcount.h>
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 61/93] MMU notifier: use the new mmap locking API
  2020-06-09  4:29 incoming Andrew Morton
                   ` (59 preceding siblings ...)
  2020-06-09  4:33 ` [patch 60/93] mmap locking API: initial implementation as rwsem wrappers Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 62/93] DMA reservations: " Andrew Morton
                   ` (34 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: MMU notifier: use the new mmap locking API

This use is converted manually ahead of the next patch in the series, as
it requires including a new header which the automated conversion would
miss.

Link: http://lkml.kernel.org/r/20200520052908.204642-3-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/mmu_notifier.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/include/linux/mmu_notifier.h~mmu-notifier-use-the-new-mmap-locking-api
+++ a/include/linux/mmu_notifier.h
@@ -5,6 +5,7 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/mm_types.h>
+#include <linux/mmap_lock.h>
 #include <linux/srcu.h>
 #include <linux/interval_tree.h>
 
@@ -277,9 +278,9 @@ mmu_notifier_get(const struct mmu_notifi
 {
 	struct mmu_notifier *ret;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	ret = mmu_notifier_get_locked(ops, mm);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 void mmu_notifier_put(struct mmu_notifier *subscription);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 62/93] DMA reservations: use the new mmap locking API
  2020-06-09  4:29 incoming Andrew Morton
                   ` (60 preceding siblings ...)
  2020-06-09  4:33 ` [patch 61/93] MMU notifier: use the new mmap locking API Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 63/93] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites Andrew Morton
                   ` (33 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: DMA reservations: use the new mmap locking API

This use is converted manually ahead of the next patch in the series, as
it requires including a new header which the automated conversion would
miss.

Link: http://lkml.kernel.org/r/20200520052908.204642-4-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/dma-buf/dma-resv.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/dma-buf/dma-resv.c~dma-reservations-use-the-new-mmap-locking-api
+++ a/drivers/dma-buf/dma-resv.c
@@ -34,6 +34,7 @@
 
 #include <linux/dma-resv.h>
 #include <linux/export.h>
+#include <linux/mm.h>
 #include <linux/sched/mm.h>
 
 /**
@@ -109,7 +110,7 @@ static int __init dma_resv_lockdep(void)
 
 	dma_resv_init(&obj);
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	ww_acquire_init(&ctx, &reservation_ww_class);
 	ret = dma_resv_lock(&obj, &ctx);
 	if (ret == -EDEADLK)
@@ -118,7 +119,7 @@ static int __init dma_resv_lockdep(void)
 	fs_reclaim_release(GFP_KERNEL);
 	ww_mutex_unlock(&obj.lock);
 	ww_acquire_fini(&ctx);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	
 	mmput(mm);
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 63/93] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
  2020-06-09  4:29 incoming Andrew Morton
                   ` (61 preceding siblings ...)
  2020-06-09  4:33 ` [patch 62/93] DMA reservations: " Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 64/93] mmap locking API: convert mmap_sem call sites missed by coccinelle Andrew Morton
                   ` (32 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: use coccinelle to convert mmap_sem rwsem call sites

This change converts the existing mmap_sem rwsem calls to use the new mmap
locking API instead.

The change is generated using coccinelle with the following rule:

// spatch --sp-file mmap_lock_api.cocci --in-place --include-headers --dir .

@@
expression mm;
@@
(
-init_rwsem
+mmap_init_lock
|
-down_write
+mmap_write_lock
|
-down_write_killable
+mmap_write_lock_killable
|
-down_write_trylock
+mmap_write_trylock
|
-up_write
+mmap_write_unlock
|
-downgrade_write
+mmap_write_downgrade
|
-down_read
+mmap_read_lock
|
-down_read_killable
+mmap_read_lock_killable
|
-down_read_trylock
+mmap_read_trylock
|
-up_read
+mmap_read_unlock
)
-(&mm->mmap_sem)
+(mm)

Link: http://lkml.kernel.org/r/20200520052908.204642-5-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/kernel/traps.c                        |    4 -
 arch/alpha/mm/fault.c                            |   10 +-
 arch/arc/kernel/process.c                        |    4 -
 arch/arc/kernel/troubleshoot.c                   |    4 -
 arch/arc/mm/fault.c                              |    4 -
 arch/arm/kernel/process.c                        |    4 -
 arch/arm/kernel/swp_emulate.c                    |    4 -
 arch/arm/lib/uaccess_with_memcpy.c               |   16 ++--
 arch/arm/mm/fault.c                              |    6 -
 arch/arm64/kernel/traps.c                        |    4 -
 arch/arm64/kernel/vdso.c                         |    8 +-
 arch/arm64/mm/fault.c                            |    8 +-
 arch/csky/kernel/vdso.c                          |    4 -
 arch/csky/mm/fault.c                             |    8 +-
 arch/hexagon/kernel/vdso.c                       |    4 -
 arch/hexagon/mm/vm_fault.c                       |    8 +-
 arch/ia64/kernel/perfmon.c                       |    8 +-
 arch/ia64/mm/fault.c                             |    8 +-
 arch/ia64/mm/init.c                              |   12 +--
 arch/m68k/kernel/sys_m68k.c                      |   14 ++--
 arch/m68k/mm/fault.c                             |    8 +-
 arch/microblaze/mm/fault.c                       |   12 +--
 arch/mips/kernel/traps.c                         |    4 -
 arch/mips/kernel/vdso.c                          |    4 -
 arch/nds32/kernel/vdso.c                         |    6 -
 arch/nds32/mm/fault.c                            |   12 +--
 arch/nios2/mm/fault.c                            |   12 +--
 arch/nios2/mm/init.c                             |    4 -
 arch/openrisc/mm/fault.c                         |   10 +-
 arch/parisc/kernel/traps.c                       |    6 -
 arch/parisc/mm/fault.c                           |    8 +-
 arch/powerpc/kernel/vdso.c                       |    6 -
 arch/powerpc/kvm/book3s_hv.c                     |    6 -
 arch/powerpc/kvm/book3s_hv_uvmem.c               |   12 +--
 arch/powerpc/kvm/e500_mmu_host.c                 |    4 -
 arch/powerpc/mm/book3s64/iommu_api.c             |    4 -
 arch/powerpc/mm/book3s64/subpage_prot.c          |   12 +--
 arch/powerpc/mm/copro_fault.c                    |    4 -
 arch/powerpc/mm/fault.c                          |   12 +--
 arch/powerpc/oprofile/cell/spu_task_sync.c       |    6 -
 arch/powerpc/platforms/cell/spufs/file.c         |    4 -
 arch/riscv/kernel/vdso.c                         |    4 -
 arch/riscv/mm/fault.c                            |   10 +-
 arch/s390/kernel/uv.c                            |    4 -
 arch/s390/kernel/vdso.c                          |    4 -
 arch/s390/kvm/gaccess.c                          |    4 -
 arch/s390/kvm/interrupt.c                        |    4 -
 arch/s390/kvm/kvm-s390.c                         |   28 ++++----
 arch/s390/kvm/priv.c                             |   32 ++++-----
 arch/s390/mm/fault.c                             |   14 ++--
 arch/s390/mm/gmap.c                              |   44 ++++++-------
 arch/s390/pci/pci_mmio.c                         |    4 -
 arch/sh/kernel/sys_sh.c                          |    6 -
 arch/sh/kernel/vsyscall/vsyscall.c               |    4 -
 arch/sh/mm/fault.c                               |   10 +-
 arch/sparc/mm/fault_32.c                         |   18 ++---
 arch/sparc/mm/fault_64.c                         |   12 +--
 arch/sparc/vdso/vma.c                            |    4 -
 arch/um/include/asm/mmu_context.h                |    2 
 arch/um/kernel/tlb.c                             |    2 
 arch/um/kernel/trap.c                            |    6 -
 arch/unicore32/mm/fault.c                        |    6 -
 arch/x86/entry/vdso/vma.c                        |   14 ++--
 arch/x86/kernel/vm86_32.c                        |    4 -
 arch/x86/mm/fault.c                              |    8 +-
 arch/x86/um/vdso/vma.c                           |    4 -
 arch/xtensa/mm/fault.c                           |   10 +-
 drivers/android/binder_alloc.c                   |   10 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c |    4 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c          |   10 +-
 drivers/gpu/drm/amd/amdkfd/kfd_events.c          |    4 -
 drivers/gpu/drm/i915/gem/i915_gem_mman.c         |    4 -
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c      |    8 +-
 drivers/gpu/drm/nouveau/nouveau_svm.c            |   22 +++---
 drivers/gpu/drm/radeon/radeon_cs.c               |    4 -
 drivers/gpu/drm/radeon/radeon_gem.c              |    6 -
 drivers/gpu/drm/ttm/ttm_bo_vm.c                  |    4 -
 drivers/infiniband/core/umem_odp.c               |    4 -
 drivers/infiniband/core/uverbs_main.c            |    4 -
 drivers/infiniband/hw/mlx4/mr.c                  |    4 -
 drivers/infiniband/hw/qib/qib_user_pages.c       |    6 -
 drivers/infiniband/hw/usnic/usnic_uiom.c         |    4 -
 drivers/infiniband/sw/siw/siw_mem.c              |    4 -
 drivers/iommu/amd_iommu_v2.c                     |    4 -
 drivers/iommu/intel-svm.c                        |    4 -
 drivers/media/v4l2-core/videobuf-core.c          |    4 -
 drivers/media/v4l2-core/videobuf-dma-contig.c    |    4 -
 drivers/media/v4l2-core/videobuf-dma-sg.c        |    4 -
 drivers/misc/cxl/cxllib.c                        |    4 -
 drivers/misc/cxl/fault.c                         |    4 -
 drivers/misc/sgi-gru/grufault.c                  |   16 ++--
 drivers/misc/sgi-gru/grufile.c                   |    4 -
 drivers/oprofile/buffer_sync.c                   |   10 +-
 drivers/staging/kpc2000/kpc_dma/fileops.c        |    4 -
 drivers/tee/optee/call.c                         |    4 -
 drivers/vfio/vfio_iommu_type1.c                  |    8 +-
 drivers/vhost/vdpa.c                             |    4 -
 drivers/xen/gntdev.c                             |    4 -
 drivers/xen/privcmd.c                            |   14 ++--
 fs/aio.c                                         |    4 -
 fs/coredump.c                                    |    4 -
 fs/exec.c                                        |   16 ++--
 fs/io_uring.c                                    |    4 -
 fs/proc/base.c                                   |   12 +--
 fs/proc/task_mmu.c                               |   28 ++++----
 fs/proc/task_nommu.c                             |   18 ++---
 fs/userfaultfd.c                                 |   20 ++---
 ipc/shm.c                                        |    8 +-
 kernel/acct.c                                    |    4 -
 kernel/bpf/stackmap.c                            |    4 -
 kernel/events/core.c                             |    4 -
 kernel/events/uprobes.c                          |   16 ++--
 kernel/exit.c                                    |    8 +-
 kernel/fork.c                                    |   12 +--
 kernel/futex.c                                   |    4 -
 kernel/sched/fair.c                              |    4 -
 kernel/sys.c                                     |   18 ++---
 kernel/trace/trace_output.c                      |    4 -
 lib/test_lockup.c                                |    8 +-
 mm/filemap.c                                     |    6 -
 mm/frame_vector.c                                |    4 -
 mm/gup.c                                         |   18 ++---
 mm/internal.h                                    |    2 
 mm/khugepaged.c                                  |   36 +++++-----
 mm/ksm.c                                         |   34 +++++-----
 mm/madvise.c                                     |   20 ++---
 mm/memcontrol.c                                  |    8 +-
 mm/memory.c                                      |   12 +--
 mm/mempolicy.c                                   |   22 +++---
 mm/migrate.c                                     |    8 +-
 mm/mincore.c                                     |    4 -
 mm/mlock.c                                       |   16 ++--
 mm/mmap.c                                        |   32 ++++-----
 mm/mmu_notifier.c                                |    4 -
 mm/mprotect.c                                    |   12 +--
 mm/mremap.c                                      |    6 -
 mm/msync.c                                       |    8 +-
 mm/nommu.c                                       |   16 ++--
 mm/oom_kill.c                                    |    4 -
 mm/process_vm_access.c                           |    4 -
 mm/ptdump.c                                      |    4 -
 mm/swapfile.c                                    |    4 -
 mm/userfaultfd.c                                 |   18 ++---
 mm/util.c                                        |    8 +-
 net/ipv4/tcp.c                                   |    6 -
 net/xdp/xdp_umem.c                               |    4 -
 virt/kvm/async_pf.c                              |    4 -
 virt/kvm/kvm_main.c                              |    8 +-
 148 files changed, 645 insertions(+), 645 deletions(-)

--- a/arch/alpha/kernel/traps.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/alpha/kernel/traps.c
@@ -957,12 +957,12 @@ give_sigsegv:
 		si_code = SEGV_ACCERR;
 	else {
 		struct mm_struct *mm = current->mm;
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		if (find_vma(mm, (unsigned long)va))
 			si_code = SEGV_ACCERR;
 		else
 			si_code = SEGV_MAPERR;
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	}
 	send_sig_fault(SIGSEGV, si_code, va, 0, current);
 	return;
--- a/arch/alpha/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/alpha/mm/fault.c
@@ -117,7 +117,7 @@ do_page_fault(unsigned long address, uns
 	if (user_mode(regs))
 		flags |= FAULT_FLAG_USER;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto bad_area;
@@ -180,14 +180,14 @@ retry:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return;
 
 	/* Something tried to access memory that isn't in our memory map.
 	   Fix it, but check if it's kernel or user first.  */
  bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	if (user_mode(regs))
 		goto do_sigsegv;
@@ -211,14 +211,14 @@ retry:
 	/* We ran out of memory, or some other thing happened to us that
 	   made us unable to handle the page fault gracefully.  */
  out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
 	return;
 
  do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	/* Send a sigbus, regardless of whether we were in kernel
 	   or user mode.  */
 	force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address, 0);
--- a/arch/arc/kernel/process.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arc/kernel/process.c
@@ -90,10 +90,10 @@ fault:
 	if (unlikely(ret != -EFAULT))
 		 goto fail;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	ret = fixup_user_fault(current, current->mm, (unsigned long) uaddr,
 			       FAULT_FLAG_WRITE, NULL);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	if (likely(!ret))
 		 goto again;
--- a/arch/arc/kernel/troubleshoot.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arc/kernel/troubleshoot.c
@@ -89,7 +89,7 @@ static void show_faulting_vma(unsigned l
 	/* can't use print_vma_addr() yet as it doesn't check for
 	 * non-inclusive vma
 	 */
-	down_read(&active_mm->mmap_sem);
+	mmap_read_lock(active_mm);
 	vma = find_vma(active_mm, address);
 
 	/* check against the find_vma( ) behaviour which returns the next VMA
@@ -111,7 +111,7 @@ static void show_faulting_vma(unsigned l
 	} else
 		pr_info("    @No matching VMA found\n");
 
-	up_read(&active_mm->mmap_sem);
+	mmap_read_unlock(active_mm);
 }
 
 static void show_ecr_verbose(struct pt_regs *regs)
--- a/arch/arc/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arc/mm/fault.c
@@ -107,7 +107,7 @@ void do_page_fault(unsigned long address
 		flags |= FAULT_FLAG_WRITE;
 
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	vma = find_vma(mm, address);
 	if (!vma)
@@ -150,7 +150,7 @@ retry:
 	}
 
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Major/minor page fault accounting
--- a/arch/arm64/kernel/traps.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm64/kernel/traps.c
@@ -448,12 +448,12 @@ void arm64_notify_segfault(unsigned long
 {
 	int code;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	if (find_vma(current->mm, addr) == NULL)
 		code = SEGV_MAPERR;
 	else
 		code = SEGV_ACCERR;
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	force_signal_inject(SIGSEGV, code, addr);
 }
--- a/arch/arm64/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm64/kernel/vdso.c
@@ -340,7 +340,7 @@ int aarch32_setup_additional_pages(struc
 	struct mm_struct *mm = current->mm;
 	int ret;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	ret = aarch32_kuser_helpers_setup(mm);
@@ -357,7 +357,7 @@ int aarch32_setup_additional_pages(struc
 #endif /* CONFIG_COMPAT_VDSO */
 
 out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 #endif /* CONFIG_COMPAT */
@@ -398,7 +398,7 @@ int arch_setup_additional_pages(struct l
 	struct mm_struct *mm = current->mm;
 	int ret;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	ret = __setup_additional_pages(VDSO_ABI_AA64,
@@ -406,7 +406,7 @@ int arch_setup_additional_pages(struct l
 				       bprm,
 				       uses_interp);
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	return ret;
 }
--- a/arch/arm64/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm64/mm/fault.c
@@ -497,11 +497,11 @@ static int __kprobes do_page_fault(unsig
 	 * validly references user space from well defined areas of the code,
 	 * we can bug out early if this is from code which shouldn't.
 	 */
-	if (!down_read_trylock(&mm->mmap_sem)) {
+	if (!mmap_read_trylock(mm)) {
 		if (!user_mode(regs) && !search_exception_tables(regs->pc))
 			goto no_context;
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	} else {
 		/*
 		 * The above down_read_trylock() might have succeeded in which
@@ -510,7 +510,7 @@ retry:
 		might_sleep();
 #ifdef CONFIG_DEBUG_VM
 		if (!user_mode(regs) && !search_exception_tables(regs->pc)) {
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			goto no_context;
 		}
 #endif
@@ -532,7 +532,7 @@ retry:
 			goto retry;
 		}
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Handle the "normal" (no error) case first.
--- a/arch/arm/kernel/process.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm/kernel/process.c
@@ -431,7 +431,7 @@ int arch_setup_additional_pages(struct l
 	npages = 1; /* for sigpage */
 	npages += vdso_total_pages;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 	hint = sigpage_addr(mm, npages);
 	addr = get_unmapped_area(NULL, hint, npages << PAGE_SHIFT, 0, 0);
@@ -458,7 +458,7 @@ int arch_setup_additional_pages(struct l
 	arm_install_vdso(mm, addr + PAGE_SIZE);
 
  up_fail:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 #endif
--- a/arch/arm/kernel/swp_emulate.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm/kernel/swp_emulate.c
@@ -97,12 +97,12 @@ static void set_segfault(struct pt_regs
 {
 	int si_code;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	if (find_vma(current->mm, addr) == NULL)
 		si_code = SEGV_MAPERR;
 	else
 		si_code = SEGV_ACCERR;
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	pr_debug("SWP{B} emulation: access caused memory abort!\n");
 	arm_notify_die("Illegal memory access", regs,
--- a/arch/arm/lib/uaccess_with_memcpy.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm/lib/uaccess_with_memcpy.c
@@ -101,7 +101,7 @@ __copy_to_user_memcpy(void __user *to, c
 	atomic = faulthandler_disabled();
 
 	if (!atomic)
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 	while (n) {
 		pte_t *pte;
 		spinlock_t *ptl;
@@ -109,11 +109,11 @@ __copy_to_user_memcpy(void __user *to, c
 
 		while (!pin_page_for_write(to, &pte, &ptl)) {
 			if (!atomic)
-				up_read(&current->mm->mmap_sem);
+				mmap_read_unlock(current->mm);
 			if (__put_user(0, (char __user *)to))
 				goto out;
 			if (!atomic)
-				down_read(&current->mm->mmap_sem);
+				mmap_read_lock(current->mm);
 		}
 
 		tocopy = (~(unsigned long)to & ~PAGE_MASK) + 1;
@@ -133,7 +133,7 @@ __copy_to_user_memcpy(void __user *to, c
 			spin_unlock(ptl);
 	}
 	if (!atomic)
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 
 out:
 	return n;
@@ -170,17 +170,17 @@ __clear_user_memset(void __user *addr, u
 		return 0;
 	}
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	while (n) {
 		pte_t *pte;
 		spinlock_t *ptl;
 		int tocopy;
 
 		while (!pin_page_for_write(addr, &pte, &ptl)) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			if (__put_user(0, (char __user *)addr))
 				goto out;
-			down_read(&current->mm->mmap_sem);
+			mmap_read_lock(current->mm);
 		}
 
 		tocopy = (~(unsigned long)addr & ~PAGE_MASK) + 1;
@@ -198,7 +198,7 @@ __clear_user_memset(void __user *addr, u
 		else
 			spin_unlock(ptl);
 	}
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 out:
 	return n;
--- a/arch/arm/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/arm/mm/fault.c
@@ -271,11 +271,11 @@ do_page_fault(unsigned long addr, unsign
 	 * validly references user space from well defined areas of the code,
 	 * we can bug out early if this is from code which shouldn't.
 	 */
-	if (!down_read_trylock(&mm->mmap_sem)) {
+	if (!mmap_read_trylock(mm)) {
 		if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
 			goto no_context;
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	} else {
 		/*
 		 * The above down_read_trylock() might have succeeded in
@@ -325,7 +325,7 @@ retry:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Handle the "normal" case first - VM_FAULT_MAJOR
--- a/arch/csky/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/csky/kernel/vdso.c
@@ -50,7 +50,7 @@ int arch_setup_additional_pages(struct l
 	unsigned long addr;
 	struct mm_struct *mm = current->mm;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	addr = get_unmapped_area(NULL, STACK_TOP, PAGE_SIZE, 0, 0);
 	if (IS_ERR_VALUE(addr)) {
@@ -70,7 +70,7 @@ int arch_setup_additional_pages(struct l
 	mm->context.vdso = (void *)addr;
 
 up_fail:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
--- a/arch/csky/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/csky/mm/fault.c
@@ -120,7 +120,7 @@ asmlinkage void do_page_fault(struct pt_
 	if (in_atomic() || !mm)
 		goto bad_area_nosemaphore;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto bad_area;
@@ -170,7 +170,7 @@ good_area:
 			      address);
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 	/*
@@ -178,7 +178,7 @@ good_area:
 	 * Fix it, but check if it's kernel or user first..
 	 */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 	/* User mode accesses just cause a SIGSEGV */
@@ -217,7 +217,7 @@ out_of_memory:
 do_sigbus:
 	tsk->thread.trap_no = (regs->sr >> 16) & 0xff;
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Kernel mode? Handle exceptions or die */
 	if (!user_mode(regs))
--- a/arch/hexagon/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/hexagon/kernel/vdso.c
@@ -52,7 +52,7 @@ int arch_setup_additional_pages(struct l
 	unsigned long vdso_base;
 	struct mm_struct *mm = current->mm;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	/* Try to get it loaded right near ld.so/glibc. */
@@ -76,7 +76,7 @@ int arch_setup_additional_pages(struct l
 	mm->context.vdso = (void *)vdso_base;
 
 up_fail:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
--- a/arch/hexagon/mm/vm_fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/hexagon/mm/vm_fault.c
@@ -54,7 +54,7 @@ void do_page_fault(unsigned long address
 	if (user_mode(regs))
 		flags |= FAULT_FLAG_USER;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto bad_area;
@@ -106,11 +106,11 @@ good_area:
 			}
 		}
 
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		return;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Handle copyin/out exception cases */
 	if (!user_mode(regs))
@@ -137,7 +137,7 @@ good_area:
 	return;
 
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	if (user_mode(regs)) {
 		force_sig_fault(SIGSEGV, si_code, (void __user *)address);
--- a/arch/ia64/kernel/perfmon.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/ia64/kernel/perfmon.c
@@ -2260,13 +2260,13 @@ pfm_smpl_buffer_alloc(struct task_struct
 	 * now we atomically find some area in the address space and
 	 * remap the buffer in it.
 	 */
-	down_write(&task->mm->mmap_sem);
+	mmap_write_lock(task->mm);
 
 	/* find some free area in address space, must have mmap sem held */
 	vma->vm_start = get_unmapped_area(NULL, 0, size, 0, MAP_PRIVATE|MAP_ANONYMOUS);
 	if (IS_ERR_VALUE(vma->vm_start)) {
 		DPRINT(("Cannot find unmapped area for size %ld\n", size));
-		up_write(&task->mm->mmap_sem);
+		mmap_write_unlock(task->mm);
 		goto error;
 	}
 	vma->vm_end = vma->vm_start + size;
@@ -2277,7 +2277,7 @@ pfm_smpl_buffer_alloc(struct task_struct
 	/* can only be applied to current task, need to have the mm semaphore held when called */
 	if (pfm_remap_buffer(vma, (unsigned long)smpl_buf, vma->vm_start, size)) {
 		DPRINT(("Can't remap buffer\n"));
-		up_write(&task->mm->mmap_sem);
+		mmap_write_unlock(task->mm);
 		goto error;
 	}
 
@@ -2288,7 +2288,7 @@ pfm_smpl_buffer_alloc(struct task_struct
 	insert_vm_struct(mm, vma);
 
 	vm_stat_account(vma->vm_mm, vma->vm_flags, vma_pages(vma));
-	up_write(&task->mm->mmap_sem);
+	mmap_write_unlock(task->mm);
 
 	/*
 	 * keep track of user level virtual address
--- a/arch/ia64/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/ia64/mm/fault.c
@@ -106,7 +106,7 @@ ia64_do_page_fault (unsigned long addres
 	if (mask & VM_WRITE)
 		flags |= FAULT_FLAG_WRITE;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	vma = find_vma_prev(mm, address, &prev_vma);
 	if (!vma && !prev_vma )
@@ -182,7 +182,7 @@ retry:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
   check_expansion:
@@ -213,7 +213,7 @@ retry:
 	goto good_area;
 
   bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 #ifdef CONFIG_VIRTUAL_MEM_MAP
   bad_area_no_up:
 #endif
@@ -279,7 +279,7 @@ retry:
 	return;
 
   out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
--- a/arch/ia64/mm/init.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/ia64/mm/init.c
@@ -118,13 +118,13 @@ ia64_init_addr_space (void)
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT;
 		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
-		down_write(&current->mm->mmap_sem);
+		mmap_write_lock(current->mm);
 		if (insert_vm_struct(current->mm, vma)) {
-			up_write(&current->mm->mmap_sem);
+			mmap_write_unlock(current->mm);
 			vm_area_free(vma);
 			return;
 		}
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 	}
 
 	/* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
@@ -136,13 +136,13 @@ ia64_init_addr_space (void)
 			vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
 			vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO |
 					VM_DONTEXPAND | VM_DONTDUMP;
-			down_write(&current->mm->mmap_sem);
+			mmap_write_lock(current->mm);
 			if (insert_vm_struct(current->mm, vma)) {
-				up_write(&current->mm->mmap_sem);
+				mmap_write_unlock(current->mm);
 				vm_area_free(vma);
 				return;
 			}
-			up_write(&current->mm->mmap_sem);
+			mmap_write_unlock(current->mm);
 		}
 	}
 }
--- a/arch/m68k/kernel/sys_m68k.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/m68k/kernel/sys_m68k.c
@@ -399,7 +399,7 @@ sys_cacheflush (unsigned long addr, int
 		 * Verify that the specified address region actually belongs
 		 * to this process.
 		 */
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		vma = find_vma(current->mm, addr);
 		if (!vma || addr < vma->vm_start || addr + len > vma->vm_end)
 			goto out_unlock;
@@ -450,7 +450,7 @@ sys_cacheflush (unsigned long addr, int
 	    }
 	}
 out_unlock:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 out:
 	return ret;
 }
@@ -472,7 +472,7 @@ sys_atomic_cmpxchg_32(unsigned long newv
 		spinlock_t *ptl;
 		unsigned long mem_value;
 
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		pgd = pgd_offset(mm, (unsigned long)mem);
 		if (!pgd_present(*pgd))
 			goto bad_access;
@@ -501,11 +501,11 @@ sys_atomic_cmpxchg_32(unsigned long newv
 			__put_user(newval, mem);
 
 		pte_unmap_unlock(pte, ptl);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		return mem_value;
 
 	      bad_access:
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		/* This is not necessarily a bad access, we can get here if
 		   a memory we're trying to write to should be copied-on-write.
 		   Make the kernel do the necessary page stuff, then re-iterate.
@@ -545,13 +545,13 @@ sys_atomic_cmpxchg_32(unsigned long newv
 	struct mm_struct *mm = current->mm;
 	unsigned long mem_value;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	mem_value = *mem;
 	if (mem_value == oldval)
 		*mem = newval;
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return mem_value;
 }
 
--- a/arch/m68k/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/m68k/mm/fault.c
@@ -86,7 +86,7 @@ int do_page_fault(struct pt_regs *regs,
 	if (user_mode(regs))
 		flags |= FAULT_FLAG_USER;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	vma = find_vma(mm, address);
 	if (!vma)
@@ -174,7 +174,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return 0;
 
 /*
@@ -182,7 +182,7 @@ good_area:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
@@ -211,6 +211,6 @@ acc_err:
 	current->thread.faddr = address;
 
 send_sig:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return send_fault_sig(regs);
 }
--- a/arch/microblaze/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/microblaze/mm/fault.c
@@ -136,12 +136,12 @@ void do_page_fault(struct pt_regs *regs,
 	 * source.  If this is invalid we can skip the address space check,
 	 * thus avoiding the deadlock.
 	 */
-	if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
+	if (unlikely(!mmap_read_trylock(mm))) {
 		if (kernel_mode(regs) && !search_exception_tables(regs->pc))
 			goto bad_area_nosemaphore;
 
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	}
 
 	vma = find_vma(mm, address);
@@ -247,7 +247,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * keep track of tlb+htab misses that are good addrs but
@@ -258,7 +258,7 @@ good_area:
 	return;
 
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 	pte_errors++;
@@ -277,7 +277,7 @@ bad_area_nosemaphore:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		bad_page_fault(regs, address, SIGKILL);
 	else
@@ -285,7 +285,7 @@ out_of_memory:
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (user_mode(regs)) {
 		force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address);
 		return;
--- a/arch/mips/kernel/traps.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/mips/kernel/traps.c
@@ -793,13 +793,13 @@ int process_fpemu_return(int sig, void _
 		return 1;
 
 	case SIGSEGV:
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		vma = find_vma(current->mm, (unsigned long)fault_addr);
 		if (vma && (vma->vm_start <= (unsigned long)fault_addr))
 			si_code = SEGV_ACCERR;
 		else
 			si_code = SEGV_MAPERR;
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		force_sig_fault(SIGSEGV, si_code, fault_addr);
 		return 1;
 
--- a/arch/mips/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/mips/kernel/vdso.c
@@ -94,7 +94,7 @@ int arch_setup_additional_pages(struct l
 	struct vm_area_struct *vma;
 	int ret;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT)) {
@@ -187,6 +187,6 @@ int arch_setup_additional_pages(struct l
 	ret = 0;
 
 out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
--- a/arch/nds32/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/nds32/kernel/vdso.c
@@ -130,7 +130,7 @@ int arch_setup_additional_pages(struct l
 	vdso_mapping_len += L1_cache_info[DCACHE].aliasing_num - 1;
 #endif
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	addr = vdso_random_addr(vdso_mapping_len);
@@ -185,12 +185,12 @@ int arch_setup_additional_pages(struct l
 		goto up_fail;
 	}
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return 0;
 
 up_fail:
 	mm->context.vdso = NULL;
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
--- a/arch/nds32/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/nds32/mm/fault.c
@@ -126,12 +126,12 @@ void do_page_fault(unsigned long entry,
 	 * validly references user space from well defined areas of the code,
 	 * we can bug out early if this is from code which shouldn't.
 	 */
-	if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
+	if (unlikely(!mmap_read_trylock(mm))) {
 		if (!user_mode(regs) &&
 		    !search_exception_tables(instruction_pointer(regs)))
 			goto no_context;
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	} else {
 		/*
 		 * The above down_read_trylock() might have succeeded in which
@@ -255,7 +255,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 	/*
@@ -263,7 +263,7 @@ good_area:
 	 * Fix it, but check if it's kernel or user first..
 	 */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 
@@ -323,14 +323,14 @@ no_context:
 	 */
 
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Kernel mode? Handle exceptions or die */
 	if (!user_mode(regs))
--- a/arch/nios2/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/nios2/mm/fault.c
@@ -83,11 +83,11 @@ asmlinkage void do_page_fault(struct pt_
 	if (user_mode(regs))
 		flags |= FAULT_FLAG_USER;
 
-	if (!down_read_trylock(&mm->mmap_sem)) {
+	if (!mmap_read_trylock(mm)) {
 		if (!user_mode(regs) && !search_exception_tables(regs->ea))
 			goto bad_area_nosemaphore;
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	}
 
 	vma = find_vma(mm, address);
@@ -169,7 +169,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 /*
@@ -177,7 +177,7 @@ good_area:
  * Fix it, but check if it's kernel or user first..
  */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 	/* User mode accesses just cause a SIGSEGV */
@@ -215,14 +215,14 @@ no_context:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Kernel mode? Handle exceptions or die */
 	if (!user_mode(regs))
--- a/arch/nios2/mm/init.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/nios2/mm/init.c
@@ -109,14 +109,14 @@ int arch_setup_additional_pages(struct l
 	struct mm_struct *mm = current->mm;
 	int ret;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	/* Map kuser helpers to user space address */
 	ret = install_special_mapping(mm, KUSER_BASE, KUSER_SIZE,
 				      VM_READ | VM_EXEC | VM_MAYREAD |
 				      VM_MAYEXEC, kuser_page);
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	return ret;
 }
--- a/arch/openrisc/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/openrisc/mm/fault.c
@@ -104,7 +104,7 @@ asmlinkage void do_page_fault(struct pt_
 		goto no_context;
 
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 
 	if (!vma)
@@ -192,7 +192,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 	/*
@@ -201,7 +201,7 @@ good_area:
 	 */
 
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 
@@ -260,14 +260,14 @@ out_of_memory:
 	__asm__ __volatile__("l.nop 42");
 	__asm__ __volatile__("l.nop 1");
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Send a sigbus, regardless of whether we were in kernel
--- a/arch/parisc/kernel/traps.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/parisc/kernel/traps.c
@@ -717,7 +717,7 @@ void notrace handle_interruption(int cod
 		if (user_mode(regs)) {
 			struct vm_area_struct *vma;
 
-			down_read(&current->mm->mmap_sem);
+			mmap_read_lock(current->mm);
 			vma = find_vma(current->mm,regs->iaoq[0]);
 			if (vma && (regs->iaoq[0] >= vma->vm_start)
 				&& (vma->vm_flags & VM_EXEC)) {
@@ -725,10 +725,10 @@ void notrace handle_interruption(int cod
 				fault_address = regs->iaoq[0];
 				fault_space = regs->iasq[0];
 
-				up_read(&current->mm->mmap_sem);
+				mmap_read_unlock(current->mm);
 				break; /* call do_page_fault() */
 			}
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 		}
 		/* Fall Through */
 	case 27: 
--- a/arch/parisc/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/parisc/mm/fault.c
@@ -282,7 +282,7 @@ void do_page_fault(struct pt_regs *regs,
 	if (acc_type & VM_WRITE)
 		flags |= FAULT_FLAG_WRITE;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma_prev(mm, address, &prev_vma);
 	if (!vma || address < vma->vm_start)
 		goto check_expansion;
@@ -337,7 +337,7 @@ good_area:
 			goto retry;
 		}
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 check_expansion:
@@ -349,7 +349,7 @@ check_expansion:
  * Something tried to access memory that isn't in our memory map..
  */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	if (user_mode(regs)) {
 		int signo, si_code;
@@ -421,7 +421,7 @@ no_context:
 	parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);
 
   out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
--- a/arch/powerpc/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/kernel/vdso.c
@@ -170,7 +170,7 @@ int arch_setup_additional_pages(struct l
 	 * and end up putting it elsewhere.
 	 * Add enough to the size so that the result can be aligned.
 	 */
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 	vdso_base = get_unmapped_area(NULL, vdso_base,
 				      (vdso_pages << PAGE_SHIFT) +
@@ -210,11 +210,11 @@ int arch_setup_additional_pages(struct l
 		goto fail_mmapsem;
 	}
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return 0;
 
  fail_mmapsem:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return rc;
 }
 
--- a/arch/powerpc/kvm/book3s_hv.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/kvm/book3s_hv.c
@@ -4621,14 +4621,14 @@ static int kvmppc_hv_setup_htab_rma(stru
 
 	/* Look up the VMA for the start of this memory slot */
 	hva = memslot->userspace_addr;
-	down_read(&kvm->mm->mmap_sem);
+	mmap_read_lock(kvm->mm);
 	vma = find_vma(kvm->mm, hva);
 	if (!vma || vma->vm_start > hva || (vma->vm_flags & VM_IO))
 		goto up_out;
 
 	psize = vma_kernel_pagesize(vma);
 
-	up_read(&kvm->mm->mmap_sem);
+	mmap_read_unlock(kvm->mm);
 
 	/* We can handle 4k, 64k or 16M pages in the VRMA */
 	if (psize >= 0x1000000)
@@ -4661,7 +4661,7 @@ static int kvmppc_hv_setup_htab_rma(stru
 	return err;
 
  up_out:
-	up_read(&kvm->mm->mmap_sem);
+	mmap_read_unlock(kvm->mm);
 	goto out_srcu;
 }
 
--- a/arch/powerpc/kvm/book3s_hv_uvmem.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/kvm/book3s_hv_uvmem.c
@@ -408,7 +408,7 @@ kvmppc_svm_page_in(struct vm_area_struct
 	 */
 	ret = ksm_madvise(vma, vma->vm_start, vma->vm_end,
 			  MADV_UNMERGEABLE, &vma->vm_flags);
-	downgrade_write(&kvm->mm->mmap_sem);
+	mmap_write_downgrade(kvm->mm);
 	*downgrade = true;
 	if (ret)
 		return ret;
@@ -525,7 +525,7 @@ kvmppc_h_svm_page_in(struct kvm *kvm, un
 
 	ret = H_PARAMETER;
 	srcu_idx = srcu_read_lock(&kvm->srcu);
-	down_write(&kvm->mm->mmap_sem);
+	mmap_write_lock(kvm->mm);
 
 	start = gfn_to_hva(kvm, gfn);
 	if (kvm_is_error_hva(start))
@@ -548,9 +548,9 @@ out_unlock:
 	mutex_unlock(&kvm->arch.uvmem_lock);
 out:
 	if (downgrade)
-		up_read(&kvm->mm->mmap_sem);
+		mmap_read_unlock(kvm->mm);
 	else
-		up_write(&kvm->mm->mmap_sem);
+		mmap_write_unlock(kvm->mm);
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
 	return ret;
 }
@@ -703,7 +703,7 @@ kvmppc_h_svm_page_out(struct kvm *kvm, u
 
 	ret = H_PARAMETER;
 	srcu_idx = srcu_read_lock(&kvm->srcu);
-	down_read(&kvm->mm->mmap_sem);
+	mmap_read_lock(kvm->mm);
 	start = gfn_to_hva(kvm, gfn);
 	if (kvm_is_error_hva(start))
 		goto out;
@@ -716,7 +716,7 @@ kvmppc_h_svm_page_out(struct kvm *kvm, u
 	if (!kvmppc_svm_page_out(vma, start, end, page_shift, kvm, gpa))
 		ret = H_SUCCESS;
 out:
-	up_read(&kvm->mm->mmap_sem);
+	mmap_read_unlock(kvm->mm);
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
 	return ret;
 }
--- a/arch/powerpc/kvm/e500_mmu_host.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/kvm/e500_mmu_host.c
@@ -355,7 +355,7 @@ static inline int kvmppc_e500_shadow_map
 
 	if (tlbsel == 1) {
 		struct vm_area_struct *vma;
-		down_read(&kvm->mm->mmap_sem);
+		mmap_read_lock(kvm->mm);
 
 		vma = find_vma(kvm->mm, hva);
 		if (vma && hva >= vma->vm_start &&
@@ -441,7 +441,7 @@ static inline int kvmppc_e500_shadow_map
 			tsize = max(BOOK3E_PAGESZ_4K, tsize & ~1);
 		}
 
-		up_read(&kvm->mm->mmap_sem);
+		mmap_read_unlock(kvm->mm);
 	}
 
 	if (likely(!pfnmap)) {
--- a/arch/powerpc/mm/book3s64/iommu_api.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/mm/book3s64/iommu_api.c
@@ -96,7 +96,7 @@ static long mm_iommu_do_alloc(struct mm_
 		goto unlock_exit;
 	}
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	chunk = (1UL << (PAGE_SHIFT + MAX_ORDER - 1)) /
 			sizeof(struct vm_area_struct *);
 	chunk = min(chunk, entries);
@@ -114,7 +114,7 @@ static long mm_iommu_do_alloc(struct mm_
 			pinned += ret;
 		break;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (pinned != entries) {
 		if (!ret)
 			ret = -EFAULT;
--- a/arch/powerpc/mm/book3s64/subpage_prot.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/mm/book3s64/subpage_prot.c
@@ -94,7 +94,7 @@ static void subpage_prot_clear(unsigned
 	size_t nw;
 	unsigned long next, limit;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	spt = mm_ctx_subpage_prot(&mm->context);
 	if (!spt)
@@ -129,7 +129,7 @@ static void subpage_prot_clear(unsigned
 	}
 
 err_out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 }
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -219,7 +219,7 @@ SYSCALL_DEFINE3(subpage_prot, unsigned l
 	if (!access_ok(map, (len >> PAGE_SHIFT) * sizeof(u32)))
 		return -EFAULT;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	spt = mm_ctx_subpage_prot(&mm->context);
 	if (!spt) {
@@ -269,11 +269,11 @@ SYSCALL_DEFINE3(subpage_prot, unsigned l
 		if (addr + (nw << PAGE_SHIFT) > next)
 			nw = (next - addr) >> PAGE_SHIFT;
 
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 		if (__copy_from_user(spp, map, nw * sizeof(u32)))
 			return -EFAULT;
 		map += nw;
-		down_write(&mm->mmap_sem);
+		mmap_write_lock(mm);
 
 		/* now flush any existing HPTEs for the range */
 		hpte_flush_range(mm, addr, nw);
@@ -282,6 +282,6 @@ SYSCALL_DEFINE3(subpage_prot, unsigned l
 		spt->maxaddr = limit;
 	err = 0;
  out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return err;
 }
--- a/arch/powerpc/mm/copro_fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/mm/copro_fault.c
@@ -33,7 +33,7 @@ int copro_handle_mm_fault(struct mm_stru
 	if (mm->pgd == NULL)
 		return -EFAULT;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	ret = -EFAULT;
 	vma = find_vma(mm, ea);
 	if (!vma)
@@ -82,7 +82,7 @@ int copro_handle_mm_fault(struct mm_stru
 		current->min_flt++;
 
 out_unlock:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(copro_handle_mm_fault);
--- a/arch/powerpc/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/mm/fault.c
@@ -108,7 +108,7 @@ static int __bad_area(struct pt_regs *re
 	 * Something tried to access memory that isn't in our memory map..
 	 * Fix it, but check if it's kernel or user first..
 	 */
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return __bad_area_nosemaphore(regs, address, si_code);
 }
@@ -144,7 +144,7 @@ static noinline int bad_access_pkey(stru
 	 */
 	pkey = vma_pkey(vma);
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * If we are in kernel mode, bail out with a SEGV, this will
@@ -551,12 +551,12 @@ static int __do_page_fault(struct pt_reg
 	 * source.  If this is invalid we can skip the address space check,
 	 * thus avoiding the deadlock.
 	 */
-	if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
+	if (unlikely(!mmap_read_trylock(mm))) {
 		if (!is_user && !search_exception_tables(regs->nip))
 			return bad_area_nosemaphore(regs, address);
 
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	} else {
 		/*
 		 * The above down_read_trylock() might have succeeded in
@@ -580,7 +580,7 @@ retry:
 		if (!must_retry)
 			return bad_area(regs, address);
 
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		if (fault_in_pages_readable((const char __user *)regs->nip,
 					    sizeof(unsigned int)))
 			return bad_area_nosemaphore(regs, address);
@@ -625,7 +625,7 @@ good_area:
 		}
 	}
 
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	if (unlikely(fault & VM_FAULT_ERROR))
 		return mm_fault_error(regs, address, fault);
--- a/arch/powerpc/oprofile/cell/spu_task_sync.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/oprofile/cell/spu_task_sync.c
@@ -332,7 +332,7 @@ get_exec_dcookie_and_offset(struct spu *
 		fput(exe_file);
 	}
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref)
 			continue;
@@ -349,13 +349,13 @@ get_exec_dcookie_and_offset(struct spu *
 	*spu_bin_dcookie = fast_get_dcookie(&vma->vm_file->f_path);
 	pr_debug("got dcookie for %pD\n", vma->vm_file);
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 out:
 	return app_cookie;
 
 fail_no_image_cookie:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	printk(KERN_ERR "SPU_PROF: "
 		"%s, line %d: Cannot find dcookie for SPU binary\n",
--- a/arch/powerpc/platforms/cell/spufs/file.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/powerpc/platforms/cell/spufs/file.c
@@ -343,11 +343,11 @@ static vm_fault_t spufs_ps_fault(struct
 		goto refault;
 
 	if (ctx->state == SPU_STATE_SAVED) {
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		spu_context_nospu_trace(spufs_ps_fault__sleep, ctx);
 		err = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
 		spu_context_trace(spufs_ps_fault__wake, ctx, ctx->spu);
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 	} else {
 		area = ctx->spu->problem_phys + ps_offs;
 		ret = vmf_insert_pfn(vmf->vma, vmf->address,
--- a/arch/riscv/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/riscv/kernel/vdso.c
@@ -61,7 +61,7 @@ int arch_setup_additional_pages(struct l
 
 	vdso_len = (vdso_pages + 1) << PAGE_SHIFT;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	vdso_base = get_unmapped_area(NULL, 0, vdso_len, 0, 0);
 	if (IS_ERR_VALUE(vdso_base)) {
 		ret = vdso_base;
@@ -83,7 +83,7 @@ int arch_setup_additional_pages(struct l
 		mm->context.vdso = NULL;
 
 end:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
--- a/arch/riscv/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/riscv/mm/fault.c
@@ -69,7 +69,7 @@ asmlinkage void do_page_fault(struct pt_
 	perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
 
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, addr);
 	if (unlikely(!vma))
 		goto bad_area;
@@ -155,7 +155,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 	/*
@@ -163,7 +163,7 @@ good_area:
 	 * Fix it, but check if it's kernel or user first.
 	 */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	/* User mode accesses just cause a SIGSEGV */
 	if (user_mode(regs)) {
 		do_trap(regs, SIGSEGV, code, addr);
@@ -191,14 +191,14 @@ no_context:
 	 * (which will retry the fault, or kill us if we got oom-killed).
 	 */
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	/* Kernel mode? Handle exceptions or die */
 	if (!user_mode(regs))
 		goto no_context;
--- a/arch/s390/kernel/uv.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/kernel/uv.c
@@ -205,7 +205,7 @@ int gmap_make_secure(struct gmap *gmap,
 
 again:
 	rc = -EFAULT;
-	down_read(&gmap->mm->mmap_sem);
+	mmap_read_lock(gmap->mm);
 
 	uaddr = __gmap_translate(gmap, gaddr);
 	if (IS_ERR_VALUE(uaddr))
@@ -234,7 +234,7 @@ again:
 	pte_unmap_unlock(ptep, ptelock);
 	unlock_page(page);
 out:
-	up_read(&gmap->mm->mmap_sem);
+	mmap_read_unlock(gmap->mm);
 
 	if (rc == -EAGAIN) {
 		wait_on_page_writeback(page);
--- a/arch/s390/kernel/vdso.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/kernel/vdso.c
@@ -207,7 +207,7 @@ int arch_setup_additional_pages(struct l
 	 * it at vdso_base which is the "natural" base for it, but we might
 	 * fail and end up putting it elsewhere.
 	 */
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 	vdso_base = get_unmapped_area(NULL, 0, vdso_pages << PAGE_SHIFT, 0, 0);
 	if (IS_ERR_VALUE(vdso_base)) {
@@ -238,7 +238,7 @@ int arch_setup_additional_pages(struct l
 	rc = 0;
 
 out_up:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return rc;
 }
 
--- a/arch/s390/kvm/gaccess.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/kvm/gaccess.c
@@ -1173,7 +1173,7 @@ int kvm_s390_shadow_fault(struct kvm_vcp
 	int dat_protection, fake;
 	int rc;
 
-	down_read(&sg->mm->mmap_sem);
+	mmap_read_lock(sg->mm);
 	/*
 	 * We don't want any guest-2 tables to change - so the parent
 	 * tables/pointers we read stay valid - unshadowing is however
@@ -1202,6 +1202,6 @@ shadow_page:
 	if (!rc)
 		rc = gmap_shadow_page(sg, saddr, __pte(pte.val));
 	ipte_unlock(vcpu);
-	up_read(&sg->mm->mmap_sem);
+	mmap_read_unlock(sg->mm);
 	return rc;
 }
--- a/arch/s390/kvm/interrupt.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/kvm/interrupt.c
@@ -2767,10 +2767,10 @@ static struct page *get_map_page(struct
 {
 	struct page *page = NULL;
 
-	down_read(&kvm->mm->mmap_sem);
+	mmap_read_lock(kvm->mm);
 	get_user_pages_remote(NULL, kvm->mm, uaddr, 1, FOLL_WRITE,
 			      &page, NULL, NULL);
-	up_read(&kvm->mm->mmap_sem);
+	mmap_read_unlock(kvm->mm);
 	return page;
 }
 
--- a/arch/s390/kvm/kvm-s390.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/kvm/kvm-s390.c
@@ -763,9 +763,9 @@ int kvm_vm_ioctl_enable_cap(struct kvm *
 			r = -EINVAL;
 		else {
 			r = 0;
-			down_write(&kvm->mm->mmap_sem);
+			mmap_write_lock(kvm->mm);
 			kvm->mm->context.allow_gmap_hpage_1m = 1;
-			up_write(&kvm->mm->mmap_sem);
+			mmap_write_unlock(kvm->mm);
 			/*
 			 * We might have to create fake 4k page
 			 * tables. To avoid that the hardware works on
@@ -1815,7 +1815,7 @@ static long kvm_s390_get_skeys(struct kv
 	if (!keys)
 		return -ENOMEM;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	srcu_idx = srcu_read_lock(&kvm->srcu);
 	for (i = 0; i < args->count; i++) {
 		hva = gfn_to_hva(kvm, args->start_gfn + i);
@@ -1829,7 +1829,7 @@ static long kvm_s390_get_skeys(struct kv
 			break;
 	}
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	if (!r) {
 		r = copy_to_user((uint8_t __user *)args->skeydata_addr, keys,
@@ -1873,7 +1873,7 @@ static long kvm_s390_set_skeys(struct kv
 		goto out;
 
 	i = 0;
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	srcu_idx = srcu_read_lock(&kvm->srcu);
         while (i < args->count) {
 		unlocked = false;
@@ -1900,7 +1900,7 @@ static long kvm_s390_set_skeys(struct kv
 			i++;
 	}
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 out:
 	kvfree(keys);
 	return r;
@@ -2089,14 +2089,14 @@ static int kvm_s390_get_cmma_bits(struct
 	if (!values)
 		return -ENOMEM;
 
-	down_read(&kvm->mm->mmap_sem);
+	mmap_read_lock(kvm->mm);
 	srcu_idx = srcu_read_lock(&kvm->srcu);
 	if (peek)
 		ret = kvm_s390_peek_cmma(kvm, args, values, bufsize);
 	else
 		ret = kvm_s390_get_cmma(kvm, args, values, bufsize);
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
-	up_read(&kvm->mm->mmap_sem);
+	mmap_read_unlock(kvm->mm);
 
 	if (kvm->arch.migration_mode)
 		args->remaining = atomic64_read(&kvm->arch.cmma_dirty_pages);
@@ -2146,7 +2146,7 @@ static int kvm_s390_set_cmma_bits(struct
 		goto out;
 	}
 
-	down_read(&kvm->mm->mmap_sem);
+	mmap_read_lock(kvm->mm);
 	srcu_idx = srcu_read_lock(&kvm->srcu);
 	for (i = 0; i < args->count; i++) {
 		hva = gfn_to_hva(kvm, args->start_gfn + i);
@@ -2161,12 +2161,12 @@ static int kvm_s390_set_cmma_bits(struct
 		set_pgste_bits(kvm->mm, hva, mask, pgstev);
 	}
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
-	up_read(&kvm->mm->mmap_sem);
+	mmap_read_unlock(kvm->mm);
 
 	if (!kvm->mm->context.uses_cmm) {
-		down_write(&kvm->mm->mmap_sem);
+		mmap_write_lock(kvm->mm);
 		kvm->mm->context.uses_cmm = 1;
-		up_write(&kvm->mm->mmap_sem);
+		mmap_write_unlock(kvm->mm);
 	}
 out:
 	vfree(bits);
@@ -2239,9 +2239,9 @@ static int kvm_s390_handle_pv(struct kvm
 		if (r)
 			break;
 
-		down_write(&current->mm->mmap_sem);
+		mmap_write_lock(current->mm);
 		r = gmap_mark_unmergeable();
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 		if (r)
 			break;
 
--- a/arch/s390/kvm/priv.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/kvm/priv.c
@@ -270,18 +270,18 @@ static int handle_iske(struct kvm_vcpu *
 		return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 retry:
 	unlocked = false;
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	rc = get_guest_storage_key(current->mm, vmaddr, &key);
 
 	if (rc) {
 		rc = fixup_user_fault(current, current->mm, vmaddr,
 				      FAULT_FLAG_WRITE, &unlocked);
 		if (!rc) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			goto retry;
 		}
 	}
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	if (rc == -EFAULT)
 		return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 	if (rc < 0)
@@ -317,17 +317,17 @@ static int handle_rrbe(struct kvm_vcpu *
 		return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 retry:
 	unlocked = false;
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	rc = reset_guest_reference_bit(current->mm, vmaddr);
 	if (rc < 0) {
 		rc = fixup_user_fault(current, current->mm, vmaddr,
 				      FAULT_FLAG_WRITE, &unlocked);
 		if (!rc) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			goto retry;
 		}
 	}
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	if (rc == -EFAULT)
 		return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 	if (rc < 0)
@@ -385,7 +385,7 @@ static int handle_sske(struct kvm_vcpu *
 		if (kvm_is_error_hva(vmaddr))
 			return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		rc = cond_set_guest_storage_key(current->mm, vmaddr, key, &oldkey,
 						m3 & SSKE_NQ, m3 & SSKE_MR,
 						m3 & SSKE_MC);
@@ -395,7 +395,7 @@ static int handle_sske(struct kvm_vcpu *
 					      FAULT_FLAG_WRITE, &unlocked);
 			rc = !rc ? -EAGAIN : rc;
 		}
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		if (rc == -EFAULT)
 			return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 		if (rc < 0)
@@ -1091,7 +1091,7 @@ static int handle_pfmf(struct kvm_vcpu *
 
 			if (rc)
 				return rc;
-			down_read(&current->mm->mmap_sem);
+			mmap_read_lock(current->mm);
 			rc = cond_set_guest_storage_key(current->mm, vmaddr,
 							key, NULL, nq, mr, mc);
 			if (rc < 0) {
@@ -1099,7 +1099,7 @@ static int handle_pfmf(struct kvm_vcpu *
 						      FAULT_FLAG_WRITE, &unlocked);
 				rc = !rc ? -EAGAIN : rc;
 			}
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			if (rc == -EFAULT)
 				return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
 			if (rc == -EAGAIN)
@@ -1220,9 +1220,9 @@ static int handle_essa(struct kvm_vcpu *
 		 * already correct, we do nothing and avoid the lock.
 		 */
 		if (vcpu->kvm->mm->context.uses_cmm == 0) {
-			down_write(&vcpu->kvm->mm->mmap_sem);
+			mmap_write_lock(vcpu->kvm->mm);
 			vcpu->kvm->mm->context.uses_cmm = 1;
-			up_write(&vcpu->kvm->mm->mmap_sem);
+			mmap_write_unlock(vcpu->kvm->mm);
 		}
 		/*
 		 * If we are here, we are supposed to have CMMA enabled in
@@ -1239,11 +1239,11 @@ static int handle_essa(struct kvm_vcpu *
 	} else {
 		int srcu_idx;
 
-		down_read(&vcpu->kvm->mm->mmap_sem);
+		mmap_read_lock(vcpu->kvm->mm);
 		srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
 		i = __do_essa(vcpu, orc);
 		srcu_read_unlock(&vcpu->kvm->srcu, srcu_idx);
-		up_read(&vcpu->kvm->mm->mmap_sem);
+		mmap_read_unlock(vcpu->kvm->mm);
 		if (i < 0)
 			return i;
 		/* Account for the possible extra cbrl entry */
@@ -1251,10 +1251,10 @@ static int handle_essa(struct kvm_vcpu *
 	}
 	vcpu->arch.sie_block->cbrlo &= PAGE_MASK;	/* reset nceo */
 	cbrlo = phys_to_virt(vcpu->arch.sie_block->cbrlo);
-	down_read(&gmap->mm->mmap_sem);
+	mmap_read_lock(gmap->mm);
 	for (i = 0; i < entries; ++i)
 		__gmap_zap(gmap, cbrlo[i]);
-	up_read(&gmap->mm->mmap_sem);
+	mmap_read_unlock(gmap->mm);
 	return 0;
 }
 
--- a/arch/s390/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/mm/fault.c
@@ -433,7 +433,7 @@ static inline vm_fault_t do_exception(st
 		flags |= FAULT_FLAG_USER;
 	if (access == VM_WRITE || (trans_exc_code & store_indication) == 0x400)
 		flags |= FAULT_FLAG_WRITE;
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	gmap = NULL;
 	if (IS_ENABLED(CONFIG_PGSTE) && type == GMAP_FAULT) {
@@ -514,7 +514,7 @@ retry:
 			}
 			flags &= ~FAULT_FLAG_RETRY_NOWAIT;
 			flags |= FAULT_FLAG_TRIED;
-			down_read(&mm->mmap_sem);
+			mmap_read_lock(mm);
 			goto retry;
 		}
 	}
@@ -532,7 +532,7 @@ retry:
 	}
 	fault = 0;
 out_up:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 out:
 	return fault;
 }
@@ -824,22 +824,22 @@ void do_secure_storage_access(struct pt_
 	switch (get_fault_type(regs)) {
 	case USER_FAULT:
 		mm = current->mm;
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		vma = find_vma(mm, addr);
 		if (!vma) {
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			do_fault_error(regs, VM_READ | VM_WRITE, VM_FAULT_BADMAP);
 			break;
 		}
 		page = follow_page(vma, addr, FOLL_WRITE | FOLL_GET);
 		if (IS_ERR_OR_NULL(page)) {
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			break;
 		}
 		if (arch_make_page_accessible(page))
 			send_sig(SIGSEGV, current, 0);
 		put_page(page);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		break;
 	case KERNEL_FAULT:
 		page = phys_to_page(addr);
--- a/arch/s390/mm/gmap.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/mm/gmap.c
@@ -405,10 +405,10 @@ int gmap_unmap_segment(struct gmap *gmap
 		return -EINVAL;
 
 	flush = 0;
-	down_write(&gmap->mm->mmap_sem);
+	mmap_write_lock(gmap->mm);
 	for (off = 0; off < len; off += PMD_SIZE)
 		flush |= __gmap_unmap_by_gaddr(gmap, to + off);
-	up_write(&gmap->mm->mmap_sem);
+	mmap_write_unlock(gmap->mm);
 	if (flush)
 		gmap_flush_tlb(gmap);
 	return 0;
@@ -438,7 +438,7 @@ int gmap_map_segment(struct gmap *gmap,
 		return -EINVAL;
 
 	flush = 0;
-	down_write(&gmap->mm->mmap_sem);
+	mmap_write_lock(gmap->mm);
 	for (off = 0; off < len; off += PMD_SIZE) {
 		/* Remove old translation */
 		flush |= __gmap_unmap_by_gaddr(gmap, to + off);
@@ -448,7 +448,7 @@ int gmap_map_segment(struct gmap *gmap,
 				      (void *) from + off))
 			break;
 	}
-	up_write(&gmap->mm->mmap_sem);
+	mmap_write_unlock(gmap->mm);
 	if (flush)
 		gmap_flush_tlb(gmap);
 	if (off >= len)
@@ -495,9 +495,9 @@ unsigned long gmap_translate(struct gmap
 {
 	unsigned long rc;
 
-	down_read(&gmap->mm->mmap_sem);
+	mmap_read_lock(gmap->mm);
 	rc = __gmap_translate(gmap, gaddr);
-	up_read(&gmap->mm->mmap_sem);
+	mmap_read_unlock(gmap->mm);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(gmap_translate);
@@ -640,7 +640,7 @@ int gmap_fault(struct gmap *gmap, unsign
 	int rc;
 	bool unlocked;
 
-	down_read(&gmap->mm->mmap_sem);
+	mmap_read_lock(gmap->mm);
 
 retry:
 	unlocked = false;
@@ -663,7 +663,7 @@ retry:
 
 	rc = __gmap_link(gmap, gaddr, vmaddr);
 out_up:
-	up_read(&gmap->mm->mmap_sem);
+	mmap_read_unlock(gmap->mm);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(gmap_fault);
@@ -696,7 +696,7 @@ void gmap_discard(struct gmap *gmap, uns
 	unsigned long gaddr, vmaddr, size;
 	struct vm_area_struct *vma;
 
-	down_read(&gmap->mm->mmap_sem);
+	mmap_read_lock(gmap->mm);
 	for (gaddr = from; gaddr < to;
 	     gaddr = (gaddr + PMD_SIZE) & PMD_MASK) {
 		/* Find the vm address for the guest address */
@@ -719,7 +719,7 @@ void gmap_discard(struct gmap *gmap, uns
 		size = min(to - gaddr, PMD_SIZE - (gaddr & ~PMD_MASK));
 		zap_page_range(vma, vmaddr, size);
 	}
-	up_read(&gmap->mm->mmap_sem);
+	mmap_read_unlock(gmap->mm);
 }
 EXPORT_SYMBOL_GPL(gmap_discard);
 
@@ -1106,9 +1106,9 @@ int gmap_mprotect_notify(struct gmap *gm
 		return -EINVAL;
 	if (!MACHINE_HAS_ESOP && prot == PROT_READ)
 		return -EINVAL;
-	down_read(&gmap->mm->mmap_sem);
+	mmap_read_lock(gmap->mm);
 	rc = gmap_protect_range(gmap, gaddr, len, prot, GMAP_NOTIFY_MPROT);
-	up_read(&gmap->mm->mmap_sem);
+	mmap_read_unlock(gmap->mm);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(gmap_mprotect_notify);
@@ -1696,11 +1696,11 @@ struct gmap *gmap_shadow(struct gmap *pa
 	}
 	spin_unlock(&parent->shadow_lock);
 	/* protect after insertion, so it will get properly invalidated */
-	down_read(&parent->mm->mmap_sem);
+	mmap_read_lock(parent->mm);
 	rc = gmap_protect_range(parent, asce & _ASCE_ORIGIN,
 				((asce & _ASCE_TABLE_LENGTH) + 1) * PAGE_SIZE,
 				PROT_READ, GMAP_NOTIFY_SHADOW);
-	up_read(&parent->mm->mmap_sem);
+	mmap_read_unlock(parent->mm);
 	spin_lock(&parent->shadow_lock);
 	new->initialized = true;
 	if (rc) {
@@ -2543,12 +2543,12 @@ int s390_enable_sie(void)
 	/* Fail if the page tables are 2K */
 	if (!mm_alloc_pgste(mm))
 		return -EINVAL;
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	mm->context.has_pgste = 1;
 	/* split thp mappings and disable thp for future mappings */
 	thp_split_mm(mm);
 	walk_page_range(mm, 0, TASK_SIZE, &zap_zero_walk_ops, NULL);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(s390_enable_sie);
@@ -2617,7 +2617,7 @@ int s390_enable_skey(void)
 	struct mm_struct *mm = current->mm;
 	int rc = 0;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	if (mm_uses_skeys(mm))
 		goto out_up;
 
@@ -2630,7 +2630,7 @@ int s390_enable_skey(void)
 	walk_page_range(mm, 0, TASK_SIZE, &enable_skey_walk_ops, NULL);
 
 out_up:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(s390_enable_skey);
@@ -2651,9 +2651,9 @@ static const struct mm_walk_ops reset_cm
 
 void s390_reset_cmma(struct mm_struct *mm)
 {
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	walk_page_range(mm, 0, TASK_SIZE, &reset_cmma_walk_ops, NULL);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 }
 EXPORT_SYMBOL_GPL(s390_reset_cmma);
 
@@ -2685,9 +2685,9 @@ void s390_reset_acc(struct mm_struct *mm
 	 */
 	if (!mmget_not_zero(mm))
 		return;
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	walk_page_range(mm, 0, TASK_SIZE, &reset_acc_walk_ops, NULL);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 }
 EXPORT_SYMBOL_GPL(s390_reset_acc);
--- a/arch/s390/pci/pci_mmio.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/s390/pci/pci_mmio.c
@@ -125,7 +125,7 @@ static long get_pfn(unsigned long user_a
 	struct vm_area_struct *vma;
 	long ret;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	ret = -EINVAL;
 	vma = find_vma(current->mm, user_addr);
 	if (!vma)
@@ -135,7 +135,7 @@ static long get_pfn(unsigned long user_a
 		goto out;
 	ret = follow_pfn(vma, user_addr, pfn);
 out:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	return ret;
 }
 
--- a/arch/sh/kernel/sys_sh.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/sh/kernel/sys_sh.c
@@ -69,10 +69,10 @@ asmlinkage int sys_cacheflush(unsigned l
 	if (addr + len < addr)
 		return -EFAULT;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	vma = find_vma (current->mm, addr);
 	if (vma == NULL || addr < vma->vm_start || addr + len > vma->vm_end) {
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		return -EFAULT;
 	}
 
@@ -91,6 +91,6 @@ asmlinkage int sys_cacheflush(unsigned l
 	if (op & CACHEFLUSH_I)
 		flush_icache_range(addr, addr+len);
 
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	return 0;
 }
--- a/arch/sh/kernel/vsyscall/vsyscall.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/sh/kernel/vsyscall/vsyscall.c
@@ -61,7 +61,7 @@ int arch_setup_additional_pages(struct l
 	unsigned long addr;
 	int ret;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0);
@@ -80,7 +80,7 @@ int arch_setup_additional_pages(struct l
 	current->mm->context.vdso = (void *)addr;
 
 up_fail:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
--- a/arch/sh/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/sh/mm/fault.c
@@ -279,7 +279,7 @@ __bad_area(struct pt_regs *regs, unsigne
 	 * Something tried to access memory that isn't in our memory map..
 	 * Fix it, but check if it's kernel or user first..
 	 */
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	__bad_area_nosemaphore(regs, error_code, address, si_code);
 }
@@ -303,7 +303,7 @@ do_sigbus(struct pt_regs *regs, unsigned
 	struct task_struct *tsk = current;
 	struct mm_struct *mm = tsk->mm;
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Kernel mode? Handle exceptions or die: */
 	if (!user_mode(regs))
@@ -328,7 +328,7 @@ mm_fault_error(struct pt_regs *regs, uns
 
 	/* Release mmap_sem first if necessary */
 	if (!(fault & VM_FAULT_RETRY))
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 
 	if (!(fault & VM_FAULT_ERROR))
 		return 0;
@@ -442,7 +442,7 @@ asmlinkage void __kprobes do_page_fault(
 	}
 
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	vma = find_vma(mm, address);
 	if (unlikely(!vma)) {
@@ -510,5 +510,5 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 }
--- a/arch/sparc/mm/fault_32.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/sparc/mm/fault_32.c
@@ -195,7 +195,7 @@ asmlinkage void do_sparc_fault(struct pt
 	perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
 
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	if (!from_user && address >= PAGE_OFFSET)
 		goto bad_area;
@@ -271,7 +271,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 	/*
@@ -279,7 +279,7 @@ good_area:
 	 * Fix it, but check if it's kernel or user first..
 	 */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 	/* User mode accesses just cause a SIGSEGV */
@@ -328,7 +328,7 @@ no_context:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (from_user) {
 		pagefault_out_of_memory();
 		return;
@@ -336,7 +336,7 @@ out_of_memory:
 	goto no_context;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	do_fault_siginfo(BUS_ADRERR, SIGBUS, regs, text_fault);
 	if (!from_user)
 		goto no_context;
@@ -390,7 +390,7 @@ static void force_user_fault(unsigned lo
 
 	code = SEGV_MAPERR;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto bad_area;
@@ -415,15 +415,15 @@ good_area:
 	case VM_FAULT_OOM:
 		goto do_sigbus;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	__do_fault_siginfo(code, SIGSEGV, tsk->thread.kregs, address);
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	__do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address);
 }
 
--- a/arch/sparc/mm/fault_64.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/sparc/mm/fault_64.c
@@ -318,7 +318,7 @@ asmlinkage void __kprobes do_sparc64_fau
 
 	perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
 
-	if (!down_read_trylock(&mm->mmap_sem)) {
+	if (!mmap_read_trylock(mm)) {
 		if ((regs->tstate & TSTATE_PRIV) &&
 		    !search_exception_tables(regs->tpc)) {
 			insn = get_fault_insn(regs, insn);
@@ -326,7 +326,7 @@ asmlinkage void __kprobes do_sparc64_fau
 		}
 
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	}
 
 	if (fault_code & FAULT_CODE_BAD_RA)
@@ -458,7 +458,7 @@ good_area:
 			goto retry;
 		}
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	mm_rss = get_mm_rss(mm);
 #if defined(CONFIG_TRANSPARENT_HUGEPAGE)
@@ -489,7 +489,7 @@ exit_exception:
 	 */
 bad_area:
 	insn = get_fault_insn(regs, insn);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 handle_kernel_fault:
 	do_kernel_fault(regs, si_code, fault_code, insn, address);
@@ -501,7 +501,7 @@ handle_kernel_fault:
  */
 out_of_memory:
 	insn = get_fault_insn(regs, insn);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!(regs->tstate & TSTATE_PRIV)) {
 		pagefault_out_of_memory();
 		goto exit_exception;
@@ -514,7 +514,7 @@ intr_or_no_mm:
 
 do_sigbus:
 	insn = get_fault_insn(regs, insn);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Send a sigbus, regardless of whether we were in kernel
--- a/arch/sparc/vdso/vma.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/sparc/vdso/vma.c
@@ -366,7 +366,7 @@ static int map_vdso(const struct vdso_im
 	unsigned long text_start, addr = 0;
 	int ret = 0;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	/*
 	 * First, get an unmapped region: then randomize it, and make sure that
@@ -422,7 +422,7 @@ up_fail:
 	if (ret)
 		current->mm->context.vdso = NULL;
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
--- a/arch/um/include/asm/mmu_context.h~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/um/include/asm/mmu_context.h
@@ -49,7 +49,7 @@ static inline void activate_mm(struct mm
 	__switch_mm(&new->context.id);
 	down_write_nested(&new->mmap_sem, 1);
 	uml_setup_stubs(new);
-	up_write(&new->mmap_sem);
+	mmap_write_unlock(new);
 }
 
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 
--- a/arch/um/kernel/tlb.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/um/kernel/tlb.c
@@ -349,7 +349,7 @@ void fix_range_common(struct mm_struct *
 		printk(KERN_ERR "fix_range_common: failed, killing current "
 		       "process: %d\n", task_tgid_vnr(current));
 		/* We are under mmap_sem, release it such that current can terminate */
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 		force_sig(SIGKILL);
 		do_signal(&current->thread.regs);
 	}
--- a/arch/um/kernel/trap.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/um/kernel/trap.c
@@ -43,7 +43,7 @@ int handle_page_fault(unsigned long addr
 	if (is_user)
 		flags |= FAULT_FLAG_USER;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto out;
@@ -116,7 +116,7 @@ good_area:
 #endif
 	flush_tlb_page(vma, address);
 out:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 out_nosemaphore:
 	return err;
 
@@ -125,7 +125,7 @@ out_of_memory:
 	 * We ran out of memory, call the OOM killer, and return the userspace
 	 * (which will retry the fault, or kill us if we got oom-killed).
 	 */
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!is_user)
 		goto out_nosemaphore;
 	pagefault_out_of_memory();
--- a/arch/unicore32/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/unicore32/mm/fault.c
@@ -223,12 +223,12 @@ static int do_pf(unsigned long addr, uns
 	 * validly references user space from well defined areas of the code,
 	 * we can bug out early if this is from code which shouldn't.
 	 */
-	if (!down_read_trylock(&mm->mmap_sem)) {
+	if (!mmap_read_trylock(mm)) {
 		if (!user_mode(regs)
 		    && !search_exception_tables(regs->UCreg_pc))
 			goto no_context;
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	} else {
 		/*
 		 * The above down_read_trylock() might have succeeded in
@@ -263,7 +263,7 @@ retry:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Handle the "normal" case first - VM_FAULT_MAJOR
--- a/arch/x86/entry/vdso/vma.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/x86/entry/vdso/vma.c
@@ -144,7 +144,7 @@ int vdso_join_timens(struct task_struct
 	struct mm_struct *mm = task->mm;
 	struct vm_area_struct *vma;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
@@ -154,7 +154,7 @@ int vdso_join_timens(struct task_struct
 			zap_page_range(vma, vma->vm_start, size);
 	}
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return 0;
 }
 #else
@@ -268,7 +268,7 @@ static int map_vdso(const struct vdso_im
 	unsigned long text_start;
 	int ret = 0;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	addr = get_unmapped_area(NULL, addr,
@@ -311,7 +311,7 @@ static int map_vdso(const struct vdso_im
 	}
 
 up_fail:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 
@@ -373,7 +373,7 @@ int map_vdso_once(const struct vdso_imag
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *vma;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	/*
 	 * Check if we have already mapped vdso blob - fail to prevent
 	 * abusing from userspace install_speciall_mapping, which may
@@ -384,11 +384,11 @@ int map_vdso_once(const struct vdso_imag
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		if (vma_is_special_mapping(vma, &vdso_mapping) ||
 				vma_is_special_mapping(vma, &vvar_mapping)) {
-			up_write(&mm->mmap_sem);
+			mmap_write_unlock(mm);
 			return -EEXIST;
 		}
 	}
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	return map_vdso(image, addr);
 }
--- a/arch/x86/kernel/vm86_32.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/x86/kernel/vm86_32.c
@@ -171,7 +171,7 @@ static void mark_screen_rdonly(struct mm
 	pte_t *pte;
 	int i;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	pgd = pgd_offset(mm, 0xA0000);
 	if (pgd_none_or_clear_bad(pgd))
 		goto out;
@@ -197,7 +197,7 @@ static void mark_screen_rdonly(struct mm
 	}
 	pte_unmap_unlock(pte, ptl);
 out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	flush_tlb_mm_range(mm, 0xA0000, 0xA0000 + 32*PAGE_SIZE, PAGE_SHIFT, false);
 }
 
--- a/arch/x86/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/x86/mm/fault.c
@@ -811,7 +811,7 @@ __bad_area(struct pt_regs *regs, unsigne
 	 * Something tried to access memory that isn't in our memory map..
 	 * Fix it, but check if it's kernel or user first..
 	 */
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	__bad_area_nosemaphore(regs, error_code, address, pkey, si_code);
 }
@@ -1239,7 +1239,7 @@ void do_user_addr_fault(struct pt_regs *
 	 * 1. Failed to acquire mmap_sem, and
 	 * 2. The access did not originate in userspace.
 	 */
-	if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
+	if (unlikely(!mmap_read_trylock(mm))) {
 		if (!user_mode(regs) && !search_exception_tables(regs->ip)) {
 			/*
 			 * Fault from code in kernel from
@@ -1249,7 +1249,7 @@ void do_user_addr_fault(struct pt_regs *
 			return;
 		}
 retry:
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	} else {
 		/*
 		 * The above down_read_trylock() might have succeeded in
@@ -1320,7 +1320,7 @@ good_area:
 		goto retry;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (unlikely(fault & VM_FAULT_ERROR)) {
 		mm_fault_error(regs, hw_error_code, address, fault);
 		return;
--- a/arch/x86/um/vdso/vma.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/x86/um/vdso/vma.c
@@ -58,7 +58,7 @@ int arch_setup_additional_pages(struct l
 	if (!vdso_enabled)
 		return 0;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	err = install_special_mapping(mm, um_vdso_addr, PAGE_SIZE,
@@ -66,7 +66,7 @@ int arch_setup_additional_pages(struct l
 		VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
 		vdsop);
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	return err;
 }
--- a/arch/xtensa/mm/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/arch/xtensa/mm/fault.c
@@ -74,7 +74,7 @@ void do_page_fault(struct pt_regs *regs)
 	if (user_mode(regs))
 		flags |= FAULT_FLAG_USER;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 
 	if (!vma)
@@ -139,7 +139,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
 	if (flags & VM_FAULT_MAJOR)
 		perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
@@ -152,7 +152,7 @@ good_area:
 	 * Fix it, but check if it's kernel or user first..
 	 */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (user_mode(regs)) {
 		current->thread.bad_vaddr = address;
 		current->thread.error_code = is_write;
@@ -167,7 +167,7 @@ bad_area:
 	 * us unable to handle the page fault gracefully.
 	 */
 out_of_memory:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		bad_page_fault(regs, address, SIGKILL);
 	else
@@ -175,7 +175,7 @@ out_of_memory:
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Send a sigbus, regardless of whether we were in kernel
 	 * or user mode.
--- a/drivers/android/binder_alloc.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/android/binder_alloc.c
@@ -212,7 +212,7 @@ static int binder_update_page_range(stru
 		mm = alloc->vma_vm_mm;
 
 	if (mm) {
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		vma = alloc->vma;
 	}
 
@@ -270,7 +270,7 @@ static int binder_update_page_range(stru
 		trace_binder_alloc_page_end(alloc, index);
 	}
 	if (mm) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		mmput(mm);
 	}
 	return 0;
@@ -303,7 +303,7 @@ err_page_ptr_cleared:
 	}
 err_no_vma:
 	if (mm) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		mmput(mm);
 	}
 	return vma ? -ENOMEM : -ESRCH;
@@ -932,7 +932,7 @@ enum lru_status binder_alloc_free_page(s
 	mm = alloc->vma_vm_mm;
 	if (!mmget_not_zero(mm))
 		goto err_mmget;
-	if (!down_read_trylock(&mm->mmap_sem))
+	if (!mmap_read_trylock(mm))
 		goto err_down_read_mmap_sem_failed;
 	vma = binder_alloc_get_vma(alloc);
 
@@ -946,7 +946,7 @@ enum lru_status binder_alloc_free_page(s
 
 		trace_binder_unmap_user_end(alloc, index);
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 
 	trace_binder_unmap_kernel_start(alloc, index);
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1393,9 +1393,9 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gp
 	 * concurrently and the queues are actually stopped
 	 */
 	if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm)) {
-		down_write(&current->mm->mmap_sem);
+		mmap_write_lock(current->mm);
 		is_invalid_userptr = atomic_read(&mem->invalid);
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 	}
 
 	mutex_lock(&mem->lock);
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -910,7 +910,7 @@ int amdgpu_ttm_tt_get_user_pages(struct
 		goto out_free_ranges;
 	}
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, start);
 	if (unlikely(!vma || start < vma->vm_start)) {
 		r = -EFAULT;
@@ -921,15 +921,15 @@ int amdgpu_ttm_tt_get_user_pages(struct
 		r = -EPERM;
 		goto out_unlock;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	timeout = jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
 
 retry:
 	range->notifier_seq = mmu_interval_read_begin(&bo->notifier);
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	r = hmm_range_fault(range);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (unlikely(r)) {
 		/*
 		 * FIXME: This timeout should encompass the retry from
@@ -954,7 +954,7 @@ retry:
 	return 0;
 
 out_unlock:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 out_free_pfns:
 	kvfree(range->hmm_pfns);
 out_free_ranges:
--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
@@ -901,7 +901,7 @@ void kfd_signal_iommu_event(struct kfd_d
 
 	memset(&memory_exception_data, 0, sizeof(memory_exception_data));
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 
 	memory_exception_data.gpu_id = dev->id;
@@ -924,7 +924,7 @@ void kfd_signal_iommu_event(struct kfd_d
 			memory_exception_data.failure.NoExecute = 0;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 
 	pr_debug("notpresent %d, noexecute %d, readonly %d\n",
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -93,7 +93,7 @@ i915_gem_mmap_ioctl(struct drm_device *d
 		struct mm_struct *mm = current->mm;
 		struct vm_area_struct *vma;
 
-		if (down_write_killable(&mm->mmap_sem)) {
+		if (mmap_write_lock_killable(mm)) {
 			addr = -EINTR;
 			goto err;
 		}
@@ -103,7 +103,7 @@ i915_gem_mmap_ioctl(struct drm_device *d
 				pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
 		else
 			addr = -ENOMEM;
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 		if (IS_ERR_VALUE(addr))
 			goto err;
 	}
--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
@@ -200,7 +200,7 @@ i915_mmu_notifier_find(struct i915_mm_st
 	if (IS_ERR(mn))
 		err = PTR_ERR(mn);
 
-	down_write(&mm->mm->mmap_sem);
+	mmap_write_lock(mm->mm);
 	mutex_lock(&mm->i915->mm_lock);
 	if (mm->mn == NULL && !err) {
 		/* Protected by mmap_sem (write-lock) */
@@ -217,7 +217,7 @@ i915_mmu_notifier_find(struct i915_mm_st
 		err = 0;
 	}
 	mutex_unlock(&mm->i915->mm_lock);
-	up_write(&mm->mm->mmap_sem);
+	mmap_write_unlock(mm->mm);
 
 	if (mn && !IS_ERR(mn))
 		kfree(mn);
@@ -468,7 +468,7 @@ __i915_gem_userptr_get_pages_worker(stru
 		if (mmget_not_zero(mm)) {
 			while (pinned < npages) {
 				if (!locked) {
-					down_read(&mm->mmap_sem);
+					mmap_read_lock(mm);
 					locked = 1;
 				}
 				ret = pin_user_pages_remote
@@ -483,7 +483,7 @@ __i915_gem_userptr_get_pages_worker(stru
 				pinned += ret;
 			}
 			if (locked)
-				up_read(&mm->mmap_sem);
+				mmap_read_unlock(mm);
 			mmput(mm);
 		}
 	}
--- a/drivers/gpu/drm/nouveau/nouveau_svm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/nouveau/nouveau_svm.c
@@ -175,10 +175,10 @@ nouveau_svmm_bind(struct drm_device *dev
 	 */
 
 	mm = get_task_mm(current);
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	if (!cli->svm.svmm) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		return -EINVAL;
 	}
 
@@ -205,7 +205,7 @@ nouveau_svmm_bind(struct drm_device *dev
 	 */
 	args->result = 0;
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 
 	return 0;
@@ -355,7 +355,7 @@ nouveau_svmm_init(struct drm_device *dev
 	if (ret)
 		goto out_free;
 
-	down_write(&current->mm->mmap_sem);
+	mmap_write_lock(current->mm);
 	svmm->notifier.ops = &nouveau_mn_ops;
 	ret = __mmu_notifier_register(&svmm->notifier, current->mm);
 	if (ret)
@@ -364,12 +364,12 @@ nouveau_svmm_init(struct drm_device *dev
 
 	cli->svm.svmm = svmm;
 	cli->svm.cli = cli;
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	mutex_unlock(&cli->mutex);
 	return 0;
 
 out_mm_unlock:
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 out_free:
 	mutex_unlock(&cli->mutex);
 	kfree(svmm);
@@ -571,9 +571,9 @@ static int nouveau_range_fault(struct no
 			return -EBUSY;
 
 		range.notifier_seq = mmu_interval_read_begin(range.notifier);
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		ret = hmm_range_fault(&range);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		if (ret) {
 			/*
 			 * FIXME: the input PFN_REQ flags are destroyed on
@@ -705,18 +705,18 @@ nouveau_svm_fault(struct nvif_notify *no
 		/* Intersect fault window with the CPU VMA, cancelling
 		 * the fault if the address is invalid.
 		 */
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		vma = find_vma_intersection(mm, start, limit);
 		if (!vma) {
 			SVMM_ERR(svmm, "wndw %016llx-%016llx", start, limit);
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			mmput(mm);
 			nouveau_svm_fault_cancel_fault(svm, buffer->fault[fi]);
 			continue;
 		}
 		start = max_t(u64, start, vma->vm_start);
 		limit = min_t(u64, limit, vma->vm_end);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		SVMM_DBG(svmm, "wndw %016llx-%016llx", start, limit);
 
 		if (buffer->fault[fi]->addr != start) {
--- a/drivers/gpu/drm/radeon/radeon_cs.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/radeon/radeon_cs.c
@@ -196,12 +196,12 @@ static int radeon_cs_parser_relocs(struc
 		p->vm_bos = radeon_vm_get_bos(p->rdev, p->ib.vm,
 					      &p->validated);
 	if (need_mmap_lock)
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 
 	r = radeon_bo_list_validate(p->rdev, &p->ticket, &p->validated, p->ring);
 
 	if (need_mmap_lock)
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 
 	return r;
 }
--- a/drivers/gpu/drm/radeon/radeon_gem.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/radeon/radeon_gem.c
@@ -342,17 +342,17 @@ int radeon_gem_userptr_ioctl(struct drm_
 	}
 
 	if (args->flags & RADEON_GEM_USERPTR_VALIDATE) {
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		r = radeon_bo_reserve(bo, true);
 		if (r) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			goto release_object;
 		}
 
 		radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_GTT);
 		r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
 		radeon_bo_unreserve(bo);
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		if (r)
 			goto release_object;
 	}
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -68,7 +68,7 @@ static vm_fault_t ttm_bo_vm_fault_idle(s
 			goto out_unlock;
 
 		ttm_bo_get(bo);
-		up_read(&vmf->vma->vm_mm->mmap_sem);
+		mmap_read_unlock(vmf->vma->vm_mm);
 		(void) dma_fence_wait(bo->moving, true);
 		dma_resv_unlock(bo->base.resv);
 		ttm_bo_put(bo);
@@ -144,7 +144,7 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_
 		if (fault_flag_allow_retry_first(vmf->flags)) {
 			if (!(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
 				ttm_bo_get(bo);
-				up_read(&vmf->vma->vm_mm->mmap_sem);
+				mmap_read_unlock(vmf->vma->vm_mm);
 				if (!dma_resv_lock_interruptible(bo->base.resv,
 								 NULL))
 					dma_resv_unlock(bo->base.resv);
--- a/drivers/infiniband/core/umem_odp.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/infiniband/core/umem_odp.c
@@ -429,7 +429,7 @@ int ib_umem_odp_map_dma_pages(struct ib_
 				ALIGN(bcnt, PAGE_SIZE) / PAGE_SIZE,
 				PAGE_SIZE / sizeof(struct page *));
 
-		down_read(&owning_mm->mmap_sem);
+		mmap_read_lock(owning_mm);
 		/*
 		 * Note: this might result in redundent page getting. We can
 		 * avoid this by checking dma_list to be 0 before calling
@@ -440,7 +440,7 @@ int ib_umem_odp_map_dma_pages(struct ib_
 		npages = get_user_pages_remote(owning_process, owning_mm,
 				user_virt, gup_num_pages,
 				flags, local_page_list, NULL, NULL);
-		up_read(&owning_mm->mmap_sem);
+		mmap_read_unlock(owning_mm);
 
 		if (npages < 0) {
 			if (npages != -EAGAIN)
--- a/drivers/infiniband/core/uverbs_main.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/infiniband/core/uverbs_main.c
@@ -840,7 +840,7 @@ void uverbs_user_mmap_disassociate(struc
 		 * at a time to get the lock ordering right. Typically there
 		 * will only be one mm, so no big deal.
 		 */
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		if (!mmget_still_valid(mm))
 			goto skip_mm;
 		mutex_lock(&ufile->umap_lock);
@@ -862,7 +862,7 @@ void uverbs_user_mmap_disassociate(struc
 		}
 		mutex_unlock(&ufile->umap_lock);
 	skip_mm:
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		mmput(mm);
 	}
 }
--- a/drivers/infiniband/hw/mlx4/mr.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/infiniband/hw/mlx4/mr.c
@@ -380,7 +380,7 @@ static struct ib_umem *mlx4_get_umem_mr(
 		unsigned long untagged_start = untagged_addr(start);
 		struct vm_area_struct *vma;
 
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		/*
 		 * FIXME: Ideally this would iterate over all the vmas that
 		 * cover the memory, but for now it requires a single vma to
@@ -395,7 +395,7 @@ static struct ib_umem *mlx4_get_umem_mr(
 			access_flags |= IB_ACCESS_LOCAL_WRITE;
 		}
 
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	}
 
 	return ib_umem_get(device, start, length, access_flags);
--- a/drivers/infiniband/hw/qib/qib_user_pages.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/infiniband/hw/qib/qib_user_pages.c
@@ -106,18 +106,18 @@ int qib_get_user_pages(unsigned long sta
 		goto bail;
 	}
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	for (got = 0; got < num_pages; got += ret) {
 		ret = pin_user_pages(start_page + got * PAGE_SIZE,
 				     num_pages - got,
 				     FOLL_LONGTERM | FOLL_WRITE | FOLL_FORCE,
 				     p + got, NULL);
 		if (ret < 0) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			goto bail_release;
 		}
 	}
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	return 0;
 bail_release:
--- a/drivers/infiniband/hw/usnic/usnic_uiom.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/infiniband/hw/usnic/usnic_uiom.c
@@ -123,7 +123,7 @@ static int usnic_uiom_get_pages(unsigned
 	npages = PAGE_ALIGN(size + (addr & ~PAGE_MASK)) >> PAGE_SHIFT;
 
 	uiomr->owning_mm = mm = current->mm;
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	locked = atomic64_add_return(npages, &current->mm->pinned_vm);
 	lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
@@ -187,7 +187,7 @@ out:
 	} else
 		mmgrab(uiomr->owning_mm);
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	free_page((unsigned long) page_list);
 	return ret;
 }
--- a/drivers/infiniband/sw/siw/siw_mem.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/infiniband/sw/siw/siw_mem.c
@@ -394,7 +394,7 @@ struct siw_umem *siw_umem_get(u64 start,
 	if (!writable)
 		foll_flags |= FOLL_FORCE;
 
-	down_read(&mm_s->mmap_sem);
+	mmap_read_lock(mm_s);
 
 	mlock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
 
@@ -438,7 +438,7 @@ struct siw_umem *siw_umem_get(u64 start,
 		num_pages -= got;
 	}
 out_sem_up:
-	up_read(&mm_s->mmap_sem);
+	mmap_read_unlock(mm_s);
 
 	if (rv > 0)
 		return umem;
--- a/drivers/iommu/amd_iommu_v2.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/iommu/amd_iommu_v2.c
@@ -485,7 +485,7 @@ static void do_fault(struct work_struct
 		flags |= FAULT_FLAG_WRITE;
 	flags |= FAULT_FLAG_REMOTE;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_extend_vma(mm, address);
 	if (!vma || address < vma->vm_start)
 		/* failed to get a vma in the right range */
@@ -497,7 +497,7 @@ static void do_fault(struct work_struct
 
 	ret = handle_mm_fault(vma, address, flags);
 out:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	if (ret & VM_FAULT_ERROR)
 		/* failed to service fault */
--- a/drivers/iommu/intel-svm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/iommu/intel-svm.c
@@ -863,7 +863,7 @@ static irqreturn_t prq_event_thread(int
 		if (!mmget_not_zero(svm->mm))
 			goto bad_req;
 
-		down_read(&svm->mm->mmap_sem);
+		mmap_read_lock(svm->mm);
 		vma = find_extend_vma(svm->mm, address);
 		if (!vma || address < vma->vm_start)
 			goto invalid;
@@ -878,7 +878,7 @@ static irqreturn_t prq_event_thread(int
 
 		result = QI_RESP_SUCCESS;
 	invalid:
-		up_read(&svm->mm->mmap_sem);
+		mmap_read_unlock(svm->mm);
 		mmput(svm->mm);
 	bad_req:
 		/* Accounting for major/minor faults? */
--- a/drivers/media/v4l2-core/videobuf-core.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/media/v4l2-core/videobuf-core.c
@@ -535,7 +535,7 @@ int videobuf_qbuf(struct videobuf_queue
 	MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
 
 	if (b->memory == V4L2_MEMORY_MMAP)
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 
 	videobuf_queue_lock(q);
 	retval = -EBUSY;
@@ -622,7 +622,7 @@ done:
 	videobuf_queue_unlock(q);
 
 	if (b->memory == V4L2_MEMORY_MMAP)
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 
 	return retval;
 }
--- a/drivers/media/v4l2-core/videobuf-dma-contig.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/media/v4l2-core/videobuf-dma-contig.c
@@ -169,7 +169,7 @@ static int videobuf_dma_contig_user_get(
 	mem->size = PAGE_ALIGN(vb->size + offset);
 	ret = -EINVAL;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	vma = find_vma(mm, untagged_baddr);
 	if (!vma)
@@ -201,7 +201,7 @@ static int videobuf_dma_contig_user_get(
 	}
 
 out_up:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	return ret;
 }
--- a/drivers/media/v4l2-core/videobuf-dma-sg.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/media/v4l2-core/videobuf-dma-sg.c
@@ -200,9 +200,9 @@ static int videobuf_dma_init_user(struct
 {
 	int ret;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	ret = videobuf_dma_init_user_locked(dma, direction, data, size);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	return ret;
 }
--- a/drivers/misc/cxl/cxllib.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/misc/cxl/cxllib.c
@@ -207,7 +207,7 @@ static int get_vma_info(struct mm_struct
 	struct vm_area_struct *vma = NULL;
 	int rc = 0;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	vma = find_vma(mm, addr);
 	if (!vma) {
@@ -218,7 +218,7 @@ static int get_vma_info(struct mm_struct
 	*vma_start = vma->vm_start;
 	*vma_end = vma->vm_end;
 out:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return rc;
 }
 
--- a/drivers/misc/cxl/fault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/misc/cxl/fault.c
@@ -321,7 +321,7 @@ static void cxl_prefault_vma(struct cxl_
 		return;
 	}
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		for (ea = vma->vm_start; ea < vma->vm_end;
 				ea = next_segment(ea, slb.vsid)) {
@@ -336,7 +336,7 @@ static void cxl_prefault_vma(struct cxl_
 			last_esid = slb.esid;
 		}
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	mmput(mm);
 }
--- a/drivers/misc/sgi-gru/grufault.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/misc/sgi-gru/grufault.c
@@ -68,14 +68,14 @@ static struct gru_thread_state *gru_find
 	struct vm_area_struct *vma;
 	struct gru_thread_state *gts = NULL;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = gru_find_vma(vaddr);
 	if (vma)
 		gts = gru_find_thread_state(vma, TSID(vaddr, vma));
 	if (gts)
 		mutex_lock(&gts->ts_ctxlock);
 	else
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	return gts;
 }
 
@@ -85,7 +85,7 @@ static struct gru_thread_state *gru_allo
 	struct vm_area_struct *vma;
 	struct gru_thread_state *gts = ERR_PTR(-EINVAL);
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	vma = gru_find_vma(vaddr);
 	if (!vma)
 		goto err;
@@ -94,11 +94,11 @@ static struct gru_thread_state *gru_allo
 	if (IS_ERR(gts))
 		goto err;
 	mutex_lock(&gts->ts_ctxlock);
-	downgrade_write(&mm->mmap_sem);
+	mmap_write_downgrade(mm);
 	return gts;
 
 err:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return gts;
 }
 
@@ -108,7 +108,7 @@ err:
 static void gru_unlock_gts(struct gru_thread_state *gts)
 {
 	mutex_unlock(&gts->ts_ctxlock);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 }
 
 /*
@@ -574,9 +574,9 @@ static irqreturn_t gru_intr(int chiplet,
 		 */
 		gts->ustats.fmm_tlbmiss++;
 		if (!gts->ts_force_cch_reload &&
-					down_read_trylock(&gts->ts_mm->mmap_sem)) {
+					mmap_read_trylock(gts->ts_mm)) {
 			gru_try_dropin(gru, gts, tfh, NULL);
-			up_read(&gts->ts_mm->mmap_sem);
+			mmap_read_unlock(gts->ts_mm);
 		} else {
 			tfh_user_polling_mode(tfh);
 			STAT(intr_mm_lock_failed);
--- a/drivers/misc/sgi-gru/grufile.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/misc/sgi-gru/grufile.c
@@ -135,7 +135,7 @@ static int gru_create_new_context(unsign
 	if (!(req.options & GRU_OPT_MISS_MASK))
 		req.options |= GRU_OPT_MISS_FMM_INTR;
 
-	down_write(&current->mm->mmap_sem);
+	mmap_write_lock(current->mm);
 	vma = gru_find_vma(req.gseg);
 	if (vma) {
 		vdata = vma->vm_private_data;
@@ -146,7 +146,7 @@ static int gru_create_new_context(unsign
 		vdata->vd_tlb_preload_count = req.tlb_preload_count;
 		ret = 0;
 	}
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 
 	return ret;
 }
--- a/drivers/oprofile/buffer_sync.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/oprofile/buffer_sync.c
@@ -91,11 +91,11 @@ munmap_notify(struct notifier_block *sel
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *mpnt;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	mpnt = find_vma(mm, addr);
 	if (mpnt && mpnt->vm_file && (mpnt->vm_flags & VM_EXEC)) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		/* To avoid latency problems, we only process the current CPU,
 		 * hoping that most samples for the task are on this CPU
 		 */
@@ -103,7 +103,7 @@ munmap_notify(struct notifier_block *sel
 		return 0;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return 0;
 }
 
@@ -256,7 +256,7 @@ lookup_dcookie(struct mm_struct *mm, uns
 	unsigned long cookie = NO_COOKIE;
 	struct vm_area_struct *vma;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) {
 
 		if (addr < vma->vm_start || addr >= vma->vm_end)
@@ -276,7 +276,7 @@ lookup_dcookie(struct mm_struct *mm, uns
 
 	if (!vma)
 		cookie = INVALID_COOKIE;
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return cookie;
 }
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -75,9 +75,9 @@ static int kpc_dma_transfer(struct dev_p
 	}
 
 	// Lock the user buffer pages in memory, and hold on to the page pointers (for the sglist)
-	down_read(&current->mm->mmap_sem);      /*  get memory map semaphore */
+	mmap_read_lock(current->mm);      /*  get memory map semaphore */
 	rv = get_user_pages(iov_base, acd->page_count, FOLL_TOUCH | FOLL_WRITE | FOLL_GET, acd->user_pages, NULL);
-	up_read(&current->mm->mmap_sem);        /*  release the semaphore */
+	mmap_read_unlock(current->mm);        /*  release the semaphore */
 	if (rv != acd->page_count) {
 		dev_err(&priv->ldev->pldev->dev, "Couldn't get_user_pages (%ld)\n", rv);
 		goto err_get_user_pages;
--- a/drivers/tee/optee/call.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/tee/optee/call.c
@@ -565,10 +565,10 @@ static int check_mem_type(unsigned long
 	if (virt_addr_valid(start))
 		return 0;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	rc = __check_mem_type(find_vma(mm, start),
 			      start + num_pages * PAGE_SIZE);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return rc;
 }
--- a/drivers/vfio/vfio_iommu_type1.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/vfio/vfio_iommu_type1.c
@@ -376,11 +376,11 @@ static int vfio_lock_acct(struct vfio_dm
 	if (!mm)
 		return -ESRCH; /* process exited */
 
-	ret = down_write_killable(&mm->mmap_sem);
+	ret = mmap_write_lock_killable(mm);
 	if (!ret) {
 		ret = __account_locked_vm(mm, abs(npage), npage > 0, dma->task,
 					  dma->lock_cap);
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 	}
 
 	if (async)
@@ -452,7 +452,7 @@ static int vaddr_get_pfn(struct mm_struc
 	if (prot & IOMMU_WRITE)
 		flags |= FOLL_WRITE;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	ret = pin_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM,
 				    page, NULL, NULL);
 	if (ret == 1) {
@@ -475,7 +475,7 @@ retry:
 			ret = -EFAULT;
 	}
 done:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return ret;
 }
 
--- a/drivers/vhost/vdpa.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/vhost/vdpa.c
@@ -527,7 +527,7 @@ static int vhost_vdpa_process_iotlb_upda
 	if (!npages)
 		return -EINVAL;
 
-	down_read(&dev->mm->mmap_sem);
+	mmap_read_lock(dev->mm);
 
 	locked = atomic64_add_return(npages, &dev->mm->pinned_vm);
 	lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
@@ -580,7 +580,7 @@ out:
 		vhost_vdpa_unmap(v, msg->iova, msg->size);
 		atomic64_sub(npages, &dev->mm->pinned_vm);
 	}
-	up_read(&dev->mm->mmap_sem);
+	mmap_read_unlock(dev->mm);
 	free_page((unsigned long)page_list);
 	return ret;
 }
--- a/drivers/xen/gntdev.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/xen/gntdev.c
@@ -625,7 +625,7 @@ static long gntdev_ioctl_get_offset_for_
 		return -EFAULT;
 	pr_debug("priv %p, offset for vaddr %lx\n", priv, (unsigned long)op.vaddr);
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	vma = find_vma(current->mm, op.vaddr);
 	if (!vma || vma->vm_ops != &gntdev_vmops)
 		goto out_unlock;
@@ -639,7 +639,7 @@ static long gntdev_ioctl_get_offset_for_
 	rv = 0;
 
  out_unlock:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	if (rv == 0 && copy_to_user(u, &op, sizeof(op)) != 0)
 		return -EFAULT;
--- a/drivers/xen/privcmd.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/drivers/xen/privcmd.c
@@ -276,7 +276,7 @@ static long privcmd_ioctl_mmap(struct fi
 	if (rc || list_empty(&pagelist))
 		goto out;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	{
 		struct page *page = list_first_entry(&pagelist,
@@ -301,7 +301,7 @@ static long privcmd_ioctl_mmap(struct fi
 
 
 out_up:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 out:
 	free_page_list(&pagelist);
@@ -497,7 +497,7 @@ static long privcmd_ioctl_mmap_batch(
 		}
 	}
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	vma = find_vma(mm, m.addr);
 	if (!vma ||
@@ -553,7 +553,7 @@ static long privcmd_ioctl_mmap_batch(
 	BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
 				    &pagelist, mmap_batch_fn, &state));
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	if (state.global_error) {
 		/* Write back errors in second pass. */
@@ -574,7 +574,7 @@ out:
 	return ret;
 
 out_unlock:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	goto out;
 }
 
@@ -739,7 +739,7 @@ static long privcmd_ioctl_mmap_resource(
 	if (data->domid != DOMID_INVALID && data->domid != kdata.dom)
 		return -EPERM;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 
 	vma = find_vma(mm, kdata.addr);
 	if (!vma || vma->vm_ops != &privcmd_vm_ops) {
@@ -818,7 +818,7 @@ static long privcmd_ioctl_mmap_resource(
 	}
 
 out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	kfree(pfns);
 
 	return rc;
--- a/fs/aio.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/aio.c
@@ -520,7 +520,7 @@ static int aio_setup_ring(struct kioctx
 	ctx->mmap_size = nr_pages * PAGE_SIZE;
 	pr_debug("attempting mmap of %lu bytes\n", ctx->mmap_size);
 
-	if (down_write_killable(&mm->mmap_sem)) {
+	if (mmap_write_lock_killable(mm)) {
 		ctx->mmap_size = 0;
 		aio_free_ring(ctx);
 		return -EINTR;
@@ -529,7 +529,7 @@ static int aio_setup_ring(struct kioctx
 	ctx->mmap_base = do_mmap_pgoff(ctx->aio_ring_file, 0, ctx->mmap_size,
 				       PROT_READ | PROT_WRITE,
 				       MAP_SHARED, 0, &unused, NULL);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	if (IS_ERR((void *)ctx->mmap_base)) {
 		ctx->mmap_size = 0;
 		aio_free_ring(ctx);
--- a/fs/coredump.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/coredump.c
@@ -445,12 +445,12 @@ static int coredump_wait(int exit_code,
 	core_state->dumper.task = tsk;
 	core_state->dumper.next = NULL;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	if (!mm->core_state)
 		core_waiters = zap_threads(tsk, mm, core_state, exit_code);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	if (core_waiters > 0) {
 		struct core_thread *ptr;
--- a/fs/exec.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/exec.c
@@ -252,7 +252,7 @@ static int __bprm_mm_init(struct linux_b
 		return -ENOMEM;
 	vma_set_anonymous(vma);
 
-	if (down_write_killable(&mm->mmap_sem)) {
+	if (mmap_write_lock_killable(mm)) {
 		err = -EINTR;
 		goto err_free;
 	}
@@ -274,11 +274,11 @@ static int __bprm_mm_init(struct linux_b
 		goto err;
 
 	mm->stack_vm = mm->total_vm = 1;
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	bprm->p = vma->vm_end - sizeof(void *);
 	return 0;
 err:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 err_free:
 	bprm->vma = NULL;
 	vm_area_free(vma);
@@ -763,7 +763,7 @@ int setup_arg_pages(struct linux_binprm
 		bprm->loader -= stack_shift;
 	bprm->exec -= stack_shift;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	vm_flags = VM_STACK_FLAGS;
@@ -825,7 +825,7 @@ int setup_arg_pages(struct linux_binprm
 		ret = -EFAULT;
 
 out_unlock:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 EXPORT_SYMBOL(setup_arg_pages);
@@ -1094,9 +1094,9 @@ static int exec_mmap(struct mm_struct *m
 		 * through with the exec.  We must hold mmap_sem around
 		 * checking core_state and changing tsk->mm.
 		 */
-		down_read(&old_mm->mmap_sem);
+		mmap_read_lock(old_mm);
 		if (unlikely(old_mm->core_state)) {
-			up_read(&old_mm->mmap_sem);
+			mmap_read_unlock(old_mm);
 			mutex_unlock(&tsk->signal->exec_update_mutex);
 			return -EINTR;
 		}
@@ -1112,7 +1112,7 @@ static int exec_mmap(struct mm_struct *m
 	vmacache_flush(tsk);
 	task_unlock(tsk);
 	if (old_mm) {
-		up_read(&old_mm->mmap_sem);
+		mmap_read_unlock(old_mm);
 		BUG_ON(active_mm != old_mm);
 		setmax_mm_hiwater_rss(&tsk->signal->maxrss, old_mm);
 		mm_update_next_owner(old_mm);
--- a/fs/io_uring.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/io_uring.c
@@ -7186,7 +7186,7 @@ static int io_sqe_buffer_register(struct
 		}
 
 		ret = 0;
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		pret = pin_user_pages(ubuf, nr_pages,
 				      FOLL_WRITE | FOLL_LONGTERM,
 				      pages, vmas);
@@ -7204,7 +7204,7 @@ static int io_sqe_buffer_register(struct
 		} else {
 			ret = pret < 0 ? pret : -EFAULT;
 		}
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		if (ret) {
 			/*
 			 * if we did partial map, or found file backed vmas,
--- a/fs/proc/base.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/proc/base.c
@@ -2112,11 +2112,11 @@ static int map_files_d_revalidate(struct
 		goto out;
 
 	if (!dname_to_vma_addr(dentry, &vm_start, &vm_end)) {
-		status = down_read_killable(&mm->mmap_sem);
+		status = mmap_read_lock_killable(mm);
 		if (!status) {
 			exact_vma_exists = !!find_exact_vma(mm, vm_start,
 							    vm_end);
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 		}
 	}
 
@@ -2163,7 +2163,7 @@ static int map_files_get_link(struct den
 	if (rc)
 		goto out_mmput;
 
-	rc = down_read_killable(&mm->mmap_sem);
+	rc = mmap_read_lock_killable(mm);
 	if (rc)
 		goto out_mmput;
 
@@ -2174,7 +2174,7 @@ static int map_files_get_link(struct den
 		path_get(path);
 		rc = 0;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 out_mmput:
 	mmput(mm);
@@ -2264,7 +2264,7 @@ static struct dentry *proc_map_files_loo
 		goto out_put_task;
 
 	result = ERR_PTR(-EINTR);
-	if (down_read_killable(&mm->mmap_sem))
+	if (mmap_read_lock_killable(mm))
 		goto out_put_mm;
 
 	result = ERR_PTR(-ENOENT);
@@ -2277,7 +2277,7 @@ static struct dentry *proc_map_files_loo
 				(void *)(unsigned long)vma->vm_file->f_mode);
 
 out_no_vma:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 out_put_mm:
 	mmput(mm);
 out_put_task:
--- a/fs/proc/task_mmu.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/proc/task_mmu.c
@@ -145,7 +145,7 @@ static void *m_start(struct seq_file *m,
 		return NULL;
 	}
 
-	if (down_read_killable(&mm->mmap_sem)) {
+	if (mmap_read_lock_killable(mm)) {
 		mmput(mm);
 		put_task_struct(priv->task);
 		priv->task = NULL;
@@ -188,7 +188,7 @@ static void m_stop(struct seq_file *m, v
 		return;
 
 	release_task_mempolicy(priv);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 	put_task_struct(priv->task);
 	priv->task = NULL;
@@ -847,7 +847,7 @@ static int show_smaps_rollup(struct seq_
 
 	memset(&mss, 0, sizeof(mss));
 
-	ret = down_read_killable(&mm->mmap_sem);
+	ret = mmap_read_lock_killable(mm);
 	if (ret)
 		goto out_put_mm;
 
@@ -866,7 +866,7 @@ static int show_smaps_rollup(struct seq_
 	__show_smap(m, &mss, true);
 
 	release_task_mempolicy(priv);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 out_put_mm:
 	mmput(mm);
@@ -1140,7 +1140,7 @@ static ssize_t clear_refs_write(struct f
 		};
 
 		if (type == CLEAR_REFS_MM_HIWATER_RSS) {
-			if (down_write_killable(&mm->mmap_sem)) {
+			if (mmap_write_lock_killable(mm)) {
 				count = -EINTR;
 				goto out_mm;
 			}
@@ -1150,11 +1150,11 @@ static ssize_t clear_refs_write(struct f
 			 * resident set size to this mm's current rss value.
 			 */
 			reset_mm_hiwater_rss(mm);
-			up_write(&mm->mmap_sem);
+			mmap_write_unlock(mm);
 			goto out_mm;
 		}
 
-		if (down_read_killable(&mm->mmap_sem)) {
+		if (mmap_read_lock_killable(mm)) {
 			count = -EINTR;
 			goto out_mm;
 		}
@@ -1163,8 +1163,8 @@ static ssize_t clear_refs_write(struct f
 			for (vma = mm->mmap; vma; vma = vma->vm_next) {
 				if (!(vma->vm_flags & VM_SOFTDIRTY))
 					continue;
-				up_read(&mm->mmap_sem);
-				if (down_write_killable(&mm->mmap_sem)) {
+				mmap_read_unlock(mm);
+				if (mmap_write_lock_killable(mm)) {
 					count = -EINTR;
 					goto out_mm;
 				}
@@ -1183,14 +1183,14 @@ static ssize_t clear_refs_write(struct f
 					 * failed like if
 					 * get_proc_task() fails?
 					 */
-					up_write(&mm->mmap_sem);
+					mmap_write_unlock(mm);
 					goto out_mm;
 				}
 				for (vma = mm->mmap; vma; vma = vma->vm_next) {
 					vma->vm_flags &= ~VM_SOFTDIRTY;
 					vma_set_page_prot(vma);
 				}
-				downgrade_write(&mm->mmap_sem);
+				mmap_write_downgrade(mm);
 				break;
 			}
 
@@ -1203,7 +1203,7 @@ static ssize_t clear_refs_write(struct f
 		if (type == CLEAR_REFS_SOFT_DIRTY)
 			mmu_notifier_invalidate_range_end(&range);
 		tlb_finish_mmu(&tlb, 0, -1);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 out_mm:
 		mmput(mm);
 	}
@@ -1564,11 +1564,11 @@ static ssize_t pagemap_read(struct file
 		/* overflow ? */
 		if (end < start_vaddr || end > end_vaddr)
 			end = end_vaddr;
-		ret = down_read_killable(&mm->mmap_sem);
+		ret = mmap_read_lock_killable(mm);
 		if (ret)
 			goto out_free;
 		ret = walk_page_range(mm, start_vaddr, end, &pagemap_ops, &pm);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		start_vaddr = end;
 
 		len = min(count, PM_ENTRY_BYTES * pm.pos);
--- a/fs/proc/task_nommu.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/proc/task_nommu.c
@@ -25,7 +25,7 @@ void task_mem(struct seq_file *m, struct
 	struct rb_node *p;
 	unsigned long bytes = 0, sbytes = 0, slack = 0, size;
         
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (p = rb_first(&mm->mm_rb); p; p = rb_next(p)) {
 		vma = rb_entry(p, struct vm_area_struct, vm_rb);
 
@@ -77,7 +77,7 @@ void task_mem(struct seq_file *m, struct
 		"Shared:\t%8lu bytes\n",
 		bytes, slack, sbytes);
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 }
 
 unsigned long task_vsize(struct mm_struct *mm)
@@ -86,12 +86,12 @@ unsigned long task_vsize(struct mm_struc
 	struct rb_node *p;
 	unsigned long vsize = 0;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (p = rb_first(&mm->mm_rb); p; p = rb_next(p)) {
 		vma = rb_entry(p, struct vm_area_struct, vm_rb);
 		vsize += vma->vm_end - vma->vm_start;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return vsize;
 }
 
@@ -104,7 +104,7 @@ unsigned long task_statm(struct mm_struc
 	struct rb_node *p;
 	unsigned long size = kobjsize(mm);
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (p = rb_first(&mm->mm_rb); p; p = rb_next(p)) {
 		vma = rb_entry(p, struct vm_area_struct, vm_rb);
 		size += kobjsize(vma);
@@ -119,7 +119,7 @@ unsigned long task_statm(struct mm_struc
 		>> PAGE_SHIFT;
 	*data = (PAGE_ALIGN(mm->start_stack) - (mm->start_data & PAGE_MASK))
 		>> PAGE_SHIFT;
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	size >>= PAGE_SHIFT;
 	size += *text + *data;
 	*resident = size;
@@ -211,7 +211,7 @@ static void *m_start(struct seq_file *m,
 	if (!mm || !mmget_not_zero(mm))
 		return NULL;
 
-	if (down_read_killable(&mm->mmap_sem)) {
+	if (mmap_read_lock_killable(mm)) {
 		mmput(mm);
 		return ERR_PTR(-EINTR);
 	}
@@ -221,7 +221,7 @@ static void *m_start(struct seq_file *m,
 		if (n-- == 0)
 			return p;
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 	return NULL;
 }
@@ -231,7 +231,7 @@ static void m_stop(struct seq_file *m, v
 	struct proc_maps_private *priv = m->private;
 
 	if (!IS_ERR_OR_NULL(_vml)) {
-		up_read(&priv->mm->mmap_sem);
+		mmap_read_unlock(priv->mm);
 		mmput(priv->mm);
 	}
 	if (priv->task) {
--- a/fs/userfaultfd.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/fs/userfaultfd.c
@@ -514,7 +514,7 @@ vm_fault_t handle_userfault(struct vm_fa
 		must_wait = userfaultfd_huge_must_wait(ctx, vmf->vma,
 						       vmf->address,
 						       vmf->flags, reason);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	if (likely(must_wait && !READ_ONCE(ctx->released) &&
 		   !userfaultfd_signal_pending(vmf->flags))) {
@@ -637,7 +637,7 @@ static void userfaultfd_event_wait_compl
 		struct mm_struct *mm = release_new_ctx->mm;
 
 		/* the various vma->vm_userfaultfd_ctx still points to it */
-		down_write(&mm->mmap_sem);
+		mmap_write_lock(mm);
 		/* no task can run (and in turn coredump) yet */
 		VM_WARN_ON(!mmget_still_valid(mm));
 		for (vma = mm->mmap; vma; vma = vma->vm_next)
@@ -645,7 +645,7 @@ static void userfaultfd_event_wait_compl
 				vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX;
 				vma->vm_flags &= ~(VM_UFFD_WP | VM_UFFD_MISSING);
 			}
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 
 		userfaultfd_ctx_put(release_new_ctx);
 	}
@@ -799,7 +799,7 @@ bool userfaultfd_remove(struct vm_area_s
 
 	userfaultfd_ctx_get(ctx);
 	WRITE_ONCE(ctx->mmap_changing, true);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	msg_init(&ewq.msg);
 
@@ -894,7 +894,7 @@ static int userfaultfd_release(struct in
 	 * it's critical that released is set to true (above), before
 	 * taking the mmap_sem for writing.
 	 */
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	still_valid = mmget_still_valid(mm);
 	prev = NULL;
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
@@ -920,7 +920,7 @@ static int userfaultfd_release(struct in
 		vma->vm_flags = new_flags;
 		vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX;
 	}
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	mmput(mm);
 wakeup:
 	/*
@@ -1345,7 +1345,7 @@ static int userfaultfd_register(struct u
 	if (!mmget_not_zero(mm))
 		goto out;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	if (!mmget_still_valid(mm))
 		goto out_unlock;
 	vma = find_vma_prev(mm, start, &prev);
@@ -1492,7 +1492,7 @@ static int userfaultfd_register(struct u
 		vma = vma->vm_next;
 	} while (vma && vma->vm_start < end);
 out_unlock:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	mmput(mm);
 	if (!ret) {
 		__u64 ioctls_out;
@@ -1547,7 +1547,7 @@ static int userfaultfd_unregister(struct
 	if (!mmget_not_zero(mm))
 		goto out;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	if (!mmget_still_valid(mm))
 		goto out_unlock;
 	vma = find_vma_prev(mm, start, &prev);
@@ -1664,7 +1664,7 @@ static int userfaultfd_unregister(struct
 		vma = vma->vm_next;
 	} while (vma && vma->vm_start < end);
 out_unlock:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	mmput(mm);
 out:
 	return ret;
--- a/ipc/shm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/ipc/shm.c
@@ -1544,7 +1544,7 @@ long do_shmat(int shmid, char __user *sh
 	if (err)
 		goto out_fput;
 
-	if (down_write_killable(&current->mm->mmap_sem)) {
+	if (mmap_write_lock_killable(current->mm)) {
 		err = -EINTR;
 		goto out_fput;
 	}
@@ -1564,7 +1564,7 @@ long do_shmat(int shmid, char __user *sh
 	if (IS_ERR_VALUE(addr))
 		err = (long)addr;
 invalid:
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	if (populate)
 		mm_populate(addr, populate);
 
@@ -1638,7 +1638,7 @@ long ksys_shmdt(char __user *shmaddr)
 	if (addr & ~PAGE_MASK)
 		return retval;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	/*
@@ -1726,7 +1726,7 @@ long ksys_shmdt(char __user *shmaddr)
 
 #endif
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return retval;
 }
 
--- a/kernel/acct.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/acct.c
@@ -541,13 +541,13 @@ void acct_collect(long exitcode, int gro
 	if (group_dead && current->mm) {
 		struct vm_area_struct *vma;
 
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		vma = current->mm->mmap;
 		while (vma) {
 			vsize += vma->vm_end - vma->vm_start;
 			vma = vma->vm_next;
 		}
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	}
 
 	spin_lock_irq(&current->sighand->siglock);
--- a/kernel/bpf/stackmap.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/bpf/stackmap.c
@@ -317,7 +317,7 @@ static void stack_map_get_build_id_offse
 	 * with build_id.
 	 */
 	if (!user || !current || !current->mm || irq_work_busy ||
-	    down_read_trylock(&current->mm->mmap_sem) == 0) {
+	    mmap_read_trylock(current->mm) == 0) {
 		/* cannot access current->mm, fall back to ips */
 		for (i = 0; i < trace_nr; i++) {
 			id_offs[i].status = BPF_STACK_BUILD_ID_IP;
@@ -342,7 +342,7 @@ static void stack_map_get_build_id_offse
 	}
 
 	if (!work) {
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	} else {
 		work->sem = &current->mm->mmap_sem;
 		irq_work_queue(&work->irq_work);
--- a/kernel/events/core.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/events/core.c
@@ -9784,7 +9784,7 @@ static void perf_event_addr_filters_appl
 		if (!mm)
 			goto restart;
 
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	}
 
 	raw_spin_lock_irqsave(&ifh->lock, flags);
@@ -9810,7 +9810,7 @@ static void perf_event_addr_filters_appl
 	raw_spin_unlock_irqrestore(&ifh->lock, flags);
 
 	if (ifh->nr_file_filters) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 
 		mmput(mm);
 	}
--- a/kernel/events/uprobes.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/events/uprobes.c
@@ -1058,7 +1058,7 @@ register_for_each_vma(struct uprobe *upr
 		if (err && is_register)
 			goto free;
 
-		down_write(&mm->mmap_sem);
+		mmap_write_lock(mm);
 		vma = find_vma(mm, info->vaddr);
 		if (!vma || !valid_vma(vma, is_register) ||
 		    file_inode(vma->vm_file) != uprobe->inode)
@@ -1080,7 +1080,7 @@ register_for_each_vma(struct uprobe *upr
 		}
 
  unlock:
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
  free:
 		mmput(mm);
 		info = free_map_info(info);
@@ -1235,7 +1235,7 @@ static int unapply_uprobe(struct uprobe
 	struct vm_area_struct *vma;
 	int err = 0;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		unsigned long vaddr;
 		loff_t offset;
@@ -1252,7 +1252,7 @@ static int unapply_uprobe(struct uprobe
 		vaddr = offset_to_vaddr(vma, uprobe->offset);
 		err |= remove_breakpoint(uprobe, mm, vaddr);
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return err;
 }
@@ -1439,7 +1439,7 @@ static int xol_add_vma(struct mm_struct
 	struct vm_area_struct *vma;
 	int ret;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	if (mm->uprobes_state.xol_area) {
@@ -1469,7 +1469,7 @@ static int xol_add_vma(struct mm_struct
 	/* pairs with get_xol_area() */
 	smp_store_release(&mm->uprobes_state.xol_area, area); /* ^^^ */
  fail:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	return ret;
 }
@@ -2039,7 +2039,7 @@ static struct uprobe *find_active_uprobe
 	struct uprobe *uprobe = NULL;
 	struct vm_area_struct *vma;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, bp_vaddr);
 	if (vma && vma->vm_start <= bp_vaddr) {
 		if (valid_vma(vma, false)) {
@@ -2057,7 +2057,7 @@ static struct uprobe *find_active_uprobe
 
 	if (!uprobe && test_and_clear_bit(MMF_RECALC_UPROBES, &mm->flags))
 		mmf_recalc_uprobes(mm);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return uprobe;
 }
--- a/kernel/exit.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/exit.c
@@ -445,12 +445,12 @@ static void exit_mm(void)
 	 * will increment ->nr_threads for each thread in the
 	 * group with ->mm != NULL.
 	 */
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	core_state = mm->core_state;
 	if (core_state) {
 		struct core_thread self;
 
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 
 		self.task = current;
 		self.next = xchg(&core_state->dumper.next, &self);
@@ -468,14 +468,14 @@ static void exit_mm(void)
 			freezable_schedule();
 		}
 		__set_current_state(TASK_RUNNING);
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 	}
 	mmgrab(mm);
 	BUG_ON(mm != current->active_mm);
 	/* more a memory barrier than a real lock */
 	task_lock(current);
 	current->mm = NULL;
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	enter_lazy_tlb(mm, current);
 	task_unlock(current);
 	mm_update_next_owner(mm);
--- a/kernel/fork.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/fork.c
@@ -492,7 +492,7 @@ static __latent_entropy int dup_mmap(str
 	LIST_HEAD(uf);
 
 	uprobe_start_dup_mmap();
-	if (down_write_killable(&oldmm->mmap_sem)) {
+	if (mmap_write_lock_killable(oldmm)) {
 		retval = -EINTR;
 		goto fail_uprobe_end;
 	}
@@ -617,9 +617,9 @@ static __latent_entropy int dup_mmap(str
 	/* a new mm has just been created */
 	retval = arch_dup_mmap(oldmm, mm);
 out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	flush_tlb_mm(oldmm);
-	up_write(&oldmm->mmap_sem);
+	mmap_write_unlock(oldmm);
 	dup_userfaultfd_complete(&uf);
 fail_uprobe_end:
 	uprobe_end_dup_mmap();
@@ -649,9 +649,9 @@ static inline void mm_free_pgd(struct mm
 #else
 static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 {
-	down_write(&oldmm->mmap_sem);
+	mmap_write_lock(oldmm);
 	RCU_INIT_POINTER(mm->exe_file, get_mm_exe_file(oldmm));
-	up_write(&oldmm->mmap_sem);
+	mmap_write_unlock(oldmm);
 	return 0;
 }
 #define mm_alloc_pgd(mm)	(0)
@@ -1022,7 +1022,7 @@ static struct mm_struct *mm_init(struct
 	mm->vmacache_seqnum = 0;
 	atomic_set(&mm->mm_users, 1);
 	atomic_set(&mm->mm_count, 1);
-	init_rwsem(&mm->mmap_sem);
+	mmap_init_lock(mm);
 	INIT_LIST_HEAD(&mm->mmlist);
 	mm->core_state = NULL;
 	mm_pgtables_bytes_init(mm);
--- a/kernel/futex.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/futex.c
@@ -698,10 +698,10 @@ static int fault_in_user_writeable(u32 _
 	struct mm_struct *mm = current->mm;
 	int ret;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	ret = fixup_user_fault(current, mm, (unsigned long)uaddr,
 			       FAULT_FLAG_WRITE, NULL);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return ret < 0 ? ret : 0;
 }
--- a/kernel/sched/fair.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/sched/fair.c
@@ -2770,7 +2770,7 @@ static void task_numa_work(struct callba
 		return;
 
 
-	if (!down_read_trylock(&mm->mmap_sem))
+	if (!mmap_read_trylock(mm))
 		return;
 	vma = find_vma(mm, start);
 	if (!vma) {
@@ -2838,7 +2838,7 @@ out:
 		mm->numa_scan_offset = start;
 	else
 		reset_ptenuma_scan(p);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/*
 	 * Make sure tasks use at least 32x as much time to run other code
--- a/kernel/sys.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/sys.c
@@ -1846,7 +1846,7 @@ static int prctl_set_mm_exe_file(struct
 	if (exe_file) {
 		struct vm_area_struct *vma;
 
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		for (vma = mm->mmap; vma; vma = vma->vm_next) {
 			if (!vma->vm_file)
 				continue;
@@ -1855,7 +1855,7 @@ static int prctl_set_mm_exe_file(struct
 				goto exit_err;
 		}
 
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		fput(exe_file);
 	}
 
@@ -1869,7 +1869,7 @@ exit:
 	fdput(exe);
 	return err;
 exit_err:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	fput(exe_file);
 	goto exit;
 }
@@ -2010,7 +2010,7 @@ static int prctl_set_mm_map(int opt, con
 	 * arg_lock protects concurent updates but we still need mmap_sem for
 	 * read to exclude races with sys_brk.
 	 */
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	/*
 	 * We don't validate if these members are pointing to
@@ -2049,7 +2049,7 @@ static int prctl_set_mm_map(int opt, con
 	if (prctl_map.auxv_size)
 		memcpy(mm->saved_auxv, user_auxv, sizeof(user_auxv));
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return 0;
 }
 #endif /* CONFIG_CHECKPOINT_RESTORE */
@@ -2125,7 +2125,7 @@ static int prctl_set_mm(int opt, unsigne
 	 * mmap_sem for a) concurrent sys_brk, b) finding VMA for addr
 	 * validation.
 	 */
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, addr);
 
 	spin_lock(&mm->arg_lock);
@@ -2217,7 +2217,7 @@ static int prctl_set_mm(int opt, unsigne
 	error = 0;
 out:
 	spin_unlock(&mm->arg_lock);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return error;
 }
 
@@ -2442,13 +2442,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsi
 	case PR_SET_THP_DISABLE:
 		if (arg3 || arg4 || arg5)
 			return -EINVAL;
-		if (down_write_killable(&me->mm->mmap_sem))
+		if (mmap_write_lock_killable(me->mm))
 			return -EINTR;
 		if (arg2)
 			set_bit(MMF_DISABLE_THP, &me->mm->flags);
 		else
 			clear_bit(MMF_DISABLE_THP, &me->mm->flags);
-		up_write(&me->mm->mmap_sem);
+		mmap_write_unlock(me->mm);
 		break;
 	case PR_MPX_ENABLE_MANAGEMENT:
 	case PR_MPX_DISABLE_MANAGEMENT:
--- a/kernel/trace/trace_output.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/kernel/trace/trace_output.c
@@ -393,7 +393,7 @@ static int seq_print_user_ip(struct trac
 	if (mm) {
 		const struct vm_area_struct *vma;
 
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		vma = find_vma(mm, ip);
 		if (vma) {
 			file = vma->vm_file;
@@ -405,7 +405,7 @@ static int seq_print_user_ip(struct trac
 				trace_seq_printf(s, "[+0x%lx]",
 						 ip - vmstart);
 		}
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	}
 	if (ret && ((sym_flags & TRACE_ITER_SYM_ADDR) || !file))
 		trace_seq_printf(s, " <" IP_FMT ">", ip);
--- a/lib/test_lockup.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/lib/test_lockup.c
@@ -193,9 +193,9 @@ static void test_lock(bool master, bool
 		if (verbose)
 			pr_notice("lock mmap_sem pid=%d\n", main_task->pid);
 		if (lock_read)
-			down_read(&main_task->mm->mmap_sem);
+			mmap_read_lock(main_task->mm);
 		else
-			down_write(&main_task->mm->mmap_sem);
+			mmap_write_lock(main_task->mm);
 	}
 
 	if (test_disable_irq)
@@ -276,9 +276,9 @@ static void test_unlock(bool master, boo
 
 	if (lock_mmap_sem && master) {
 		if (lock_read)
-			up_read(&main_task->mm->mmap_sem);
+			mmap_read_unlock(main_task->mm);
 		else
-			up_write(&main_task->mm->mmap_sem);
+			mmap_write_unlock(main_task->mm);
 		if (verbose)
 			pr_notice("unlock mmap_sem pid=%d\n", main_task->pid);
 	}
--- a/mm/filemap.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/filemap.c
@@ -1391,7 +1391,7 @@ int __lock_page_or_retry(struct page *pa
 		if (flags & FAULT_FLAG_RETRY_NOWAIT)
 			return 0;
 
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		if (flags & FAULT_FLAG_KILLABLE)
 			wait_on_page_locked_killable(page);
 		else
@@ -1403,7 +1403,7 @@ int __lock_page_or_retry(struct page *pa
 
 			ret = __lock_page_killable(page);
 			if (ret) {
-				up_read(&mm->mmap_sem);
+				mmap_read_unlock(mm);
 				return 0;
 			}
 		} else
@@ -2347,7 +2347,7 @@ static int lock_page_maybe_drop_mmap(str
 			 * mmap_sem here and return 0 if we don't have a fpin.
 			 */
 			if (*fpin == NULL)
-				up_read(&vmf->vma->vm_mm->mmap_sem);
+				mmap_read_unlock(vmf->vma->vm_mm);
 			return 0;
 		}
 	} else
--- a/mm/frame_vector.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/frame_vector.c
@@ -48,7 +48,7 @@ int get_vaddr_frames(unsigned long start
 
 	start = untagged_addr(start);
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	locked = 1;
 	vma = find_vma_intersection(mm, start, start + 1);
 	if (!vma) {
@@ -102,7 +102,7 @@ int get_vaddr_frames(unsigned long start
 	} while (vma && vma->vm_flags & (VM_IO | VM_PFNMAP));
 out:
 	if (locked)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	if (!ret)
 		ret = -EFAULT;
 	if (ret > 0)
--- a/mm/gup.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/gup.c
@@ -1249,7 +1249,7 @@ retry:
 	}
 
 	if (ret & VM_FAULT_RETRY) {
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		*unlocked = true;
 		fault_flags |= FAULT_FLAG_TRIED;
 		goto retry;
@@ -1354,7 +1354,7 @@ retry:
 			break;
 		}
 
-		ret = down_read_killable(&mm->mmap_sem);
+		ret = mmap_read_lock_killable(mm);
 		if (ret) {
 			BUG_ON(ret > 0);
 			if (!pages_done)
@@ -1389,7 +1389,7 @@ retry:
 		 * We must let the caller know we temporarily dropped the lock
 		 * and so the critical section protected by it was lost.
 		 */
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		*locked = 0;
 	}
 	return pages_done;
@@ -1477,7 +1477,7 @@ int __mm_populate(unsigned long start, u
 		 */
 		if (!locked) {
 			locked = 1;
-			down_read(&mm->mmap_sem);
+			mmap_read_lock(mm);
 			vma = find_vma(mm, nstart);
 		} else if (nstart >= vma->vm_end)
 			vma = vma->vm_next;
@@ -1509,7 +1509,7 @@ int __mm_populate(unsigned long start, u
 		ret = 0;
 	}
 	if (locked)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	return ret;	/* 0 or negative error code */
 }
 
@@ -2078,11 +2078,11 @@ long get_user_pages_unlocked(unsigned lo
 	if (WARN_ON_ONCE(gup_flags & FOLL_LONGTERM))
 		return -EINVAL;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	ret = __get_user_pages_locked(current, mm, start, nr_pages, pages, NULL,
 				      &locked, gup_flags | FOLL_TOUCH);
 	if (locked)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	return ret;
 }
 EXPORT_SYMBOL(get_user_pages_unlocked);
@@ -2723,11 +2723,11 @@ static int __gup_longterm_unlocked(unsig
 	 * get_user_pages_unlocked() (see comments in that function)
 	 */
 	if (gup_flags & FOLL_LONGTERM) {
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		ret = __gup_longterm_locked(current, current->mm,
 					    start, nr_pages,
 					    pages, NULL, gup_flags);
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	} else {
 		ret = get_user_pages_unlocked(start, nr_pages,
 					      pages, gup_flags);
--- a/mm/internal.h~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/internal.h
@@ -419,7 +419,7 @@ static inline struct file *maybe_unlock_
 	if (fault_flag_allow_retry_first(flags) &&
 	    !(flags & FAULT_FLAG_RETRY_NOWAIT)) {
 		fpin = get_file(vmf->vma->vm_file);
-		up_read(&vmf->vma->vm_mm->mmap_sem);
+		mmap_read_unlock(vmf->vma->vm_mm);
 	}
 	return fpin;
 }
--- a/mm/khugepaged.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/khugepaged.c
@@ -536,8 +536,8 @@ void __khugepaged_exit(struct mm_struct
 		 * khugepaged has finished working on the pagetables
 		 * under the mmap_sem.
 		 */
-		down_write(&mm->mmap_sem);
-		up_write(&mm->mmap_sem);
+		mmap_write_lock(mm);
+		mmap_write_unlock(mm);
 	}
 }
 
@@ -995,7 +995,7 @@ static bool __collapse_huge_page_swapin(
 
 		/* do_swap_page returns VM_FAULT_RETRY with released mmap_sem */
 		if (ret & VM_FAULT_RETRY) {
-			down_read(&mm->mmap_sem);
+			mmap_read_lock(mm);
 			if (hugepage_vma_revalidate(mm, address, &vmf.vma)) {
 				/* vma is no longer available, don't continue to swapin */
 				trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
@@ -1052,7 +1052,7 @@ static void collapse_huge_page(struct mm
 	 * sync compaction, and we do not need to hold the mmap_sem during
 	 * that. We will recheck the vma after taking it again in write mode.
 	 */
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	new_page = khugepaged_alloc_page(hpage, gfp, node);
 	if (!new_page) {
 		result = SCAN_ALLOC_HUGE_PAGE_FAIL;
@@ -1065,17 +1065,17 @@ static void collapse_huge_page(struct mm
 	}
 	count_memcg_page_event(new_page, THP_COLLAPSE_ALLOC);
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	result = hugepage_vma_revalidate(mm, address, &vma);
 	if (result) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		goto out_nolock;
 	}
 
 	pmd = mm_find_pmd(mm, address);
 	if (!pmd) {
 		result = SCAN_PMD_NULL;
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		goto out_nolock;
 	}
 
@@ -1086,17 +1086,17 @@ static void collapse_huge_page(struct mm
 	 */
 	if (unmapped && !__collapse_huge_page_swapin(mm, vma, address,
 						     pmd, referenced)) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		goto out_nolock;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	/*
 	 * Prevent all access to pagetables with the exception of
 	 * gup_fast later handled by the ptep_clear_flush and the VM
 	 * handled by the anon_vma lock + PG_lock.
 	 */
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	result = SCAN_ANY_PROCESS;
 	if (!mmget_still_valid(mm))
 		goto out;
@@ -1184,7 +1184,7 @@ static void collapse_huge_page(struct mm
 	khugepaged_pages_collapsed++;
 	result = SCAN_SUCCEED;
 out_up_write:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 out_nolock:
 	if (!IS_ERR_OR_NULL(*hpage))
 		mem_cgroup_uncharge(*hpage);
@@ -1517,7 +1517,7 @@ static int khugepaged_collapse_pte_mappe
 	if (likely(mm_slot->nr_pte_mapped_thp == 0))
 		return 0;
 
-	if (!down_write_trylock(&mm->mmap_sem))
+	if (!mmap_write_trylock(mm))
 		return -EBUSY;
 
 	if (unlikely(khugepaged_test_exit(mm)))
@@ -1528,7 +1528,7 @@ static int khugepaged_collapse_pte_mappe
 
 out:
 	mm_slot->nr_pte_mapped_thp = 0;
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return 0;
 }
 
@@ -1573,12 +1573,12 @@ static void retract_page_tables(struct a
 		 * mmap_sem while holding page lock. Fault path does it in
 		 * reverse order. Trylock is a way to avoid deadlock.
 		 */
-		if (down_write_trylock(&vma->vm_mm->mmap_sem)) {
+		if (mmap_write_trylock(vma->vm_mm)) {
 			spinlock_t *ptl = pmd_lock(vma->vm_mm, pmd);
 			/* assume page table is clear */
 			_pmd = pmdp_collapse_flush(vma, addr, pmd);
 			spin_unlock(ptl);
-			up_write(&vma->vm_mm->mmap_sem);
+			mmap_write_unlock(vma->vm_mm);
 			mm_dec_nr_ptes(vma->vm_mm);
 			pte_free(vma->vm_mm, pmd_pgtable(_pmd));
 		} else {
@@ -2057,7 +2057,7 @@ static unsigned int khugepaged_scan_mm_s
 	 * the next mm on the list.
 	 */
 	vma = NULL;
-	if (unlikely(!down_read_trylock(&mm->mmap_sem)))
+	if (unlikely(!mmap_read_trylock(mm)))
 		goto breakouterloop_mmap_sem;
 	if (likely(!khugepaged_test_exit(mm)))
 		vma = find_vma(mm, khugepaged_scan.address);
@@ -2102,7 +2102,7 @@ skip:
 				pgoff_t pgoff = linear_page_index(vma,
 						khugepaged_scan.address);
 
-				up_read(&mm->mmap_sem);
+				mmap_read_unlock(mm);
 				ret = 1;
 				khugepaged_scan_file(mm, file, pgoff, hpage);
 				fput(file);
@@ -2122,7 +2122,7 @@ skip:
 		}
 	}
 breakouterloop:
-	up_read(&mm->mmap_sem); /* exit_mmap will destroy ptes after this */
+	mmap_read_unlock(mm); /* exit_mmap will destroy ptes after this */
 breakouterloop_mmap_sem:
 
 	spin_lock(&khugepaged_mm_lock);
--- a/mm/ksm.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/ksm.c
@@ -542,11 +542,11 @@ static void break_cow(struct rmap_item *
 	 */
 	put_anon_vma(rmap_item->anon_vma);
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_mergeable_vma(mm, addr);
 	if (vma)
 		break_ksm(vma, addr);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 }
 
 static struct page *get_mergeable_page(struct rmap_item *rmap_item)
@@ -556,7 +556,7 @@ static struct page *get_mergeable_page(s
 	struct vm_area_struct *vma;
 	struct page *page;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_mergeable_vma(mm, addr);
 	if (!vma)
 		goto out;
@@ -572,7 +572,7 @@ static struct page *get_mergeable_page(s
 out:
 		page = NULL;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return page;
 }
 
@@ -976,7 +976,7 @@ static int unmerge_and_remove_all_rmap_i
 	for (mm_slot = ksm_scan.mm_slot;
 			mm_slot != &ksm_mm_head; mm_slot = ksm_scan.mm_slot) {
 		mm = mm_slot->mm;
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		for (vma = mm->mmap; vma; vma = vma->vm_next) {
 			if (ksm_test_exit(mm))
 				break;
@@ -989,7 +989,7 @@ static int unmerge_and_remove_all_rmap_i
 		}
 
 		remove_trailing_rmap_items(mm_slot, &mm_slot->rmap_list);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 
 		spin_lock(&ksm_mmlist_lock);
 		ksm_scan.mm_slot = list_entry(mm_slot->mm_list.next,
@@ -1012,7 +1012,7 @@ static int unmerge_and_remove_all_rmap_i
 	return 0;
 
 error:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	spin_lock(&ksm_mmlist_lock);
 	ksm_scan.mm_slot = &ksm_mm_head;
 	spin_unlock(&ksm_mmlist_lock);
@@ -1280,7 +1280,7 @@ static int try_to_merge_with_ksm_page(st
 	struct vm_area_struct *vma;
 	int err = -EFAULT;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_mergeable_vma(mm, rmap_item->address);
 	if (!vma)
 		goto out;
@@ -1296,7 +1296,7 @@ static int try_to_merge_with_ksm_page(st
 	rmap_item->anon_vma = vma->anon_vma;
 	get_anon_vma(vma->anon_vma);
 out:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return err;
 }
 
@@ -2110,7 +2110,7 @@ static void cmp_and_merge_page(struct pa
 	if (ksm_use_zero_pages && (checksum == zero_checksum)) {
 		struct vm_area_struct *vma;
 
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		vma = find_mergeable_vma(mm, rmap_item->address);
 		if (vma) {
 			err = try_to_merge_one_page(vma, page,
@@ -2122,7 +2122,7 @@ static void cmp_and_merge_page(struct pa
 			 */
 			err = 0;
 		}
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		/*
 		 * In case of failure, the page was not really empty, so we
 		 * need to continue. Otherwise we're done.
@@ -2285,7 +2285,7 @@ next_mm:
 	}
 
 	mm = slot->mm;
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	if (ksm_test_exit(mm))
 		vma = NULL;
 	else
@@ -2319,7 +2319,7 @@ next_mm:
 					ksm_scan.address += PAGE_SIZE;
 				} else
 					put_page(*page);
-				up_read(&mm->mmap_sem);
+				mmap_read_unlock(mm);
 				return rmap_item;
 			}
 			put_page(*page);
@@ -2357,10 +2357,10 @@ next_mm:
 
 		free_mm_slot(slot);
 		clear_bit(MMF_VM_MERGEABLE, &mm->flags);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		mmdrop(mm);
 	} else {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		/*
 		 * up_read(&mm->mmap_sem) first because after
 		 * spin_unlock(&ksm_mmlist_lock) run, the "mm" may
@@ -2560,8 +2560,8 @@ void __ksm_exit(struct mm_struct *mm)
 		clear_bit(MMF_VM_MERGEABLE, &mm->flags);
 		mmdrop(mm);
 	} else if (mm_slot) {
-		down_write(&mm->mmap_sem);
-		up_write(&mm->mmap_sem);
+		mmap_write_lock(mm);
+		mmap_write_unlock(mm);
 	}
 }
 
--- a/mm/madvise.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/madvise.c
@@ -289,12 +289,12 @@ static long madvise_willneed(struct vm_a
 	 */
 	*prev = NULL;	/* tell sys_madvise we drop mmap_sem */
 	get_file(file);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	offset = (loff_t)(start - vma->vm_start)
 			+ ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
 	vfs_fadvise(file, offset, end - start, POSIX_FADV_WILLNEED);
 	fput(file);
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	return 0;
 }
 
@@ -770,7 +770,7 @@ static long madvise_dontneed_free(struct
 	if (!userfaultfd_remove(vma, start, end)) {
 		*prev = NULL; /* mmap_sem has been dropped, prev is stale */
 
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		vma = find_vma(current->mm, start);
 		if (!vma)
 			return -ENOMEM;
@@ -852,13 +852,13 @@ static long madvise_remove(struct vm_are
 	get_file(f);
 	if (userfaultfd_remove(vma, start, end)) {
 		/* mmap_sem was not released by userfaultfd_remove() */
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	}
 	error = vfs_fallocate(f,
 				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
 				offset, end - start);
 	fput(f);
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	return error;
 }
 
@@ -1089,7 +1089,7 @@ int do_madvise(unsigned long start, size
 
 	write = madvise_need_mmap_write(behavior);
 	if (write) {
-		if (down_write_killable(&current->mm->mmap_sem))
+		if (mmap_write_lock_killable(current->mm))
 			return -EINTR;
 
 		/*
@@ -1105,11 +1105,11 @@ int do_madvise(unsigned long start, size
 		 * model.
 		 */
 		if (!mmget_still_valid(current->mm)) {
-			up_write(&current->mm->mmap_sem);
+			mmap_write_unlock(current->mm);
 			return -EINTR;
 		}
 	} else {
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 	}
 
 	/*
@@ -1159,9 +1159,9 @@ int do_madvise(unsigned long start, size
 out:
 	blk_finish_plug(&plug);
 	if (write)
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 	else
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 
 	return error;
 }
--- a/mm/memcontrol.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/memcontrol.c
@@ -5614,9 +5614,9 @@ static unsigned long mem_cgroup_count_pr
 {
 	unsigned long precharge;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	walk_page_range(mm, 0, mm->highest_vm_end, &precharge_walk_ops, NULL);
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	precharge = mc.precharge;
 	mc.precharge = 0;
@@ -5899,7 +5899,7 @@ static void mem_cgroup_move_charge(void)
 	atomic_inc(&mc.from->moving_account);
 	synchronize_rcu();
 retry:
-	if (unlikely(!down_read_trylock(&mc.mm->mmap_sem))) {
+	if (unlikely(!mmap_read_trylock(mc.mm))) {
 		/*
 		 * Someone who are holding the mmap_sem might be waiting in
 		 * waitq. So we cancel all extra charges, wake up all waiters,
@@ -5918,7 +5918,7 @@ retry:
 	walk_page_range(mc.mm, 0, mc.mm->highest_vm_end, &charge_walk_ops,
 			NULL);
 
-	up_read(&mc.mm->mmap_sem);
+	mmap_read_unlock(mc.mm);
 	atomic_dec(&mc.from->moving_account);
 }
 
--- a/mm/memory.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/memory.c
@@ -1592,7 +1592,7 @@ int vm_insert_pages(struct vm_area_struc
 	if (addr < vma->vm_start || end_addr >= vma->vm_end)
 		return -EFAULT;
 	if (!(vma->vm_flags & VM_MIXEDMAP)) {
-		BUG_ON(down_read_trylock(&vma->vm_mm->mmap_sem));
+		BUG_ON(mmap_read_trylock(vma->vm_mm));
 		BUG_ON(vma->vm_flags & VM_PFNMAP);
 		vma->vm_flags |= VM_MIXEDMAP;
 	}
@@ -1650,7 +1650,7 @@ int vm_insert_page(struct vm_area_struct
 	if (!page_count(page))
 		return -EINVAL;
 	if (!(vma->vm_flags & VM_MIXEDMAP)) {
-		BUG_ON(down_read_trylock(&vma->vm_mm->mmap_sem));
+		BUG_ON(mmap_read_trylock(vma->vm_mm));
 		BUG_ON(vma->vm_flags & VM_PFNMAP);
 		vma->vm_flags |= VM_MIXEDMAP;
 	}
@@ -4658,7 +4658,7 @@ int __access_remote_vm(struct task_struc
 	void *old_buf = buf;
 	int write = gup_flags & FOLL_WRITE;
 
-	if (down_read_killable(&mm->mmap_sem))
+	if (mmap_read_lock_killable(mm))
 		return 0;
 
 	/* ignore errors, just check how much was successfully transferred */
@@ -4709,7 +4709,7 @@ int __access_remote_vm(struct task_struc
 		buf += bytes;
 		addr += bytes;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return buf - old_buf;
 }
@@ -4766,7 +4766,7 @@ void print_vma_addr(char *prefix, unsign
 	/*
 	 * we might be running from an atomic context so we cannot sleep
 	 */
-	if (!down_read_trylock(&mm->mmap_sem))
+	if (!mmap_read_trylock(mm))
 		return;
 
 	vma = find_vma(mm, ip);
@@ -4785,7 +4785,7 @@ void print_vma_addr(char *prefix, unsign
 			free_page((unsigned long)buf);
 		}
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 }
 
 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)
--- a/mm/mempolicy.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mempolicy.c
@@ -405,10 +405,10 @@ void mpol_rebind_mm(struct mm_struct *mm
 {
 	struct vm_area_struct *vma;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	for (vma = mm->mmap; vma; vma = vma->vm_next)
 		mpol_rebind_policy(vma->vm_policy, new);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 }
 
 static const struct mempolicy_operations mpol_ops[MPOL_MAX] = {
@@ -932,7 +932,7 @@ static int lookup_node(struct mm_struct
 		put_page(p);
 	}
 	if (locked)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	return err;
 }
 
@@ -965,10 +965,10 @@ static long do_get_mempolicy(int *policy
 		 * vma/shared policy at addr is NULL.  We
 		 * want to return MPOL_DEFAULT in this case.
 		 */
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		vma = find_vma_intersection(mm, addr, addr+1);
 		if (!vma) {
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			return -EFAULT;
 		}
 		if (vma->vm_ops && vma->vm_ops->get_policy)
@@ -1027,7 +1027,7 @@ static long do_get_mempolicy(int *policy
  out:
 	mpol_cond_put(pol);
 	if (vma)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	if (pol_refcount)
 		mpol_put(pol_refcount);
 	return err;
@@ -1136,7 +1136,7 @@ int do_migrate_pages(struct mm_struct *m
 	if (err)
 		return err;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	/*
 	 * Find a 'source' bit set in 'tmp' whose corresponding 'dest'
@@ -1217,7 +1217,7 @@ int do_migrate_pages(struct mm_struct *m
 		if (err < 0)
 			break;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (err < 0)
 		return err;
 	return busy;
@@ -1340,12 +1340,12 @@ static long do_mbind(unsigned long start
 	{
 		NODEMASK_SCRATCH(scratch);
 		if (scratch) {
-			down_write(&mm->mmap_sem);
+			mmap_write_lock(mm);
 			task_lock(current);
 			err = mpol_set_nodemask(new, nmask, scratch);
 			task_unlock(current);
 			if (err)
-				up_write(&mm->mmap_sem);
+				mmap_write_unlock(mm);
 		} else
 			err = -ENOMEM;
 		NODEMASK_SCRATCH_FREE(scratch);
@@ -1382,7 +1382,7 @@ up_out:
 			putback_movable_pages(&pagelist);
 	}
 
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 mpol_out:
 	mpol_put(new);
 	return err;
--- a/mm/migrate.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/migrate.c
@@ -1555,7 +1555,7 @@ static int add_page_for_migration(struct
 	unsigned int follflags;
 	int err;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	err = -EFAULT;
 	vma = find_vma(mm, addr);
 	if (!vma || addr < vma->vm_start || !vma_migratable(vma))
@@ -1608,7 +1608,7 @@ out_putpage:
 	 */
 	put_page(page);
 out:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return err;
 }
 
@@ -1733,7 +1733,7 @@ static void do_pages_stat_array(struct m
 {
 	unsigned long i;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 
 	for (i = 0; i < nr_pages; i++) {
 		unsigned long addr = (unsigned long)(*pages);
@@ -1760,7 +1760,7 @@ set_status:
 		status++;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 }
 
 /*
--- a/mm/mincore.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mincore.c
@@ -284,9 +284,9 @@ SYSCALL_DEFINE3(mincore, unsigned long,
 		 * Do at most PAGE_SIZE entries per iteration, due to
 		 * the temporary buffer size.
 		 */
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		retval = do_mincore(start, min(pages, PAGE_SIZE), tmp);
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 
 		if (retval <= 0)
 			break;
--- a/mm/mlock.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mlock.c
@@ -686,7 +686,7 @@ static __must_check int do_mlock(unsigne
 	lock_limit >>= PAGE_SHIFT;
 	locked = len >> PAGE_SHIFT;
 
-	if (down_write_killable(&current->mm->mmap_sem))
+	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
 
 	locked += current->mm->locked_vm;
@@ -705,7 +705,7 @@ static __must_check int do_mlock(unsigne
 	if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
 		error = apply_vma_lock_flags(start, len, flags);
 
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	if (error)
 		return error;
 
@@ -742,10 +742,10 @@ SYSCALL_DEFINE2(munlock, unsigned long,
 	len = PAGE_ALIGN(len + (offset_in_page(start)));
 	start &= PAGE_MASK;
 
-	if (down_write_killable(&current->mm->mmap_sem))
+	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
 	ret = apply_vma_lock_flags(start, len, 0);
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 
 	return ret;
 }
@@ -811,14 +811,14 @@ SYSCALL_DEFINE1(mlockall, int, flags)
 	lock_limit = rlimit(RLIMIT_MEMLOCK);
 	lock_limit >>= PAGE_SHIFT;
 
-	if (down_write_killable(&current->mm->mmap_sem))
+	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
 
 	ret = -ENOMEM;
 	if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
 	    capable(CAP_IPC_LOCK))
 		ret = apply_mlockall_flags(flags);
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	if (!ret && (flags & MCL_CURRENT))
 		mm_populate(0, TASK_SIZE);
 
@@ -829,10 +829,10 @@ SYSCALL_DEFINE0(munlockall)
 {
 	int ret;
 
-	if (down_write_killable(&current->mm->mmap_sem))
+	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
 	ret = apply_mlockall_flags(0);
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	return ret;
 }
 
--- a/mm/mmap.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mmap.c
@@ -198,7 +198,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
 	bool downgraded = false;
 	LIST_HEAD(uf);
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	origbrk = mm->brk;
@@ -272,9 +272,9 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
 success:
 	populate = newbrk > oldbrk && (mm->def_flags & VM_LOCKED) != 0;
 	if (downgraded)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 	else
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 	userfaultfd_unmap_complete(mm, &uf);
 	if (populate)
 		mm_populate(oldbrk, newbrk - oldbrk);
@@ -282,7 +282,7 @@ success:
 
 out:
 	retval = origbrk;
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return retval;
 }
 
@@ -2828,7 +2828,7 @@ int __do_munmap(struct mm_struct *mm, un
 	detach_vmas_to_be_unmapped(mm, vma, prev, end);
 
 	if (downgrade)
-		downgrade_write(&mm->mmap_sem);
+		mmap_write_downgrade(mm);
 
 	unmap_region(mm, vma, prev, start, end);
 
@@ -2850,7 +2850,7 @@ static int __vm_munmap(unsigned long sta
 	struct mm_struct *mm = current->mm;
 	LIST_HEAD(uf);
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	ret = __do_munmap(mm, start, len, &uf, downgrade);
@@ -2860,10 +2860,10 @@ static int __vm_munmap(unsigned long sta
 	 * it to 0 before return.
 	 */
 	if (ret == 1) {
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		ret = 0;
 	} else
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 
 	userfaultfd_unmap_complete(mm, &uf);
 	return ret;
@@ -2911,7 +2911,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsign
 	if (pgoff + (size >> PAGE_SHIFT) < pgoff)
 		return ret;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	vma = find_vma(mm, start);
@@ -2974,7 +2974,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsign
 			prot, flags, pgoff, &populate, NULL);
 	fput(file);
 out:
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	if (populate)
 		mm_populate(ret, populate);
 	if (!IS_ERR_VALUE(ret))
@@ -3074,12 +3074,12 @@ int vm_brk_flags(unsigned long addr, uns
 	if (!len)
 		return 0;
 
-	if (down_write_killable(&mm->mmap_sem))
+	if (mmap_write_lock_killable(mm))
 		return -EINTR;
 
 	ret = do_brk_flags(addr, len, flags, &uf);
 	populate = ((mm->def_flags & VM_LOCKED) != 0);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	userfaultfd_unmap_complete(mm, &uf);
 	if (populate && !ret)
 		mm_populate(addr, len);
@@ -3123,8 +3123,8 @@ void exit_mmap(struct mm_struct *mm)
 		(void)__oom_reap_task_mm(mm);
 
 		set_bit(MMF_OOM_SKIP, &mm->flags);
-		down_write(&mm->mmap_sem);
-		up_write(&mm->mmap_sem);
+		mmap_write_lock(mm);
+		mmap_write_unlock(mm);
 	}
 
 	if (mm->locked_vm) {
@@ -3550,7 +3550,7 @@ int mm_take_all_locks(struct mm_struct *
 	struct vm_area_struct *vma;
 	struct anon_vma_chain *avc;
 
-	BUG_ON(down_read_trylock(&mm->mmap_sem));
+	BUG_ON(mmap_read_trylock(mm));
 
 	mutex_lock(&mm_all_locks_mutex);
 
@@ -3630,7 +3630,7 @@ void mm_drop_all_locks(struct mm_struct
 	struct vm_area_struct *vma;
 	struct anon_vma_chain *avc;
 
-	BUG_ON(down_read_trylock(&mm->mmap_sem));
+	BUG_ON(mmap_read_trylock(mm));
 	BUG_ON(!mutex_is_locked(&mm_all_locks_mutex));
 
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
--- a/mm/mmu_notifier.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mmu_notifier.c
@@ -708,9 +708,9 @@ int mmu_notifier_register(struct mmu_not
 {
 	int ret;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	ret = __mmu_notifier_register(subscription, mm);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(mmu_notifier_register);
--- a/mm/mprotect.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mprotect.c
@@ -538,7 +538,7 @@ static int do_mprotect_pkey(unsigned lon
 
 	reqprot = prot;
 
-	if (down_write_killable(&current->mm->mmap_sem))
+	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
 
 	/*
@@ -628,7 +628,7 @@ static int do_mprotect_pkey(unsigned lon
 		prot = reqprot;
 	}
 out:
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	return error;
 }
 
@@ -658,7 +658,7 @@ SYSCALL_DEFINE2(pkey_alloc, unsigned lon
 	if (init_val & ~PKEY_ACCESS_MASK)
 		return -EINVAL;
 
-	down_write(&current->mm->mmap_sem);
+	mmap_write_lock(current->mm);
 	pkey = mm_pkey_alloc(current->mm);
 
 	ret = -ENOSPC;
@@ -672,7 +672,7 @@ SYSCALL_DEFINE2(pkey_alloc, unsigned lon
 	}
 	ret = pkey;
 out:
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	return ret;
 }
 
@@ -680,9 +680,9 @@ SYSCALL_DEFINE1(pkey_free, int, pkey)
 {
 	int ret;
 
-	down_write(&current->mm->mmap_sem);
+	mmap_write_lock(current->mm);
 	ret = mm_pkey_free(current->mm, pkey);
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 
 	/*
 	 * We could provie warnings or errors if any VMA still
--- a/mm/mremap.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/mremap.c
@@ -696,7 +696,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, a
 	if (!new_len)
 		return ret;
 
-	if (down_write_killable(&current->mm->mmap_sem))
+	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
 
 	if (flags & (MREMAP_FIXED | MREMAP_DONTUNMAP)) {
@@ -788,9 +788,9 @@ out:
 		locked = false;
 	}
 	if (downgraded)
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	else
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 	if (locked && new_len > old_len)
 		mm_populate(new_addr + old_len, new_len - old_len);
 	userfaultfd_unmap_complete(mm, &uf_unmap_early);
--- a/mm/msync.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/msync.c
@@ -57,7 +57,7 @@ SYSCALL_DEFINE3(msync, unsigned long, st
 	 * If the interval [start,end) covers some unmapped address ranges,
 	 * just ignore them, but return -ENOMEM at the end.
 	 */
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, start);
 	for (;;) {
 		struct file *file;
@@ -88,12 +88,12 @@ SYSCALL_DEFINE3(msync, unsigned long, st
 		if ((flags & MS_SYNC) && file &&
 				(vma->vm_flags & VM_SHARED)) {
 			get_file(file);
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			error = vfs_fsync_range(file, fstart, fend, 1);
 			fput(file);
 			if (error || start >= end)
 				goto out;
-			down_read(&mm->mmap_sem);
+			mmap_read_lock(mm);
 			vma = find_vma(mm, start);
 		} else {
 			if (start >= end) {
@@ -104,7 +104,7 @@ SYSCALL_DEFINE3(msync, unsigned long, st
 		}
 	}
 out_unlock:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 out:
 	return error ? : unmapped_error;
 }
--- a/mm/nommu.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/nommu.c
@@ -172,11 +172,11 @@ static void *__vmalloc_user_flags(unsign
 	if (ret) {
 		struct vm_area_struct *vma;
 
-		down_write(&current->mm->mmap_sem);
+		mmap_write_lock(current->mm);
 		vma = find_vma(current->mm, (unsigned long)ret);
 		if (vma)
 			vma->vm_flags |= VM_USERMAP;
-		up_write(&current->mm->mmap_sem);
+		mmap_write_unlock(current->mm);
 	}
 
 	return ret;
@@ -1542,9 +1542,9 @@ int vm_munmap(unsigned long addr, size_t
 	struct mm_struct *mm = current->mm;
 	int ret;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	ret = do_munmap(mm, addr, len, NULL);
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 	return ret;
 }
 EXPORT_SYMBOL(vm_munmap);
@@ -1631,9 +1631,9 @@ SYSCALL_DEFINE5(mremap, unsigned long, a
 {
 	unsigned long ret;
 
-	down_write(&current->mm->mmap_sem);
+	mmap_write_lock(current->mm);
 	ret = do_mremap(addr, old_len, new_len, flags, new_addr);
-	up_write(&current->mm->mmap_sem);
+	mmap_write_unlock(current->mm);
 	return ret;
 }
 
@@ -1705,7 +1705,7 @@ int __access_remote_vm(struct task_struc
 	struct vm_area_struct *vma;
 	int write = gup_flags & FOLL_WRITE;
 
-	if (down_read_killable(&mm->mmap_sem))
+	if (mmap_read_lock_killable(mm))
 		return 0;
 
 	/* the access must start within one of the target process's mappings */
@@ -1728,7 +1728,7 @@ int __access_remote_vm(struct task_struc
 		len = 0;
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return len;
 }
--- a/mm/oom_kill.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/oom_kill.c
@@ -569,7 +569,7 @@ static bool oom_reap_task_mm(struct task
 {
 	bool ret = true;
 
-	if (!down_read_trylock(&mm->mmap_sem)) {
+	if (!mmap_read_trylock(mm)) {
 		trace_skip_task_reaping(tsk->pid);
 		return false;
 	}
@@ -600,7 +600,7 @@ static bool oom_reap_task_mm(struct task
 out_finish:
 	trace_finish_task_reaping(tsk->pid);
 out_unlock:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	return ret;
 }
--- a/mm/process_vm_access.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/process_vm_access.c
@@ -104,12 +104,12 @@ static int process_vm_rw_single_vec(unsi
 		 * access remotely because task/mm might not
 		 * current/current->mm
 		 */
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		pinned_pages = pin_user_pages_remote(task, mm, pa, pinned_pages,
 						     flags, process_pages,
 						     NULL, &locked);
 		if (locked)
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 		if (pinned_pages <= 0)
 			return -EFAULT;
 
--- a/mm/ptdump.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/ptdump.c
@@ -141,13 +141,13 @@ void ptdump_walk_pgd(struct ptdump_state
 {
 	const struct ptdump_range *range = st->range;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	while (range->start != range->end) {
 		walk_page_range_novma(mm, range->start, range->end,
 				      &ptdump_ops, pgd, st);
 		range++;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Flush out the last page */
 	st->note_page(st, 0, -1, 0);
--- a/mm/swapfile.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/swapfile.c
@@ -2100,7 +2100,7 @@ static int unuse_mm(struct mm_struct *mm
 	struct vm_area_struct *vma;
 	int ret = 0;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		if (vma->anon_vma) {
 			ret = unuse_vma(vma, type, frontswap,
@@ -2110,7 +2110,7 @@ static int unuse_mm(struct mm_struct *mm
 		}
 		cond_resched();
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return ret;
 }
 
--- a/mm/userfaultfd.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/userfaultfd.c
@@ -228,7 +228,7 @@ static __always_inline ssize_t __mcopy_a
 	 * feature is not supported.
 	 */
 	if (zeropage) {
-		up_read(&dst_mm->mmap_sem);
+		mmap_read_unlock(dst_mm);
 		return -EINVAL;
 	}
 
@@ -315,7 +315,7 @@ retry:
 		cond_resched();
 
 		if (unlikely(err == -ENOENT)) {
-			up_read(&dst_mm->mmap_sem);
+			mmap_read_unlock(dst_mm);
 			BUG_ON(!page);
 
 			err = copy_huge_page_from_user(page,
@@ -326,7 +326,7 @@ retry:
 				err = -EFAULT;
 				goto out;
 			}
-			down_read(&dst_mm->mmap_sem);
+			mmap_read_lock(dst_mm);
 
 			dst_vma = NULL;
 			goto retry;
@@ -346,7 +346,7 @@ retry:
 	}
 
 out_unlock:
-	up_read(&dst_mm->mmap_sem);
+	mmap_read_unlock(dst_mm);
 out:
 	if (page) {
 		/*
@@ -485,7 +485,7 @@ static __always_inline ssize_t __mcopy_a
 	copied = 0;
 	page = NULL;
 retry:
-	down_read(&dst_mm->mmap_sem);
+	mmap_read_lock(dst_mm);
 
 	/*
 	 * If memory mappings are changing because of non-cooperative
@@ -583,7 +583,7 @@ retry:
 		if (unlikely(err == -ENOENT)) {
 			void *page_kaddr;
 
-			up_read(&dst_mm->mmap_sem);
+			mmap_read_unlock(dst_mm);
 			BUG_ON(!page);
 
 			page_kaddr = kmap(page);
@@ -612,7 +612,7 @@ retry:
 	}
 
 out_unlock:
-	up_read(&dst_mm->mmap_sem);
+	mmap_read_unlock(dst_mm);
 out:
 	if (page)
 		put_page(page);
@@ -652,7 +652,7 @@ int mwriteprotect_range(struct mm_struct
 	/* Does the address range wrap, or is the span zero-sized? */
 	BUG_ON(start + len <= start);
 
-	down_read(&dst_mm->mmap_sem);
+	mmap_read_lock(dst_mm);
 
 	/*
 	 * If memory mappings are changing because of non-cooperative
@@ -686,6 +686,6 @@ int mwriteprotect_range(struct mm_struct
 
 	err = 0;
 out_unlock:
-	up_read(&dst_mm->mmap_sem);
+	mmap_read_unlock(dst_mm);
 	return err;
 }
--- a/mm/util.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/mm/util.c
@@ -481,10 +481,10 @@ int account_locked_vm(struct mm_struct *
 	if (pages == 0 || !mm)
 		return 0;
 
-	down_write(&mm->mmap_sem);
+	mmap_write_lock(mm);
 	ret = __account_locked_vm(mm, pages, inc, current,
 				  capable(CAP_IPC_LOCK));
-	up_write(&mm->mmap_sem);
+	mmap_write_unlock(mm);
 
 	return ret;
 }
@@ -501,11 +501,11 @@ unsigned long vm_mmap_pgoff(struct file
 
 	ret = security_mmap_file(file, prot, flag);
 	if (!ret) {
-		if (down_write_killable(&mm->mmap_sem))
+		if (mmap_write_lock_killable(mm))
 			return -EINTR;
 		ret = do_mmap_pgoff(file, addr, len, prot, flag, pgoff,
 				    &populate, &uf);
-		up_write(&mm->mmap_sem);
+		mmap_write_unlock(mm);
 		userfaultfd_unmap_complete(mm, &uf);
 		if (populate)
 			mm_populate(ret, populate);
--- a/net/ipv4/tcp.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/net/ipv4/tcp.c
@@ -1762,11 +1762,11 @@ static int tcp_zerocopy_receive(struct s
 
 	sock_rps_record_flow(sk);
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 
 	vma = find_vma(current->mm, address);
 	if (!vma || vma->vm_start > address || vma->vm_ops != &tcp_vm_ops) {
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		return -EINVAL;
 	}
 	zc->length = min_t(unsigned long, zc->length, vma->vm_end - address);
@@ -1827,7 +1827,7 @@ static int tcp_zerocopy_receive(struct s
 		frags++;
 	}
 out:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	if (length) {
 		WRITE_ONCE(tp->copied_seq, seq);
 		tcp_rcv_space_adjust(sk);
--- a/net/xdp/xdp_umem.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/net/xdp/xdp_umem.c
@@ -254,10 +254,10 @@ static int xdp_umem_pin_pages(struct xdp
 	if (!umem->pgs)
 		return -ENOMEM;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	npgs = pin_user_pages(address, umem->npgs,
 			      gup_flags | FOLL_LONGTERM, &umem->pgs[0], NULL);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	if (npgs != umem->npgs) {
 		if (npgs >= 0) {
--- a/virt/kvm/async_pf.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/virt/kvm/async_pf.c
@@ -60,11 +60,11 @@ static void async_pf_execute(struct work
 	 * mm and might be done in another context, so we must
 	 * access remotely.
 	 */
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	get_user_pages_remote(NULL, mm, addr, 1, FOLL_WRITE, NULL, NULL,
 			&locked);
 	if (locked)
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 
 	if (IS_ENABLED(CONFIG_KVM_ASYNC_PF_SYNC))
 		kvm_arch_async_page_present(vcpu, apf);
--- a/virt/kvm/kvm_main.c~mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites
+++ a/virt/kvm/kvm_main.c
@@ -1631,7 +1631,7 @@ unsigned long kvm_host_page_size(struct
 	if (kvm_is_error_hva(addr))
 		return PAGE_SIZE;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	vma = find_vma(current->mm, addr);
 	if (!vma)
 		goto out;
@@ -1639,7 +1639,7 @@ unsigned long kvm_host_page_size(struct
 	size = vma_kernel_pagesize(vma);
 
 out:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	return size;
 }
@@ -1892,7 +1892,7 @@ static kvm_pfn_t hva_to_pfn(unsigned lon
 	if (npages == 1)
 		return pfn;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	if (npages == -EHWPOISON ||
 	      (!async && check_user_page_hwpoison(addr))) {
 		pfn = KVM_PFN_ERR_HWPOISON;
@@ -1916,7 +1916,7 @@ retry:
 		pfn = KVM_PFN_ERR_FAULT;
 	}
 exit:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	return pfn;
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 64/93] mmap locking API: convert mmap_sem call sites missed by coccinelle
  2020-06-09  4:29 incoming Andrew Morton
                   ` (62 preceding siblings ...)
  2020-06-09  4:33 ` [patch 63/93] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 65/93] mmap locking API: convert nested write lock sites Andrew Morton
                   ` (31 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: convert mmap_sem call sites missed by coccinelle

Convert the last few remaining mmap_sem rwsem calls to use the new mmap
locking API.  These were missed by coccinelle for some reason (I think
coccinelle does not support some of the preprocessor constructs in these
files ?)

[akpm@linux-foundation.org: convert linux-next leftovers]
[akpm@linux-foundation.org: more linux-next leftovers]
[akpm@linux-foundation.org: more linux-next leftovers]
Link: http://lkml.kernel.org/r/20200520052908.204642-6-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm64/kvm/mmu.c                           |   14 +++++++-------
 arch/mips/mm/fault.c                           |   10 +++++-----
 arch/riscv/mm/pageattr.c                       |    4 ++--
 arch/x86/kvm/mmu/paging_tmpl.h                 |    8 ++++----
 drivers/staging/media/atomisp/pci/hmm/hmm_bo.c |    4 ++--
 drivers/vfio/pci/vfio_pci.c                    |    8 ++++----
 fs/proc/base.c                                 |    6 +++---
 lib/test_hmm.c                                 |   14 +++++++-------
 8 files changed, 34 insertions(+), 34 deletions(-)

--- a/arch/arm64/kvm/mmu.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/arch/arm64/kvm/mmu.c
@@ -1084,7 +1084,7 @@ void stage2_unmap_vm(struct kvm *kvm)
 	int idx;
 
 	idx = srcu_read_lock(&kvm->srcu);
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	spin_lock(&kvm->mmu_lock);
 
 	slots = kvm_memslots(kvm);
@@ -1092,7 +1092,7 @@ void stage2_unmap_vm(struct kvm *kvm)
 		stage2_unmap_memslot(kvm, memslot);
 
 	spin_unlock(&kvm->mmu_lock);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	srcu_read_unlock(&kvm->srcu, idx);
 }
 
@@ -1848,11 +1848,11 @@ static int user_mem_abort(struct kvm_vcp
 	}
 
 	/* Let's check if we will get back a huge page backed by hugetlbfs */
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	vma = find_vma_intersection(current->mm, hva, hva + 1);
 	if (unlikely(!vma)) {
 		kvm_err("Failed to find VMA for hva 0x%lx\n", hva);
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 		return -EFAULT;
 	}
 
@@ -1879,7 +1879,7 @@ static int user_mem_abort(struct kvm_vcp
 	if (vma_pagesize == PMD_SIZE ||
 	    (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm)))
 		gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT;
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 
 	/* We need minimum second+third level pages */
 	ret = mmu_topup_memory_cache(memcache, kvm_mmu_cache_min_pages(kvm),
@@ -2456,7 +2456,7 @@ int kvm_arch_prepare_memory_region(struc
 	    (kvm_phys_size(kvm) >> PAGE_SHIFT))
 		return -EFAULT;
 
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	/*
 	 * A memory region could potentially cover multiple VMAs, and any holes
 	 * between them, so iterate over all of them to find out if we can map
@@ -2515,7 +2515,7 @@ int kvm_arch_prepare_memory_region(struc
 		stage2_flush_memslot(kvm, memslot);
 	spin_unlock(&kvm->mmu_lock);
 out:
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	return ret;
 }
 
--- a/arch/mips/mm/fault.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/arch/mips/mm/fault.c
@@ -97,7 +97,7 @@ static void __kprobes __do_page_fault(st
 	if (user_mode(regs))
 		flags |= FAULT_FLAG_USER;
 retry:
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto bad_area;
@@ -190,7 +190,7 @@ good_area:
 		}
 	}
 
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	return;
 
 /*
@@ -198,7 +198,7 @@ good_area:
  * Fix it, but check if it's kernel or user first..
  */
 bad_area:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 bad_area_nosemaphore:
 	/* User mode accesses just cause a SIGSEGV */
@@ -250,14 +250,14 @@ out_of_memory:
 	 * We ran out of memory, call the OOM killer, and return the userspace
 	 * (which will retry the fault, or kill us if we got oom-killed).
 	 */
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
 	return;
 
 do_sigbus:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 
 	/* Kernel mode? Handle exceptions or die */
 	if (!user_mode(regs))
--- a/arch/riscv/mm/pageattr.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/arch/riscv/mm/pageattr.c
@@ -117,10 +117,10 @@ static int __set_memory(unsigned long ad
 	if (!numpages)
 		return 0;
 
-	down_read(&init_mm.mmap_sem);
+	mmap_read_lock(&init_mm);
 	ret =  walk_page_range_novma(&init_mm, start, end, &pageattr_ops, NULL,
 				     &masks);
-	up_read(&init_mm.mmap_sem);
+	mmap_read_unlock(&init_mm);
 
 	flush_tlb_kernel_range(start, end);
 
--- a/arch/x86/kvm/mmu/paging_tmpl.h~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/arch/x86/kvm/mmu/paging_tmpl.h
@@ -165,22 +165,22 @@ static int FNAME(cmpxchg_gpte)(struct kv
 		unsigned long pfn;
 		unsigned long paddr;
 
-		down_read(&current->mm->mmap_sem);
+		mmap_read_lock(current->mm);
 		vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
 		if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			return -EFAULT;
 		}
 		pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
 		paddr = pfn << PAGE_SHIFT;
 		table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
 		if (!table) {
-			up_read(&current->mm->mmap_sem);
+			mmap_read_unlock(current->mm);
 			return -EFAULT;
 		}
 		ret = CMPXCHG(&table[index], orig_pte, new_pte);
 		memunmap(table);
-		up_read(&current->mm->mmap_sem);
+		mmap_read_unlock(current->mm);
 	}
 
 	return (ret != orig_pte);
--- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
@@ -982,9 +982,9 @@ static int alloc_user_pages(struct hmm_b
 	}
 
 	mutex_unlock(&bo->mutex);
-	down_read(&current->mm->mmap_sem);
+	mmap_read_lock(current->mm);
 	vma = find_vma(current->mm, (unsigned long)userptr);
-	up_read(&current->mm->mmap_sem);
+	mmap_read_unlock(current->mm);
 	if (!vma) {
 		dev_err(atomisp_dev, "find_vma failed\n");
 		kfree(bo->page_obj);
--- a/drivers/vfio/pci/vfio_pci.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/drivers/vfio/pci/vfio_pci.c
@@ -1422,17 +1422,17 @@ static int vfio_pci_zap_and_vma_lock(str
 		mutex_unlock(&vdev->vma_lock);
 
 		if (try) {
-			if (!down_read_trylock(&mm->mmap_sem)) {
+			if (!mmap_read_trylock(mm)) {
 				mmput(mm);
 				return 0;
 			}
 		} else {
-			down_read(&mm->mmap_sem);
+			mmap_read_lock(mm);
 		}
 		if (mmget_still_valid(mm)) {
 			if (try) {
 				if (!mutex_trylock(&vdev->vma_lock)) {
-					up_read(&mm->mmap_sem);
+					mmap_read_unlock(mm);
 					mmput(mm);
 					return 0;
 				}
@@ -1454,7 +1454,7 @@ static int vfio_pci_zap_and_vma_lock(str
 			}
 			mutex_unlock(&vdev->vma_lock);
 		}
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		mmput(mm);
 	}
 }
--- a/fs/proc/base.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/fs/proc/base.c
@@ -2322,7 +2322,7 @@ proc_map_files_readdir(struct file *file
 	if (!mm)
 		goto out_put_task;
 
-	ret = down_read_killable(&mm->mmap_sem);
+	ret = mmap_read_lock_killable(mm);
 	if (ret) {
 		mmput(mm);
 		goto out_put_task;
@@ -2349,7 +2349,7 @@ proc_map_files_readdir(struct file *file
 		p = genradix_ptr_alloc(&fa, nr_files++, GFP_KERNEL);
 		if (!p) {
 			ret = -ENOMEM;
-			up_read(&mm->mmap_sem);
+			mmap_read_unlock(mm);
 			mmput(mm);
 			goto out_put_task;
 		}
@@ -2358,7 +2358,7 @@ proc_map_files_readdir(struct file *file
 		p->end = vma->vm_end;
 		p->mode = vma->vm_file->f_mode;
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 
 	for (i = 0; i < nr_files; i++) {
--- a/lib/test_hmm.c~mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle
+++ a/lib/test_hmm.c
@@ -245,9 +245,9 @@ static int dmirror_range_fault(struct dm
 		}
 
 		range->notifier_seq = mmu_interval_read_begin(range->notifier);
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		ret = hmm_range_fault(range);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		if (ret) {
 			if (ret == -EBUSY)
 				continue;
@@ -686,7 +686,7 @@ static int dmirror_migrate(struct dmirro
 	if (!mmget_not_zero(mm))
 		return -EINVAL;
 
-	down_read(&mm->mmap_sem);
+	mmap_read_lock(mm);
 	for (addr = start; addr < end; addr = next) {
 		vma = find_vma(mm, addr);
 		if (!vma || addr < vma->vm_start ||
@@ -713,7 +713,7 @@ static int dmirror_migrate(struct dmirro
 		dmirror_migrate_finalize_and_map(&args, dmirror);
 		migrate_vma_finalize(&args);
 	}
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 
 	/* Return the migrated data for verification. */
@@ -733,7 +733,7 @@ static int dmirror_migrate(struct dmirro
 	return ret;
 
 out:
-	up_read(&mm->mmap_sem);
+	mmap_read_unlock(mm);
 	mmput(mm);
 	return ret;
 }
@@ -825,9 +825,9 @@ static int dmirror_range_snapshot(struct
 
 		range->notifier_seq = mmu_interval_read_begin(range->notifier);
 
-		down_read(&mm->mmap_sem);
+		mmap_read_lock(mm);
 		ret = hmm_range_fault(range);
-		up_read(&mm->mmap_sem);
+		mmap_read_unlock(mm);
 		if (ret) {
 			if (ret == -EBUSY)
 				continue;
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 65/93] mmap locking API: convert nested write lock sites
  2020-06-09  4:29 incoming Andrew Morton
                   ` (63 preceding siblings ...)
  2020-06-09  4:33 ` [patch 64/93] mmap locking API: convert mmap_sem call sites missed by coccinelle Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 66/93] mmap locking API: add mmap_read_trylock_non_owner() Andrew Morton
                   ` (30 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: convert nested write lock sites

Add API for nested write locks and convert the few call sites doing that.

Link: http://lkml.kernel.org/r/20200520052908.204642-7-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/um/include/asm/mmu_context.h |    3 ++-
 include/linux/mmap_lock.h         |    5 +++++
 kernel/fork.c                     |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

--- a/arch/um/include/asm/mmu_context.h~mmap-locking-api-convert-nested-write-lock-sites
+++ a/arch/um/include/asm/mmu_context.h
@@ -8,6 +8,7 @@
 
 #include <linux/sched.h>
 #include <linux/mm_types.h>
+#include <linux/mmap_lock.h>
 
 #include <asm/mmu.h>
 
@@ -47,7 +48,7 @@ static inline void activate_mm(struct mm
 	 * when the new ->mm is used for the first time.
 	 */
 	__switch_mm(&new->context.id);
-	down_write_nested(&new->mmap_sem, 1);
+	mmap_write_lock_nested(new, SINGLE_DEPTH_NESTING);
 	uml_setup_stubs(new);
 	mmap_write_unlock(new);
 }
--- a/include/linux/mmap_lock.h~mmap-locking-api-convert-nested-write-lock-sites
+++ a/include/linux/mmap_lock.h
@@ -11,6 +11,11 @@ static inline void mmap_write_lock(struc
 	down_write(&mm->mmap_sem);
 }
 
+static inline void mmap_write_lock_nested(struct mm_struct *mm, int subclass)
+{
+	down_write_nested(&mm->mmap_sem, subclass);
+}
+
 static inline int mmap_write_lock_killable(struct mm_struct *mm)
 {
 	return down_write_killable(&mm->mmap_sem);
--- a/kernel/fork.c~mmap-locking-api-convert-nested-write-lock-sites
+++ a/kernel/fork.c
@@ -501,7 +501,7 @@ static __latent_entropy int dup_mmap(str
 	/*
 	 * Not linked in yet - no deadlock potential:
 	 */
-	down_write_nested(&mm->mmap_sem, SINGLE_DEPTH_NESTING);
+	mmap_write_lock_nested(mm, SINGLE_DEPTH_NESTING);
 
 	/* No ordering required: file already has been exposed. */
 	RCU_INIT_POINTER(mm->exe_file, get_mm_exe_file(oldmm));
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 66/93] mmap locking API: add mmap_read_trylock_non_owner()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (64 preceding siblings ...)
  2020-06-09  4:33 ` [patch 65/93] mmap locking API: convert nested write lock sites Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 67/93] mmap locking API: add MMAP_LOCK_INITIALIZER Andrew Morton
                   ` (29 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: add mmap_read_trylock_non_owner()

Add a couple APIs used by kernel/bpf/stackmap.c only:
- mmap_read_trylock_non_owner()
- mmap_read_unlock_non_owner() (may be called from a work queue).

It's still not ideal that bpf/stackmap subverts the lock ownership in this
way.  Thanks to Peter Zijlstra for suggesting this API as the least-ugly
way of addressing this in the short term.

Link: http://lkml.kernel.org/r/20200520052908.204642-8-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/mmap_lock.h |   14 ++++++++++++++
 kernel/bpf/stackmap.c     |   17 +++++------------
 2 files changed, 19 insertions(+), 12 deletions(-)

--- a/include/linux/mmap_lock.h~mmap-locking-api-add-mmap_read_trylock_non_owner
+++ a/include/linux/mmap_lock.h
@@ -56,4 +56,18 @@ static inline void mmap_read_unlock(stru
 	up_read(&mm->mmap_sem);
 }
 
+static inline bool mmap_read_trylock_non_owner(struct mm_struct *mm)
+{
+	if (down_read_trylock(&mm->mmap_sem)) {
+		rwsem_release(&mm->mmap_sem.dep_map, _RET_IP_);
+		return true;
+	}
+	return false;
+}
+
+static inline void mmap_read_unlock_non_owner(struct mm_struct *mm)
+{
+	up_read_non_owner(&mm->mmap_sem);
+}
+
 #endif /* _LINUX_MMAP_LOCK_H */
--- a/kernel/bpf/stackmap.c~mmap-locking-api-add-mmap_read_trylock_non_owner
+++ a/kernel/bpf/stackmap.c
@@ -33,7 +33,7 @@ struct bpf_stack_map {
 /* irq_work to run up_read() for build_id lookup in nmi context */
 struct stack_map_irq_work {
 	struct irq_work irq_work;
-	struct rw_semaphore *sem;
+	struct mm_struct *mm;
 };
 
 static void do_up_read(struct irq_work *entry)
@@ -44,8 +44,7 @@ static void do_up_read(struct irq_work *
 		return;
 
 	work = container_of(entry, struct stack_map_irq_work, irq_work);
-	up_read_non_owner(work->sem);
-	work->sem = NULL;
+	mmap_read_unlock_non_owner(work->mm);
 }
 
 static DEFINE_PER_CPU(struct stack_map_irq_work, up_read_work);
@@ -317,7 +316,7 @@ static void stack_map_get_build_id_offse
 	 * with build_id.
 	 */
 	if (!user || !current || !current->mm || irq_work_busy ||
-	    mmap_read_trylock(current->mm) == 0) {
+	    !mmap_read_trylock_non_owner(current->mm)) {
 		/* cannot access current->mm, fall back to ips */
 		for (i = 0; i < trace_nr; i++) {
 			id_offs[i].status = BPF_STACK_BUILD_ID_IP;
@@ -342,16 +341,10 @@ static void stack_map_get_build_id_offse
 	}
 
 	if (!work) {
-		mmap_read_unlock(current->mm);
+		mmap_read_unlock_non_owner(current->mm);
 	} else {
-		work->sem = &current->mm->mmap_sem;
+		work->mm = current->mm;
 		irq_work_queue(&work->irq_work);
-		/*
-		 * The irq_work will release the mmap_sem with
-		 * up_read_non_owner(). The rwsem_release() is called
-		 * here to release the lock from lockdep's perspective.
-		 */
-		rwsem_release(&current->mm->mmap_sem.dep_map, _RET_IP_);
 	}
 }
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 67/93] mmap locking API: add MMAP_LOCK_INITIALIZER
  2020-06-09  4:29 incoming Andrew Morton
                   ` (65 preceding siblings ...)
  2020-06-09  4:33 ` [patch 66/93] mmap locking API: add mmap_read_trylock_non_owner() Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 68/93] mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked() Andrew Morton
                   ` (28 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: add MMAP_LOCK_INITIALIZER

Define a new initializer for the mmap locking api.  Initially this just
evaluates to __RWSEM_INITIALIZER as the API is defined as wrappers around
rwsem.

Link: http://lkml.kernel.org/r/20200520052908.204642-9-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/kernel/tboot.c    |    2 +-
 drivers/firmware/efi/efi.c |    2 +-
 include/linux/mmap_lock.h  |    3 +++
 mm/init-mm.c               |    2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

--- a/arch/x86/kernel/tboot.c~mmap-locking-api-add-mmap_lock_initializer
+++ a/arch/x86/kernel/tboot.c
@@ -93,7 +93,7 @@ static struct mm_struct tboot_mm = {
 	.pgd            = swapper_pg_dir,
 	.mm_users       = ATOMIC_INIT(2),
 	.mm_count       = ATOMIC_INIT(1),
-	.mmap_sem       = __RWSEM_INITIALIZER(init_mm.mmap_sem),
+	MMAP_LOCK_INITIALIZER(init_mm)
 	.page_table_lock =  __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
 	.mmlist         = LIST_HEAD_INIT(init_mm.mmlist),
 };
--- a/drivers/firmware/efi/efi.c~mmap-locking-api-add-mmap_lock_initializer
+++ a/drivers/firmware/efi/efi.c
@@ -54,7 +54,7 @@ struct mm_struct efi_mm = {
 	.mm_rb			= RB_ROOT,
 	.mm_users		= ATOMIC_INIT(2),
 	.mm_count		= ATOMIC_INIT(1),
-	.mmap_sem		= __RWSEM_INITIALIZER(efi_mm.mmap_sem),
+	MMAP_LOCK_INITIALIZER(efi_mm)
 	.page_table_lock	= __SPIN_LOCK_UNLOCKED(efi_mm.page_table_lock),
 	.mmlist			= LIST_HEAD_INIT(efi_mm.mmlist),
 	.cpu_bitmap		= { [BITS_TO_LONGS(NR_CPUS)] = 0},
--- a/include/linux/mmap_lock.h~mmap-locking-api-add-mmap_lock_initializer
+++ a/include/linux/mmap_lock.h
@@ -1,6 +1,9 @@
 #ifndef _LINUX_MMAP_LOCK_H
 #define _LINUX_MMAP_LOCK_H
 
+#define MMAP_LOCK_INITIALIZER(name) \
+	.mmap_sem = __RWSEM_INITIALIZER((name).mmap_sem),
+
 static inline void mmap_init_lock(struct mm_struct *mm)
 {
 	init_rwsem(&mm->mmap_sem);
--- a/mm/init-mm.c~mmap-locking-api-add-mmap_lock_initializer
+++ a/mm/init-mm.c
@@ -31,7 +31,7 @@ struct mm_struct init_mm = {
 	.pgd		= swapper_pg_dir,
 	.mm_users	= ATOMIC_INIT(2),
 	.mm_count	= ATOMIC_INIT(1),
-	.mmap_sem	= __RWSEM_INITIALIZER(init_mm.mmap_sem),
+	MMAP_LOCK_INITIALIZER(init_mm)
 	.page_table_lock =  __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
 	.arg_lock	=  __SPIN_LOCK_UNLOCKED(init_mm.arg_lock),
 	.mmlist		= LIST_HEAD_INIT(init_mm.mmlist),
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 68/93] mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (66 preceding siblings ...)
  2020-06-09  4:33 ` [patch 67/93] mmap locking API: add MMAP_LOCK_INITIALIZER Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 69/93] mmap locking API: rename mmap_sem to mmap_lock Andrew Morton
                   ` (27 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked()

Add new APIs to assert that mmap_sem is held.

Using this instead of rwsem_is_locked and lockdep_assert_held[_write]
makes the assertions more tolerant of future changes to the lock type.

Link: http://lkml.kernel.org/r/20200520052908.204642-10-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/events/core.c    |    2 +-
 fs/userfaultfd.c          |    6 +++---
 include/linux/mmap_lock.h |   14 ++++++++++++++
 mm/gup.c                  |    2 +-
 mm/hmm.c                  |    2 +-
 mm/memory.c               |    2 +-
 mm/mmu_notifier.c         |    6 +++---
 mm/pagewalk.c             |    6 +++---
 mm/util.c                 |    2 +-
 9 files changed, 28 insertions(+), 14 deletions(-)

--- a/arch/x86/events/core.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/arch/x86/events/core.c
@@ -2181,7 +2181,7 @@ static void x86_pmu_event_mapped(struct
 	 * For now, this can't happen because all callers hold mmap_sem
 	 * for write.  If this changes, we'll need a different solution.
 	 */
-	lockdep_assert_held_write(&mm->mmap_sem);
+	mmap_assert_write_locked(mm);
 
 	if (atomic_inc_return(&mm->context.perf_rdpmc_allowed) == 1)
 		on_each_cpu_mask(mm_cpumask(mm), cr4_update_pce, NULL, 1);
--- a/fs/userfaultfd.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/fs/userfaultfd.c
@@ -234,7 +234,7 @@ static inline bool userfaultfd_huge_must
 	pte_t *ptep, pte;
 	bool ret = true;
 
-	VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem));
+	mmap_assert_locked(mm);
 
 	ptep = huge_pte_offset(mm, address, vma_mmu_pagesize(vma));
 
@@ -286,7 +286,7 @@ static inline bool userfaultfd_must_wait
 	pte_t *pte;
 	bool ret = true;
 
-	VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem));
+	mmap_assert_locked(mm);
 
 	pgd = pgd_offset(mm, address);
 	if (!pgd_present(*pgd))
@@ -405,7 +405,7 @@ vm_fault_t handle_userfault(struct vm_fa
 	 * Coredumping runs without mmap_sem so we can only check that
 	 * the mmap_sem is held, if PF_DUMPCORE was not set.
 	 */
-	WARN_ON_ONCE(!rwsem_is_locked(&mm->mmap_sem));
+	mmap_assert_locked(mm);
 
 	ctx = vmf->vma->vm_userfaultfd_ctx.ctx;
 	if (!ctx)
--- a/include/linux/mmap_lock.h~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/include/linux/mmap_lock.h
@@ -1,6 +1,8 @@
 #ifndef _LINUX_MMAP_LOCK_H
 #define _LINUX_MMAP_LOCK_H
 
+#include <linux/mmdebug.h>
+
 #define MMAP_LOCK_INITIALIZER(name) \
 	.mmap_sem = __RWSEM_INITIALIZER((name).mmap_sem),
 
@@ -73,4 +75,16 @@ static inline void mmap_read_unlock_non_
 	up_read_non_owner(&mm->mmap_sem);
 }
 
+static inline void mmap_assert_locked(struct mm_struct *mm)
+{
+	lockdep_assert_held(&mm->mmap_sem);
+	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_sem), mm);
+}
+
+static inline void mmap_assert_write_locked(struct mm_struct *mm)
+{
+	lockdep_assert_held_write(&mm->mmap_sem);
+	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_sem), mm);
+}
+
 #endif /* _LINUX_MMAP_LOCK_H */
--- a/mm/gup.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/mm/gup.c
@@ -1425,7 +1425,7 @@ long populate_vma_page_range(struct vm_a
 	VM_BUG_ON(end   & ~PAGE_MASK);
 	VM_BUG_ON_VMA(start < vma->vm_start, vma);
 	VM_BUG_ON_VMA(end   > vma->vm_end, vma);
-	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_sem), mm);
+	mmap_assert_locked(mm);
 
 	gup_flags = FOLL_TOUCH | FOLL_POPULATE | FOLL_MLOCK;
 	if (vma->vm_flags & VM_LOCKONFAULT)
--- a/mm/hmm.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/mm/hmm.c
@@ -563,7 +563,7 @@ int hmm_range_fault(struct hmm_range *ra
 	struct mm_struct *mm = range->notifier->mm;
 	int ret;
 
-	lockdep_assert_held(&mm->mmap_sem);
+	mmap_assert_locked(mm);
 
 	do {
 		/* If range is no longer valid force retry. */
--- a/mm/memory.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/mm/memory.c
@@ -1211,7 +1211,7 @@ static inline unsigned long zap_pud_rang
 		next = pud_addr_end(addr, end);
 		if (pud_trans_huge(*pud) || pud_devmap(*pud)) {
 			if (next - addr != HPAGE_PUD_SIZE) {
-				VM_BUG_ON_VMA(!rwsem_is_locked(&tlb->mm->mmap_sem), vma);
+				mmap_assert_locked(tlb->mm);
 				split_huge_pud(vma, pud, addr);
 			} else if (zap_huge_pud(tlb, vma, pud, addr))
 				goto next;
--- a/mm/mmu_notifier.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/mm/mmu_notifier.c
@@ -609,7 +609,7 @@ int __mmu_notifier_register(struct mmu_n
 	struct mmu_notifier_subscriptions *subscriptions = NULL;
 	int ret;
 
-	lockdep_assert_held_write(&mm->mmap_sem);
+	mmap_assert_write_locked(mm);
 	BUG_ON(atomic_read(&mm->mm_users) <= 0);
 
 	if (IS_ENABLED(CONFIG_LOCKDEP)) {
@@ -761,7 +761,7 @@ struct mmu_notifier *mmu_notifier_get_lo
 	struct mmu_notifier *subscription;
 	int ret;
 
-	lockdep_assert_held_write(&mm->mmap_sem);
+	mmap_assert_write_locked(mm);
 
 	if (mm->notifier_subscriptions) {
 		subscription = find_get_mmu_notifier(mm, ops);
@@ -1006,7 +1006,7 @@ int mmu_interval_notifier_insert_locked(
 		mm->notifier_subscriptions;
 	int ret;
 
-	lockdep_assert_held_write(&mm->mmap_sem);
+	mmap_assert_write_locked(mm);
 
 	if (!subscriptions || !subscriptions->has_itree) {
 		ret = __mmu_notifier_register(NULL, mm);
--- a/mm/pagewalk.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/mm/pagewalk.c
@@ -395,7 +395,7 @@ int walk_page_range(struct mm_struct *mm
 	if (!walk.mm)
 		return -EINVAL;
 
-	lockdep_assert_held(&walk.mm->mmap_sem);
+	mmap_assert_locked(walk.mm);
 
 	vma = find_vma(walk.mm, start);
 	do {
@@ -453,7 +453,7 @@ int walk_page_range_novma(struct mm_stru
 	if (start >= end || !walk.mm)
 		return -EINVAL;
 
-	lockdep_assert_held(&walk.mm->mmap_sem);
+	mmap_assert_locked(walk.mm);
 
 	return __walk_page_range(start, end, &walk);
 }
@@ -472,7 +472,7 @@ int walk_page_vma(struct vm_area_struct
 	if (!walk.mm)
 		return -EINVAL;
 
-	lockdep_assert_held(&walk.mm->mmap_sem);
+	mmap_assert_locked(walk.mm);
 
 	err = walk_page_test(vma->vm_start, vma->vm_end, &walk);
 	if (err > 0)
--- a/mm/util.c~mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked
+++ a/mm/util.c
@@ -437,7 +437,7 @@ int __account_locked_vm(struct mm_struct
 	unsigned long locked_vm, limit;
 	int ret = 0;
 
-	lockdep_assert_held_write(&mm->mmap_sem);
+	mmap_assert_write_locked(mm);
 
 	locked_vm = mm->locked_vm;
 	if (inc) {
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 69/93] mmap locking API: rename mmap_sem to mmap_lock
  2020-06-09  4:29 incoming Andrew Morton
                   ` (67 preceding siblings ...)
  2020-06-09  4:33 ` [patch 68/93] mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked() Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 70/93] mmap locking API: convert mmap_sem API comments Andrew Morton
                   ` (26 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: rename mmap_sem to mmap_lock

Rename the mmap_sem field to mmap_lock.  Any new uses of this lock should
now go through the new mmap locking api.  The mmap_lock is still
implemented as a rwsem, though this could change in the future.

[akpm@linux-foundation.org: fix it for mm-gup-might_lock_readmmap_sem-in-get_user_pages_fast.patch]
Link: http://lkml.kernel.org/r/20200520052908.204642-11-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/ia64/mm/fault.c                  |    4 +-
 arch/x86/mm/fault.c                   |    2 -
 drivers/gpu/drm/etnaviv/etnaviv_gem.c |    2 -
 include/linux/mm_types.h              |    2 -
 include/linux/mmap_lock.h             |   38 ++++++++++++------------
 mm/gup.c                              |    2 -
 mm/memory.c                           |    2 -
 mm/mmap.c                             |    4 +-
 mm/mmu_notifier.c                     |    2 -
 9 files changed, 29 insertions(+), 29 deletions(-)

--- a/arch/ia64/mm/fault.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/arch/ia64/mm/fault.c
@@ -74,8 +74,8 @@ ia64_do_page_fault (unsigned long addres
 	mask = ((((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT)
 		| (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT));
 
-	/* mmap_sem is performance critical.... */
-	prefetchw(&mm->mmap_sem);
+	/* mmap_lock is performance critical.... */
+	prefetchw(&mm->mmap_lock);
 
 	/*
 	 * If we're in an interrupt or have no user context, we must not take the fault..
--- a/arch/x86/mm/fault.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/arch/x86/mm/fault.c
@@ -1359,7 +1359,7 @@ dotraplinkage void
 do_page_fault(struct pt_regs *regs, unsigned long hw_error_code,
 		unsigned long address)
 {
-	prefetchw(&current->mm->mmap_sem);
+	prefetchw(&current->mm->mmap_lock);
 	/*
 	 * KVM has two types of events that are, logically, interrupts, but
 	 * are unfortunately delivered using the #PF vector.  These events are
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -661,7 +661,7 @@ static int etnaviv_gem_userptr_get_pages
 	struct etnaviv_gem_userptr *userptr = &etnaviv_obj->userptr;
 	int ret, pinned = 0, npages = etnaviv_obj->base.size >> PAGE_SHIFT;
 
-	might_lock_read(&current->mm->mmap_sem);
+	might_lock_read(&current->mm->mmap_lock);
 
 	if (userptr->mm != current->mm)
 		return -EPERM;
--- a/include/linux/mmap_lock.h~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/include/linux/mmap_lock.h
@@ -4,67 +4,67 @@
 #include <linux/mmdebug.h>
 
 #define MMAP_LOCK_INITIALIZER(name) \
-	.mmap_sem = __RWSEM_INITIALIZER((name).mmap_sem),
+	.mmap_lock = __RWSEM_INITIALIZER((name).mmap_lock),
 
 static inline void mmap_init_lock(struct mm_struct *mm)
 {
-	init_rwsem(&mm->mmap_sem);
+	init_rwsem(&mm->mmap_lock);
 }
 
 static inline void mmap_write_lock(struct mm_struct *mm)
 {
-	down_write(&mm->mmap_sem);
+	down_write(&mm->mmap_lock);
 }
 
 static inline void mmap_write_lock_nested(struct mm_struct *mm, int subclass)
 {
-	down_write_nested(&mm->mmap_sem, subclass);
+	down_write_nested(&mm->mmap_lock, subclass);
 }
 
 static inline int mmap_write_lock_killable(struct mm_struct *mm)
 {
-	return down_write_killable(&mm->mmap_sem);
+	return down_write_killable(&mm->mmap_lock);
 }
 
 static inline bool mmap_write_trylock(struct mm_struct *mm)
 {
-	return down_write_trylock(&mm->mmap_sem) != 0;
+	return down_write_trylock(&mm->mmap_lock) != 0;
 }
 
 static inline void mmap_write_unlock(struct mm_struct *mm)
 {
-	up_write(&mm->mmap_sem);
+	up_write(&mm->mmap_lock);
 }
 
 static inline void mmap_write_downgrade(struct mm_struct *mm)
 {
-	downgrade_write(&mm->mmap_sem);
+	downgrade_write(&mm->mmap_lock);
 }
 
 static inline void mmap_read_lock(struct mm_struct *mm)
 {
-	down_read(&mm->mmap_sem);
+	down_read(&mm->mmap_lock);
 }
 
 static inline int mmap_read_lock_killable(struct mm_struct *mm)
 {
-	return down_read_killable(&mm->mmap_sem);
+	return down_read_killable(&mm->mmap_lock);
 }
 
 static inline bool mmap_read_trylock(struct mm_struct *mm)
 {
-	return down_read_trylock(&mm->mmap_sem) != 0;
+	return down_read_trylock(&mm->mmap_lock) != 0;
 }
 
 static inline void mmap_read_unlock(struct mm_struct *mm)
 {
-	up_read(&mm->mmap_sem);
+	up_read(&mm->mmap_lock);
 }
 
 static inline bool mmap_read_trylock_non_owner(struct mm_struct *mm)
 {
-	if (down_read_trylock(&mm->mmap_sem)) {
-		rwsem_release(&mm->mmap_sem.dep_map, _RET_IP_);
+	if (down_read_trylock(&mm->mmap_lock)) {
+		rwsem_release(&mm->mmap_lock.dep_map, _RET_IP_);
 		return true;
 	}
 	return false;
@@ -72,19 +72,19 @@ static inline bool mmap_read_trylock_non
 
 static inline void mmap_read_unlock_non_owner(struct mm_struct *mm)
 {
-	up_read_non_owner(&mm->mmap_sem);
+	up_read_non_owner(&mm->mmap_lock);
 }
 
 static inline void mmap_assert_locked(struct mm_struct *mm)
 {
-	lockdep_assert_held(&mm->mmap_sem);
-	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_sem), mm);
+	lockdep_assert_held(&mm->mmap_lock);
+	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm);
 }
 
 static inline void mmap_assert_write_locked(struct mm_struct *mm)
 {
-	lockdep_assert_held_write(&mm->mmap_sem);
-	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_sem), mm);
+	lockdep_assert_held_write(&mm->mmap_lock);
+	VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm);
 }
 
 #endif /* _LINUX_MMAP_LOCK_H */
--- a/include/linux/mm_types.h~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/include/linux/mm_types.h
@@ -440,7 +440,7 @@ struct mm_struct {
 		spinlock_t page_table_lock; /* Protects page tables and some
 					     * counters
 					     */
-		struct rw_semaphore mmap_sem;
+		struct rw_semaphore mmap_lock;
 
 		struct list_head mmlist; /* List of maybe swapped mm's.	These
 					  * are globally strung together off
--- a/mm/gup.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/mm/gup.c
@@ -2750,7 +2750,7 @@ static int internal_get_user_pages_fast(
 		return -EINVAL;
 
 	if (!(gup_flags & FOLL_FAST_ONLY))
-		might_lock_read(&current->mm->mmap_sem);
+		might_lock_read(&current->mm->mmap_lock);
 
 	start = untagged_addr(start) & PAGE_MASK;
 	addr = start;
--- a/mm/memory.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/mm/memory.c
@@ -4804,7 +4804,7 @@ void __might_fault(const char *file, int
 	__might_sleep(file, line, 0);
 #if defined(CONFIG_DEBUG_ATOMIC_SLEEP)
 	if (current->mm)
-		might_lock_read(&current->mm->mmap_sem);
+		might_lock_read(&current->mm->mmap_lock);
 #endif
 }
 EXPORT_SYMBOL(__might_fault);
--- a/mm/mmap.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/mm/mmap.c
@@ -3474,7 +3474,7 @@ static void vm_lock_anon_vma(struct mm_s
 		 * The LSB of head.next can't change from under us
 		 * because we hold the mm_all_locks_mutex.
 		 */
-		down_write_nest_lock(&anon_vma->root->rwsem, &mm->mmap_sem);
+		down_write_nest_lock(&anon_vma->root->rwsem, &mm->mmap_lock);
 		/*
 		 * We can safely modify head.next after taking the
 		 * anon_vma->root->rwsem. If some other vma in this mm shares
@@ -3504,7 +3504,7 @@ static void vm_lock_mapping(struct mm_st
 		 */
 		if (test_and_set_bit(AS_MM_ALL_LOCKS, &mapping->flags))
 			BUG();
-		down_write_nest_lock(&mapping->i_mmap_rwsem, &mm->mmap_sem);
+		down_write_nest_lock(&mapping->i_mmap_rwsem, &mm->mmap_lock);
 	}
 }
 
--- a/mm/mmu_notifier.c~mmap-locking-api-rename-mmap_sem-to-mmap_lock
+++ a/mm/mmu_notifier.c
@@ -983,7 +983,7 @@ int mmu_interval_notifier_insert(struct
 	struct mmu_notifier_subscriptions *subscriptions;
 	int ret;
 
-	might_lock(&mm->mmap_sem);
+	might_lock(&mm->mmap_lock);
 
 	subscriptions = smp_load_acquire(&mm->notifier_subscriptions);
 	if (!subscriptions || !subscriptions->has_itree) {
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 70/93] mmap locking API: convert mmap_sem API comments
  2020-06-09  4:29 incoming Andrew Morton
                   ` (68 preceding siblings ...)
  2020-06-09  4:33 ` [patch 69/93] mmap locking API: rename mmap_sem to mmap_lock Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 71/93] mmap locking API: convert mmap_sem comments Andrew Morton
                   ` (25 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: convert mmap_sem API comments

Convert comments that reference old mmap_sem APIs to reference
corresponding new mmap locking APIs instead.

Link: http://lkml.kernel.org/r/20200520052908.204642-12-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Documentation/vm/hmm.rst       |    6 +++---
 arch/alpha/mm/fault.c          |    2 +-
 arch/ia64/mm/fault.c           |    2 +-
 arch/m68k/mm/fault.c           |    2 +-
 arch/microblaze/mm/fault.c     |    2 +-
 arch/mips/mm/fault.c           |    2 +-
 arch/nds32/mm/fault.c          |    2 +-
 arch/nios2/mm/fault.c          |    2 +-
 arch/openrisc/mm/fault.c       |    2 +-
 arch/parisc/mm/fault.c         |    2 +-
 arch/riscv/mm/fault.c          |    2 +-
 arch/sh/mm/fault.c             |    2 +-
 arch/sparc/mm/fault_32.c       |    2 +-
 arch/sparc/mm/fault_64.c       |    2 +-
 arch/xtensa/mm/fault.c         |    2 +-
 drivers/android/binder_alloc.c |    4 ++--
 fs/hugetlbfs/inode.c           |    2 +-
 fs/userfaultfd.c               |    2 +-
 mm/filemap.c                   |    2 +-
 mm/gup.c                       |   12 ++++++------
 mm/huge_memory.c               |    4 ++--
 mm/khugepaged.c                |    2 +-
 mm/ksm.c                       |    2 +-
 mm/memory.c                    |    4 ++--
 mm/mempolicy.c                 |    2 +-
 mm/migrate.c                   |    4 ++--
 mm/mmap.c                      |    2 +-
 mm/oom_kill.c                  |    8 ++++----
 net/ipv4/tcp.c                 |    2 +-
 29 files changed, 43 insertions(+), 43 deletions(-)

--- a/arch/alpha/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/alpha/mm/fault.c
@@ -171,7 +171,7 @@ retry:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			 /* No need to up_read(&mm->mmap_sem) as we would
+			 /* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/ia64/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/ia64/mm/fault.c
@@ -173,7 +173,7 @@ retry:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			 /* No need to up_read(&mm->mmap_sem) as we would
+			 /* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/m68k/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/m68k/mm/fault.c
@@ -165,7 +165,7 @@ good_area:
 			flags |= FAULT_FLAG_TRIED;
 
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/microblaze/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/microblaze/mm/fault.c
@@ -238,7 +238,7 @@ good_area:
 			flags |= FAULT_FLAG_TRIED;
 
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/mips/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/mips/mm/fault.c
@@ -181,7 +181,7 @@ good_area:
 			flags |= FAULT_FLAG_TRIED;
 
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/nds32/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/nds32/mm/fault.c
@@ -247,7 +247,7 @@ good_area:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			/* No need to up_read(&mm->mmap_sem) as we would
+			/* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/nios2/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/nios2/mm/fault.c
@@ -160,7 +160,7 @@ good_area:
 			flags |= FAULT_FLAG_TRIED;
 
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/openrisc/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/openrisc/mm/fault.c
@@ -183,7 +183,7 @@ good_area:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			 /* No need to up_read(&mm->mmap_sem) as we would
+			 /* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/parisc/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/parisc/mm/fault.c
@@ -329,7 +329,7 @@ good_area:
 			current->min_flt++;
 		if (fault & VM_FAULT_RETRY) {
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/riscv/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/riscv/mm/fault.c
@@ -147,7 +147,7 @@ good_area:
 			flags |= FAULT_FLAG_TRIED;
 
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/sh/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/sh/mm/fault.c
@@ -502,7 +502,7 @@ good_area:
 			flags |= FAULT_FLAG_TRIED;
 
 			/*
-			 * No need to up_read(&mm->mmap_sem) as we would
+			 * No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/sparc/mm/fault_32.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/sparc/mm/fault_32.c
@@ -262,7 +262,7 @@ good_area:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			/* No need to up_read(&mm->mmap_sem) as we would
+			/* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/sparc/mm/fault_64.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/sparc/mm/fault_64.c
@@ -450,7 +450,7 @@ good_area:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			/* No need to up_read(&mm->mmap_sem) as we would
+			/* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/arch/xtensa/mm/fault.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/arch/xtensa/mm/fault.c
@@ -130,7 +130,7 @@ good_area:
 		if (fault & VM_FAULT_RETRY) {
 			flags |= FAULT_FLAG_TRIED;
 
-			 /* No need to up_read(&mm->mmap_sem) as we would
+			 /* No need to mmap_read_unlock(mm) as we would
 			 * have already released it in __lock_page_or_retry
 			 * in mm/filemap.c.
 			 */
--- a/Documentation/vm/hmm.rst~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/Documentation/vm/hmm.rst
@@ -191,15 +191,15 @@ The usage pattern is::
 
  again:
       range.notifier_seq = mmu_interval_read_begin(&interval_sub);
-      down_read(&mm->mmap_sem);
+      mmap_read_lock(mm);
       ret = hmm_range_fault(&range);
       if (ret) {
-          up_read(&mm->mmap_sem);
+          mmap_read_unlock(mm);
           if (ret == -EBUSY)
                  goto again;
           return ret;
       }
-      up_read(&mm->mmap_sem);
+      mmap_read_unlock(mm);
 
       take_lock(driver->update);
       if (mmu_interval_read_retry(&ni, range.notifier_seq) {
--- a/drivers/android/binder_alloc.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/drivers/android/binder_alloc.c
@@ -933,7 +933,7 @@ enum lru_status binder_alloc_free_page(s
 	if (!mmget_not_zero(mm))
 		goto err_mmget;
 	if (!mmap_read_trylock(mm))
-		goto err_down_read_mmap_sem_failed;
+		goto err_mmap_read_lock_failed;
 	vma = binder_alloc_get_vma(alloc);
 
 	list_lru_isolate(lru, item);
@@ -960,7 +960,7 @@ enum lru_status binder_alloc_free_page(s
 	mutex_unlock(&alloc->mutex);
 	return LRU_REMOVED_RETRY;
 
-err_down_read_mmap_sem_failed:
+err_mmap_read_lock_failed:
 	mmput_async(mm);
 err_mmget:
 err_page_already_freed:
--- a/fs/hugetlbfs/inode.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/fs/hugetlbfs/inode.c
@@ -187,7 +187,7 @@ out:
 }
 
 /*
- * Called under down_write(mmap_sem).
+ * Called under mmap_write_lock(mm).
  */
 
 #ifndef HAVE_ARCH_HUGETLB_UNMAPPED_AREA
--- a/fs/userfaultfd.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/fs/userfaultfd.c
@@ -1248,7 +1248,7 @@ static __always_inline void wake_userfau
 	/*
 	 * To be sure waitqueue_active() is not reordered by the CPU
 	 * before the pagetable update, use an explicit SMP memory
-	 * barrier here. PT lock release or up_read(mmap_sem) still
+	 * barrier here. PT lock release or mmap_read_unlock(mm) still
 	 * have release semantics that can allow the
 	 * waitqueue_active() to be reordered before the pte update.
 	 */
--- a/mm/filemap.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/filemap.c
@@ -1373,7 +1373,7 @@ EXPORT_SYMBOL_GPL(__lock_page_killable);
  * Return values:
  * 1 - page is locked; mmap_sem is still held.
  * 0 - page is not locked.
- *     mmap_sem has been released (up_read()), unless flags had both
+ *     mmap_lock has been released (mmap_read_unlock(), unless flags had both
  *     FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_RETRY_NOWAIT set, in
  *     which case mmap_sem is still held.
  *
--- a/mm/gup.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/gup.c
@@ -1993,19 +1993,19 @@ EXPORT_SYMBOL(get_user_pages);
 /**
  * get_user_pages_locked() is suitable to replace the form:
  *
- *      down_read(&mm->mmap_sem);
+ *      mmap_read_lock(mm);
  *      do_something()
  *      get_user_pages(tsk, mm, ..., pages, NULL);
- *      up_read(&mm->mmap_sem);
+ *      mmap_read_unlock(mm);
  *
  *  to:
  *
  *      int locked = 1;
- *      down_read(&mm->mmap_sem);
+ *      mmap_read_lock(mm);
  *      do_something()
  *      get_user_pages_locked(tsk, mm, ..., pages, &locked);
  *      if (locked)
- *          up_read(&mm->mmap_sem);
+ *          mmap_read_unlock(mm);
  *
  * @start:      starting user address
  * @nr_pages:   number of pages from start to pin
@@ -2050,9 +2050,9 @@ EXPORT_SYMBOL(get_user_pages_locked);
 /*
  * get_user_pages_unlocked() is suitable to replace the form:
  *
- *      down_read(&mm->mmap_sem);
+ *      mmap_read_lock(mm);
  *      get_user_pages(tsk, mm, ..., pages, NULL);
- *      up_read(&mm->mmap_sem);
+ *      mmap_read_unlock(mm);
  *
  *  with:
  *
--- a/mm/huge_memory.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/huge_memory.c
@@ -1833,9 +1833,9 @@ int change_huge_pmd(struct vm_area_struc
 		goto unlock;
 
 	/*
-	 * In case prot_numa, we are under down_read(mmap_sem). It's critical
+	 * In case prot_numa, we are under mmap_read_lock(mm). It's critical
 	 * to not clear pmd intermittently to avoid race with MADV_DONTNEED
-	 * which is also under down_read(mmap_sem):
+	 * which is also under mmap_read_lock(mm):
 	 *
 	 *	CPU0:				CPU1:
 	 *				change_huge_pmd(prot_numa=1)
--- a/mm/khugepaged.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/khugepaged.c
@@ -1543,7 +1543,7 @@ static void retract_page_tables(struct a
 		/*
 		 * Check vma->anon_vma to exclude MAP_PRIVATE mappings that
 		 * got written to. These VMAs are likely not worth investing
-		 * down_write(mmap_sem) as PMD-mapping is likely to be split
+		 * mmap_write_lock(mm) as PMD-mapping is likely to be split
 		 * later.
 		 *
 		 * Not that vma->anon_vma check is racy: it can be set up after
--- a/mm/ksm.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/ksm.c
@@ -2362,7 +2362,7 @@ next_mm:
 	} else {
 		mmap_read_unlock(mm);
 		/*
-		 * up_read(&mm->mmap_sem) first because after
+		 * mmap_read_unlock(mm) first because after
 		 * spin_unlock(&ksm_mmlist_lock) run, the "mm" may
 		 * already have been freed under us by __ksm_exit()
 		 * because the "mm_slot" is still hashed and
--- a/mm/memory.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/memory.c
@@ -3323,10 +3323,10 @@ static vm_fault_t do_anonymous_page(stru
 	 * pte_offset_map() on pmds where a huge pmd might be created
 	 * from a different thread.
 	 *
-	 * pte_alloc_map() is safe to use under down_write(mmap_sem) or when
+	 * pte_alloc_map() is safe to use under mmap_write_lock(mm) or when
 	 * parallel threads are excluded by other means.
 	 *
-	 * Here we only have down_read(mmap_sem).
+	 * Here we only have mmap_read_lock(mm).
 	 */
 	if (pte_alloc(vma->vm_mm, vmf->pmd))
 		return VM_FAULT_OOM;
--- a/mm/mempolicy.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/mempolicy.c
@@ -2185,7 +2185,7 @@ static struct page *alloc_page_interleav
  *
  * 	This function allocates a page from the kernel page pool and applies
  *	a NUMA policy associated with the VMA or the current process.
- *	When VMA is not NULL caller must hold down_read on the mmap_sem of the
+ *	When VMA is not NULL caller must read-lock the mmap_lock of the
  *	mm_struct of the VMA to prevent it from going away. Should be used for
  *	all allocations for pages that will be mapped into user space. Returns
  *	NULL when no page can be allocated.
--- a/mm/migrate.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/migrate.c
@@ -2772,10 +2772,10 @@ static void migrate_vma_insert_page(stru
 	 * pte_offset_map() on pmds where a huge pmd might be created
 	 * from a different thread.
 	 *
-	 * pte_alloc_map() is safe to use under down_write(mmap_sem) or when
+	 * pte_alloc_map() is safe to use under mmap_write_lock(mm) or when
 	 * parallel threads are excluded by other means.
 	 *
-	 * Here we only have down_read(mmap_sem).
+	 * Here we only have mmap_read_lock(mm).
 	 */
 	if (pte_alloc(mm, pmdp))
 		goto abort;
--- a/mm/mmap.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/mmap.c
@@ -1361,7 +1361,7 @@ static inline bool file_mmap_ok(struct f
 }
 
 /*
- * The caller must hold down_write(&current->mm->mmap_sem).
+ * The caller must write-lock current->mm->mmap_lock.
  */
 unsigned long do_mmap(struct file *file, unsigned long addr,
 			unsigned long len, unsigned long prot,
--- a/mm/oom_kill.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/mm/oom_kill.c
@@ -577,8 +577,8 @@ static bool oom_reap_task_mm(struct task
 	/*
 	 * MMF_OOM_SKIP is set by exit_mmap when the OOM reaper can't
 	 * work on the mm anymore. The check for MMF_OOM_SKIP must run
-	 * under mmap_sem for reading because it serializes against the
-	 * down_write();up_write() cycle in exit_mmap().
+	 * under mmap_lock for reading because it serializes against the
+	 * mmap_write_lock();mmap_write_unlock() cycle in exit_mmap().
 	 */
 	if (test_bit(MMF_OOM_SKIP, &mm->flags)) {
 		trace_skip_task_reaping(tsk->pid);
@@ -611,7 +611,7 @@ static void oom_reap_task(struct task_st
 	int attempts = 0;
 	struct mm_struct *mm = tsk->signal->oom_mm;
 
-	/* Retry the down_read_trylock(mmap_sem) a few times */
+	/* Retry the mmap_read_trylock(mm) a few times */
 	while (attempts++ < MAX_OOM_REAP_RETRIES && !oom_reap_task_mm(tsk, mm))
 		schedule_timeout_idle(HZ/10);
 
@@ -629,7 +629,7 @@ done:
 
 	/*
 	 * Hide this mm from OOM killer because it has been either reaped or
-	 * somebody can't call up_write(mmap_sem).
+	 * somebody can't call mmap_write_unlock(mm).
 	 */
 	set_bit(MMF_OOM_SKIP, &mm->flags);
 
--- a/net/ipv4/tcp.c~mmap-locking-api-convert-mmap_sem-api-comments
+++ a/net/ipv4/tcp.c
@@ -1734,7 +1734,7 @@ int tcp_mmap(struct file *file, struct s
 		return -EPERM;
 	vma->vm_flags &= ~(VM_MAYWRITE | VM_MAYEXEC);
 
-	/* Instruct vm_insert_page() to not down_read(mmap_sem) */
+	/* Instruct vm_insert_page() to not mmap_read_lock(mm) */
 	vma->vm_flags |= VM_MIXEDMAP;
 
 	vma->vm_ops = &tcp_vm_ops;
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 71/93] mmap locking API: convert mmap_sem comments
  2020-06-09  4:29 incoming Andrew Morton
                   ` (69 preceding siblings ...)
  2020-06-09  4:33 ` [patch 70/93] mmap locking API: convert mmap_sem API comments Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:33 ` [patch 72/93] maccess: unexport probe_kernel_write() Andrew Morton
                   ` (24 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, daniel.m.jordan, dbueso, hughd, jgg, jglisse, jhubbard,
	ldufour, Liam.Howlett, linux-mm, mm-commits, peterz, rientjes,
	torvalds, vbabka, walken, willy, yinghan

From: Michel Lespinasse <walken@google.com>
Subject: mmap locking API: convert mmap_sem comments

Convert comments that reference mmap_sem to reference mmap_lock instead.

[akpm@linux-foundation.org: fix up linux-next leftovers]
[akpm@linux-foundation.org: s/lockaphore/lock/, per Vlastimil]
[akpm@linux-foundation.org: more linux-next fixups, per Michel]
Link: http://lkml.kernel.org/r/20200520052908.204642-13-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Documentation/admin-guide/mm/numa_memory_policy.rst |   10 +-
 Documentation/admin-guide/mm/userfaultfd.rst        |    2 
 Documentation/filesystems/locking.rst               |    2 
 Documentation/vm/transhuge.rst                      |    4 -
 arch/arc/mm/fault.c                                 |    2 
 arch/arm/kernel/vdso.c                              |    2 
 arch/arm/mm/fault.c                                 |    2 
 arch/ia64/mm/fault.c                                |    2 
 arch/microblaze/mm/fault.c                          |    2 
 arch/nds32/mm/fault.c                               |    2 
 arch/powerpc/include/asm/pkeys.h                    |    2 
 arch/powerpc/kvm/book3s_hv_uvmem.c                  |    6 -
 arch/powerpc/mm/book3s32/tlb.c                      |    2 
 arch/powerpc/mm/book3s64/hash_pgtable.c             |    4 -
 arch/powerpc/mm/book3s64/subpage_prot.c             |    2 
 arch/powerpc/mm/fault.c                             |   10 +-
 arch/powerpc/mm/pgtable.c                           |    2 
 arch/powerpc/platforms/cell/spufs/file.c            |    6 -
 arch/riscv/mm/fault.c                               |    2 
 arch/s390/kvm/priv.c                                |    2 
 arch/s390/mm/fault.c                                |    2 
 arch/s390/mm/gmap.c                                 |   32 ++++----
 arch/s390/mm/pgalloc.c                              |    2 
 arch/sh/mm/cache-sh4.c                              |    2 
 arch/sh/mm/fault.c                                  |    2 
 arch/sparc/mm/fault_64.c                            |    2 
 arch/um/kernel/skas/mmu.c                           |    2 
 arch/um/kernel/tlb.c                                |    2 
 arch/unicore32/mm/fault.c                           |    2 
 arch/x86/events/core.c                              |    2 
 arch/x86/include/asm/mmu.h                          |    2 
 arch/x86/include/asm/pgtable-3level.h               |    8 +-
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c           |    6 -
 arch/x86/kernel/cpu/resctrl/rdtgroup.c              |    6 -
 arch/x86/kernel/ldt.c                               |    2 
 arch/x86/mm/fault.c                                 |   12 +--
 drivers/char/mspec.c                                |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h          |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c   |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c   |    2 
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c         |    6 -
 drivers/gpu/drm/i915/i915_perf.c                    |    2 
 drivers/gpu/drm/ttm/ttm_bo_vm.c                     |    6 -
 drivers/infiniband/core/uverbs_main.c               |    2 
 drivers/infiniband/hw/hfi1/mmu_rb.c                 |    2 
 drivers/media/v4l2-core/videobuf-dma-sg.c           |    2 
 drivers/misc/cxl/cxllib.c                           |    5 -
 drivers/misc/sgi-gru/grufault.c                     |    8 +-
 drivers/oprofile/buffer_sync.c                      |    2 
 drivers/staging/android/ashmem.c                    |    4 -
 drivers/staging/comedi/comedi_fops.c                |    2 
 drivers/tty/vt/consolemap.c                         |    2 
 drivers/vfio/pci/vfio_pci.c                         |   14 +--
 drivers/xen/gntdev.c                                |    2 
 fs/coredump.c                                       |    4 -
 fs/exec.c                                           |    2 
 fs/ext2/file.c                                      |    2 
 fs/ext4/super.c                                     |    6 -
 fs/kernfs/file.c                                    |    4 -
 fs/proc/base.c                                      |    6 -
 fs/proc/task_mmu.c                                  |    6 -
 fs/userfaultfd.c                                    |   18 ++--
 fs/xfs/xfs_file.c                                   |    2 
 fs/xfs/xfs_inode.c                                  |   14 +--
 fs/xfs/xfs_iops.c                                   |    4 -
 include/linux/fs.h                                  |    4 -
 include/linux/huge_mm.h                             |    2 
 include/linux/mempolicy.h                           |    2 
 include/linux/mm.h                                  |   10 +-
 include/linux/mm_types.h                            |    2 
 include/linux/mmu_notifier.h                        |    8 +-
 include/linux/pagemap.h                             |    2 
 include/linux/pgtable.h                             |    6 -
 include/linux/rmap.h                                |    2 
 include/linux/sched/mm.h                            |   10 +-
 kernel/acct.c                                       |    2 
 kernel/cgroup/cpuset.c                              |    4 -
 kernel/events/core.c                                |    6 -
 kernel/events/uprobes.c                             |    4 -
 kernel/exit.c                                       |    2 
 kernel/relay.c                                      |    2 
 kernel/sys.c                                        |    4 -
 lib/test_lockup.c                                   |    8 +-
 mm/filemap.c                                        |   38 ++++-----
 mm/frame_vector.c                                   |    2 
 mm/gup.c                                            |   38 ++++-----
 mm/huge_memory.c                                    |    4 -
 mm/hugetlb.c                                        |    2 
 mm/internal.h                                       |    4 -
 mm/khugepaged.c                                     |   34 ++++----
 mm/ksm.c                                            |   12 +--
 mm/maccess.c                                        |    4 -
 mm/madvise.c                                        |   20 ++---
 mm/memcontrol.c                                     |    2 
 mm/memory.c                                         |   40 +++++-----
 mm/mempolicy.c                                      |   12 +--
 mm/migrate.c                                        |    4 -
 mm/mlock.c                                          |    6 -
 mm/mmap.c                                           |   36 ++++-----
 mm/mmu_gather.c                                     |    2 
 mm/mmu_notifier.c                                   |   10 +-
 mm/mprotect.c                                       |    8 +-
 mm/mremap.c                                         |    8 +-
 mm/nommu.c                                          |    6 -
 mm/oom_kill.c                                       |    2 
 mm/pagewalk.c                                       |    6 -
 mm/rmap.c                                           |   12 +--
 mm/shmem.c                                          |    4 -
 mm/swap_state.c                                     |    4 -
 mm/userfaultfd.c                                    |    8 +-
 mm/util.c                                           |    2 
 security/keys/keyctl.c                              |    2 
 sound/core/oss/pcm_oss.c                            |    2 
 113 files changed, 351 insertions(+), 352 deletions(-)

--- a/arch/arc/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/arc/mm/fault.c
@@ -141,7 +141,7 @@ retry:
 	}
 
 	/*
-	 * Fault retry nuances, mmap_sem already relinquished by core mm
+	 * Fault retry nuances, mmap_lock already relinquished by core mm
 	 */
 	if (unlikely((fault & VM_FAULT_RETRY) &&
 		     (flags & FAULT_FLAG_ALLOW_RETRY))) {
--- a/arch/arm/kernel/vdso.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/arm/kernel/vdso.c
@@ -240,7 +240,7 @@ static int install_vvar(struct mm_struct
 	return PTR_ERR_OR_ZERO(vma);
 }
 
-/* assumes mmap_sem is write-locked */
+/* assumes mmap_lock is write-locked */
 void arm_install_vdso(struct mm_struct *mm, unsigned long addr)
 {
 	struct vm_area_struct *vma;
--- a/arch/arm/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/arm/mm/fault.c
@@ -293,7 +293,7 @@ retry:
 	fault = __do_page_fault(mm, addr, fsr, flags, tsk);
 
 	/* If we need to retry but a fatal signal is pending, handle the
-	 * signal first. We do not need to release the mmap_sem because
+	 * signal first. We do not need to release the mmap_lock because
 	 * it would already be released in __lock_page_or_retry in
 	 * mm/filemap.c. */
 	if (fault_signal_pending(fault, regs)) {
--- a/arch/ia64/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/ia64/mm/fault.c
@@ -86,7 +86,7 @@ ia64_do_page_fault (unsigned long addres
 #ifdef CONFIG_VIRTUAL_MEM_MAP
 	/*
 	 * If fault is in region 5 and we are in the kernel, we may already
-	 * have the mmap_sem (pfn_valid macro is called during mmap). There
+	 * have the mmap_lock (pfn_valid macro is called during mmap). There
 	 * is no vma for region 5 addr's anyway, so skip getting the semaphore
 	 * and go directly to the exception handling code.
 	 */
--- a/arch/microblaze/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/microblaze/mm/fault.c
@@ -124,7 +124,7 @@ void do_page_fault(struct pt_regs *regs,
 	/* When running in the kernel we expect faults to occur only to
 	 * addresses in user space.  All other faults represent errors in the
 	 * kernel and should generate an OOPS.  Unfortunately, in the case of an
-	 * erroneous fault occurring in a code path which already holds mmap_sem
+	 * erroneous fault occurring in a code path which already holds mmap_lock
 	 * we will deadlock attempting to validate the fault against the
 	 * address space.  Luckily the kernel only validly references user
 	 * space from well defined areas of code, which are listed in the
--- a/arch/nds32/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/nds32/mm/fault.c
@@ -210,7 +210,7 @@ good_area:
 
 	/*
 	 * If we need to retry but a fatal signal is pending, handle the
-	 * signal first. We do not need to release the mmap_sem because it
+	 * signal first. We do not need to release the mmap_lock because it
 	 * would already be released in __lock_page_or_retry in mm/filemap.c.
 	 */
 	if (fault_signal_pending(fault, regs)) {
--- a/arch/powerpc/include/asm/pkeys.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/include/asm/pkeys.h
@@ -101,7 +101,7 @@ static inline bool mm_pkey_is_allocated(
 
 /*
  * Returns a positive, 5-bit key on success, or -1 on failure.
- * Relies on the mmap_sem to protect against concurrency in mm_pkey_alloc() and
+ * Relies on the mmap_lock to protect against concurrency in mm_pkey_alloc() and
  * mm_pkey_free().
  */
 static inline int mm_pkey_alloc(struct mm_struct *mm)
--- a/arch/powerpc/kvm/book3s_hv_uvmem.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/kvm/book3s_hv_uvmem.c
@@ -47,7 +47,7 @@
  * Locking order
  *
  * 1. kvm->srcu - Protects KVM memslots
- * 2. kvm->mm->mmap_sem - find_vma, migrate_vma_pages and helpers, ksm_madvise
+ * 2. kvm->mm->mmap_lock - find_vma, migrate_vma_pages and helpers, ksm_madvise
  * 3. kvm->arch.uvmem_lock - protects read/writes to uvmem slots thus acting
  *			     as sync-points for page-in/out
  */
@@ -402,8 +402,8 @@ kvmppc_svm_page_in(struct vm_area_struct
 	mig.dst = &dst_pfn;
 
 	/*
-	 * We come here with mmap_sem write lock held just for
-	 * ksm_madvise(), otherwise we only need read mmap_sem.
+	 * We come here with mmap_lock write lock held just for
+	 * ksm_madvise(), otherwise we only need read mmap_lock.
 	 * Hence downgrade to read lock once ksm_madvise() is done.
 	 */
 	ret = ksm_madvise(vma, vma->vm_start, vma->vm_end,
--- a/arch/powerpc/mm/book3s32/tlb.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/mm/book3s32/tlb.c
@@ -129,7 +129,7 @@ void flush_tlb_mm(struct mm_struct *mm)
 
 	/*
 	 * It is safe to go down the mm's list of vmas when called
-	 * from dup_mmap, holding mmap_sem.  It would also be safe from
+	 * from dup_mmap, holding mmap_lock.  It would also be safe from
 	 * unmap_region or exit_mmap, but not from vmtruncate on SMP -
 	 * but it seems dup_mmap is the only SMP case which gets here.
 	 */
--- a/arch/powerpc/mm/book3s64/hash_pgtable.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/mm/book3s64/hash_pgtable.c
@@ -237,7 +237,7 @@ pmd_t hash__pmdp_collapse_flush(struct v
 	 * to hugepage, we first clear the pmd, then invalidate all
 	 * the PTE entries. The assumption here is that any low level
 	 * page fault will see a none pmd and take the slow path that
-	 * will wait on mmap_sem. But we could very well be in a
+	 * will wait on mmap_lock. But we could very well be in a
 	 * hash_page with local ptep pointer value. Such a hash page
 	 * can result in adding new HPTE entries for normal subpages.
 	 * That means we could be modifying the page content as we
@@ -251,7 +251,7 @@ pmd_t hash__pmdp_collapse_flush(struct v
 	 * Now invalidate the hpte entries in the range
 	 * covered by pmd. This make sure we take a
 	 * fault and will find the pmd as none, which will
-	 * result in a major fault which takes mmap_sem and
+	 * result in a major fault which takes mmap_lock and
 	 * hence wait for collapse to complete. Without this
 	 * the __collapse_huge_page_copy can result in copying
 	 * the old content.
--- a/arch/powerpc/mm/book3s64/subpage_prot.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/mm/book3s64/subpage_prot.c
@@ -225,7 +225,7 @@ SYSCALL_DEFINE3(subpage_prot, unsigned l
 	if (!spt) {
 		/*
 		 * Allocate subpage prot table if not already done.
-		 * Do this with mmap_sem held
+		 * Do this with mmap_lock held
 		 */
 		spt = kzalloc(sizeof(struct subpage_prot_table), GFP_KERNEL);
 		if (!spt) {
--- a/arch/powerpc/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/mm/fault.c
@@ -138,7 +138,7 @@ static noinline int bad_access_pkey(stru
 	 * 2. T1   : set AMR to deny access to pkey=4, touches, page
 	 * 3. T1   : faults...
 	 * 4.    T2: mprotect_key(foo, PAGE_SIZE, pkey=5);
-	 * 5. T1   : enters fault handler, takes mmap_sem, etc...
+	 * 5. T1   : enters fault handler, takes mmap_lock, etc...
 	 * 6. T1   : reaches here, sees vma_pkey(vma)=5, when we really
 	 *	     faulted on a pte with its pkey=4.
 	 */
@@ -525,9 +525,9 @@ static int __do_page_fault(struct pt_reg
 	perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
 
 	/*
-	 * We want to do this outside mmap_sem, because reading code around nip
+	 * We want to do this outside mmap_lock, because reading code around nip
 	 * can result in fault, which will cause a deadlock when called with
-	 * mmap_sem held
+	 * mmap_lock held
 	 */
 	if (is_user)
 		flags |= FAULT_FLAG_USER;
@@ -539,7 +539,7 @@ static int __do_page_fault(struct pt_reg
 	/* When running in the kernel we expect faults to occur only to
 	 * addresses in user space.  All other faults represent errors in the
 	 * kernel and should generate an OOPS.  Unfortunately, in the case of an
-	 * erroneous fault occurring in a code path which already holds mmap_sem
+	 * erroneous fault occurring in a code path which already holds mmap_lock
 	 * we will deadlock attempting to validate the fault against the
 	 * address space.  Luckily the kernel only validly references user
 	 * space from well defined areas of code, which are listed in the
@@ -615,7 +615,7 @@ good_area:
 		return user_mode(regs) ? 0 : SIGBUS;
 
 	/*
-	 * Handle the retry right now, the mmap_sem has been released in that
+	 * Handle the retry right now, the mmap_lock has been released in that
 	 * case.
 	 */
 	if (unlikely(fault & VM_FAULT_RETRY)) {
--- a/arch/powerpc/mm/pgtable.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/mm/pgtable.c
@@ -306,7 +306,7 @@ void assert_pte_locked(struct mm_struct
 	pmd = pmd_offset(pud, addr);
 	/*
 	 * khugepaged to collapse normal pages to hugepage, first set
-	 * pmd to none to force page fault/gup to take mmap_sem. After
+	 * pmd to none to force page fault/gup to take mmap_lock. After
 	 * pmd is set to none, we do a pte_clear which does this assertion
 	 * so if we find pmd none, return.
 	 */
--- a/arch/powerpc/platforms/cell/spufs/file.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/powerpc/platforms/cell/spufs/file.c
@@ -325,7 +325,7 @@ static vm_fault_t spufs_ps_fault(struct
 		return VM_FAULT_SIGBUS;
 
 	/*
-	 * Because we release the mmap_sem, the context may be destroyed while
+	 * Because we release the mmap_lock, the context may be destroyed while
 	 * we're in spu_wait. Grab an extra reference so it isn't destroyed
 	 * in the meantime.
 	 */
@@ -334,8 +334,8 @@ static vm_fault_t spufs_ps_fault(struct
 	/*
 	 * We have to wait for context to be loaded before we have
 	 * pages to hand out to the user, but we don't want to wait
-	 * with the mmap_sem held.
-	 * It is possible to drop the mmap_sem here, but then we need
+	 * with the mmap_lock held.
+	 * It is possible to drop the mmap_lock here, but then we need
 	 * to return VM_FAULT_NOPAGE because the mappings may have
 	 * hanged.
 	 */
--- a/arch/riscv/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/riscv/mm/fault.c
@@ -114,7 +114,7 @@ good_area:
 
 	/*
 	 * If we need to retry but a fatal signal is pending, handle the
-	 * signal first. We do not need to release the mmap_sem because it
+	 * signal first. We do not need to release the mmap_lock because it
 	 * would already be released in __lock_page_or_retry in mm/filemap.c.
 	 */
 	if (fault_signal_pending(fault, regs))
--- a/arch/s390/kvm/priv.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/s390/kvm/priv.c
@@ -1122,7 +1122,7 @@ static int handle_pfmf(struct kvm_vcpu *
 }
 
 /*
- * Must be called with relevant read locks held (kvm->mm->mmap_sem, kvm->srcu)
+ * Must be called with relevant read locks held (kvm->mm->mmap_lock, kvm->srcu)
  */
 static inline int __do_essa(struct kvm_vcpu *vcpu, const int orc)
 {
--- a/arch/s390/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/s390/mm/fault.c
@@ -507,7 +507,7 @@ retry:
 			if (IS_ENABLED(CONFIG_PGSTE) && gmap &&
 			    (flags & FAULT_FLAG_RETRY_NOWAIT)) {
 				/* FAULT_FLAG_RETRY_NOWAIT has been set,
-				 * mmap_sem has not been released */
+				 * mmap_lock has not been released */
 				current->thread.gmap_pfault = 1;
 				fault = VM_FAULT_PFAULT;
 				goto out_up;
--- a/arch/s390/mm/gmap.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/s390/mm/gmap.c
@@ -300,7 +300,7 @@ struct gmap *gmap_get_enabled(void)
 EXPORT_SYMBOL_GPL(gmap_get_enabled);
 
 /*
- * gmap_alloc_table is assumed to be called with mmap_sem held
+ * gmap_alloc_table is assumed to be called with mmap_lock held
  */
 static int gmap_alloc_table(struct gmap *gmap, unsigned long *table,
 			    unsigned long init, unsigned long gaddr)
@@ -466,7 +466,7 @@ EXPORT_SYMBOL_GPL(gmap_map_segment);
  * Returns user space address which corresponds to the guest address or
  * -EFAULT if no such mapping exists.
  * This function does not establish potentially missing page table entries.
- * The mmap_sem of the mm that belongs to the address space must be held
+ * The mmap_lock of the mm that belongs to the address space must be held
  * when this function gets called.
  *
  * Note: Can also be called for shadow gmaps.
@@ -534,7 +534,7 @@ static void gmap_pmdp_xchg(struct gmap *
  *
  * Returns 0 on success, -ENOMEM for out of memory conditions, and -EFAULT
  * if the vm address is already mapped to a different guest segment.
- * The mmap_sem of the mm that belongs to the address space must be held
+ * The mmap_lock of the mm that belongs to the address space must be held
  * when this function gets called.
  */
 int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr)
@@ -655,7 +655,7 @@ retry:
 		goto out_up;
 	}
 	/*
-	 * In the case that fixup_user_fault unlocked the mmap_sem during
+	 * In the case that fixup_user_fault unlocked the mmap_lock during
 	 * faultin redo __gmap_translate to not race with a map/unmap_segment.
 	 */
 	if (unlocked)
@@ -669,7 +669,7 @@ out_up:
 EXPORT_SYMBOL_GPL(gmap_fault);
 
 /*
- * this function is assumed to be called with mmap_sem held
+ * this function is assumed to be called with mmap_lock held
  */
 void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
 {
@@ -882,7 +882,7 @@ static int gmap_pte_op_fixup(struct gmap
 	if (fixup_user_fault(current, mm, vmaddr, fault_flags, &unlocked))
 		return -EFAULT;
 	if (unlocked)
-		/* lost mmap_sem, caller has to retry __gmap_translate */
+		/* lost mmap_lock, caller has to retry __gmap_translate */
 		return 0;
 	/* Connect the page tables */
 	return __gmap_link(gmap, gaddr, vmaddr);
@@ -953,7 +953,7 @@ static inline void gmap_pmd_op_end(struc
  * -EAGAIN if a fixup is needed
  * -EINVAL if unsupported notifier bits have been specified
  *
- * Expected to be called with sg->mm->mmap_sem in read and
+ * Expected to be called with sg->mm->mmap_lock in read and
  * guest_table_lock held.
  */
 static int gmap_protect_pmd(struct gmap *gmap, unsigned long gaddr,
@@ -999,7 +999,7 @@ static int gmap_protect_pmd(struct gmap
  * Returns 0 if successfully protected, -ENOMEM if out of memory and
  * -EAGAIN if a fixup is needed.
  *
- * Expected to be called with sg->mm->mmap_sem in read
+ * Expected to be called with sg->mm->mmap_lock in read
  */
 static int gmap_protect_pte(struct gmap *gmap, unsigned long gaddr,
 			    pmd_t *pmdp, int prot, unsigned long bits)
@@ -1035,7 +1035,7 @@ static int gmap_protect_pte(struct gmap
  * Returns 0 if successfully protected, -ENOMEM if out of memory and
  * -EFAULT if gaddr is invalid (or mapping for shadows is missing).
  *
- * Called with sg->mm->mmap_sem in read.
+ * Called with sg->mm->mmap_lock in read.
  */
 static int gmap_protect_range(struct gmap *gmap, unsigned long gaddr,
 			      unsigned long len, int prot, unsigned long bits)
@@ -1124,7 +1124,7 @@ EXPORT_SYMBOL_GPL(gmap_mprotect_notify);
  * if reading using the virtual address failed. -EINVAL if called on a gmap
  * shadow.
  *
- * Called with gmap->mm->mmap_sem in read.
+ * Called with gmap->mm->mmap_lock in read.
  */
 int gmap_read_table(struct gmap *gmap, unsigned long gaddr, unsigned long *val)
 {
@@ -1729,7 +1729,7 @@ EXPORT_SYMBOL_GPL(gmap_shadow);
  * shadow table structure is incomplete, -ENOMEM if out of memory and
  * -EFAULT if an address in the parent gmap could not be resolved.
  *
- * Called with sg->mm->mmap_sem in read.
+ * Called with sg->mm->mmap_lock in read.
  */
 int gmap_shadow_r2t(struct gmap *sg, unsigned long saddr, unsigned long r2t,
 		    int fake)
@@ -1813,7 +1813,7 @@ EXPORT_SYMBOL_GPL(gmap_shadow_r2t);
  * shadow table structure is incomplete, -ENOMEM if out of memory and
  * -EFAULT if an address in the parent gmap could not be resolved.
  *
- * Called with sg->mm->mmap_sem in read.
+ * Called with sg->mm->mmap_lock in read.
  */
 int gmap_shadow_r3t(struct gmap *sg, unsigned long saddr, unsigned long r3t,
 		    int fake)
@@ -1897,7 +1897,7 @@ EXPORT_SYMBOL_GPL(gmap_shadow_r3t);
  * shadow table structure is incomplete, -ENOMEM if out of memory and
  * -EFAULT if an address in the parent gmap could not be resolved.
  *
- * Called with sg->mm->mmap_sem in read.
+ * Called with sg->mm->mmap_lock in read.
  */
 int gmap_shadow_sgt(struct gmap *sg, unsigned long saddr, unsigned long sgt,
 		    int fake)
@@ -1981,7 +1981,7 @@ EXPORT_SYMBOL_GPL(gmap_shadow_sgt);
  * Returns 0 if the shadow page table was found and -EAGAIN if the page
  * table was not found.
  *
- * Called with sg->mm->mmap_sem in read.
+ * Called with sg->mm->mmap_lock in read.
  */
 int gmap_shadow_pgt_lookup(struct gmap *sg, unsigned long saddr,
 			   unsigned long *pgt, int *dat_protection,
@@ -2021,7 +2021,7 @@ EXPORT_SYMBOL_GPL(gmap_shadow_pgt_lookup
  * shadow table structure is incomplete, -ENOMEM if out of memory,
  * -EFAULT if an address in the parent gmap could not be resolved and
  *
- * Called with gmap->mm->mmap_sem in read
+ * Called with gmap->mm->mmap_lock in read
  */
 int gmap_shadow_pgt(struct gmap *sg, unsigned long saddr, unsigned long pgt,
 		    int fake)
@@ -2100,7 +2100,7 @@ EXPORT_SYMBOL_GPL(gmap_shadow_pgt);
  * shadow table structure is incomplete, -ENOMEM if out of memory and
  * -EFAULT if an address in the parent gmap could not be resolved.
  *
- * Called with sg->mm->mmap_sem in read.
+ * Called with sg->mm->mmap_lock in read.
  */
 int gmap_shadow_page(struct gmap *sg, unsigned long saddr, pte_t pte)
 {
--- a/arch/s390/mm/pgalloc.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/s390/mm/pgalloc.c
@@ -114,7 +114,7 @@ int crst_table_upgrade(struct mm_struct
 	spin_lock_bh(&mm->page_table_lock);
 
 	/*
-	 * This routine gets called with mmap_sem lock held and there is
+	 * This routine gets called with mmap_lock lock held and there is
 	 * no reason to optimize for the case of otherwise. However, if
 	 * that would ever change, the below check will let us know.
 	 */
--- a/arch/sh/mm/cache-sh4.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/sh/mm/cache-sh4.c
@@ -182,7 +182,7 @@ static void sh4_flush_cache_all(void *un
  * accessed with (hence cache set) is in accord with the physical
  * address (i.e. tag).  It's no different here.
  *
- * Caller takes mm->mmap_sem.
+ * Caller takes mm->mmap_lock.
  */
 static void sh4_flush_cache_mm(void *arg)
 {
--- a/arch/sh/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/sh/mm/fault.c
@@ -326,7 +326,7 @@ mm_fault_error(struct pt_regs *regs, uns
 		return 1;
 	}
 
-	/* Release mmap_sem first if necessary */
+	/* Release mmap_lock first if necessary */
 	if (!(fault & VM_FAULT_RETRY))
 		mmap_read_unlock(current->mm);
 
--- a/arch/sparc/mm/fault_64.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/sparc/mm/fault_64.c
@@ -70,7 +70,7 @@ static void __kprobes bad_kernel_pc(stru
 }
 
 /*
- * We now make sure that mmap_sem is held in all paths that call 
+ * We now make sure that mmap_lock is held in all paths that call
  * this. Additionally, to prevent kswapd from ripping ptes from
  * under us, raise interrupts around the time that we look at the
  * pte, kswapd will have to wait to get his smp ipi response from
--- a/arch/um/kernel/skas/mmu.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/um/kernel/skas/mmu.c
@@ -114,7 +114,7 @@ void uml_setup_stubs(struct mm_struct *m
 	mm->context.stub_pages[0] = virt_to_page(__syscall_stub_start);
 	mm->context.stub_pages[1] = virt_to_page(mm->context.id.stack);
 
-	/* dup_mmap already holds mmap_sem */
+	/* dup_mmap already holds mmap_lock */
 	err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START,
 				      VM_READ | VM_MAYREAD | VM_EXEC |
 				      VM_MAYEXEC | VM_DONTCOPY | VM_PFNMAP,
--- a/arch/um/kernel/tlb.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/um/kernel/tlb.c
@@ -348,7 +348,7 @@ void fix_range_common(struct mm_struct *
 	if (ret) {
 		printk(KERN_ERR "fix_range_common: failed, killing current "
 		       "process: %d\n", task_tgid_vnr(current));
-		/* We are under mmap_sem, release it such that current can terminate */
+		/* We are under mmap_lock, release it such that current can terminate */
 		mmap_write_unlock(current->mm);
 		force_sig(SIGKILL);
 		do_signal(&current->thread.regs);
--- a/arch/unicore32/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/unicore32/mm/fault.c
@@ -246,7 +246,7 @@ retry:
 	fault = __do_pf(mm, addr, fsr, flags, tsk);
 
 	/* If we need to retry but a fatal signal is pending, handle the
-	 * signal first. We do not need to release the mmap_sem because
+	 * signal first. We do not need to release the mmap_lock because
 	 * it would already be released in __lock_page_or_retry in
 	 * mm/filemap.c. */
 	if (fault_signal_pending(fault, regs))
--- a/arch/x86/events/core.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/events/core.c
@@ -2178,7 +2178,7 @@ static void x86_pmu_event_mapped(struct
 	 * userspace with CR4.PCE clear while another task is still
 	 * doing on_each_cpu_mask() to propagate CR4.PCE.
 	 *
-	 * For now, this can't happen because all callers hold mmap_sem
+	 * For now, this can't happen because all callers hold mmap_lock
 	 * for write.  If this changes, we'll need a different solution.
 	 */
 	mmap_assert_write_locked(mm);
--- a/arch/x86/include/asm/mmu.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/include/asm/mmu.h
@@ -45,7 +45,7 @@ typedef struct {
 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
 	/*
 	 * One bit per protection key says whether userspace can
-	 * use it or not.  protected by mmap_sem.
+	 * use it or not.  protected by mmap_lock.
 	 */
 	u16 pkey_allocation_map;
 	s16 execute_only_pkey;
--- a/arch/x86/include/asm/pgtable-3level.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/include/asm/pgtable-3level.h
@@ -39,23 +39,23 @@ static inline void native_set_pte(pte_t
  * pte_offset_map_lock() on 32-bit PAE kernels was reading the pmd_t with
  * a "*pmdp" dereference done by GCC. Problem is, in certain places
  * where pte_offset_map_lock() is called, concurrent page faults are
- * allowed, if the mmap_sem is hold for reading. An example is mincore
+ * allowed, if the mmap_lock is hold for reading. An example is mincore
  * vs page faults vs MADV_DONTNEED. On the page fault side
  * pmd_populate() rightfully does a set_64bit(), but if we're reading the
  * pmd_t with a "*pmdp" on the mincore side, a SMP race can happen
  * because GCC will not read the 64-bit value of the pmd atomically.
  *
  * To fix this all places running pte_offset_map_lock() while holding the
- * mmap_sem in read mode, shall read the pmdp pointer using this
+ * mmap_lock in read mode, shall read the pmdp pointer using this
  * function to know if the pmd is null or not, and in turn to know if
  * they can run pte_offset_map_lock() or pmd_trans_huge() or other pmd
  * operations.
  *
- * Without THP if the mmap_sem is held for reading, the pmd can only
+ * Without THP if the mmap_lock is held for reading, the pmd can only
  * transition from null to not null while pmd_read_atomic() runs. So
  * we can always return atomic pmd values with this function.
  *
- * With THP if the mmap_sem is held for reading, the pmd can become
+ * With THP if the mmap_lock is held for reading, the pmd can become
  * trans_huge or none or point to a pte (and in turn become "stable")
  * at any time under pmd_read_atomic(). We could read it truly
  * atomically here with an atomic64_read() for the THP enabled case (and
--- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
@@ -1326,9 +1326,9 @@ int rdtgroup_pseudo_lock_create(struct r
 	 * pseudo-locked region will still be here on return.
 	 *
 	 * The mutex has to be released temporarily to avoid a potential
-	 * deadlock with the mm->mmap_sem semaphore which is obtained in
-	 * the device_create() and debugfs_create_dir() callpath below
-	 * as well as before the mmap() callback is called.
+	 * deadlock with the mm->mmap_lock which is obtained in the
+	 * device_create() and debugfs_create_dir() callpath below as well as
+	 * before the mmap() callback is called.
 	 */
 	mutex_unlock(&rdtgroup_mutex);
 
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -3199,10 +3199,10 @@ int __init rdtgroup_init(void)
 	 * during the debugfs directory creation also &sb->s_type->i_mutex_key
 	 * (the lockdep class of inode->i_rwsem). Other filesystem
 	 * interactions (eg. SyS_getdents) have the lock ordering:
-	 * &sb->s_type->i_mutex_key --> &mm->mmap_sem
-	 * During mmap(), called with &mm->mmap_sem, the rdtgroup_mutex
+	 * &sb->s_type->i_mutex_key --> &mm->mmap_lock
+	 * During mmap(), called with &mm->mmap_lock, the rdtgroup_mutex
 	 * is taken, thus creating dependency:
-	 * &mm->mmap_sem --> rdtgroup_mutex for the latter that can cause
+	 * &mm->mmap_lock --> rdtgroup_mutex for the latter that can cause
 	 * issues considering the other two lock dependencies.
 	 * By creating the debugfs directory here we avoid a dependency
 	 * that may cause deadlock (even though file operations cannot
--- a/arch/x86/kernel/ldt.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/kernel/ldt.c
@@ -8,7 +8,7 @@
  *
  * Lock order:
  *	contex.ldt_usr_sem
- *	  mmap_sem
+ *	  mmap_lock
  *	    context.lock
  */
 
--- a/arch/x86/mm/fault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/arch/x86/mm/fault.c
@@ -865,7 +865,7 @@ bad_area_access_error(struct pt_regs *re
 		 * 2. T1   : set PKRU to deny access to pkey=4, touches page
 		 * 3. T1   : faults...
 		 * 4.    T2: mprotect_key(foo, PAGE_SIZE, pkey=5);
-		 * 5. T1   : enters fault handler, takes mmap_sem, etc...
+		 * 5. T1   : enters fault handler, takes mmap_lock, etc...
 		 * 6. T1   : reaches here, sees vma_pkey(vma)=5, when we really
 		 *	     faulted on a pte with its pkey=4.
 		 */
@@ -1231,12 +1231,12 @@ void do_user_addr_fault(struct pt_regs *
 	 * Kernel-mode access to the user address space should only occur
 	 * on well-defined single instructions listed in the exception
 	 * tables.  But, an erroneous kernel fault occurring outside one of
-	 * those areas which also holds mmap_sem might deadlock attempting
+	 * those areas which also holds mmap_lock might deadlock attempting
 	 * to validate the fault against the address space.
 	 *
 	 * Only do the expensive exception table search when we might be at
 	 * risk of a deadlock.  This happens if we
-	 * 1. Failed to acquire mmap_sem, and
+	 * 1. Failed to acquire mmap_lock, and
 	 * 2. The access did not originate in userspace.
 	 */
 	if (unlikely(!mmap_read_trylock(mm))) {
@@ -1289,9 +1289,9 @@ good_area:
 	 * If for any reason at all we couldn't handle the fault,
 	 * make sure we exit gracefully rather than endlessly redo
 	 * the fault.  Since we never set FAULT_FLAG_RETRY_NOWAIT, if
-	 * we get VM_FAULT_RETRY back, the mmap_sem has been unlocked.
+	 * we get VM_FAULT_RETRY back, the mmap_lock has been unlocked.
 	 *
-	 * Note that handle_userfault() may also release and reacquire mmap_sem
+	 * Note that handle_userfault() may also release and reacquire mmap_lock
 	 * (and not return with VM_FAULT_RETRY), when returning to userland to
 	 * repeat the page fault later with a VM_FAULT_NOPAGE retval
 	 * (potentially after handling any pending signal during the return to
@@ -1310,7 +1310,7 @@ good_area:
 	}
 
 	/*
-	 * If we need to retry the mmap_sem has already been released,
+	 * If we need to retry the mmap_lock has already been released,
 	 * and if there is a fatal signal pending there is no guarantee
 	 * that we made any progress. Handle this case first.
 	 */
--- a/Documentation/admin-guide/mm/numa_memory_policy.rst~mmap-locking-api-convert-mmap_sem-comments
+++ a/Documentation/admin-guide/mm/numa_memory_policy.rst
@@ -364,19 +364,19 @@ follows:
 
 2) for querying the policy, we do not need to take an extra reference on the
    target task's task policy nor vma policies because we always acquire the
-   task's mm's mmap_sem for read during the query.  The set_mempolicy() and
-   mbind() APIs [see below] always acquire the mmap_sem for write when
+   task's mm's mmap_lock for read during the query.  The set_mempolicy() and
+   mbind() APIs [see below] always acquire the mmap_lock for write when
    installing or replacing task or vma policies.  Thus, there is no possibility
    of a task or thread freeing a policy while another task or thread is
    querying it.
 
 3) Page allocation usage of task or vma policy occurs in the fault path where
-   we hold them mmap_sem for read.  Again, because replacing the task or vma
-   policy requires that the mmap_sem be held for write, the policy can't be
+   we hold them mmap_lock for read.  Again, because replacing the task or vma
+   policy requires that the mmap_lock be held for write, the policy can't be
    freed out from under us while we're using it for page allocation.
 
 4) Shared policies require special consideration.  One task can replace a
-   shared memory policy while another task, with a distinct mmap_sem, is
+   shared memory policy while another task, with a distinct mmap_lock, is
    querying or allocating a page based on the policy.  To resolve this
    potential race, the shared policy infrastructure adds an extra reference
    to the shared policy during lookup while holding a spin lock on the shared
--- a/Documentation/admin-guide/mm/userfaultfd.rst~mmap-locking-api-convert-mmap_sem-comments
+++ a/Documentation/admin-guide/mm/userfaultfd.rst
@@ -33,7 +33,7 @@ memory ranges) provides two primary func
 The real advantage of userfaults if compared to regular virtual memory
 management of mremap/mprotect is that the userfaults in all their
 operations never involve heavyweight structures like vmas (in fact the
-``userfaultfd`` runtime load never takes the mmap_sem for writing).
+``userfaultfd`` runtime load never takes the mmap_lock for writing).
 
 Vmas are not suitable for page- (or hugepage) granular fault tracking
 when dealing with virtual address spaces that could span
--- a/Documentation/filesystems/locking.rst~mmap-locking-api-convert-mmap_sem-comments
+++ a/Documentation/filesystems/locking.rst
@@ -615,7 +615,7 @@ prototypes::
 locking rules:
 
 =============	========	===========================
-ops		mmap_sem	PageLocked(page)
+ops		mmap_lock	PageLocked(page)
 =============	========	===========================
 open:		yes
 close:		yes
--- a/Documentation/vm/transhuge.rst~mmap-locking-api-convert-mmap_sem-comments
+++ a/Documentation/vm/transhuge.rst
@@ -98,9 +98,9 @@ split_huge_page() or split_huge_pmd() ha
 
 To make pagetable walks huge pmd aware, all you need to do is to call
 pmd_trans_huge() on the pmd returned by pmd_offset. You must hold the
-mmap_sem in read (or write) mode to be sure a huge pmd cannot be
+mmap_lock in read (or write) mode to be sure a huge pmd cannot be
 created from under you by khugepaged (khugepaged collapse_huge_page
-takes the mmap_sem in write mode in addition to the anon_vma lock). If
+takes the mmap_lock in write mode in addition to the anon_vma lock). If
 pmd_trans_huge returns false, you just fallback in the old code
 paths. If instead pmd_trans_huge returns true, you have to take the
 page table lock (pmd_lock()) and re-run pmd_trans_huge. Taking the
--- a/drivers/char/mspec.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/char/mspec.c
@@ -64,7 +64,7 @@ enum mspec_page_type {
  * This structure is shared by all vma's that are split off from the
  * original vma when split_vma()'s are done.
  *
- * The refcnt is incremented atomically because mm->mmap_sem does not
+ * The refcnt is incremented atomically because mm->mmap_lock does not
  * protect in fork case where multiple tasks share the vma_data.
  */
 struct vma_data {
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
@@ -237,7 +237,7 @@ static int kgd_hqd_load(struct kgd_dev *
 			     CP_HQD_PQ_DOORBELL_CONTROL, DOORBELL_EN, 1);
 	WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL, data);
 
-	/* read_user_ptr may take the mm->mmap_sem.
+	/* read_user_ptr may take the mm->mmap_lock.
 	 * release srbm_mutex to avoid circular dependency between
 	 * srbm_mutex->mm_sem->reservation_ww_class_mutex->srbm_mutex.
 	 */
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
@@ -224,7 +224,7 @@ static int kgd_hqd_load(struct kgd_dev *
 			     CP_HQD_PQ_DOORBELL_CONTROL, DOORBELL_EN, 1);
 	WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL, data);
 
-	/* read_user_ptr may take the mm->mmap_sem.
+	/* read_user_ptr may take the mm->mmap_lock.
 	 * release srbm_mutex to avoid circular dependency between
 	 * srbm_mutex->mm_sem->reservation_ww_class_mutex->srbm_mutex.
 	 */
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
@@ -186,7 +186,7 @@ uint8_t amdgpu_amdkfd_get_xgmi_hops_coun
  * disabled. The memory must be pinned and mapped to the hardware when
  * this is called in hqd_load functions, so it should never fault in
  * the first place. This resolves a circular lock dependency involving
- * four locks, including the DQM lock and mmap_sem.
+ * four locks, including the DQM lock and mmap_lock.
  */
 #define read_user_wptr(mmptr, wptr, dst)				\
 	({								\
--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
@@ -203,7 +203,7 @@ i915_mmu_notifier_find(struct i915_mm_st
 	mmap_write_lock(mm->mm);
 	mutex_lock(&mm->i915->mm_lock);
 	if (mm->mn == NULL && !err) {
-		/* Protected by mmap_sem (write-lock) */
+		/* Protected by mmap_lock (write-lock) */
 		err = __mmu_notifier_register(&mn->mn, mm->mm);
 		if (!err) {
 			/* Protected by mm_lock */
@@ -522,8 +522,8 @@ __i915_gem_userptr_get_pages_schedule(st
 
 	/* Spawn a worker so that we can acquire the
 	 * user pages without holding our mutex. Access
-	 * to the user pages requires mmap_sem, and we have
-	 * a strict lock ordering of mmap_sem, struct_mutex -
+	 * to the user pages requires mmap_lock, and we have
+	 * a strict lock ordering of mmap_lock, struct_mutex -
 	 * we already hold struct_mutex here and so cannot
 	 * call gup without encountering a lock inversion.
 	 *
--- a/drivers/gpu/drm/i915/i915_perf.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/gpu/drm/i915/i915_perf.c
@@ -3676,7 +3676,7 @@ static int read_properties_unlocked(stru
  * buffered data written by the GPU besides periodic OA metrics.
  *
  * Note we copy the properties from userspace outside of the i915 perf
- * mutex to avoid an awkward lockdep with mmap_sem.
+ * mutex to avoid an awkward lockdep with mmap_lock.
  *
  * Most of the implementation details are handled by
  * i915_perf_open_ioctl_locked() after taking the &perf->lock
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -58,7 +58,7 @@ static vm_fault_t ttm_bo_vm_fault_idle(s
 		goto out_clear;
 
 	/*
-	 * If possible, avoid waiting for GPU with mmap_sem
+	 * If possible, avoid waiting for GPU with mmap_lock
 	 * held.  We only do this if the fault allows retry and this
 	 * is the first attempt.
 	 */
@@ -131,14 +131,14 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_
 {
 	/*
 	 * Work around locking order reversal in fault / nopfn
-	 * between mmap_sem and bo_reserve: Perform a trylock operation
+	 * between mmap_lock and bo_reserve: Perform a trylock operation
 	 * for reserve, and if it fails, retry the fault after waiting
 	 * for the buffer to become unreserved.
 	 */
 	if (unlikely(!dma_resv_trylock(bo->base.resv))) {
 		/*
 		 * If the fault allows retry and this is the first
-		 * fault attempt, we try to release the mmap_sem
+		 * fault attempt, we try to release the mmap_lock
 		 * before waiting
 		 */
 		if (fault_flag_allow_retry_first(vmf->flags)) {
--- a/drivers/infiniband/core/uverbs_main.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/infiniband/core/uverbs_main.c
@@ -835,7 +835,7 @@ void uverbs_user_mmap_disassociate(struc
 			return;
 
 		/*
-		 * The umap_lock is nested under mmap_sem since it used within
+		 * The umap_lock is nested under mmap_lock since it used within
 		 * the vma_ops callbacks, so we have to clean the list one mm
 		 * at a time to get the lock ordering right. Typically there
 		 * will only be one mm, so no big deal.
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -333,7 +333,7 @@ static void do_remove(struct mmu_rb_hand
 
 /*
  * Work queue function to remove all nodes that have been queued up to
- * be removed.  The key feature is that mm->mmap_sem is not being held
+ * be removed.  The key feature is that mm->mmap_lock is not being held
  * and the remove callback can sleep while taking it, if needed.
  */
 static void handle_remove(struct work_struct *work)
--- a/drivers/media/v4l2-core/videobuf-dma-sg.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/media/v4l2-core/videobuf-dma-sg.c
@@ -533,7 +533,7 @@ static int __videobuf_iolock(struct vide
 		} else {
 			/* NOTE: HACK: videobuf_iolock on V4L2_MEMORY_MMAP
 			buffers can only be called from videobuf_qbuf
-			we take current->mm->mmap_sem there, to prevent
+			we take current->mm->mmap_lock there, to prevent
 			locking inversion, so don't take it here */
 
 			err = videobuf_dma_init_user_locked(&mem->dma,
--- a/drivers/misc/cxl/cxllib.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/misc/cxl/cxllib.c
@@ -245,9 +245,8 @@ int cxllib_handle_fault(struct mm_struct
 	     dar += page_size) {
 		if (dar < vma_start || dar >= vma_end) {
 			/*
-			 * We don't hold the mm->mmap_sem semaphore
-			 * while iterating, since the semaphore is
-			 * required by one of the lower-level page
+			 * We don't hold mm->mmap_lock while iterating, since
+			 * the lock is required by one of the lower-level page
 			 * fault processing functions and it could
 			 * create a deadlock.
 			 *
--- a/drivers/misc/sgi-gru/grufault.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/misc/sgi-gru/grufault.c
@@ -42,7 +42,7 @@ static inline int is_gru_paddr(unsigned
 }
 
 /*
- * Find the vma of a GRU segment. Caller must hold mmap_sem.
+ * Find the vma of a GRU segment. Caller must hold mmap_lock.
  */
 struct vm_area_struct *gru_find_vma(unsigned long vaddr)
 {
@@ -58,7 +58,7 @@ struct vm_area_struct *gru_find_vma(unsi
  * Find and lock the gts that contains the specified user vaddr.
  *
  * Returns:
- * 	- *gts with the mmap_sem locked for read and the GTS locked.
+ * 	- *gts with the mmap_lock locked for read and the GTS locked.
  *	- NULL if vaddr invalid OR is not a valid GSEG vaddr.
  */
 
@@ -198,7 +198,7 @@ static int non_atomic_pte_lookup(struct
  * Only supports Intel large pages (2MB only) on x86_64.
  *	ZZZ - hugepage support is incomplete
  *
- * NOTE: mmap_sem is already held on entry to this function. This
+ * NOTE: mmap_lock is already held on entry to this function. This
  * guarantees existence of the page tables.
  */
 static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
@@ -569,7 +569,7 @@ static irqreturn_t gru_intr(int chiplet,
 		}
 
 		/*
-		 * This is running in interrupt context. Trylock the mmap_sem.
+		 * This is running in interrupt context. Trylock the mmap_lock.
 		 * If it fails, retry the fault in user context.
 		 */
 		gts->ustats.fmm_tlbmiss++;
--- a/drivers/oprofile/buffer_sync.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/oprofile/buffer_sync.c
@@ -486,7 +486,7 @@ typedef enum {
 
 /* Sync one of the CPU's buffers into the global event buffer.
  * Here we need to go through each batch of samples punctuated
- * by context switch notes, taking the task's mmap_sem and doing
+ * by context switch notes, taking the task's mmap_lock and doing
  * lookup in task->mm->mmap to convert EIP into dcookie/offset
  * value.
  */
--- a/drivers/staging/android/ashmem.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/staging/android/ashmem.c
@@ -555,7 +555,7 @@ static int set_name(struct ashmem_area *
 
 	/*
 	 * Holding the ashmem_mutex while doing a copy_from_user might cause
-	 * an data abort which would try to access mmap_sem. If another
+	 * an data abort which would try to access mmap_lock. If another
 	 * thread has invoked ashmem_mmap then it will be holding the
 	 * semaphore and will be waiting for ashmem_mutex, there by leading to
 	 * deadlock. We'll release the mutex and take the name to a local
@@ -586,7 +586,7 @@ static int get_name(struct ashmem_area *
 	 * Have a local variable to which we'll copy the content
 	 * from asma with the lock held. Later we can copy this to the user
 	 * space safely without holding any locks. So even if we proceed to
-	 * wait for mmap_sem, it won't lead to deadlock.
+	 * wait for mmap_lock, it won't lead to deadlock.
 	 */
 	char local_name[ASHMEM_NAME_LEN];
 
--- a/drivers/staging/comedi/comedi_fops.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/staging/comedi/comedi_fops.c
@@ -2325,7 +2325,7 @@ static int comedi_mmap(struct file *file
 	int retval = 0;
 
 	/*
-	 * 'trylock' avoids circular dependency with current->mm->mmap_sem
+	 * 'trylock' avoids circular dependency with current->mm->mmap_lock
 	 * and down-reading &dev->attach_lock should normally succeed without
 	 * contention unless the device is in the process of being attached
 	 * or detached.
--- a/drivers/tty/vt/consolemap.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/tty/vt/consolemap.c
@@ -12,7 +12,7 @@
  * Fix bug in inverse translation. Stanislav Voronyi <stas@cnti.uanet.kharkov.ua>, Dec 1998
  *
  * In order to prevent the following circular lock dependency:
- *   &mm->mmap_sem --> cpu_hotplug.lock --> console_lock --> &mm->mmap_sem
+ *   &mm->mmap_lock --> cpu_hotplug.lock --> console_lock --> &mm->mmap_lock
  *
  * We cannot allow page fault to happen while holding the console_lock.
  * Therefore, all the userspace copy operations have to be done outside
--- a/drivers/vfio/pci/vfio_pci.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/vfio/pci/vfio_pci.c
@@ -1185,7 +1185,7 @@ reset_info_exit:
 
 		/*
 		 * We need to get memory_lock for each device, but devices
-		 * can share mmap_sem, therefore we need to zap and hold
+		 * can share mmap_lock, therefore we need to zap and hold
 		 * the vma_lock for each device, and only then get each
 		 * memory_lock.
 		 */
@@ -1375,26 +1375,26 @@ static int vfio_pci_zap_and_vma_lock(str
 
 	/*
 	 * Lock ordering:
-	 * vma_lock is nested under mmap_sem for vm_ops callback paths.
+	 * vma_lock is nested under mmap_lock for vm_ops callback paths.
 	 * The memory_lock semaphore is used by both code paths calling
 	 * into this function to zap vmas and the vm_ops.fault callback
 	 * to protect the memory enable state of the device.
 	 *
-	 * When zapping vmas we need to maintain the mmap_sem => vma_lock
+	 * When zapping vmas we need to maintain the mmap_lock => vma_lock
 	 * ordering, which requires using vma_lock to walk vma_list to
-	 * acquire an mm, then dropping vma_lock to get the mmap_sem and
+	 * acquire an mm, then dropping vma_lock to get the mmap_lock and
 	 * reacquiring vma_lock.  This logic is derived from similar
 	 * requirements in uverbs_user_mmap_disassociate().
 	 *
-	 * mmap_sem must always be the top-level lock when it is taken.
+	 * mmap_lock must always be the top-level lock when it is taken.
 	 * Therefore we can only hold the memory_lock write lock when
-	 * vma_list is empty, as we'd need to take mmap_sem to clear
+	 * vma_list is empty, as we'd need to take mmap_lock to clear
 	 * entries.  vma_list can only be guaranteed empty when holding
 	 * vma_lock, thus memory_lock is nested under vma_lock.
 	 *
 	 * This enables the vm_ops.fault callback to acquire vma_lock,
 	 * followed by memory_lock read lock, while already holding
-	 * mmap_sem without risk of deadlock.
+	 * mmap_lock without risk of deadlock.
 	 */
 	while (1) {
 		struct mm_struct *mm = NULL;
--- a/drivers/xen/gntdev.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/drivers/xen/gntdev.c
@@ -1014,7 +1014,7 @@ static int gntdev_mmap(struct file *flip
 		 * to the PTE from going stale.
 		 *
 		 * Since this vma's mappings can't be touched without the
-		 * mmap_sem, and we are holding it now, there is no need for
+		 * mmap_lock, and we are holding it now, there is no need for
 		 * the notifier_range locking pattern.
 		 */
 		mmu_interval_read_begin(&map->notifier);
--- a/fs/coredump.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/coredump.c
@@ -393,7 +393,7 @@ static int zap_threads(struct task_struc
 	 *	of ->siglock provides a memory barrier.
 	 *
 	 * do_exit:
-	 *	The caller holds mm->mmap_sem. This means that the task which
+	 *	The caller holds mm->mmap_lock. This means that the task which
 	 *	uses this mm can't pass exit_mm(), so it can't exit or clear
 	 *	its ->mm.
 	 *
@@ -401,7 +401,7 @@ static int zap_threads(struct task_struc
 	 *	It does list_replace_rcu(&leader->tasks, &current->tasks),
 	 *	we must see either old or new leader, this does not matter.
 	 *	However, it can change p->sighand, so lock_task_sighand(p)
-	 *	must be used. Since p->mm != NULL and we hold ->mmap_sem
+	 *	must be used. Since p->mm != NULL and we hold ->mmap_lock
 	 *	it can't fail.
 	 *
 	 *	Note also that "g" can be the old leader with ->mm == NULL
--- a/fs/exec.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/exec.c
@@ -1091,7 +1091,7 @@ static int exec_mmap(struct mm_struct *m
 		/*
 		 * Make sure that if there is a core dump in progress
 		 * for the old mm, we get out and die instead of going
-		 * through with the exec.  We must hold mmap_sem around
+		 * through with the exec.  We must hold mmap_lock around
 		 * checking core_state and changing tsk->mm.
 		 */
 		mmap_read_lock(old_mm);
--- a/fs/ext2/file.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/ext2/file.c
@@ -79,7 +79,7 @@ out_unlock:
 /*
  * The lock ordering for ext2 DAX fault paths is:
  *
- * mmap_sem (MM)
+ * mmap_lock (MM)
  *   sb_start_pagefault (vfs, freeze)
  *     ext2_inode_info->dax_sem
  *       address_space->i_mmap_rwsem or page_lock (mutually exclusive in DAX)
--- a/fs/ext4/super.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/ext4/super.c
@@ -93,11 +93,11 @@ static struct inode *ext4_get_journal_in
  * i_mmap_rwsem (inode->i_mmap_rwsem)!
  *
  * page fault path:
- * mmap_sem -> sb_start_pagefault -> i_mmap_sem (r) -> transaction start ->
+ * mmap_lock -> sb_start_pagefault -> i_mmap_sem (r) -> transaction start ->
  *   page lock -> i_data_sem (rw)
  *
  * buffered write path:
- * sb_start_write -> i_mutex -> mmap_sem
+ * sb_start_write -> i_mutex -> mmap_lock
  * sb_start_write -> i_mutex -> transaction start -> page lock ->
  *   i_data_sem (rw)
  *
@@ -107,7 +107,7 @@ static struct inode *ext4_get_journal_in
  *   i_data_sem (rw)
  *
  * direct IO:
- * sb_start_write -> i_mutex -> mmap_sem
+ * sb_start_write -> i_mutex -> mmap_lock
  * sb_start_write -> i_mutex -> transaction start -> i_data_sem (rw)
  *
  * writepages:
--- a/fs/kernfs/file.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/kernfs/file.c
@@ -652,9 +652,9 @@ static int kernfs_fop_open(struct inode
 	 * The following is done to give a different lockdep key to
 	 * @of->mutex for files which implement mmap.  This is a rather
 	 * crude way to avoid false positive lockdep warning around
-	 * mm->mmap_sem - mmap nests @of->mutex under mm->mmap_sem and
+	 * mm->mmap_lock - mmap nests @of->mutex under mm->mmap_lock and
 	 * reading /sys/block/sda/trace/act_mask grabs sr_mutex, under
-	 * which mm->mmap_sem nests, while holding @of->mutex.  As each
+	 * which mm->mmap_lock nests, while holding @of->mutex.  As each
 	 * open file has a separate mutex, it's okay as long as those don't
 	 * happen on the same file.  At this point, we can't easily give
 	 * each file a separate locking class.  Let's differentiate on
--- a/fs/proc/base.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/proc/base.c
@@ -2333,11 +2333,11 @@ proc_map_files_readdir(struct file *file
 	/*
 	 * We need two passes here:
 	 *
-	 *  1) Collect vmas of mapped files with mmap_sem taken
-	 *  2) Release mmap_sem and instantiate entries
+	 *  1) Collect vmas of mapped files with mmap_lock taken
+	 *  2) Release mmap_lock and instantiate entries
 	 *
 	 * otherwise we get lockdep complained, since filldir()
-	 * routine might require mmap_sem taken in might_fault().
+	 * routine might require mmap_lock taken in might_fault().
 	 */
 
 	for (vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) {
--- a/fs/proc/task_mmu.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/proc/task_mmu.c
@@ -593,7 +593,7 @@ static int smaps_pte_range(pmd_t *pmd, u
 	if (pmd_trans_unstable(pmd))
 		goto out;
 	/*
-	 * The mmap_sem held all the way back in m_start() is what
+	 * The mmap_lock held all the way back in m_start() is what
 	 * keeps khugepaged out of here and from collapsing things
 	 * in here.
 	 */
@@ -752,7 +752,7 @@ static void smap_gather_stats(struct vm_
 		}
 	}
 #endif
-	/* mmap_sem is held in m_start */
+	/* mmap_lock is held in m_start */
 	walk_page_vma(vma, &smaps_walk_ops, mss);
 }
 
@@ -1827,7 +1827,7 @@ static int show_numa_map(struct seq_file
 	if (is_vm_hugetlb_page(vma))
 		seq_puts(m, " huge");
 
-	/* mmap_sem is held by m_start */
+	/* mmap_lock is held by m_start */
 	walk_page_vma(vma, &show_numa_ops, md);
 
 	if (!md->pages)
--- a/fs/userfaultfd.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/userfaultfd.c
@@ -369,13 +369,13 @@ static inline bool userfaultfd_signal_pe
  * FAULT_FLAG_KILLABLE are not straightforward. The "Caution"
  * recommendation in __lock_page_or_retry is not an understatement.
  *
- * If FAULT_FLAG_ALLOW_RETRY is set, the mmap_sem must be released
+ * If FAULT_FLAG_ALLOW_RETRY is set, the mmap_lock must be released
  * before returning VM_FAULT_RETRY only if FAULT_FLAG_RETRY_NOWAIT is
  * not set.
  *
  * If FAULT_FLAG_ALLOW_RETRY is set but FAULT_FLAG_KILLABLE is not
  * set, VM_FAULT_RETRY can still be returned if and only if there are
- * fatal_signal_pending()s, and the mmap_sem must be released before
+ * fatal_signal_pending()s, and the mmap_lock must be released before
  * returning it.
  */
 vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason)
@@ -396,14 +396,14 @@ vm_fault_t handle_userfault(struct vm_fa
 	 * FOLL_DUMP case, anon memory also checks for FOLL_DUMP with
 	 * the no_page_table() helper in follow_page_mask(), but the
 	 * shmem_vm_ops->fault method is invoked even during
-	 * coredumping without mmap_sem and it ends up here.
+	 * coredumping without mmap_lock and it ends up here.
 	 */
 	if (current->flags & (PF_EXITING|PF_DUMPCORE))
 		goto out;
 
 	/*
-	 * Coredumping runs without mmap_sem so we can only check that
-	 * the mmap_sem is held, if PF_DUMPCORE was not set.
+	 * Coredumping runs without mmap_lock so we can only check that
+	 * the mmap_lock is held, if PF_DUMPCORE was not set.
 	 */
 	mmap_assert_locked(mm);
 
@@ -422,7 +422,7 @@ vm_fault_t handle_userfault(struct vm_fa
 	/*
 	 * If it's already released don't get it. This avoids to loop
 	 * in __get_user_pages if userfaultfd_release waits on the
-	 * caller of handle_userfault to release the mmap_sem.
+	 * caller of handle_userfault to release the mmap_lock.
 	 */
 	if (unlikely(READ_ONCE(ctx->released))) {
 		/*
@@ -481,7 +481,7 @@ vm_fault_t handle_userfault(struct vm_fa
 	if (vmf->flags & FAULT_FLAG_RETRY_NOWAIT)
 		goto out;
 
-	/* take the reference before dropping the mmap_sem */
+	/* take the reference before dropping the mmap_lock */
 	userfaultfd_ctx_get(ctx);
 
 	init_waitqueue_func_entry(&uwq.wq, userfaultfd_wake_function);
@@ -890,9 +890,9 @@ static int userfaultfd_release(struct in
 	 * Flush page faults out of all CPUs. NOTE: all page faults
 	 * must be retried without returning VM_FAULT_SIGBUS if
 	 * userfaultfd_ctx_get() succeeds but vma->vma_userfault_ctx
-	 * changes while handle_userfault released the mmap_sem. So
+	 * changes while handle_userfault released the mmap_lock. So
 	 * it's critical that released is set to true (above), before
-	 * taking the mmap_sem for writing.
+	 * taking the mmap_lock for writing.
 	 */
 	mmap_write_lock(mm);
 	still_valid = mmget_still_valid(mm);
--- a/fs/xfs/xfs_file.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/xfs/xfs_file.c
@@ -1173,7 +1173,7 @@ xfs_file_llseek(
  * Locking for serialisation of IO during page faults. This results in a lock
  * ordering of:
  *
- * mmap_sem (MM)
+ * mmap_lock (MM)
  *   sb_start_pagefault(vfs, freeze)
  *     i_mmaplock (XFS - truncate serialisation)
  *       page_lock (MM)
--- a/fs/xfs/xfs_inode.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/xfs/xfs_inode.c
@@ -145,17 +145,17 @@ xfs_ilock_attr_map_shared(
  *
  * i_rwsem -> i_mmap_lock -> page_lock -> i_ilock
  *
- * mmap_sem locking order:
+ * mmap_lock locking order:
  *
- * i_rwsem -> page lock -> mmap_sem
- * mmap_sem -> i_mmap_lock -> page_lock
+ * i_rwsem -> page lock -> mmap_lock
+ * mmap_lock -> i_mmap_lock -> page_lock
  *
- * The difference in mmap_sem locking order mean that we cannot hold the
+ * The difference in mmap_lock locking order mean that we cannot hold the
  * i_mmap_lock over syscall based read(2)/write(2) based IO. These IO paths can
- * fault in pages during copy in/out (for buffered IO) or require the mmap_sem
+ * fault in pages during copy in/out (for buffered IO) or require the mmap_lock
  * in get_user_pages() to map the user pages into the kernel address space for
  * direct IO. Similarly the i_rwsem cannot be taken inside a page fault because
- * page faults already hold the mmap_sem.
+ * page faults already hold the mmap_lock.
  *
  * Hence to serialise fully against both syscall and mmap based IO, we need to
  * take both the i_rwsem and the i_mmap_lock. These locks should *only* be both
@@ -1630,7 +1630,7 @@ xfs_release(
 			return 0;
 		/*
 		 * If we can't get the iolock just skip truncating the blocks
-		 * past EOF because we could deadlock with the mmap_sem
+		 * past EOF because we could deadlock with the mmap_lock
 		 * otherwise. We'll get another chance to drop them once the
 		 * last reference to the inode is dropped, so we'll never leak
 		 * blocks permanently.
--- a/fs/xfs/xfs_iops.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/fs/xfs/xfs_iops.c
@@ -28,11 +28,11 @@
 #include <linux/fiemap.h>
 
 /*
- * Directories have different lock order w.r.t. mmap_sem compared to regular
+ * Directories have different lock order w.r.t. mmap_lock compared to regular
  * files. This is due to readdir potentially triggering page faults on a user
  * buffer inside filldir(), and this happens with the ilock on the directory
  * held. For regular files, the lock order is the other way around - the
- * mmap_sem is taken during the page fault, and then we lock the ilock to do
+ * mmap_lock is taken during the page fault, and then we lock the ilock to do
  * block mapping. Hence we need a different class for the directory ilock so
  * that lockdep can tell them apart.
  */
--- a/include/linux/fs.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/fs.h
@@ -1679,10 +1679,10 @@ static inline int sb_start_write_trylock
  *
  * Since page fault freeze protection behaves as a lock, users have to preserve
  * ordering of freeze protection and other filesystem locks. It is advised to
- * put sb_start_pagefault() close to mmap_sem in lock ordering. Page fault
+ * put sb_start_pagefault() close to mmap_lock in lock ordering. Page fault
  * handling code implies lock dependency:
  *
- * mmap_sem
+ * mmap_lock
  *   -> sb_start_pagefault
  */
 static inline void sb_start_pagefault(struct super_block *sb)
--- a/include/linux/huge_mm.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/huge_mm.h
@@ -248,7 +248,7 @@ static inline int is_swap_pmd(pmd_t pmd)
 	return !pmd_none(pmd) && !pmd_present(pmd);
 }
 
-/* mmap_sem must be held on entry */
+/* mmap_lock must be held on entry */
 static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd,
 		struct vm_area_struct *vma)
 {
--- a/include/linux/mempolicy.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/mempolicy.h
@@ -31,7 +31,7 @@ struct mm_struct;
  * Locking policy for interlave:
  * In process context there is no locking because only the process accesses
  * its own state. All vma manipulation is somewhat protected by a down_read on
- * mmap_sem.
+ * mmap_lock.
  *
  * Freeing policy:
  * Mempolicy objects are reference counted.  A mempolicy will be freed when
--- a/include/linux/mm.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/mm.h
@@ -402,7 +402,7 @@ extern pgprot_t protection_map[16];
  * @FAULT_FLAG_WRITE: Fault was a write fault.
  * @FAULT_FLAG_MKWRITE: Fault was mkwrite of existing PTE.
  * @FAULT_FLAG_ALLOW_RETRY: Allow to retry the fault if blocked.
- * @FAULT_FLAG_RETRY_NOWAIT: Don't drop mmap_sem and wait when retrying.
+ * @FAULT_FLAG_RETRY_NOWAIT: Don't drop mmap_lock and wait when retrying.
  * @FAULT_FLAG_KILLABLE: The fault task is in SIGKILL killable region.
  * @FAULT_FLAG_TRIED: The fault has been tried once.
  * @FAULT_FLAG_USER: The fault originated in userspace.
@@ -452,10 +452,10 @@ extern pgprot_t protection_map[16];
  * fault_flag_allow_retry_first - check ALLOW_RETRY the first time
  *
  * This is mostly used for places where we want to try to avoid taking
- * the mmap_sem for too long a time when waiting for another condition
+ * the mmap_lock for too long a time when waiting for another condition
  * to change, in which case we can try to be polite to release the
- * mmap_sem in the first round to avoid potential starvation of other
- * processes that would also want the mmap_sem.
+ * mmap_lock in the first round to avoid potential starvation of other
+ * processes that would also want the mmap_lock.
  *
  * Return: true if the page fault allows retry and this is the first
  * attempt of the fault handling; false otherwise.
@@ -582,7 +582,7 @@ struct vm_operations_struct {
 	 * (vma,addr) marked as MPOL_SHARED.  The shared policy infrastructure
 	 * in mm/mempolicy.c will do this automatically.
 	 * get_policy() must NOT add a ref if the policy at (vma,addr) is not
-	 * marked as MPOL_SHARED. vma policies are protected by the mmap_sem.
+	 * marked as MPOL_SHARED. vma policies are protected by the mmap_lock.
 	 * If no [shared/vma] mempolicy exists at the addr, get_policy() op
 	 * must return NULL--i.e., do not "fallback" to task or system default
 	 * policy.
--- a/include/linux/mm_types.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/mm_types.h
@@ -344,7 +344,7 @@ struct vm_area_struct {
 	 * can only be in the i_mmap tree.  An anonymous MAP_PRIVATE, stack
 	 * or brk vma (with NULL file) can only be in an anon_vma list.
 	 */
-	struct list_head anon_vma_chain; /* Serialized by mmap_sem &
+	struct list_head anon_vma_chain; /* Serialized by mmap_lock &
 					  * page_table_lock */
 	struct anon_vma *anon_vma;	/* Serialized by page_table_lock */
 
--- a/include/linux/mmu_notifier.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/mmu_notifier.h
@@ -122,7 +122,7 @@ struct mmu_notifier_ops {
 
 	/*
 	 * invalidate_range_start() and invalidate_range_end() must be
-	 * paired and are called only when the mmap_sem and/or the
+	 * paired and are called only when the mmap_lock and/or the
 	 * locks protecting the reverse maps are held. If the subsystem
 	 * can't guarantee that no additional references are taken to
 	 * the pages in the range, it has to implement the
@@ -213,13 +213,13 @@ struct mmu_notifier_ops {
 };
 
 /*
- * The notifier chains are protected by mmap_sem and/or the reverse map
+ * The notifier chains are protected by mmap_lock and/or the reverse map
  * semaphores. Notifier chains are only changed when all reverse maps and
- * the mmap_sem locks are taken.
+ * the mmap_lock locks are taken.
  *
  * Therefore notifier chains can only be traversed when either
  *
- * 1. mmap_sem is held.
+ * 1. mmap_lock is held.
  * 2. One of the reverse map locks is held (i_mmap_rwsem or anon_vma->rwsem).
  * 3. No other concurrent thread can access the list (release)
  */
--- a/include/linux/pagemap.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/pagemap.h
@@ -538,7 +538,7 @@ static inline int lock_page_killable(str
  * lock_page_or_retry - Lock the page, unless this would block and the
  * caller indicated that it can handle a retry.
  *
- * Return value and mmap_sem implications depend on flags; see
+ * Return value and mmap_lock implications depend on flags; see
  * __lock_page_or_retry().
  */
 static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm,
--- a/include/linux/pgtable.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/pgtable.h
@@ -1134,11 +1134,11 @@ static inline pmd_t pmd_read_atomic(pmd_
 #endif
 /*
  * This function is meant to be used by sites walking pagetables with
- * the mmap_sem hold in read mode to protect against MADV_DONTNEED and
+ * the mmap_lock held in read mode to protect against MADV_DONTNEED and
  * transhuge page faults. MADV_DONTNEED can convert a transhuge pmd
  * into a null pmd and the transhuge page fault can convert a null pmd
  * into an hugepmd or into a regular pmd (if the hugepage allocation
- * fails). While holding the mmap_sem in read mode the pmd becomes
+ * fails). While holding the mmap_lock in read mode the pmd becomes
  * stable and stops changing under us only if it's not null and not a
  * transhuge pmd. When those races occurs and this function makes a
  * difference vs the standard pmd_none_or_clear_bad, the result is
@@ -1148,7 +1148,7 @@ static inline pmd_t pmd_read_atomic(pmd_
  *
  * For 32bit kernels with a 64bit large pmd_t this automatically takes
  * care of reading the pmd atomically to avoid SMP race conditions
- * against pmd_populate() when the mmap_sem is hold for reading by the
+ * against pmd_populate() when the mmap_lock is hold for reading by the
  * caller (a special atomic read not done by "gcc" as in the generic
  * version above, is also needed when THP is disabled because the page
  * fault can populate the pmd from under us).
--- a/include/linux/rmap.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/rmap.h
@@ -77,7 +77,7 @@ struct anon_vma {
 struct anon_vma_chain {
 	struct vm_area_struct *vma;
 	struct anon_vma *anon_vma;
-	struct list_head same_vma;   /* locked by mmap_sem & page_table_lock */
+	struct list_head same_vma;   /* locked by mmap_lock & page_table_lock */
 	struct rb_node rb;			/* locked by anon_vma->rwsem */
 	unsigned long rb_subtree_last;
 #ifdef CONFIG_DEBUG_VM_RB
--- a/include/linux/sched/mm.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/include/linux/sched/mm.h
@@ -53,7 +53,7 @@ void mmdrop(struct mm_struct *mm);
 
 /*
  * This has to be called after a get_task_mm()/mmget_not_zero()
- * followed by taking the mmap_sem for writing before modifying the
+ * followed by taking the mmap_lock for writing before modifying the
  * vmas or anything the coredump pretends not to change from under it.
  *
  * It also has to be called when mmgrab() is used in the context of
@@ -61,14 +61,14 @@ void mmdrop(struct mm_struct *mm);
  * the context of the process to run down_write() on that pinned mm.
  *
  * NOTE: find_extend_vma() called from GUP context is the only place
- * that can modify the "mm" (notably the vm_start/end) under mmap_sem
+ * that can modify the "mm" (notably the vm_start/end) under mmap_lock
  * for reading and outside the context of the process, so it is also
- * the only case that holds the mmap_sem for reading that must call
- * this function. Generally if the mmap_sem is hold for reading
+ * the only case that holds the mmap_lock for reading that must call
+ * this function. Generally if the mmap_lock is hold for reading
  * there's no need of this check after get_task_mm()/mmget_not_zero().
  *
  * This function can be obsoleted and the check can be removed, after
- * the coredump code will hold the mmap_sem for writing before
+ * the coredump code will hold the mmap_lock for writing before
  * invoking the ->core_dump methods.
  */
 static inline bool mmget_still_valid(struct mm_struct *mm)
--- a/kernel/acct.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/acct.c
@@ -40,7 +40,7 @@
  *  is one more bug... 10/11/98, AV.
  *
  *	Oh, fsck... Oopsable SMP race in do_process_acct() - we must hold
- * ->mmap_sem to walk the vma list of current->mm. Nasty, since it leaks
+ * ->mmap_lock to walk the vma list of current->mm. Nasty, since it leaks
  * a struct file opened for write. Fixed. 2/6/2000, AV.
  */
 
--- a/kernel/cgroup/cpuset.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/cgroup/cpuset.c
@@ -1655,7 +1655,7 @@ static void update_tasks_nodemask(struct
 	guarantee_online_mems(cs, &newmems);
 
 	/*
-	 * The mpol_rebind_mm() call takes mmap_sem, which we couldn't
+	 * The mpol_rebind_mm() call takes mmap_lock, which we couldn't
 	 * take while holding tasklist_lock.  Forks can happen - the
 	 * mpol_dup() cpuset_being_rebound check will catch such forks,
 	 * and rebind their vma mempolicies too.  Because we still hold
@@ -1760,7 +1760,7 @@ static void update_nodemasks_hier(struct
  *
  * Call with cpuset_mutex held. May take callback_lock during call.
  * Will take tasklist_lock, scan tasklist for tasks in cpuset cs,
- * lock each such tasks mm->mmap_sem, scan its vma's and rebind
+ * lock each such tasks mm->mmap_lock, scan its vma's and rebind
  * their mempolicies to the cpusets new mems_allowed.
  */
 static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,
--- a/kernel/events/core.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/events/core.c
@@ -1316,7 +1316,7 @@ static void put_ctx(struct perf_event_co
  *	    perf_event::child_mutex;
  *	      perf_event_context::lock
  *	    perf_event::mmap_mutex
- *	    mmap_sem
+ *	    mmap_lock
  *	      perf_addr_filters_head::lock
  *
  *    cpu_hotplug_lock
@@ -3080,7 +3080,7 @@ static int perf_event_stop(struct perf_e
  *     pre-existing mappings, called once when new filters arrive via SET_FILTER
  *     ioctl;
  * (2) perf_addr_filters_adjust(): adjusting filters' offsets based on newly
- *     registered mapping, called for every new mmap(), with mm::mmap_sem down
+ *     registered mapping, called for every new mmap(), with mm::mmap_lock down
  *     for reading;
  * (3) perf_event_addr_filters_exec(): clearing filters' offsets in the process
  *     of exec.
@@ -9742,7 +9742,7 @@ static void perf_addr_filters_splice(str
 /*
  * Scan through mm's vmas and see if one of them matches the
  * @filter; if so, adjust filter's address range.
- * Called with mm::mmap_sem down for reading.
+ * Called with mm::mmap_lock down for reading.
  */
 static void perf_addr_filter_apply(struct perf_addr_filter *filter,
 				   struct mm_struct *mm,
--- a/kernel/events/uprobes.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/events/uprobes.c
@@ -457,7 +457,7 @@ static int update_ref_ctr(struct uprobe
  * @vaddr: the virtual address to store the opcode.
  * @opcode: opcode to be written at @vaddr.
  *
- * Called with mm->mmap_sem held for write.
+ * Called with mm->mmap_lock held for write.
  * Return 0 (success) or a negative errno.
  */
 int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
@@ -1349,7 +1349,7 @@ static int delayed_ref_ctr_inc(struct vm
 }
 
 /*
- * Called from mmap_region/vma_adjust with mm->mmap_sem acquired.
+ * Called from mmap_region/vma_adjust with mm->mmap_lock acquired.
  *
  * Currently we ignore all errors and always return 0, the callers
  * can't handle the failure anyway.
--- a/kernel/exit.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/exit.c
@@ -440,7 +440,7 @@ static void exit_mm(void)
 	sync_mm_rss(mm);
 	/*
 	 * Serialize with any possible pending coredump.
-	 * We must hold mmap_sem around checking core_state
+	 * We must hold mmap_lock around checking core_state
 	 * and clearing tsk->mm.  The core-inducing thread
 	 * will increment ->nr_threads for each thread in the
 	 * group with ->mm != NULL.
--- a/kernel/relay.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/relay.c
@@ -91,7 +91,7 @@ static void relay_free_page_array(struct
  *
  *	Returns 0 if ok, negative on error
  *
- *	Caller should already have grabbed mmap_sem.
+ *	Caller should already have grabbed mmap_lock.
  */
 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma)
 {
--- a/kernel/sys.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/kernel/sys.c
@@ -2007,7 +2007,7 @@ static int prctl_set_mm_map(int opt, con
 	}
 
 	/*
-	 * arg_lock protects concurent updates but we still need mmap_sem for
+	 * arg_lock protects concurent updates but we still need mmap_lock for
 	 * read to exclude races with sys_brk.
 	 */
 	mmap_read_lock(mm);
@@ -2122,7 +2122,7 @@ static int prctl_set_mm(int opt, unsigne
 
 	/*
 	 * arg_lock protects concurent updates of arg boundaries, we need
-	 * mmap_sem for a) concurrent sys_brk, b) finding VMA for addr
+	 * mmap_lock for a) concurrent sys_brk, b) finding VMA for addr
 	 * validation.
 	 */
 	mmap_read_lock(mm);
--- a/lib/test_lockup.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/lib/test_lockup.c
@@ -103,7 +103,7 @@ MODULE_PARM_DESC(lock_rcu, "grab rcu_rea
 
 static bool lock_mmap_sem;
 module_param(lock_mmap_sem, bool, 0400);
-MODULE_PARM_DESC(lock_mmap_sem, "lock mm->mmap_sem: block procfs interfaces");
+MODULE_PARM_DESC(lock_mmap_sem, "lock mm->mmap_lock: block procfs interfaces");
 
 static unsigned long lock_rwsem_ptr;
 module_param_unsafe(lock_rwsem_ptr, ulong, 0400);
@@ -191,7 +191,7 @@ static void test_lock(bool master, bool
 
 	if (lock_mmap_sem && master) {
 		if (verbose)
-			pr_notice("lock mmap_sem pid=%d\n", main_task->pid);
+			pr_notice("lock mmap_lock pid=%d\n", main_task->pid);
 		if (lock_read)
 			mmap_read_lock(main_task->mm);
 		else
@@ -280,7 +280,7 @@ static void test_unlock(bool master, boo
 		else
 			mmap_write_unlock(main_task->mm);
 		if (verbose)
-			pr_notice("unlock mmap_sem pid=%d\n", main_task->pid);
+			pr_notice("unlock mmap_lock pid=%d\n", main_task->pid);
 	}
 
 	if (lock_rwsem_ptr && master) {
@@ -505,7 +505,7 @@ static int __init test_lockup_init(void)
 	}
 
 	if (lock_mmap_sem && !main_task->mm) {
-		pr_err("no mm to lock mmap_sem\n");
+		pr_err("no mm to lock mmap_lock\n");
 		return -EINVAL;
 	}
 
--- a/mm/filemap.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/filemap.c
@@ -76,16 +76,16 @@
  *  ->i_mutex
  *    ->i_mmap_rwsem		(truncate->unmap_mapping_range)
  *
- *  ->mmap_sem
+ *  ->mmap_lock
  *    ->i_mmap_rwsem
  *      ->page_table_lock or pte_lock	(various, mainly in memory.c)
  *        ->i_pages lock	(arch-dependent flush_dcache_mmap_lock)
  *
- *  ->mmap_sem
+ *  ->mmap_lock
  *    ->lock_page		(access_process_vm)
  *
  *  ->i_mutex			(generic_perform_write)
- *    ->mmap_sem		(fault_in_pages_readable->do_page_fault)
+ *    ->mmap_lock		(fault_in_pages_readable->do_page_fault)
  *
  *  bdi->wb.list_lock
  *    sb_lock			(fs/fs-writeback.c)
@@ -1371,21 +1371,21 @@ EXPORT_SYMBOL_GPL(__lock_page_killable);
 
 /*
  * Return values:
- * 1 - page is locked; mmap_sem is still held.
+ * 1 - page is locked; mmap_lock is still held.
  * 0 - page is not locked.
  *     mmap_lock has been released (mmap_read_unlock(), unless flags had both
  *     FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_RETRY_NOWAIT set, in
- *     which case mmap_sem is still held.
+ *     which case mmap_lock is still held.
  *
  * If neither ALLOW_RETRY nor KILLABLE are set, will always return 1
- * with the page locked and the mmap_sem unperturbed.
+ * with the page locked and the mmap_lock unperturbed.
  */
 int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
 			 unsigned int flags)
 {
 	if (fault_flag_allow_retry_first(flags)) {
 		/*
-		 * CAUTION! In this case, mmap_sem is not released
+		 * CAUTION! In this case, mmap_lock is not released
 		 * even though return 0.
 		 */
 		if (flags & FAULT_FLAG_RETRY_NOWAIT)
@@ -2313,14 +2313,14 @@ EXPORT_SYMBOL(generic_file_read_iter);
 #ifdef CONFIG_MMU
 #define MMAP_LOTSAMISS  (100)
 /*
- * lock_page_maybe_drop_mmap - lock the page, possibly dropping the mmap_sem
+ * lock_page_maybe_drop_mmap - lock the page, possibly dropping the mmap_lock
  * @vmf - the vm_fault for this fault.
  * @page - the page to lock.
  * @fpin - the pointer to the file we may pin (or is already pinned).
  *
- * This works similar to lock_page_or_retry in that it can drop the mmap_sem.
+ * This works similar to lock_page_or_retry in that it can drop the mmap_lock.
  * It differs in that it actually returns the page locked if it returns 1 and 0
- * if it couldn't lock the page.  If we did have to drop the mmap_sem then fpin
+ * if it couldn't lock the page.  If we did have to drop the mmap_lock then fpin
  * will point to the pinned file and needs to be fput()'ed at a later point.
  */
 static int lock_page_maybe_drop_mmap(struct vm_fault *vmf, struct page *page,
@@ -2331,7 +2331,7 @@ static int lock_page_maybe_drop_mmap(str
 
 	/*
 	 * NOTE! This will make us return with VM_FAULT_RETRY, but with
-	 * the mmap_sem still held. That's how FAULT_FLAG_RETRY_NOWAIT
+	 * the mmap_lock still held. That's how FAULT_FLAG_RETRY_NOWAIT
 	 * is supposed to work. We have way too many special cases..
 	 */
 	if (vmf->flags & FAULT_FLAG_RETRY_NOWAIT)
@@ -2341,10 +2341,10 @@ static int lock_page_maybe_drop_mmap(str
 	if (vmf->flags & FAULT_FLAG_KILLABLE) {
 		if (__lock_page_killable(page)) {
 			/*
-			 * We didn't have the right flags to drop the mmap_sem,
+			 * We didn't have the right flags to drop the mmap_lock,
 			 * but all fault_handlers only check for fatal signals
 			 * if we return VM_FAULT_RETRY, so we need to drop the
-			 * mmap_sem here and return 0 if we don't have a fpin.
+			 * mmap_lock here and return 0 if we don't have a fpin.
 			 */
 			if (*fpin == NULL)
 				mmap_read_unlock(vmf->vma->vm_mm);
@@ -2409,7 +2409,7 @@ static struct file *do_sync_mmap_readahe
 /*
  * Asynchronous readahead happens when we find the page and PG_readahead,
  * so we want to possibly extend the readahead further.  We return the file that
- * was pinned if we have to drop the mmap_sem in order to do IO.
+ * was pinned if we have to drop the mmap_lock in order to do IO.
  */
 static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
 					    struct page *page)
@@ -2444,12 +2444,12 @@ static struct file *do_async_mmap_readah
  * it in the page cache, and handles the special cases reasonably without
  * having a lot of duplicated code.
  *
- * vma->vm_mm->mmap_sem must be held on entry.
+ * vma->vm_mm->mmap_lock must be held on entry.
  *
- * If our return value has VM_FAULT_RETRY set, it's because the mmap_sem
+ * If our return value has VM_FAULT_RETRY set, it's because the mmap_lock
  * may be dropped before doing I/O or by lock_page_maybe_drop_mmap().
  *
- * If our return value does not have VM_FAULT_RETRY set, the mmap_sem
+ * If our return value does not have VM_FAULT_RETRY set, the mmap_lock
  * has not been released.
  *
  * We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set.
@@ -2519,7 +2519,7 @@ retry_find:
 		goto page_not_uptodate;
 
 	/*
-	 * We've made it this far and we had to drop our mmap_sem, now is the
+	 * We've made it this far and we had to drop our mmap_lock, now is the
 	 * time to return to the upper layer and have it re-find the vma and
 	 * redo the fault.
 	 */
@@ -2569,7 +2569,7 @@ page_not_uptodate:
 
 out_retry:
 	/*
-	 * We dropped the mmap_sem, we need to return to the fault handler to
+	 * We dropped the mmap_lock, we need to return to the fault handler to
 	 * re-find the vma and come back and find our hopefully still populated
 	 * page.
 	 */
--- a/mm/frame_vector.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/frame_vector.c
@@ -29,7 +29,7 @@
  * different type underlying the specified range of virtual addresses.
  * When the function isn't able to map a single page, it returns error.
  *
- * This function takes care of grabbing mmap_sem as necessary.
+ * This function takes care of grabbing mmap_lock as necessary.
  */
 int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
 		     unsigned int gup_flags, struct frame_vector *vec)
--- a/mm/gup.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/gup.c
@@ -592,7 +592,7 @@ retry:
 		pmdval = READ_ONCE(*pmd);
 		/*
 		 * MADV_DONTNEED may convert the pmd to null because
-		 * mmap_sem is held in read mode
+		 * mmap_lock is held in read mode
 		 */
 		if (pmd_none(pmdval))
 			return no_page_table(vma, flags);
@@ -855,8 +855,8 @@ unmap:
 }
 
 /*
- * mmap_sem must be held on entry.  If @locked != NULL and *@flags
- * does not include FOLL_NOWAIT, the mmap_sem may be released.  If it
+ * mmap_lock must be held on entry.  If @locked != NULL and *@flags
+ * does not include FOLL_NOWAIT, the mmap_lock may be released.  If it
  * is, *@locked will be set to 0 and -EBUSY returned.
  */
 static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
@@ -979,7 +979,7 @@ static int check_vma_flags(struct vm_are
  *		only intends to ensure the pages are faulted in.
  * @vmas:	array of pointers to vmas corresponding to each page.
  *		Or NULL if the caller does not require them.
- * @locked:     whether we're still with the mmap_sem held
+ * @locked:     whether we're still with the mmap_lock held
  *
  * Returns either number of pages pinned (which may be less than the
  * number requested), or an error. Details about the return value:
@@ -992,9 +992,9 @@ static int check_vma_flags(struct vm_are
  *
  * The caller is responsible for releasing returned @pages, via put_page().
  *
- * @vmas are valid only as long as mmap_sem is held.
+ * @vmas are valid only as long as mmap_lock is held.
  *
- * Must be called with mmap_sem held.  It may be released.  See below.
+ * Must be called with mmap_lock held.  It may be released.  See below.
  *
  * __get_user_pages walks a process's page tables and takes a reference to
  * each struct page that each user address corresponds to at a given
@@ -1015,12 +1015,12 @@ static int check_vma_flags(struct vm_are
  * appropriate) must be called after the page is finished with, and
  * before put_page is called.
  *
- * If @locked != NULL, *@locked will be set to 0 when mmap_sem is
+ * If @locked != NULL, *@locked will be set to 0 when mmap_lock is
  * released by an up_read().  That can happen if @gup_flags does not
  * have FOLL_NOWAIT.
  *
  * A caller using such a combination of @locked and @gup_flags
- * must therefore hold the mmap_sem for reading only, and recognize
+ * must therefore hold the mmap_lock for reading only, and recognize
  * when it's been released.  Otherwise, it must be held for either
  * reading or writing and will not be released.
  *
@@ -1083,7 +1083,7 @@ static long __get_user_pages(struct task
 				if (locked && *locked == 0) {
 					/*
 					 * We've got a VM_FAULT_RETRY
-					 * and we've lost mmap_sem.
+					 * and we've lost mmap_lock.
 					 * We must stop here.
 					 */
 					BUG_ON(gup_flags & FOLL_NOWAIT);
@@ -1190,7 +1190,7 @@ static bool vma_permits_fault(struct vm_
  * @mm:		mm_struct of target mm
  * @address:	user address
  * @fault_flags:flags to pass down to handle_mm_fault()
- * @unlocked:	did we unlock the mmap_sem while retrying, maybe NULL if caller
+ * @unlocked:	did we unlock the mmap_lock while retrying, maybe NULL if caller
  *		does not allow retry. If NULL, the caller must guarantee
  *		that fault_flags does not contain FAULT_FLAG_ALLOW_RETRY.
  *
@@ -1211,8 +1211,8 @@ static bool vma_permits_fault(struct vm_
  * such architectures, gup() will not be enough to make a subsequent access
  * succeed.
  *
- * This function will not return with an unlocked mmap_sem. So it has not the
- * same semantics wrt the @mm->mmap_sem as does filemap_fault().
+ * This function will not return with an unlocked mmap_lock. So it has not the
+ * same semantics wrt the @mm->mmap_lock as does filemap_fault().
  */
 int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
 		     unsigned long address, unsigned int fault_flags,
@@ -1400,13 +1400,13 @@ retry:
  * @vma:   target vma
  * @start: start address
  * @end:   end address
- * @locked: whether the mmap_sem is still held
+ * @locked: whether the mmap_lock is still held
  *
  * This takes care of mlocking the pages too if VM_LOCKED is set.
  *
  * return 0 on success, negative error code on error.
  *
- * vma->vm_mm->mmap_sem must be held.
+ * vma->vm_mm->mmap_lock must be held.
  *
  * If @locked is NULL, it may be held for read or write and will
  * be unperturbed.
@@ -1458,7 +1458,7 @@ long populate_vma_page_range(struct vm_a
  *
  * This is used to implement mlock() and the MAP_POPULATE / MAP_LOCKED mmap
  * flags. VMAs must be already marked with the desired vm_flags, and
- * mmap_sem must not be held.
+ * mmap_lock must not be held.
  */
 int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
 {
@@ -1525,7 +1525,7 @@ int __mm_populate(unsigned long start, u
  * NULL wherever the ZERO_PAGE, or an anonymous pte_none, has been found -
  * allowing a hole to be left in the corefile to save diskspace.
  *
- * Called without mmap_sem, but after all other threads have been killed.
+ * Called without mmap_lock, but after all other threads have been killed.
  */
 #ifdef CONFIG_ELF_CORE
 struct page *get_dump_page(unsigned long addr)
@@ -1886,9 +1886,9 @@ static long __get_user_pages_remote(stru
  *
  * The caller is responsible for releasing returned @pages, via put_page().
  *
- * @vmas are valid only as long as mmap_sem is held.
+ * @vmas are valid only as long as mmap_lock is held.
  *
- * Must be called with mmap_sem held for read or write.
+ * Must be called with mmap_lock held for read or write.
  *
  * get_user_pages_remote walks a process's page tables and takes a reference
  * to each struct page that each user address corresponds to at a given
@@ -2873,7 +2873,7 @@ EXPORT_SYMBOL_GPL(get_user_pages_fast_on
  * @pages:      array that receives pointers to the pages pinned.
  *              Should be at least nr_pages long.
  *
- * Attempt to pin user pages in memory without taking mm->mmap_sem.
+ * Attempt to pin user pages in memory without taking mm->mmap_lock.
  * If not successful, it will fall back to taking the lock and
  * calling get_user_pages().
  *
--- a/mm/huge_memory.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/huge_memory.c
@@ -1746,7 +1746,7 @@ bool move_huge_pmd(struct vm_area_struct
 
 	/*
 	 * We don't have to worry about the ordering of src and dst
-	 * ptlocks because exclusive mmap_sem prevents deadlock.
+	 * ptlocks because exclusive mmap_lock prevents deadlock.
 	 */
 	old_ptl = __pmd_trans_huge_lock(old_pmd, vma);
 	if (old_ptl) {
@@ -2618,7 +2618,7 @@ int split_huge_page_to_list(struct page
 
 	if (PageAnon(head)) {
 		/*
-		 * The caller does not necessarily hold an mmap_sem that would
+		 * The caller does not necessarily hold an mmap_lock that would
 		 * prevent the anon_vma disappearing so we first we take a
 		 * reference to it and then lock the anon_vma for write. This
 		 * is similar to page_lock_anon_vma_read except the write lock
--- a/mm/hugetlb.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/hugetlb.c
@@ -4695,7 +4695,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_s
 						(const void __user *) src_addr,
 						pages_per_huge_page(h), false);
 
-		/* fallback to copy_from_user outside mmap_sem */
+		/* fallback to copy_from_user outside mmap_lock */
 		if (unlikely(ret)) {
 			ret = -ENOENT;
 			*pagep = page;
--- a/mm/internal.h~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/internal.h
@@ -344,7 +344,7 @@ static inline void munlock_vma_pages_all
 }
 
 /*
- * must be called with vma's mmap_sem held for read or write, and page locked.
+ * must be called with vma's mmap_lock held for read or write, and page locked.
  */
 extern void mlock_vma_page(struct page *page);
 extern unsigned int munlock_vma_page(struct page *page);
@@ -413,7 +413,7 @@ static inline struct file *maybe_unlock_
 
 	/*
 	 * FAULT_FLAG_RETRY_NOWAIT means we don't want to wait on page locks or
-	 * anything, so we only pin the file and drop the mmap_sem if only
+	 * anything, so we only pin the file and drop the mmap_lock if only
 	 * FAULT_FLAG_ALLOW_RETRY is set, while this is the first attempt.
 	 */
 	if (fault_flag_allow_retry_first(flags) &&
--- a/mm/khugepaged.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/khugepaged.c
@@ -534,7 +534,7 @@ void __khugepaged_exit(struct mm_struct
 		 * under mmap sem read mode). Stop here (after we
 		 * return all pagetables will be destroyed) until
 		 * khugepaged has finished working on the pagetables
-		 * under the mmap_sem.
+		 * under the mmap_lock.
 		 */
 		mmap_write_lock(mm);
 		mmap_write_unlock(mm);
@@ -933,8 +933,8 @@ khugepaged_alloc_page(struct page **hpag
 #endif
 
 /*
- * If mmap_sem temporarily dropped, revalidate vma
- * before taking mmap_sem.
+ * If mmap_lock temporarily dropped, revalidate vma
+ * before taking mmap_lock.
  * Return 0 if succeeds, otherwise return none-zero
  * value (scan code).
  */
@@ -966,7 +966,7 @@ static int hugepage_vma_revalidate(struc
  * Only done if khugepaged_scan_pmd believes it is worthwhile.
  *
  * Called and returns without pte mapped or spinlocks held,
- * but with mmap_sem held to protect against vma changes.
+ * but with mmap_lock held to protect against vma changes.
  */
 
 static bool __collapse_huge_page_swapin(struct mm_struct *mm,
@@ -993,7 +993,7 @@ static bool __collapse_huge_page_swapin(
 		swapped_in++;
 		ret = do_swap_page(&vmf);
 
-		/* do_swap_page returns VM_FAULT_RETRY with released mmap_sem */
+		/* do_swap_page returns VM_FAULT_RETRY with released mmap_lock */
 		if (ret & VM_FAULT_RETRY) {
 			mmap_read_lock(mm);
 			if (hugepage_vma_revalidate(mm, address, &vmf.vma)) {
@@ -1047,9 +1047,9 @@ static void collapse_huge_page(struct mm
 	gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_THISNODE;
 
 	/*
-	 * Before allocating the hugepage, release the mmap_sem read lock.
+	 * Before allocating the hugepage, release the mmap_lock read lock.
 	 * The allocation can take potentially a long time if it involves
-	 * sync compaction, and we do not need to hold the mmap_sem during
+	 * sync compaction, and we do not need to hold the mmap_lock during
 	 * that. We will recheck the vma after taking it again in write mode.
 	 */
 	mmap_read_unlock(mm);
@@ -1080,8 +1080,8 @@ static void collapse_huge_page(struct mm
 	}
 
 	/*
-	 * __collapse_huge_page_swapin always returns with mmap_sem locked.
-	 * If it fails, we release mmap_sem and jump out_nolock.
+	 * __collapse_huge_page_swapin always returns with mmap_lock locked.
+	 * If it fails, we release mmap_lock and jump out_nolock.
 	 * Continuing to collapse causes inconsistency.
 	 */
 	if (unmapped && !__collapse_huge_page_swapin(mm, vma, address,
@@ -1345,7 +1345,7 @@ out_unmap:
 	pte_unmap_unlock(pte, ptl);
 	if (ret) {
 		node = khugepaged_find_target_node();
-		/* collapse_huge_page will return with the mmap_sem released */
+		/* collapse_huge_page will return with the mmap_lock released */
 		collapse_huge_page(mm, address, hpage, node,
 				referenced, unmapped);
 	}
@@ -1547,7 +1547,7 @@ static void retract_page_tables(struct a
 		 * later.
 		 *
 		 * Not that vma->anon_vma check is racy: it can be set up after
-		 * the check but before we took mmap_sem by the fault path.
+		 * the check but before we took mmap_lock by the fault path.
 		 * But page lock would prevent establishing any new ptes of the
 		 * page, so we are safe.
 		 *
@@ -1567,10 +1567,10 @@ static void retract_page_tables(struct a
 		if (!pmd)
 			continue;
 		/*
-		 * We need exclusive mmap_sem to retract page table.
+		 * We need exclusive mmap_lock to retract page table.
 		 *
 		 * We use trylock due to lock inversion: we need to acquire
-		 * mmap_sem while holding page lock. Fault path does it in
+		 * mmap_lock while holding page lock. Fault path does it in
 		 * reverse order. Trylock is a way to avoid deadlock.
 		 */
 		if (mmap_write_trylock(vma->vm_mm)) {
@@ -2058,7 +2058,7 @@ static unsigned int khugepaged_scan_mm_s
 	 */
 	vma = NULL;
 	if (unlikely(!mmap_read_trylock(mm)))
-		goto breakouterloop_mmap_sem;
+		goto breakouterloop_mmap_lock;
 	if (likely(!khugepaged_test_exit(mm)))
 		vma = find_vma(mm, khugepaged_scan.address);
 
@@ -2115,15 +2115,15 @@ skip:
 			khugepaged_scan.address += HPAGE_PMD_SIZE;
 			progress += HPAGE_PMD_NR;
 			if (ret)
-				/* we released mmap_sem so break loop */
-				goto breakouterloop_mmap_sem;
+				/* we released mmap_lock so break loop */
+				goto breakouterloop_mmap_lock;
 			if (progress >= pages)
 				goto breakouterloop;
 		}
 	}
 breakouterloop:
 	mmap_read_unlock(mm); /* exit_mmap will destroy ptes after this */
-breakouterloop_mmap_sem:
+breakouterloop_mmap_lock:
 
 	spin_lock(&khugepaged_mm_lock);
 	VM_BUG_ON(khugepaged_scan.mm_slot != mm_slot);
--- a/mm/ksm.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/ksm.c
@@ -442,7 +442,7 @@ static void insert_to_mm_slots_hash(stru
 /*
  * ksmd, and unmerge_and_remove_all_rmap_items(), must not touch an mm's
  * page tables after it has passed through ksm_exit() - which, if necessary,
- * takes mmap_sem briefly to serialize against them.  ksm_exit() does not set
+ * takes mmap_lock briefly to serialize against them.  ksm_exit() does not set
  * a special flag: they can just back out as soon as mm_users goes to zero.
  * ksm_test_exit() is used throughout to make this test for exit: in some
  * places for correctness, in some places just to avoid unnecessary work.
@@ -831,7 +831,7 @@ static void remove_trailing_rmap_items(s
  * Though it's very tempting to unmerge rmap_items from stable tree rather
  * than check every pte of a given vma, the locking doesn't quite work for
  * that - an rmap_item is assigned to the stable tree after inserting ksm
- * page and upping mmap_sem.  Nor does it fit with the way we skip dup'ing
+ * page and upping mmap_lock.  Nor does it fit with the way we skip dup'ing
  * rmap_items from parent to child at fork time (so as not to waste time
  * if exit comes before the next scan reaches it).
  *
@@ -1292,7 +1292,7 @@ static int try_to_merge_with_ksm_page(st
 	/* Unstable nid is in union with stable anon_vma: remove first */
 	remove_rmap_item_from_tree(rmap_item);
 
-	/* Must get reference to anon_vma while still holding mmap_sem */
+	/* Must get reference to anon_vma while still holding mmap_lock */
 	rmap_item->anon_vma = vma->anon_vma;
 	get_anon_vma(vma->anon_vma);
 out:
@@ -2343,13 +2343,13 @@ next_mm:
 						struct mm_slot, mm_list);
 	if (ksm_scan.address == 0) {
 		/*
-		 * We've completed a full scan of all vmas, holding mmap_sem
+		 * We've completed a full scan of all vmas, holding mmap_lock
 		 * throughout, and found no VM_MERGEABLE: so do the same as
 		 * __ksm_exit does to remove this mm from all our lists now.
 		 * This applies either when cleaning up after __ksm_exit
 		 * (but beware: we can reach here even before __ksm_exit),
 		 * or when all VM_MERGEABLE areas have been unmapped (and
-		 * mmap_sem then protects against race with MADV_MERGEABLE).
+		 * mmap_lock then protects against race with MADV_MERGEABLE).
 		 */
 		hash_del(&slot->link);
 		list_del(&slot->mm_list);
@@ -2536,7 +2536,7 @@ void __ksm_exit(struct mm_struct *mm)
 	 * This process is exiting: if it's straightforward (as is the
 	 * case when ksmd was never running), free mm_slot immediately.
 	 * But if it's at the cursor or has rmap_items linked to it, use
-	 * mmap_sem to synchronize with any break_cows before pagetables
+	 * mmap_lock to synchronize with any break_cows before pagetables
 	 * are freed, and leave the mm_slot on the list for ksmd to free.
 	 * Beware: ksm may already have noticed it exiting and freed the slot.
 	 */
--- a/mm/maccess.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/maccess.c
@@ -40,9 +40,9 @@ probe_write_common(void __user *dst, con
  * happens, handle that and return -EFAULT.
  *
  * We ensure that the copy_from_user is executed in atomic context so that
- * do_page_fault() doesn't attempt to take mmap_sem.  This makes
+ * do_page_fault() doesn't attempt to take mmap_lock.  This makes
  * probe_kernel_read() suitable for use within regions where the caller
- * already holds mmap_sem, or other locks which nest inside mmap_sem.
+ * already holds mmap_lock, or other locks which nest inside mmap_lock.
  *
  * probe_kernel_read_strict() is the same as probe_kernel_read() except for
  * the case where architectures have non-overlapping user and kernel address
--- a/mm/madvise.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/madvise.c
@@ -40,7 +40,7 @@ struct madvise_walk_private {
 
 /*
  * Any behaviour which results in changes to the vma->vm_flags needs to
- * take mmap_sem for writing. Others, which simply traverse vmas, need
+ * take mmap_lock for writing. Others, which simply traverse vmas, need
  * to only take it for reading.
  */
 static int madvise_need_mmap_write(int behavior)
@@ -165,7 +165,7 @@ static long madvise_behavior(struct vm_a
 
 success:
 	/*
-	 * vm_flags is protected by the mmap_sem held in write mode.
+	 * vm_flags is protected by the mmap_lock held in write mode.
 	 */
 	vma->vm_flags = new_flags;
 
@@ -285,9 +285,9 @@ static long madvise_willneed(struct vm_a
 	 * Filesystem's fadvise may need to take various locks.  We need to
 	 * explicitly grab a reference because the vma (and hence the
 	 * vma's reference to the file) can go away as soon as we drop
-	 * mmap_sem.
+	 * mmap_lock.
 	 */
-	*prev = NULL;	/* tell sys_madvise we drop mmap_sem */
+	*prev = NULL;	/* tell sys_madvise we drop mmap_lock */
 	get_file(file);
 	mmap_read_unlock(current->mm);
 	offset = (loff_t)(start - vma->vm_start)
@@ -768,7 +768,7 @@ static long madvise_dontneed_free(struct
 		return -EINVAL;
 
 	if (!userfaultfd_remove(vma, start, end)) {
-		*prev = NULL; /* mmap_sem has been dropped, prev is stale */
+		*prev = NULL; /* mmap_lock has been dropped, prev is stale */
 
 		mmap_read_lock(current->mm);
 		vma = find_vma(current->mm, start);
@@ -791,7 +791,7 @@ static long madvise_dontneed_free(struct
 		if (end > vma->vm_end) {
 			/*
 			 * Don't fail if end > vma->vm_end. If the old
-			 * vma was splitted while the mmap_sem was
+			 * vma was splitted while the mmap_lock was
 			 * released the effect of the concurrent
 			 * operation may not cause madvise() to
 			 * have an undefined result. There may be an
@@ -826,7 +826,7 @@ static long madvise_remove(struct vm_are
 	int error;
 	struct file *f;
 
-	*prev = NULL;	/* tell sys_madvise we drop mmap_sem */
+	*prev = NULL;	/* tell sys_madvise we drop mmap_lock */
 
 	if (vma->vm_flags & VM_LOCKED)
 		return -EINVAL;
@@ -847,11 +847,11 @@ static long madvise_remove(struct vm_are
 	 * Filesystem's fallocate may need to take i_mutex.  We need to
 	 * explicitly grab a reference because the vma (and hence the
 	 * vma's reference to the file) can go away as soon as we drop
-	 * mmap_sem.
+	 * mmap_lock.
 	 */
 	get_file(f);
 	if (userfaultfd_remove(vma, start, end)) {
-		/* mmap_sem was not released by userfaultfd_remove() */
+		/* mmap_lock was not released by userfaultfd_remove() */
 		mmap_read_unlock(current->mm);
 	}
 	error = vfs_fallocate(f,
@@ -1153,7 +1153,7 @@ int do_madvise(unsigned long start, size
 			goto out;
 		if (prev)
 			vma = prev->vm_next;
-		else	/* madvise_remove dropped mmap_sem */
+		else	/* madvise_remove dropped mmap_lock */
 			vma = find_vma(current->mm, start);
 	}
 out:
--- a/mm/memcontrol.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/memcontrol.c
@@ -5901,7 +5901,7 @@ static void mem_cgroup_move_charge(void)
 retry:
 	if (unlikely(!mmap_read_trylock(mc.mm))) {
 		/*
-		 * Someone who are holding the mmap_sem might be waiting in
+		 * Someone who are holding the mmap_lock might be waiting in
 		 * waitq. So we cancel all extra charges, wake up all waiters,
 		 * and retry. Because we cancel precharges, we might not be able
 		 * to move enough charges, but moving charge is a best-effort
--- a/mm/memory.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/memory.c
@@ -1185,7 +1185,7 @@ static inline unsigned long zap_pmd_rang
 		 * Here there can be other concurrent MADV_DONTNEED or
 		 * trans huge page faults running, and if the pmd is
 		 * none or trans huge it can change under us. This is
-		 * because MADV_DONTNEED holds the mmap_sem in read
+		 * because MADV_DONTNEED holds the mmap_lock in read
 		 * mode.
 		 */
 		if (pmd_none_or_trans_huge_or_clear_bad(pmd))
@@ -1636,7 +1636,7 @@ EXPORT_SYMBOL(vm_insert_pages);
  * The page does not need to be reserved.
  *
  * Usually this function is called from f_op->mmap() handler
- * under mm->mmap_sem write-lock, so it can change vma->vm_flags.
+ * under mm->mmap_lock write-lock, so it can change vma->vm_flags.
  * Caller must set VM_MIXEDMAP on vma if it wants to call this
  * function from other places, for example from page-fault handler.
  *
@@ -2573,7 +2573,7 @@ static vm_fault_t fault_dirty_shared_pag
 	 * mapping may be NULL here because some device drivers do not
 	 * set page.mapping but still dirty their pages
 	 *
-	 * Drop the mmap_sem before waiting on IO, if we can. The file
+	 * Drop the mmap_lock before waiting on IO, if we can. The file
 	 * is pinning the mapping, as per above.
 	 */
 	if ((dirtied || page_mkwrite) && mapping) {
@@ -2623,7 +2623,7 @@ static inline void wp_page_reuse(struct
 /*
  * Handle the case of a page which we actually need to copy to a new page.
  *
- * Called with mmap_sem locked and the old page referenced, but
+ * Called with mmap_lock locked and the old page referenced, but
  * without the ptl held.
  *
  * High level logic flow:
@@ -2887,9 +2887,9 @@ static vm_fault_t wp_page_shared(struct
  * change only once the write actually happens. This avoids a few races,
  * and potentially makes it more efficient.
  *
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
+ * We enter with non-exclusive mmap_lock (to exclude vma changes,
  * but allow concurrent faults), with pte both mapped and locked.
- * We return with mmap_sem still held, but pte unmapped and unlocked.
+ * We return with mmap_lock still held, but pte unmapped and unlocked.
  */
 static vm_fault_t do_wp_page(struct vm_fault *vmf)
 	__releases(vmf->ptl)
@@ -3078,11 +3078,11 @@ void unmap_mapping_range(struct address_
 EXPORT_SYMBOL(unmap_mapping_range);
 
 /*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
+ * We enter with non-exclusive mmap_lock (to exclude vma changes,
  * but allow concurrent faults), and pte mapped but not yet locked.
  * We return with pte unmapped and unlocked.
  *
- * We return with the mmap_sem locked or unlocked in the same cases
+ * We return with the mmap_lock locked or unlocked in the same cases
  * as does filemap_fault().
  */
 vm_fault_t do_swap_page(struct vm_fault *vmf)
@@ -3303,9 +3303,9 @@ out_release:
 }
 
 /*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
+ * We enter with non-exclusive mmap_lock (to exclude vma changes,
  * but allow concurrent faults), and pte mapped but not yet locked.
- * We return with mmap_sem still held, but pte unmapped and unlocked.
+ * We return with mmap_lock still held, but pte unmapped and unlocked.
  */
 static vm_fault_t do_anonymous_page(struct vm_fault *vmf)
 {
@@ -3419,7 +3419,7 @@ oom:
 }
 
 /*
- * The mmap_sem must have been held on entry, and may have been
+ * The mmap_lock must have been held on entry, and may have been
  * released depending on flags and vma->vm_ops->fault() return value.
  * See filemap_fault() and __lock_page_retry().
  */
@@ -3928,11 +3928,11 @@ static vm_fault_t do_shared_fault(struct
 }
 
 /*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
+ * We enter with non-exclusive mmap_lock (to exclude vma changes,
  * but allow concurrent faults).
- * The mmap_sem may have been released depending on flags and our
+ * The mmap_lock may have been released depending on flags and our
  * return value.  See filemap_fault() and __lock_page_or_retry().
- * If mmap_sem is released, vma may become invalid (for example
+ * If mmap_lock is released, vma may become invalid (for example
  * by other thread calling munmap()).
  */
 static vm_fault_t do_fault(struct vm_fault *vmf)
@@ -4161,10 +4161,10 @@ static vm_fault_t wp_huge_pud(struct vm_
  * with external mmu caches can use to update those (ie the Sparc or
  * PowerPC hashed page tables that act as extended TLBs).
  *
- * We enter with non-exclusive mmap_sem (to exclude vma changes, but allow
+ * We enter with non-exclusive mmap_lock (to exclude vma changes, but allow
  * concurrent faults).
  *
- * The mmap_sem may have been released depending on flags and our return value.
+ * The mmap_lock may have been released depending on flags and our return value.
  * See filemap_fault() and __lock_page_or_retry().
  */
 static vm_fault_t handle_pte_fault(struct vm_fault *vmf)
@@ -4186,7 +4186,7 @@ static vm_fault_t handle_pte_fault(struc
 		/*
 		 * A regular pmd is established and it can't morph into a huge
 		 * pmd from under us anymore at this point because we hold the
-		 * mmap_sem read mode and khugepaged takes it in write mode.
+		 * mmap_lock read mode and khugepaged takes it in write mode.
 		 * So now it's safe to run pte_offset_map().
 		 */
 		vmf->pte = pte_offset_map(vmf->pmd, vmf->address);
@@ -4254,7 +4254,7 @@ unlock:
 /*
  * By the time we get here, we already hold the mm semaphore
  *
- * The mmap_sem may have been released depending on flags and our
+ * The mmap_lock may have been released depending on flags and our
  * return value.  See filemap_fault() and __lock_page_or_retry().
  */
 static vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
@@ -4349,7 +4349,7 @@ retry_pud:
 /*
  * By the time we get here, we already hold the mm semaphore
  *
- * The mmap_sem may have been released depending on flags and our
+ * The mmap_lock may have been released depending on flags and our
  * return value.  See filemap_fault() and __lock_page_or_retry().
  */
 vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
@@ -4793,7 +4793,7 @@ void __might_fault(const char *file, int
 {
 	/*
 	 * Some code (nfs/sunrpc) uses socket ops on kernel memory while
-	 * holding the mmap_sem, this is safe because kernel memory doesn't
+	 * holding the mmap_lock, this is safe because kernel memory doesn't
 	 * get paged out, therefore we'll never actually fault, and the
 	 * below annotations will generate false positives.
 	 */
--- a/mm/mempolicy.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mempolicy.c
@@ -224,7 +224,7 @@ static int mpol_new_bind(struct mempolic
  * handle an empty nodemask with MPOL_PREFERRED here.
  *
  * Must be called holding task's alloc_lock to protect task's mems_allowed
- * and mempolicy.  May also be called holding the mmap_semaphore for write.
+ * and mempolicy.  May also be called holding the mmap_lock for write.
  */
 static int mpol_set_nodemask(struct mempolicy *pol,
 		     const nodemask_t *nodes, struct nodemask_scratch *nsc)
@@ -368,7 +368,7 @@ static void mpol_rebind_preferred(struct
 /*
  * mpol_rebind_policy - Migrate a policy to a different set of nodes
  *
- * Per-vma policies are protected by mmap_sem. Allocations using per-task
+ * Per-vma policies are protected by mmap_lock. Allocations using per-task
  * policies are protected by task->mems_allowed_seq to prevent a premature
  * OOM/allocation failure due to parallel nodemask modification.
  */
@@ -398,7 +398,7 @@ void mpol_rebind_task(struct task_struct
 /*
  * Rebind each vma in mm to new nodemask.
  *
- * Call holding a reference to mm.  Takes mm->mmap_sem during call.
+ * Call holding a reference to mm.  Takes mm->mmap_lock during call.
  */
 
 void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new)
@@ -764,7 +764,7 @@ queue_pages_range(struct mm_struct *mm,
 
 /*
  * Apply policy to a single VMA
- * This must be called with the mmap_sem held for writing.
+ * This must be called with the mmap_lock held for writing.
  */
 static int vma_replace_policy(struct vm_area_struct *vma,
 						struct mempolicy *pol)
@@ -789,7 +789,7 @@ static int vma_replace_policy(struct vm_
 	}
 
 	old = vma->vm_policy;
-	vma->vm_policy = new; /* protected by mmap_sem */
+	vma->vm_policy = new; /* protected by mmap_lock */
 	mpol_put(old);
 
 	return 0;
@@ -985,7 +985,7 @@ static long do_get_mempolicy(int *policy
 		if (flags & MPOL_F_ADDR) {
 			/*
 			 * Take a refcount on the mpol, lookup_node()
-			 * wil drop the mmap_sem, so after calling
+			 * wil drop the mmap_lock, so after calling
 			 * lookup_node() only "pol" remains valid, "vma"
 			 * is stale.
 			 */
--- a/mm/migrate.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/migrate.c
@@ -2120,7 +2120,7 @@ int migrate_misplaced_transhuge_page(str
 	 * pmd before doing set_pmd_at(), nor to flush the TLB after
 	 * set_pmd_at().  Clearing the pmd here would introduce a race
 	 * condition against MADV_DONTNEED, because MADV_DONTNEED only holds the
-	 * mmap_sem for reading.  If the pmd is set to NULL at any given time,
+	 * mmap_lock for reading.  If the pmd is set to NULL at any given time,
 	 * MADV_DONTNEED won't wait on the pmd lock and it'll skip clearing this
 	 * pmd.
 	 */
@@ -2675,7 +2675,7 @@ restore:
  * have the MIGRATE_PFN_MIGRATE flag set for their src array entry.
  *
  * It is safe to update device page table after migrate_vma_pages() because
- * both destination and source page are still locked, and the mmap_sem is held
+ * both destination and source page are still locked, and the mmap_lock is held
  * in read mode (hence no one can unmap the range being migrated).
  *
  * Once the caller is done cleaning up things and updating its page table (if it
--- a/mm/mlock.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mlock.c
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(can_do_mlock);
  * When lazy mlocking via vmscan, it is important to ensure that the
  * vma's VM_LOCKED status is not concurrently being modified, otherwise we
  * may have mlocked a page that is being munlocked. So lazy mlock must take
- * the mmap_sem for read, and verify that the vma really is locked
+ * the mmap_lock for read, and verify that the vma really is locked
  * (see mm/rmap.c).
  */
 
@@ -381,7 +381,7 @@ static unsigned long __munlock_pagevec_f
 	/*
 	 * Initialize pte walk starting at the already pinned page where we
 	 * are sure that there is a pte, as it was pinned under the same
-	 * mmap_sem write op.
+	 * mmap_lock write op.
 	 */
 	pte = get_locked_pte(vma->vm_mm, start,	&ptl);
 	/* Make sure we do not cross the page table boundary */
@@ -565,7 +565,7 @@ success:
 	mm->locked_vm += nr_pages;
 
 	/*
-	 * vm_flags is protected by the mmap_sem held in write mode.
+	 * vm_flags is protected by the mmap_lock held in write mode.
 	 * It's okay if try_to_unmap_one unmaps a page just after we
 	 * set VM_LOCKED, populate_vma_page_range will bring it back.
 	 */
--- a/mm/mmap.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mmap.c
@@ -132,7 +132,7 @@ void vma_set_page_prot(struct vm_area_st
 		vm_flags &= ~VM_SHARED;
 		vm_page_prot = vm_pgprot_modify(vm_page_prot, vm_flags);
 	}
-	/* remove_protection_ptes reads vma->vm_page_prot without mmap_sem */
+	/* remove_protection_ptes reads vma->vm_page_prot without mmap_lock */
 	WRITE_ONCE(vma->vm_page_prot, vm_page_prot);
 }
 
@@ -238,14 +238,14 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
 
 	/*
 	 * Always allow shrinking brk.
-	 * __do_munmap() may downgrade mmap_sem to read.
+	 * __do_munmap() may downgrade mmap_lock to read.
 	 */
 	if (brk <= mm->brk) {
 		int ret;
 
 		/*
-		 * mm->brk must to be protected by write mmap_sem so update it
-		 * before downgrading mmap_sem. When __do_munmap() fails,
+		 * mm->brk must to be protected by write mmap_lock so update it
+		 * before downgrading mmap_lock. When __do_munmap() fails,
 		 * mm->brk will be restored from origbrk.
 		 */
 		mm->brk = brk;
@@ -505,7 +505,7 @@ static __always_inline void vma_rb_erase
  * After the update, the vma will be reinserted using
  * anon_vma_interval_tree_post_update_vma().
  *
- * The entire update must be protected by exclusive mmap_sem and by
+ * The entire update must be protected by exclusive mmap_lock and by
  * the root anon_vma's mutex.
  */
 static inline void
@@ -2371,7 +2371,7 @@ int expand_upwards(struct vm_area_struct
 
 	/*
 	 * vma->vm_start/vm_end cannot change under us because the caller
-	 * is required to hold the mmap_sem in read mode.  We need the
+	 * is required to hold the mmap_lock in read mode.  We need the
 	 * anon_vma lock to serialize against concurrent expand_stacks.
 	 */
 	anon_vma_lock_write(vma->anon_vma);
@@ -2389,7 +2389,7 @@ int expand_upwards(struct vm_area_struct
 			if (!error) {
 				/*
 				 * vma_gap_update() doesn't support concurrent
-				 * updates, but we only hold a shared mmap_sem
+				 * updates, but we only hold a shared mmap_lock
 				 * lock here, so we need to protect against
 				 * concurrent vma expansions.
 				 * anon_vma_lock_write() doesn't help here, as
@@ -2451,7 +2451,7 @@ int expand_downwards(struct vm_area_stru
 
 	/*
 	 * vma->vm_start/vm_end cannot change under us because the caller
-	 * is required to hold the mmap_sem in read mode.  We need the
+	 * is required to hold the mmap_lock in read mode.  We need the
 	 * anon_vma lock to serialize against concurrent expand_stacks.
 	 */
 	anon_vma_lock_write(vma->anon_vma);
@@ -2469,7 +2469,7 @@ int expand_downwards(struct vm_area_stru
 			if (!error) {
 				/*
 				 * vma_gap_update() doesn't support concurrent
-				 * updates, but we only hold a shared mmap_sem
+				 * updates, but we only hold a shared mmap_lock
 				 * lock here, so we need to protect against
 				 * concurrent vma expansions.
 				 * anon_vma_lock_write() doesn't help here, as
@@ -2855,7 +2855,7 @@ static int __vm_munmap(unsigned long sta
 
 	ret = __do_munmap(mm, start, len, &uf, downgrade);
 	/*
-	 * Returning 1 indicates mmap_sem is downgraded.
+	 * Returning 1 indicates mmap_lock is downgraded.
 	 * But 1 is not legal return value of vm_munmap() and munmap(), reset
 	 * it to 0 before return.
 	 */
@@ -3107,12 +3107,12 @@ void exit_mmap(struct mm_struct *mm)
 		/*
 		 * Manually reap the mm to free as much memory as possible.
 		 * Then, as the oom reaper does, set MMF_OOM_SKIP to disregard
-		 * this mm from further consideration.  Taking mm->mmap_sem for
+		 * this mm from further consideration.  Taking mm->mmap_lock for
 		 * write after setting MMF_OOM_SKIP will guarantee that the oom
-		 * reaper will not run on this mm again after mmap_sem is
+		 * reaper will not run on this mm again after mmap_lock is
 		 * dropped.
 		 *
-		 * Nothing can be holding mm->mmap_sem here and the above call
+		 * Nothing can be holding mm->mmap_lock here and the above call
 		 * to mmu_notifier_release(mm) ensures mmu notifier callbacks in
 		 * __oom_reap_task_mm() will not block.
 		 *
@@ -3437,7 +3437,7 @@ bool vma_is_special_mapping(const struct
 }
 
 /*
- * Called with mm->mmap_sem held for writing.
+ * Called with mm->mmap_lock held for writing.
  * Insert a new vma covering the given region, with the given flags.
  * Its pages are supplied by the given array of struct page *.
  * The array can be shorter than len >> PAGE_SHIFT if it's null-terminated.
@@ -3513,11 +3513,11 @@ static void vm_lock_mapping(struct mm_st
  * operations that could ever happen on a certain mm. This includes
  * vmtruncate, try_to_unmap, and all page faults.
  *
- * The caller must take the mmap_sem in write mode before calling
+ * The caller must take the mmap_lock in write mode before calling
  * mm_take_all_locks(). The caller isn't allowed to release the
- * mmap_sem until mm_drop_all_locks() returns.
+ * mmap_lock until mm_drop_all_locks() returns.
  *
- * mmap_sem in write mode is required in order to block all operations
+ * mmap_lock in write mode is required in order to block all operations
  * that could modify pagetables and free pages without need of
  * altering the vma layout. It's also needed in write mode to avoid new
  * anon_vmas to be associated with existing vmas.
@@ -3622,7 +3622,7 @@ static void vm_unlock_mapping(struct add
 }
 
 /*
- * The mmap_sem cannot be released by the caller until
+ * The mmap_lock cannot be released by the caller until
  * mm_drop_all_locks() returns.
  */
 void mm_drop_all_locks(struct mm_struct *mm)
--- a/mm/mmu_gather.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mmu_gather.c
@@ -301,7 +301,7 @@ void tlb_finish_mmu(struct mmu_gather *t
 {
 	/*
 	 * If there are parallel threads are doing PTE changes on same range
-	 * under non-exclusive lock (e.g., mmap_sem read-side) but defer TLB
+	 * under non-exclusive lock (e.g., mmap_lock read-side) but defer TLB
 	 * flush by batching, one thread may end up seeing inconsistent PTEs
 	 * and result in having stale TLB entries.  So flush TLB forcefully
 	 * if we detect parallel PTE batching threads.
--- a/mm/mmu_notifier.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mmu_notifier.c
@@ -599,7 +599,7 @@ void __mmu_notifier_invalidate_range(str
 }
 
 /*
- * Same as mmu_notifier_register but here the caller must hold the mmap_sem in
+ * Same as mmu_notifier_register but here the caller must hold the mmap_lock in
  * write mode. A NULL mn signals the notifier is being registered for itree
  * mode.
  */
@@ -623,7 +623,7 @@ int __mmu_notifier_register(struct mmu_n
 		/*
 		 * kmalloc cannot be called under mm_take_all_locks(), but we
 		 * know that mm->notifier_subscriptions can't change while we
-		 * hold the write side of the mmap_sem.
+		 * hold the write side of the mmap_lock.
 		 */
 		subscriptions = kzalloc(
 			sizeof(struct mmu_notifier_subscriptions), GFP_KERNEL);
@@ -655,7 +655,7 @@ int __mmu_notifier_register(struct mmu_n
 	 * readers.  acquire can only be used while holding the mmgrab or
 	 * mmget, and is safe because once created the
 	 * mmu_notifier_subscriptions is not freed until the mm is destroyed.
-	 * As above, users holding the mmap_sem or one of the
+	 * As above, users holding the mmap_lock or one of the
 	 * mm_take_all_locks() do not need to use acquire semantics.
 	 */
 	if (subscriptions)
@@ -689,7 +689,7 @@ EXPORT_SYMBOL_GPL(__mmu_notifier_registe
  * @mn: The notifier to attach
  * @mm: The mm to attach the notifier to
  *
- * Must not hold mmap_sem nor any other VM related lock when calling
+ * Must not hold mmap_lock nor any other VM related lock when calling
  * this registration function. Must also ensure mm_users can't go down
  * to zero while this runs to avoid races with mmu_notifier_release,
  * so mm has to be current->mm or the mm should be pinned safely such
@@ -750,7 +750,7 @@ find_get_mmu_notifier(struct mm_struct *
  * are the same.
  *
  * Each call to mmu_notifier_get() must be paired with a call to
- * mmu_notifier_put(). The caller must hold the write side of mm->mmap_sem.
+ * mmu_notifier_put(). The caller must hold the write side of mm->mmap_lock.
  *
  * While the caller has a mmu_notifier get the mm pointer will remain valid,
  * and can be converted to an active mm pointer via mmget_not_zero().
--- a/mm/mprotect.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mprotect.c
@@ -49,7 +49,7 @@ static unsigned long change_pte_range(st
 	bool uffd_wp_resolve = cp_flags & MM_CP_UFFD_WP_RESOLVE;
 
 	/*
-	 * Can be called with only the mmap_sem for reading by
+	 * Can be called with only the mmap_lock for reading by
 	 * prot_numa so we must check the pmd isn't constantly
 	 * changing from under us from pmd_none to pmd_trans_huge
 	 * and/or the other way around.
@@ -59,7 +59,7 @@ static unsigned long change_pte_range(st
 
 	/*
 	 * The pmd points to a regular pte so the pmd can't change
-	 * from under us even if the mmap_sem is only hold for
+	 * from under us even if the mmap_lock is only hold for
 	 * reading.
 	 */
 	pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
@@ -228,7 +228,7 @@ static inline unsigned long change_pmd_r
 		next = pmd_addr_end(addr, end);
 
 		/*
-		 * Automatic NUMA balancing walks the tables with mmap_sem
+		 * Automatic NUMA balancing walks the tables with mmap_lock
 		 * held for read. It's possible a parallel update to occur
 		 * between pmd_trans_huge() and a pmd_none_or_clear_bad()
 		 * check leading to a false positive and clearing.
@@ -477,7 +477,7 @@ mprotect_fixup(struct vm_area_struct *vm
 
 success:
 	/*
-	 * vm_flags and vm_page_prot are protected by the mmap_sem
+	 * vm_flags and vm_page_prot are protected by the mmap_lock
 	 * held in write mode.
 	 */
 	vma->vm_flags = newflags;
--- a/mm/mremap.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/mremap.c
@@ -146,7 +146,7 @@ static void move_ptes(struct vm_area_str
 
 	/*
 	 * We don't have to worry about the ordering of src and dst
-	 * pte locks because exclusive mmap_sem prevents deadlock.
+	 * pte locks because exclusive mmap_lock prevents deadlock.
 	 */
 	old_pte = pte_offset_map_lock(mm, old_pmd, old_addr, &old_ptl);
 	new_pte = pte_offset_map(new_pmd, new_addr);
@@ -213,7 +213,7 @@ static bool move_normal_pmd(struct vm_ar
 
 	/*
 	 * We don't have to worry about the ordering of src and dst
-	 * ptlocks because exclusive mmap_sem prevents deadlock.
+	 * ptlocks because exclusive mmap_lock prevents deadlock.
 	 */
 	old_ptl = pmd_lock(vma->vm_mm, old_pmd);
 	new_ptl = pmd_lockptr(mm, new_pmd);
@@ -710,7 +710,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, a
 	 * Always allow a shrinking remap: that just unmaps
 	 * the unnecessary pages..
 	 * __do_munmap does all the needed commit accounting, and
-	 * downgrades mmap_sem to read if so directed.
+	 * downgrades mmap_lock to read if so directed.
 	 */
 	if (old_len >= new_len) {
 		int retval;
@@ -720,7 +720,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, a
 		if (retval < 0 && old_len != new_len) {
 			ret = retval;
 			goto out;
-		/* Returning 1 indicates mmap_sem is downgraded to read. */
+		/* Returning 1 indicates mmap_lock is downgraded to read. */
 		} else if (retval == 1)
 			downgraded = true;
 		ret = addr;
--- a/mm/nommu.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/nommu.c
@@ -582,7 +582,7 @@ static void put_nommu_region(struct vm_r
  * add a VMA into a process's mm_struct in the appropriate place in the list
  * and tree and add to the address space's page tree also if not an anonymous
  * page
- * - should be called with mm->mmap_sem held writelocked
+ * - should be called with mm->mmap_lock held writelocked
  */
 static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
 {
@@ -696,7 +696,7 @@ static void delete_vma(struct mm_struct
 
 /*
  * look up the first VMA in which addr resides, NULL if none
- * - should be called with mm->mmap_sem at least held readlocked
+ * - should be called with mm->mmap_lock at least held readlocked
  */
 struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
 {
@@ -742,7 +742,7 @@ int expand_stack(struct vm_area_struct *
 
 /*
  * look up the first VMA exactly that exactly matches addr
- * - should be called with mm->mmap_sem at least held readlocked
+ * - should be called with mm->mmap_lock at least held readlocked
  */
 static struct vm_area_struct *find_vma_exact(struct mm_struct *mm,
 					     unsigned long addr,
--- a/mm/oom_kill.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/oom_kill.c
@@ -898,7 +898,7 @@ static void __oom_kill_process(struct ta
 	/*
 	 * Kill all user processes sharing victim->mm in other thread groups, if
 	 * any.  They don't get access to memory reserves, though, to avoid
-	 * depletion of all memory.  This prevents mm->mmap_sem livelock when an
+	 * depletion of all memory.  This prevents mm->mmap_lock livelock when an
 	 * oom killed thread cannot exit because it requires the semaphore and
 	 * its contended by another thread trying to allocate memory itself.
 	 * That thread will now get access to memory reserves since it has a
--- a/mm/pagewalk.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/pagewalk.c
@@ -373,7 +373,7 @@ static int __walk_page_range(unsigned lo
  * caller-specific data to callbacks, @private should be helpful.
  *
  * Locking:
- *   Callers of walk_page_range() and walk_page_vma() should hold @mm->mmap_sem,
+ *   Callers of walk_page_range() and walk_page_vma() should hold @mm->mmap_lock,
  *   because these function traverse vma list and/or access to vma's data.
  */
 int walk_page_range(struct mm_struct *mm, unsigned long start,
@@ -498,11 +498,11 @@ int walk_page_vma(struct vm_area_struct
  * Also see walk_page_range() for additional information.
  *
  * Locking:
- *   This function can't require that the struct mm_struct::mmap_sem is held,
+ *   This function can't require that the struct mm_struct::mmap_lock is held,
  *   since @mapping may be mapped by multiple processes. Instead
  *   @mapping->i_mmap_rwsem must be held. This might have implications in the
  *   callbacks, and it's up tho the caller to ensure that the
- *   struct mm_struct::mmap_sem is not needed.
+ *   struct mm_struct::mmap_lock is not needed.
  *
  *   Also this means that a caller can't rely on the struct
  *   vm_area_struct::vm_flags to be constant across a call,
--- a/mm/rmap.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/rmap.c
@@ -21,7 +21,7 @@
  * Lock ordering in mm:
  *
  * inode->i_mutex	(while writing or truncating, not reading or faulting)
- *   mm->mmap_sem
+ *   mm->mmap_lock
  *     page->flags PG_locked (lock_page)   * (see huegtlbfs below)
  *       hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share)
  *         mapping->i_mmap_rwsem
@@ -177,7 +177,7 @@ static void anon_vma_chain_link(struct v
  * to do any locking for the common case of already having
  * an anon_vma.
  *
- * This must be called with the mmap_sem held for reading.
+ * This must be called with the mmap_lock held for reading.
  */
 int __anon_vma_prepare(struct vm_area_struct *vma)
 {
@@ -1444,7 +1444,7 @@ static bool try_to_unmap_one(struct page
 				if (!PageTransCompound(page)) {
 					/*
 					 * Holding pte lock, we do *not* need
-					 * mmap_sem here
+					 * mmap_lock here
 					 */
 					mlock_vma_page(page);
 				}
@@ -1817,7 +1817,7 @@ static struct anon_vma *rmap_walk_anon_l
 	/*
 	 * Note: remove_migration_ptes() cannot use page_lock_anon_vma_read()
 	 * because that depends on page_mapped(); but not all its usages
-	 * are holding mmap_sem. Users without mmap_sem are required to
+	 * are holding mmap_lock. Users without mmap_lock are required to
 	 * take a reference count to prevent the anon_vma disappearing
 	 */
 	anon_vma = page_anon_vma(page);
@@ -1837,7 +1837,7 @@ static struct anon_vma *rmap_walk_anon_l
  * Find all the mappings of a page using the mapping pointer and the vma chains
  * contained in the anon_vma struct it points to.
  *
- * When called from try_to_munlock(), the mmap_sem of the mm containing the vma
+ * When called from try_to_munlock(), the mmap_lock of the mm containing the vma
  * where the page was found will be held for write.  So, we won't recheck
  * vm_flags for that VMA.  That should be OK, because that vma shouldn't be
  * LOCKED.
@@ -1889,7 +1889,7 @@ static void rmap_walk_anon(struct page *
  * Find all the mappings of a page using the mapping pointer and the vma chains
  * contained in the address_space struct it points to.
  *
- * When called from try_to_munlock(), the mmap_sem of the mm containing the vma
+ * When called from try_to_munlock(), the mmap_lock of the mm containing the vma
  * where the page was found will be held for write.  So, we won't recheck
  * vm_flags for that VMA.  That should be OK, because that vma shouldn't be
  * LOCKED.
--- a/mm/shmem.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/shmem.c
@@ -2319,7 +2319,7 @@ static int shmem_mfill_atomic_pte(struct
 					     PAGE_SIZE);
 			kunmap_atomic(page_kaddr);
 
-			/* fallback to copy_from_user outside mmap_sem */
+			/* fallback to copy_from_user outside mmap_lock */
 			if (unlikely(ret)) {
 				*pagep = page;
 				shmem_inode_unacct_blocks(inode, 1);
@@ -4136,7 +4136,7 @@ int shmem_zero_setup(struct vm_area_stru
 	loff_t size = vma->vm_end - vma->vm_start;
 
 	/*
-	 * Cloning a new file under mmap_sem leads to a lock ordering conflict
+	 * Cloning a new file under mmap_lock leads to a lock ordering conflict
 	 * between XFS directory reading and selinux: since this file is only
 	 * accessible to the user through its mapping, use S_PRIVATE flag to
 	 * bypass file security, in the same way as shmem_kernel_file_setup().
--- a/mm/swap_state.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/swap_state.c
@@ -552,7 +552,7 @@ static unsigned long swapin_nr_pages(uns
  * This has been extended to use the NUMA policies from the mm triggering
  * the readahead.
  *
- * Caller must hold read mmap_sem if vmf->vma is not NULL.
+ * Caller must hold read mmap_lock if vmf->vma is not NULL.
  */
 struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask,
 				struct vm_fault *vmf)
@@ -734,7 +734,7 @@ static void swap_ra_info(struct vm_fault
  * Primitive swap readahead code. We simply read in a few pages whoes
  * virtual addresses are around the fault address in the same vma.
  *
- * Caller must hold read mmap_sem if vmf->vma is not NULL.
+ * Caller must hold read mmap_lock if vmf->vma is not NULL.
  *
  */
 static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask,
--- a/mm/userfaultfd.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/userfaultfd.c
@@ -76,7 +76,7 @@ static int mcopy_atomic_pte(struct mm_st
 				     PAGE_SIZE);
 		kunmap_atomic(page_kaddr);
 
-		/* fallback to copy_from_user outside mmap_sem */
+		/* fallback to copy_from_user outside mmap_lock */
 		if (unlikely(ret)) {
 			ret = -ENOENT;
 			*pagep = page;
@@ -200,7 +200,7 @@ static pmd_t *mm_alloc_pmd(struct mm_str
 #ifdef CONFIG_HUGETLB_PAGE
 /*
  * __mcopy_atomic processing for HUGETLB vmas.  Note that this routine is
- * called with mmap_sem held, it will release mmap_sem before returning.
+ * called with mmap_lock held, it will release mmap_lock before returning.
  */
 static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 					      struct vm_area_struct *dst_vma,
@@ -247,7 +247,7 @@ static __always_inline ssize_t __mcopy_a
 
 retry:
 	/*
-	 * On routine entry dst_vma is set.  If we had to drop mmap_sem and
+	 * On routine entry dst_vma is set.  If we had to drop mmap_lock and
 	 * retry, dst_vma will be set to NULL and we must lookup again.
 	 */
 	if (!dst_vma) {
@@ -357,7 +357,7 @@ out:
 		 * private and shared mappings.  See the routine
 		 * restore_reserve_on_error for details.  Unfortunately, we
 		 * can not call restore_reserve_on_error now as it would
-		 * require holding mmap_sem.
+		 * require holding mmap_lock.
 		 *
 		 * If a reservation for the page existed in the reservation
 		 * map of a private mapping, the map was modified to indicate
--- a/mm/util.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/mm/util.c
@@ -425,7 +425,7 @@ void arch_pick_mmap_layout(struct mm_str
  * @bypass_rlim: %true if checking RLIMIT_MEMLOCK should be skipped
  *
  * Assumes @task and @mm are valid (i.e. at least one reference on each), and
- * that mmap_sem is held as writer.
+ * that mmap_lock is held as writer.
  *
  * Return:
  * * 0       on success
--- a/security/keys/keyctl.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/security/keys/keyctl.c
@@ -875,7 +875,7 @@ can_read_key:
 	 *
 	 * Allocating a temporary buffer to hold the keys before
 	 * transferring them to user buffer to avoid potential
-	 * deadlock involving page fault and mmap_sem.
+	 * deadlock involving page fault and mmap_lock.
 	 *
 	 * key_data_len = (buflen <= PAGE_SIZE)
 	 *		? buflen : actual length of key data
--- a/sound/core/oss/pcm_oss.c~mmap-locking-api-convert-mmap_sem-comments
+++ a/sound/core/oss/pcm_oss.c
@@ -2876,7 +2876,7 @@ static int snd_pcm_oss_mmap(struct file
 	
 	if (runtime->oss.params) {
 		/* use mutex_trylock() for params_lock for avoiding a deadlock
-		 * between mmap_sem and params_lock taken by
+		 * between mmap_lock and params_lock taken by
 		 * copy_from/to_user() in snd_pcm_oss_write/read()
 		 */
 		err = snd_pcm_oss_change_params(substream, true);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 72/93] maccess: unexport probe_kernel_write()
  2020-06-09  4:29 incoming Andrew Morton
                   ` (70 preceding siblings ...)
  2020-06-09  4:33 ` [patch 71/93] mmap locking API: convert mmap_sem comments Andrew Morton
@ 2020-06-09  4:33 ` Andrew Morton
  2020-06-09  4:34 ` [patch 73/93] maccess: remove various unused weak aliases Andrew Morton
                   ` (23 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:33 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, sfr, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: unexport probe_kernel_write()

Patch series "clean up and streamline probe_kernel_* and friends", v4.

This series start cleaning up the safe kernel and user memory probing
helpers in mm/maccess.c, and then allows architectures to implement the
kernel probing without overriding the address space limit and temporarily
allowing access to user memory.  It then switches x86 over to this new
mechanism by reusing the unsafe_* uaccess logic.

This version also switches to the saner copy_{from,to}_kernel_nofault
naming suggested by Linus.

I kept the x86 helpers as-is without calling unsage_{get,put}_user as that
avoids a number of hard to trace casts, and it will still work with the
asm-goto based version easily.


This patch (of 20):

probe_kernel_write() is not used by any modular code.

[sfr@canb.auug.org.au: turns out that probe_user_write is used in modular code]
  Link: http://lkml.kernel.org/r/20200602195741.4faaa348@canb.auug.org.au
Link: http://lkml.kernel.org/r/20200521152301.2587579-1-hch@lst.de
Link: http://lkml.kernel.org/r/20200521152301.2587579-2-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |    1 -
 1 file changed, 1 deletion(-)

--- a/mm/maccess.c~maccess-unexport-probe_kernel_write-and-probe_user_write
+++ a/mm/maccess.c
@@ -121,7 +121,6 @@ long __probe_kernel_write(void *dst, con
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(probe_kernel_write);
 
 /**
  * probe_user_write(): safely attempt to write to a user-space location
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 73/93] maccess: remove various unused weak aliases
  2020-06-09  4:29 incoming Andrew Morton
                   ` (71 preceding siblings ...)
  2020-06-09  4:33 ` [patch 72/93] maccess: unexport probe_kernel_write() Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 74/93] maccess: remove duplicate kerneldoc comments Andrew Morton
                   ` (22 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: remove various unused weak aliases

maccess tends to define lots of underscore prefixed symbols that then
have other weak aliases.  But except for two cases they are never
actually used, so remove them.

Link: http://lkml.kernel.org/r/20200521152301.2587579-3-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/uaccess.h |    3 ---
 mm/maccess.c            |   19 +++----------------
 2 files changed, 3 insertions(+), 19 deletions(-)

--- a/include/linux/uaccess.h~maccess-remove-various-unused-weak-aliases
+++ a/include/linux/uaccess.h
@@ -324,7 +324,6 @@ extern long __probe_kernel_read(void *ds
  * happens, handle that and return -EFAULT.
  */
 extern long probe_user_read(void *dst, const void __user *src, size_t size);
-extern long __probe_user_read(void *dst, const void __user *src, size_t size);
 
 /*
  * probe_kernel_write(): safely attempt to write to a location
@@ -336,7 +335,6 @@ extern long __probe_user_read(void *dst,
  * happens, handle that and return -EFAULT.
  */
 extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
-extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size);
 
 /*
  * probe_user_write(): safely attempt to write to a location in user space
@@ -348,7 +346,6 @@ extern long notrace __probe_kernel_write
  * happens, handle that and return -EFAULT.
  */
 extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
-extern long notrace __probe_user_write(void __user *dst, const void *src, size_t size);
 
 extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
--- a/mm/maccess.c~maccess-remove-various-unused-weak-aliases
+++ a/mm/maccess.c
@@ -79,11 +79,7 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
  * Safely read from user address @src to the buffer at @dst. If a kernel fault
  * happens, handle that and return -EFAULT.
  */
-
-long __weak probe_user_read(void *dst, const void __user *src, size_t size)
-    __attribute__((alias("__probe_user_read")));
-
-long __probe_user_read(void *dst, const void __user *src, size_t size)
+long probe_user_read(void *dst, const void __user *src, size_t size)
 {
 	long ret = -EFAULT;
 	mm_segment_t old_fs = get_fs();
@@ -106,11 +102,7 @@ EXPORT_SYMBOL_GPL(probe_user_read);
  * Safely write to address @dst from the buffer at @src.  If a kernel fault
  * happens, handle that and return -EFAULT.
  */
-
-long __weak probe_kernel_write(void *dst, const void *src, size_t size)
-    __attribute__((alias("__probe_kernel_write")));
-
-long __probe_kernel_write(void *dst, const void *src, size_t size)
+long probe_kernel_write(void *dst, const void *src, size_t size)
 {
 	long ret;
 	mm_segment_t old_fs = get_fs();
@@ -131,11 +123,7 @@ long __probe_kernel_write(void *dst, con
  * Safely write to address @dst from the buffer at @src.  If a kernel fault
  * happens, handle that and return -EFAULT.
  */
-
-long __weak probe_user_write(void __user *dst, const void *src, size_t size)
-    __attribute__((alias("__probe_user_write")));
-
-long __probe_user_write(void __user *dst, const void *src, size_t size)
+long probe_user_write(void __user *dst, const void *src, size_t size)
 {
 	long ret = -EFAULT;
 	mm_segment_t old_fs = get_fs();
@@ -172,7 +160,6 @@ EXPORT_SYMBOL_GPL(probe_user_write);
  * probing memory on a user address range where strncpy_from_unsafe_user() is
  * supposed to be used instead.
  */
-
 long __weak strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
     __attribute__((alias("__strncpy_from_unsafe")));
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 74/93] maccess: remove duplicate kerneldoc comments
  2020-06-09  4:29 incoming Andrew Morton
                   ` (72 preceding siblings ...)
  2020-06-09  4:34 ` [patch 73/93] maccess: remove various unused weak aliases Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 75/93] maccess: clarify " Andrew Morton
                   ` (21 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: remove duplicate kerneldoc comments

Many of the maccess routines have a copy of the kerneldoc comment
in the header.  Remove it as it is not useful and will get out of
sync sooner or later.

Link: http://lkml.kernel.org/r/20200521152301.2587579-4-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/uaccess.h |   38 --------------------------------------
 1 file changed, 38 deletions(-)

--- a/include/linux/uaccess.h~maccess-remove-duplicate-kerneldoc-comments
+++ a/include/linux/uaccess.h
@@ -301,50 +301,12 @@ copy_struct_from_user(void *dst, size_t
 	return 0;
 }
 
-/*
- * probe_kernel_read(): safely attempt to read from a location
- * @dst: pointer to the buffer that shall take the data
- * @src: address to read from
- * @size: size of the data chunk
- *
- * Safely read from address @src to the buffer at @dst.  If a kernel fault
- * happens, handle that and return -EFAULT.
- */
 extern long probe_kernel_read(void *dst, const void *src, size_t size);
 extern long probe_kernel_read_strict(void *dst, const void *src, size_t size);
 extern long __probe_kernel_read(void *dst, const void *src, size_t size);
-
-/*
- * probe_user_read(): safely attempt to read from a location in user space
- * @dst: pointer to the buffer that shall take the data
- * @src: address to read from
- * @size: size of the data chunk
- *
- * Safely read from address @src to the buffer at @dst.  If a kernel fault
- * happens, handle that and return -EFAULT.
- */
 extern long probe_user_read(void *dst, const void __user *src, size_t size);
 
-/*
- * probe_kernel_write(): safely attempt to write to a location
- * @dst: address to write to
- * @src: pointer to the data that shall be written
- * @size: size of the data chunk
- *
- * Safely write to address @dst from the buffer at @src.  If a kernel fault
- * happens, handle that and return -EFAULT.
- */
 extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
-
-/*
- * probe_user_write(): safely attempt to write to a location in user space
- * @dst: address to write to
- * @src: pointer to the data that shall be written
- * @size: size of the data chunk
- *
- * Safely write to address @dst from the buffer at @src.  If a kernel fault
- * happens, handle that and return -EFAULT.
- */
 extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
 
 extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 75/93] maccess: clarify kerneldoc comments
  2020-06-09  4:29 incoming Andrew Morton
                   ` (73 preceding siblings ...)
  2020-06-09  4:34 ` [patch 74/93] maccess: remove duplicate kerneldoc comments Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 76/93] maccess: update the top of file comment Andrew Morton
                   ` (20 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: clarify kerneldoc comments

Add proper kerneldoc comments for probe_kernel_read_strict and
probe_kernel_read strncpy_from_unsafe_strict and explain the different
versus the non-strict version.

Link: http://lkml.kernel.org/r/20200521152301.2587579-5-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |   60 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 17 deletions(-)

--- a/mm/maccess.c~maccess-clarify-kerneldoc-comments
+++ a/mm/maccess.c
@@ -31,29 +31,36 @@ probe_write_common(void __user *dst, con
 }
 
 /**
- * probe_kernel_read(): safely attempt to read from a kernel-space location
+ * probe_kernel_read(): safely attempt to read from any location
  * @dst: pointer to the buffer that shall take the data
  * @src: address to read from
  * @size: size of the data chunk
  *
- * Safely read from address @src to the buffer at @dst.  If a kernel fault
- * happens, handle that and return -EFAULT.
+ * Same as probe_kernel_read_strict() except that for architectures with
+ * not fully separated user and kernel address spaces this function also works
+ * for user address tanges.
+ *
+ * DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
+ * separate kernel and user address spaces, and also a bad idea otherwise.
+ */
+long __weak probe_kernel_read(void *dst, const void *src, size_t size)
+    __attribute__((alias("__probe_kernel_read")));
+
+/**
+ * probe_kernel_read_strict(): safely attempt to read from kernel-space
+ * @dst: pointer to the buffer that shall take the data
+ * @src: address to read from
+ * @size: size of the data chunk
+ *
+ * Safely read from kernel address @src to the buffer at @dst.  If a kernel
+ * fault happens, handle that and return -EFAULT.
  *
  * We ensure that the copy_from_user is executed in atomic context so that
  * do_page_fault() doesn't attempt to take mmap_lock.  This makes
  * probe_kernel_read() suitable for use within regions where the caller
  * already holds mmap_lock, or other locks which nest inside mmap_lock.
- *
- * probe_kernel_read_strict() is the same as probe_kernel_read() except for
- * the case where architectures have non-overlapping user and kernel address
- * ranges: probe_kernel_read_strict() will additionally return -EFAULT for
- * probing memory on a user address range where probe_user_read() is supposed
- * to be used instead.
  */
 
-long __weak probe_kernel_read(void *dst, const void *src, size_t size)
-    __attribute__((alias("__probe_kernel_read")));
-
 long __weak probe_kernel_read_strict(void *dst, const void *src, size_t size)
     __attribute__((alias("__probe_kernel_read")));
 
@@ -154,15 +161,34 @@ EXPORT_SYMBOL_GPL(probe_user_write);
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
  *
- * strncpy_from_unsafe_strict() is the same as strncpy_from_unsafe() except
- * for the case where architectures have non-overlapping user and kernel address
- * ranges: strncpy_from_unsafe_strict() will additionally return -EFAULT for
- * probing memory on a user address range where strncpy_from_unsafe_user() is
- * supposed to be used instead.
+ * Same as strncpy_from_unsafe_strict() except that for architectures with
+ * not fully separated user and kernel address spaces this function also works
+ * for user address tanges.
+ *
+ * DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
+ * separate kernel and user address spaces, and also a bad idea otherwise.
  */
 long __weak strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
     __attribute__((alias("__strncpy_from_unsafe")));
 
+/**
+ * strncpy_from_unsafe_strict: - Copy a NUL terminated string from unsafe
+ *				 address.
+ * @dst:   Destination address, in kernel space.  This buffer must be at
+ *         least @count bytes long.
+ * @unsafe_addr: Unsafe address.
+ * @count: Maximum number of bytes to copy, including the trailing NUL.
+ *
+ * Copies a NUL-terminated string from unsafe address to kernel buffer.
+ *
+ * On success, returns the length of the string INCLUDING the trailing NUL.
+ *
+ * If access fails, returns -EFAULT (some data may have been copied
+ * and the trailing NUL added).
+ *
+ * If @count is smaller than the length of the string, copies @count-1 bytes,
+ * sets the last byte of @dst buffer to NUL and returns @count.
+ */
 long __weak strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
 				       long count)
     __attribute__((alias("__strncpy_from_unsafe")));
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 76/93] maccess: update the top of file comment
  2020-06-09  4:29 incoming Andrew Morton
                   ` (74 preceding siblings ...)
  2020-06-09  4:34 ` [patch 75/93] maccess: clarify " Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 77/93] maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault Andrew Morton
                   ` (19 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: update the top of file comment

This file now also contains several helpers for accessing user memory.

Link: http://lkml.kernel.org/r/20200521152301.2587579-6-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/maccess.c~maccess-update-the-top-of-file-comment
+++ a/mm/maccess.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Access kernel memory without faulting.
+ * Access kernel or user memory without faulting.
  */
 #include <linux/export.h>
 #include <linux/mm.h>
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 77/93] maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault
  2020-06-09  4:29 incoming Andrew Morton
                   ` (75 preceding siblings ...)
  2020-06-09  4:34 ` [patch 76/93] maccess: update the top of file comment Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 78/93] maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault Andrew Morton
                   ` (18 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault

This matches the naming of strncpy_from_user, and also makes it more
clear what the function is supposed to do.

Link: http://lkml.kernel.org/r/20200521152301.2587579-7-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/uaccess.h     |    4 ++--
 kernel/trace/bpf_trace.c    |    4 ++--
 kernel/trace/trace_kprobe.c |    2 +-
 mm/maccess.c                |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

--- a/include/linux/uaccess.h~maccess-rename-strncpy_from_unsafe_user-to-strncpy_from_user_nofault
+++ a/include/linux/uaccess.h
@@ -313,8 +313,8 @@ extern long strncpy_from_unsafe(char *ds
 extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
 				       long count);
 extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
-extern long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
-				     long count);
+long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
+		long count);
 extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
 
 /**
--- a/kernel/trace/bpf_trace.c~maccess-rename-strncpy_from_unsafe_user-to-strncpy_from_user_nofault
+++ a/kernel/trace/bpf_trace.c
@@ -159,7 +159,7 @@ const struct bpf_func_proto bpf_probe_re
 BPF_CALL_3(bpf_probe_read_user_str, void *, dst, u32, size,
 	   const void __user *, unsafe_ptr)
 {
-	int ret = strncpy_from_unsafe_user(dst, unsafe_ptr, size);
+	int ret = strncpy_from_user_nofault(dst, unsafe_ptr, size);
 
 	if (unlikely(ret < 0))
 		memset(dst, 0, size);
@@ -419,7 +419,7 @@ fmt_str:
 							   sizeof(buf));
 				break;
 			case 'u':
-				strncpy_from_unsafe_user(buf,
+				strncpy_from_user_nofault(buf,
 					(__force void __user *)unsafe_ptr,
 							 sizeof(buf));
 				break;
--- a/kernel/trace/trace_kprobe.c~maccess-rename-strncpy_from_unsafe_user-to-strncpy_from_user_nofault
+++ a/kernel/trace/trace_kprobe.c
@@ -1268,7 +1268,7 @@ fetch_store_string_user(unsigned long ad
 
 	__dest = get_loc_data(dest, base);
 
-	ret = strncpy_from_unsafe_user(__dest, uaddr, maxlen);
+	ret = strncpy_from_user_nofault(__dest, uaddr, maxlen);
 	if (ret >= 0)
 		*(u32 *)dest = make_data_loc(ret, __dest - base);
 
--- a/mm/maccess.c~maccess-rename-strncpy_from_unsafe_user-to-strncpy_from_user_nofault
+++ a/mm/maccess.c
@@ -217,7 +217,7 @@ long __strncpy_from_unsafe(char *dst, co
 }
 
 /**
- * strncpy_from_unsafe_user: - Copy a NUL terminated string from unsafe user
+ * strncpy_from_user_nofault: - Copy a NUL terminated string from unsafe user
  *				address.
  * @dst:   Destination address, in kernel space.  This buffer must be at
  *         least @count bytes long.
@@ -234,7 +234,7 @@ long __strncpy_from_unsafe(char *dst, co
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
  */
-long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
+long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
 			      long count)
 {
 	mm_segment_t old_fs = get_fs();
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 78/93] maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault
  2020-06-09  4:29 incoming Andrew Morton
                   ` (76 preceding siblings ...)
  2020-06-09  4:34 ` [patch 77/93] maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 79/93] maccess: rename strnlen_unsafe_user to strnlen_user_nofault Andrew Morton
                   ` (17 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault

This matches the naming of strncpy_from_user_nofault, and also makes it
more clear what the function is supposed to do.

Link: http://lkml.kernel.org/r/20200521152301.2587579-8-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/mm/maccess.c    |    2 +-
 include/linux/uaccess.h  |    4 ++--
 kernel/trace/bpf_trace.c |    4 ++--
 mm/maccess.c             |    6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

--- a/arch/x86/mm/maccess.c~maccess-rename-strncpy_from_unsafe_strict-to-strncpy_from_kernel_nofault
+++ a/arch/x86/mm/maccess.c
@@ -34,7 +34,7 @@ long probe_kernel_read_strict(void *dst,
 	return __probe_kernel_read(dst, src, size);
 }
 
-long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr, long count)
+long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
 {
 	if (unlikely(invalid_probe_range((unsigned long)unsafe_addr)))
 		return -EFAULT;
--- a/include/linux/uaccess.h~maccess-rename-strncpy_from_unsafe_strict-to-strncpy_from_kernel_nofault
+++ a/include/linux/uaccess.h
@@ -310,8 +310,8 @@ extern long notrace probe_kernel_write(v
 extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
 
 extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
-extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
-				       long count);
+long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
+		long count);
 extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
 		long count);
--- a/kernel/trace/bpf_trace.c~maccess-rename-strncpy_from_unsafe_strict-to-strncpy_from_kernel_nofault
+++ a/kernel/trace/bpf_trace.c
@@ -240,7 +240,7 @@ bpf_probe_read_kernel_str_common(void *d
 	 * is returned that can be used for bpf_perf_event_output() et al.
 	 */
 	ret = compat ? strncpy_from_unsafe(dst, unsafe_ptr, size) :
-	      strncpy_from_unsafe_strict(dst, unsafe_ptr, size);
+	      strncpy_from_kernel_nofault(dst, unsafe_ptr, size);
 	if (unlikely(ret < 0))
 out:
 		memset(dst, 0, size);
@@ -415,7 +415,7 @@ fmt_str:
 				break;
 #endif
 			case 'k':
-				strncpy_from_unsafe_strict(buf, unsafe_ptr,
+				strncpy_from_kernel_nofault(buf, unsafe_ptr,
 							   sizeof(buf));
 				break;
 			case 'u':
--- a/mm/maccess.c~maccess-rename-strncpy_from_unsafe_strict-to-strncpy_from_kernel_nofault
+++ a/mm/maccess.c
@@ -161,7 +161,7 @@ EXPORT_SYMBOL_GPL(probe_user_write);
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
  *
- * Same as strncpy_from_unsafe_strict() except that for architectures with
+ * Same as strncpy_from_kernel_nofault() except that for architectures with
  * not fully separated user and kernel address spaces this function also works
  * for user address tanges.
  *
@@ -172,7 +172,7 @@ long __weak strncpy_from_unsafe(char *ds
     __attribute__((alias("__strncpy_from_unsafe")));
 
 /**
- * strncpy_from_unsafe_strict: - Copy a NUL terminated string from unsafe
+ * strncpy_from_kernel_nofault: - Copy a NUL terminated string from unsafe
  *				 address.
  * @dst:   Destination address, in kernel space.  This buffer must be at
  *         least @count bytes long.
@@ -189,7 +189,7 @@ long __weak strncpy_from_unsafe(char *ds
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
  */
-long __weak strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
+long __weak strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
 				       long count)
     __attribute__((alias("__strncpy_from_unsafe")));
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 79/93] maccess: rename strnlen_unsafe_user to strnlen_user_nofault
  2020-06-09  4:29 incoming Andrew Morton
                   ` (77 preceding siblings ...)
  2020-06-09  4:34 ` [patch 78/93] maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 80/93] maccess: remove probe_read_common and probe_write_common Andrew Morton
                   ` (16 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: rename strnlen_unsafe_user to strnlen_user_nofault

This matches the naming of strnlen_user, and also makes it more clear
what the function is supposed to do.

Link: http://lkml.kernel.org/r/20200521152301.2587579-9-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/uaccess.h     |    2 +-
 kernel/trace/trace_kprobe.c |    2 +-
 mm/maccess.c                |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

--- a/include/linux/uaccess.h~maccess-rename-strnlen_unsafe_user-to-strnlen_user_nofault
+++ a/include/linux/uaccess.h
@@ -315,7 +315,7 @@ long strncpy_from_kernel_nofault(char *d
 extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
 		long count);
-extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
+long strnlen_user_nofault(const void __user *unsafe_addr, long count);
 
 /**
  * probe_kernel_address(): safely attempt to read from a location
--- a/kernel/trace/trace_kprobe.c~maccess-rename-strnlen_unsafe_user-to-strnlen_user_nofault
+++ a/kernel/trace/trace_kprobe.c
@@ -1221,7 +1221,7 @@ fetch_store_strlen_user(unsigned long ad
 {
 	const void __user *uaddr =  (__force const void __user *)addr;
 
-	return strnlen_unsafe_user(uaddr, MAX_STRING_SIZE);
+	return strnlen_user_nofault(uaddr, MAX_STRING_SIZE);
 }
 
 /*
--- a/mm/maccess.c~maccess-rename-strnlen_unsafe_user-to-strnlen_user_nofault
+++ a/mm/maccess.c
@@ -260,7 +260,7 @@ long strncpy_from_user_nofault(char *dst
 }
 
 /**
- * strnlen_unsafe_user: - Get the size of a user string INCLUDING final NUL.
+ * strnlen_user_nofault: - Get the size of a user string INCLUDING final NUL.
  * @unsafe_addr: The string to measure.
  * @count: Maximum count (including NUL)
  *
@@ -275,7 +275,7 @@ long strncpy_from_user_nofault(char *dst
  * Unlike strnlen_user, this can be used from IRQ handler etc. because
  * it disables pagefaults.
  */
-long strnlen_unsafe_user(const void __user *unsafe_addr, long count)
+long strnlen_user_nofault(const void __user *unsafe_addr, long count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 80/93] maccess: remove probe_read_common and probe_write_common
  2020-06-09  4:29 incoming Andrew Morton
                   ` (78 preceding siblings ...)
  2020-06-09  4:34 ` [patch 79/93] maccess: rename strnlen_unsafe_user to strnlen_user_nofault Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 81/93] maccess: unify the probe kernel arch hooks Andrew Morton
                   ` (15 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: remove probe_read_common and probe_write_common

Each of the helpers has just two callers, which also different in
dealing with kernel or userspace pointers.  Just open code the logic
in the callers.

Link: http://lkml.kernel.org/r/20200521152301.2587579-10-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |   63 ++++++++++++++++++++++---------------------------
 1 file changed, 29 insertions(+), 34 deletions(-)

--- a/mm/maccess.c~maccess-remove-probe_read_common-and-probe_write_common
+++ a/mm/maccess.c
@@ -6,30 +6,6 @@
 #include <linux/mm.h>
 #include <linux/uaccess.h>
 
-static __always_inline long
-probe_read_common(void *dst, const void __user *src, size_t size)
-{
-	long ret;
-
-	pagefault_disable();
-	ret = __copy_from_user_inatomic(dst, src, size);
-	pagefault_enable();
-
-	return ret ? -EFAULT : 0;
-}
-
-static __always_inline long
-probe_write_common(void __user *dst, const void *src, size_t size)
-{
-	long ret;
-
-	pagefault_disable();
-	ret = __copy_to_user_inatomic(dst, src, size);
-	pagefault_enable();
-
-	return ret ? -EFAULT : 0;
-}
-
 /**
  * probe_kernel_read(): safely attempt to read from any location
  * @dst: pointer to the buffer that shall take the data
@@ -70,10 +46,15 @@ long __probe_kernel_read(void *dst, cons
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
-	ret = probe_read_common(dst, (__force const void __user *)src, size);
+	pagefault_disable();
+	ret = __copy_from_user_inatomic(dst, (__force const void __user *)src,
+			size);
+	pagefault_enable();
 	set_fs(old_fs);
 
-	return ret;
+	if (ret)
+		return -EFAULT;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(probe_kernel_read);
 
@@ -92,11 +73,16 @@ long probe_user_read(void *dst, const vo
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(USER_DS);
-	if (access_ok(src, size))
-		ret = probe_read_common(dst, src, size);
+	if (access_ok(src, size)) {
+		pagefault_disable();
+		ret = __copy_from_user_inatomic(dst, src, size);
+		pagefault_enable();
+	}
 	set_fs(old_fs);
 
-	return ret;
+	if (ret)
+		return -EFAULT;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(probe_user_read);
 
@@ -115,10 +101,14 @@ long probe_kernel_write(void *dst, const
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
-	ret = probe_write_common((__force void __user *)dst, src, size);
+	pagefault_disable();
+	ret = __copy_to_user_inatomic((__force void __user *)dst, src, size);
+	pagefault_enable();
 	set_fs(old_fs);
 
-	return ret;
+	if (ret)
+		return -EFAULT;
+	return 0;
 }
 
 /**
@@ -136,11 +126,16 @@ long probe_user_write(void __user *dst,
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(USER_DS);
-	if (access_ok(dst, size))
-		ret = probe_write_common(dst, src, size);
+	if (access_ok(dst, size)) {
+		pagefault_disable();
+		ret = __copy_to_user_inatomic(dst, src, size);
+		pagefault_enable();
+	}
 	set_fs(old_fs);
 
-	return ret;
+	if (ret)
+		return -EFAULT;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(probe_user_write);
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 81/93] maccess: unify the probe kernel arch hooks
  2020-06-09  4:29 incoming Andrew Morton
                   ` (79 preceding siblings ...)
  2020-06-09  4:34 ` [patch 80/93] maccess: remove probe_read_common and probe_write_common Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 82/93] bpf: factor out a bpf_trace_copy_string helper Andrew Morton
                   ` (14 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: unify the probe kernel arch hooks

Currently architectures have to override every routine that probes
kernel memory, which includes a pure read and strcpy, both in strict
and not strict variants.  Just provide a single arch hooks instead to
make sure all architectures cover all the cases.

[akpm@linux-foundation.org: fix !CONFIG_X86_64 build]
Link: http://lkml.kernel.org/r/20200521152301.2587579-11-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/parisc/lib/memcpy.c |   12 ++------
 arch/um/kernel/maccess.c |   10 ++-----
 arch/x86/mm/maccess.c    |   33 ++++++++----------------
 include/linux/uaccess.h  |    6 ++--
 mm/maccess.c             |   50 +++++++++++++++++++++++++++----------
 5 files changed, 61 insertions(+), 50 deletions(-)

--- a/arch/parisc/lib/memcpy.c~maccess-unify-the-probe-kernel-arch-hooks
+++ a/arch/parisc/lib/memcpy.c
@@ -57,14 +57,10 @@ void * memcpy(void * dst,const void *src
 EXPORT_SYMBOL(raw_copy_in_user);
 EXPORT_SYMBOL(memcpy);
 
-long probe_kernel_read(void *dst, const void *src, size_t size)
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size, bool strict)
 {
-	unsigned long addr = (unsigned long)src;
-
-	if (addr < PAGE_SIZE)
-		return -EFAULT;
-
+	if ((unsigned long)unsafe_src < PAGE_SIZE)
+		return false;
 	/* check for I/O space F_EXTEND(0xfff00000) access as well? */
-
-	return __probe_kernel_read(dst, src, size);
+	return true;
 }
--- a/arch/um/kernel/maccess.c~maccess-unify-the-probe-kernel-arch-hooks
+++ a/arch/um/kernel/maccess.c
@@ -7,15 +7,13 @@
 #include <linux/kernel.h>
 #include <os.h>
 
-long probe_kernel_read(void *dst, const void *src, size_t size)
+bool probe_kernel_read_allowed(const void *src, size_t size, bool strict)
 {
 	void *psrc = (void *)rounddown((unsigned long)src, PAGE_SIZE);
 
 	if ((unsigned long)src < PAGE_SIZE || size <= 0)
-		return -EFAULT;
-
+		return false;
 	if (os_mincore(psrc, size + src - psrc) <= 0)
-		return -EFAULT;
-
-	return __probe_kernel_read(dst, src, size);
+		return false;
+	return true;
 }
--- a/arch/x86/mm/maccess.c~maccess-unify-the-probe-kernel-arch-hooks
+++ a/arch/x86/mm/maccess.c
@@ -9,35 +9,26 @@ static __always_inline u64 canonical_add
 	return ((s64)vaddr << (64 - vaddr_bits)) >> (64 - vaddr_bits);
 }
 
-static __always_inline bool invalid_probe_range(u64 vaddr)
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size, bool strict)
 {
+	unsigned long vaddr = (unsigned long)unsafe_src;
+
+	if (!strict)
+		return true;
+
 	/*
 	 * Range covering the highest possible canonical userspace address
 	 * as well as non-canonical address range. For the canonical range
 	 * we also need to include the userspace guard page.
 	 */
-	return vaddr < TASK_SIZE_MAX + PAGE_SIZE ||
-	       canonical_address(vaddr, boot_cpu_data.x86_virt_bits) != vaddr;
+	return vaddr >= TASK_SIZE_MAX + PAGE_SIZE &&
+	       canonical_address(vaddr, boot_cpu_data.x86_virt_bits) == vaddr;
 }
 #else
-static __always_inline bool invalid_probe_range(u64 vaddr)
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size, bool strict)
 {
-	return vaddr < TASK_SIZE_MAX;
+	if (!strict)
+		return true;
+	return (unsigned long)unsafe_src >= TASK_SIZE_MAX;
 }
 #endif
-
-long probe_kernel_read_strict(void *dst, const void *src, size_t size)
-{
-	if (unlikely(invalid_probe_range((unsigned long)src)))
-		return -EFAULT;
-
-	return __probe_kernel_read(dst, src, size);
-}
-
-long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
-{
-	if (unlikely(invalid_probe_range((unsigned long)unsafe_addr)))
-		return -EFAULT;
-
-	return __strncpy_from_unsafe(dst, unsafe_addr, count);
-}
--- a/include/linux/uaccess.h~maccess-unify-the-probe-kernel-arch-hooks
+++ a/include/linux/uaccess.h
@@ -301,9 +301,11 @@ copy_struct_from_user(void *dst, size_t
 	return 0;
 }
 
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size,
+		bool strict);
+
 extern long probe_kernel_read(void *dst, const void *src, size_t size);
 extern long probe_kernel_read_strict(void *dst, const void *src, size_t size);
-extern long __probe_kernel_read(void *dst, const void *src, size_t size);
 extern long probe_user_read(void *dst, const void __user *src, size_t size);
 
 extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
@@ -312,7 +314,7 @@ extern long notrace probe_user_write(voi
 extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
 		long count);
-extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
+
 long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
 		long count);
 long strnlen_user_nofault(const void __user *unsafe_addr, long count);
--- a/mm/maccess.c~maccess-unify-the-probe-kernel-arch-hooks
+++ a/mm/maccess.c
@@ -6,6 +6,17 @@
 #include <linux/mm.h>
 #include <linux/uaccess.h>
 
+static long __probe_kernel_read(void *dst, const void *src, size_t size,
+		bool strict);
+static long __strncpy_from_unsafe(char *dst, const void *unsafe_addr,
+		long count, bool strict);
+
+bool __weak probe_kernel_read_allowed(const void *unsafe_src, size_t size,
+		bool strict)
+{
+	return true;
+}
+
 /**
  * probe_kernel_read(): safely attempt to read from any location
  * @dst: pointer to the buffer that shall take the data
@@ -19,8 +30,11 @@
  * DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
  * separate kernel and user address spaces, and also a bad idea otherwise.
  */
-long __weak probe_kernel_read(void *dst, const void *src, size_t size)
-    __attribute__((alias("__probe_kernel_read")));
+long probe_kernel_read(void *dst, const void *src, size_t size)
+{
+	return __probe_kernel_read(dst, src, size, false);
+}
+EXPORT_SYMBOL_GPL(probe_kernel_read);
 
 /**
  * probe_kernel_read_strict(): safely attempt to read from kernel-space
@@ -36,15 +50,20 @@ long __weak probe_kernel_read(void *dst,
  * probe_kernel_read() suitable for use within regions where the caller
  * already holds mmap_lock, or other locks which nest inside mmap_lock.
  */
+long probe_kernel_read_strict(void *dst, const void *src, size_t size)
+{
+	return __probe_kernel_read(dst, src, size, true);
+}
 
-long __weak probe_kernel_read_strict(void *dst, const void *src, size_t size)
-    __attribute__((alias("__probe_kernel_read")));
-
-long __probe_kernel_read(void *dst, const void *src, size_t size)
+static long __probe_kernel_read(void *dst, const void *src, size_t size,
+		bool strict)
 {
 	long ret;
 	mm_segment_t old_fs = get_fs();
 
+	if (!probe_kernel_read_allowed(src, size, strict))
+		return -EFAULT;
+
 	set_fs(KERNEL_DS);
 	pagefault_disable();
 	ret = __copy_from_user_inatomic(dst, (__force const void __user *)src,
@@ -56,7 +75,6 @@ long __probe_kernel_read(void *dst, cons
 		return -EFAULT;
 	return 0;
 }
-EXPORT_SYMBOL_GPL(probe_kernel_read);
 
 /**
  * probe_user_read(): safely attempt to read from a user-space location
@@ -163,8 +181,10 @@ EXPORT_SYMBOL_GPL(probe_user_write);
  * DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
  * separate kernel and user address spaces, and also a bad idea otherwise.
  */
-long __weak strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
-    __attribute__((alias("__strncpy_from_unsafe")));
+long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
+{
+	return __strncpy_from_unsafe(dst, unsafe_addr, count, false);
+}
 
 /**
  * strncpy_from_kernel_nofault: - Copy a NUL terminated string from unsafe
@@ -184,11 +204,13 @@ long __weak strncpy_from_unsafe(char *ds
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
  */
-long __weak strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
-				       long count)
-    __attribute__((alias("__strncpy_from_unsafe")));
+long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
+{
+	return __strncpy_from_unsafe(dst, unsafe_addr, count, true);
+}
 
-long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
+static long __strncpy_from_unsafe(char *dst, const void *unsafe_addr,
+		long count, bool strict)
 {
 	mm_segment_t old_fs = get_fs();
 	const void *src = unsafe_addr;
@@ -196,6 +218,8 @@ long __strncpy_from_unsafe(char *dst, co
 
 	if (unlikely(count <= 0))
 		return 0;
+	if (!probe_kernel_read_allowed(unsafe_addr, count, strict))
+		return -EFAULT;
 
 	set_fs(KERNEL_DS);
 	pagefault_disable();
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 82/93] bpf: factor out a bpf_trace_copy_string helper
  2020-06-09  4:29 incoming Andrew Morton
                   ` (80 preceding siblings ...)
  2020-06-09  4:34 ` [patch 81/93] maccess: unify the probe kernel arch hooks Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 83/93] bpf: handle the compat string in bpf_trace_copy_string better Andrew Morton
                   ` (13 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: bpf: factor out a bpf_trace_copy_string helper

Split out a helper to do the fault free access to the string pointer
to get it out of a crazy indentation level.

Link: http://lkml.kernel.org/r/20200521152301.2587579-12-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/trace/bpf_trace.c |   42 +++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 18 deletions(-)

--- a/kernel/trace/bpf_trace.c~bpf-factor-out-a-bpf_trace_copy_string-helper
+++ a/kernel/trace/bpf_trace.c
@@ -324,6 +324,28 @@ static const struct bpf_func_proto *bpf_
 	return &bpf_probe_write_user_proto;
 }
 
+static void bpf_trace_copy_string(char *buf, void *unsafe_ptr, char fmt_ptype,
+		size_t bufsz)
+{
+	void __user *user_ptr = (__force void __user *)unsafe_ptr;
+
+	buf[0] = 0;
+
+	switch (fmt_ptype) {
+	case 's':
+#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+		strncpy_from_unsafe(buf, unsafe_ptr, bufsz);
+		break;
+#endif
+	case 'k':
+		strncpy_from_kernel_nofault(buf, unsafe_ptr, bufsz);
+		break;
+	case 'u':
+		strncpy_from_user_nofault(buf, user_ptr, bufsz);
+		break;
+	}
+}
+
 /*
  * Only limited trace_printk() conversion specifiers allowed:
  * %d %i %u %x %ld %li %lu %lx %lld %lli %llu %llx %p %pks %pus %s
@@ -406,24 +428,8 @@ fmt_str:
 				break;
 			}
 
-			buf[0] = 0;
-			switch (fmt_ptype) {
-			case 's':
-#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
-				strncpy_from_unsafe(buf, unsafe_ptr,
-						    sizeof(buf));
-				break;
-#endif
-			case 'k':
-				strncpy_from_kernel_nofault(buf, unsafe_ptr,
-							   sizeof(buf));
-				break;
-			case 'u':
-				strncpy_from_user_nofault(buf,
-					(__force void __user *)unsafe_ptr,
-							 sizeof(buf));
-				break;
-			}
+			bpf_trace_copy_string(buf, unsafe_ptr, fmt_ptype,
+					sizeof(buf));
 			goto fmt_next;
 		}
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 83/93] bpf: handle the compat string in bpf_trace_copy_string better
  2020-06-09  4:29 incoming Andrew Morton
                   ` (81 preceding siblings ...)
  2020-06-09  4:34 ` [patch 82/93] bpf: factor out a bpf_trace_copy_string helper Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 84/93] bpf:bpf_seq_printf(): handle potentially unsafe format string better Andrew Morton
                   ` (12 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: bpf: handle the compat string in bpf_trace_copy_string better

User the proper helper for kernel or userspace addresses based on
TASK_SIZE instead of the dangerous strncpy_from_unsafe function.

Link: http://lkml.kernel.org/r/20200521152301.2587579-13-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/trace/bpf_trace.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/kernel/trace/bpf_trace.c~bpf-handle-the-compat-string-in-bpf_trace_copy_string-better
+++ a/kernel/trace/bpf_trace.c
@@ -334,8 +334,11 @@ static void bpf_trace_copy_string(char *
 	switch (fmt_ptype) {
 	case 's':
 #ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
-		strncpy_from_unsafe(buf, unsafe_ptr, bufsz);
-		break;
+		if ((unsigned long)unsafe_ptr < TASK_SIZE) {
+			strncpy_from_user_nofault(buf, user_ptr, bufsz);
+			break;
+		}
+		fallthrough;
 #endif
 	case 'k':
 		strncpy_from_kernel_nofault(buf, unsafe_ptr, bufsz);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 84/93] bpf:bpf_seq_printf(): handle potentially unsafe format string better
  2020-06-09  4:29 incoming Andrew Morton
                   ` (82 preceding siblings ...)
  2020-06-09  4:34 ` [patch 83/93] bpf: handle the compat string in bpf_trace_copy_string better Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 85/93] bpf: rework the compat kernel probe handling Andrew Morton
                   ` (11 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Andrew Morton <akpm@linux-foundation.org>
Subject: bpf:bpf_seq_printf(): handle potentially unsafe format string better

User the proper helper for kernel or userspace addresses based on
TASK_SIZE instead of the dangerous strncpy_from_unsafe function.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/trace/bpf_trace.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/kernel/trace/bpf_trace.c~bpf-bpf_seq_printf-handle-potentially-unsafe-format-string-better
+++ a/kernel/trace/bpf_trace.c
@@ -588,15 +588,17 @@ BPF_CALL_5(bpf_seq_printf, struct seq_fi
 		}
 
 		if (fmt[i] == 's') {
+			void *unsafe_ptr;
+
 			/* try our best to copy */
 			if (memcpy_cnt >= MAX_SEQ_PRINTF_MAX_MEMCPY) {
 				err = -E2BIG;
 				goto out;
 			}
 
-			err = strncpy_from_unsafe_strict(bufs->buf[memcpy_cnt],
-							 (void *) (long) args[fmt_cnt],
-							 MAX_SEQ_PRINTF_STR_LEN);
+			unsafe_ptr = (void *)(long)args[fmt_cnt];
+			err = strncpy_from_kernel_nofault(bufs->buf[memcpy_cnt],
+					unsafe_ptr, MAX_SEQ_PRINTF_STR_LEN);
 			if (err < 0)
 				bufs->buf[memcpy_cnt][0] = '\0';
 			params[fmt_cnt] = (u64)(long)bufs->buf[memcpy_cnt];
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 85/93] bpf: rework the compat kernel probe handling
  2020-06-09  4:29 incoming Andrew Morton
                   ` (83 preceding siblings ...)
  2020-06-09  4:34 ` [patch 84/93] bpf:bpf_seq_printf(): handle potentially unsafe format string better Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 86/93] tracing/kprobes: handle mixed kernel/userspace probes better Andrew Morton
                   ` (10 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: bpf: rework the compat kernel probe handling

Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe
helpers, rework the compat probes to check if an address is a kernel or
userspace one, and then use the low-level kernel or user probe helper
shared by the proper kernel and user probe helpers.  This slightly
changes behavior as the compat probe on a user address doesn't check
the lockdown flags, just as the pure user probes do.

Link: http://lkml.kernel.org/r/20200521152301.2587579-14-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/trace/bpf_trace.c |  109 ++++++++++++++++++++++---------------
 1 file changed, 67 insertions(+), 42 deletions(-)

--- a/kernel/trace/bpf_trace.c~bpf-rework-the-compat-kernel-probe-handling
+++ a/kernel/trace/bpf_trace.c
@@ -136,17 +136,23 @@ static const struct bpf_func_proto bpf_o
 };
 #endif
 
-BPF_CALL_3(bpf_probe_read_user, void *, dst, u32, size,
-	   const void __user *, unsafe_ptr)
+static __always_inline int
+bpf_probe_read_user_common(void *dst, u32 size, const void __user *unsafe_ptr)
 {
-	int ret = probe_user_read(dst, unsafe_ptr, size);
+	int ret;
 
+	ret = probe_user_read(dst, unsafe_ptr, size);
 	if (unlikely(ret < 0))
 		memset(dst, 0, size);
-
 	return ret;
 }
 
+BPF_CALL_3(bpf_probe_read_user, void *, dst, u32, size,
+	   const void __user *, unsafe_ptr)
+{
+	return bpf_probe_read_user_common(dst, size, unsafe_ptr);
+}
+
 const struct bpf_func_proto bpf_probe_read_user_proto = {
 	.func		= bpf_probe_read_user,
 	.gpl_only	= true,
@@ -156,17 +162,24 @@ const struct bpf_func_proto bpf_probe_re
 	.arg3_type	= ARG_ANYTHING,
 };
 
-BPF_CALL_3(bpf_probe_read_user_str, void *, dst, u32, size,
-	   const void __user *, unsafe_ptr)
+static __always_inline int
+bpf_probe_read_user_str_common(void *dst, u32 size,
+			       const void __user *unsafe_ptr)
 {
-	int ret = strncpy_from_user_nofault(dst, unsafe_ptr, size);
+	int ret;
 
+	ret = strncpy_from_user_nofault(dst, unsafe_ptr, size);
 	if (unlikely(ret < 0))
 		memset(dst, 0, size);
-
 	return ret;
 }
 
+BPF_CALL_3(bpf_probe_read_user_str, void *, dst, u32, size,
+	   const void __user *, unsafe_ptr)
+{
+	return bpf_probe_read_user_str_common(dst, size, unsafe_ptr);
+}
+
 const struct bpf_func_proto bpf_probe_read_user_str_proto = {
 	.func		= bpf_probe_read_user_str,
 	.gpl_only	= true,
@@ -177,25 +190,25 @@ const struct bpf_func_proto bpf_probe_re
 };
 
 static __always_inline int
-bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_ptr,
-			     const bool compat)
+bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_ptr)
 {
 	int ret = security_locked_down(LOCKDOWN_BPF_READ);
 
 	if (unlikely(ret < 0))
-		goto out;
-	ret = compat ? probe_kernel_read(dst, unsafe_ptr, size) :
-	      probe_kernel_read_strict(dst, unsafe_ptr, size);
+		goto fail;
+	ret = probe_kernel_read_strict(dst, unsafe_ptr, size);
 	if (unlikely(ret < 0))
-out:
-		memset(dst, 0, size);
+		goto fail;
+	return ret;
+fail:
+	memset(dst, 0, size);
 	return ret;
 }
 
 BPF_CALL_3(bpf_probe_read_kernel, void *, dst, u32, size,
 	   const void *, unsafe_ptr)
 {
-	return bpf_probe_read_kernel_common(dst, size, unsafe_ptr, false);
+	return bpf_probe_read_kernel_common(dst, size, unsafe_ptr);
 }
 
 const struct bpf_func_proto bpf_probe_read_kernel_proto = {
@@ -207,50 +220,37 @@ const struct bpf_func_proto bpf_probe_re
 	.arg3_type	= ARG_ANYTHING,
 };
 
-BPF_CALL_3(bpf_probe_read_compat, void *, dst, u32, size,
-	   const void *, unsafe_ptr)
-{
-	return bpf_probe_read_kernel_common(dst, size, unsafe_ptr, true);
-}
-
-static const struct bpf_func_proto bpf_probe_read_compat_proto = {
-	.func		= bpf_probe_read_compat,
-	.gpl_only	= true,
-	.ret_type	= RET_INTEGER,
-	.arg1_type	= ARG_PTR_TO_UNINIT_MEM,
-	.arg2_type	= ARG_CONST_SIZE_OR_ZERO,
-	.arg3_type	= ARG_ANYTHING,
-};
-
 static __always_inline int
-bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr,
-				 const bool compat)
+bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr)
 {
 	int ret = security_locked_down(LOCKDOWN_BPF_READ);
 
 	if (unlikely(ret < 0))
-		goto out;
+		goto fail;
+
 	/*
-	 * The strncpy_from_unsafe_*() call will likely not fill the entire
-	 * buffer, but that's okay in this circumstance as we're probing
+	 * The strncpy_from_kernel_nofault() call will likely not fill the
+	 * entire buffer, but that's okay in this circumstance as we're probing
 	 * arbitrary memory anyway similar to bpf_probe_read_*() and might
 	 * as well probe the stack. Thus, memory is explicitly cleared
 	 * only in error case, so that improper users ignoring return
 	 * code altogether don't copy garbage; otherwise length of string
 	 * is returned that can be used for bpf_perf_event_output() et al.
 	 */
-	ret = compat ? strncpy_from_unsafe(dst, unsafe_ptr, size) :
-	      strncpy_from_kernel_nofault(dst, unsafe_ptr, size);
+	ret = strncpy_from_kernel_nofault(dst, unsafe_ptr, size);
 	if (unlikely(ret < 0))
-out:
-		memset(dst, 0, size);
+		goto fail;
+
+	return 0;
+fail:
+	memset(dst, 0, size);
 	return ret;
 }
 
 BPF_CALL_3(bpf_probe_read_kernel_str, void *, dst, u32, size,
 	   const void *, unsafe_ptr)
 {
-	return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr, false);
+	return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr);
 }
 
 const struct bpf_func_proto bpf_probe_read_kernel_str_proto = {
@@ -262,10 +262,34 @@ const struct bpf_func_proto bpf_probe_re
 	.arg3_type	= ARG_ANYTHING,
 };
 
+#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+BPF_CALL_3(bpf_probe_read_compat, void *, dst, u32, size,
+	   const void *, unsafe_ptr)
+{
+	if ((unsigned long)unsafe_ptr < TASK_SIZE) {
+		return bpf_probe_read_user_common(dst, size,
+				(__force void __user *)unsafe_ptr);
+	}
+	return bpf_probe_read_kernel_common(dst, size, unsafe_ptr);
+}
+
+static const struct bpf_func_proto bpf_probe_read_compat_proto = {
+	.func		= bpf_probe_read_compat,
+	.gpl_only	= true,
+	.ret_type	= RET_INTEGER,
+	.arg1_type	= ARG_PTR_TO_UNINIT_MEM,
+	.arg2_type	= ARG_CONST_SIZE_OR_ZERO,
+	.arg3_type	= ARG_ANYTHING,
+};
+
 BPF_CALL_3(bpf_probe_read_compat_str, void *, dst, u32, size,
 	   const void *, unsafe_ptr)
 {
-	return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr, true);
+	if ((unsigned long)unsafe_ptr < TASK_SIZE) {
+		return bpf_probe_read_user_str_common(dst, size,
+				(__force void __user *)unsafe_ptr);
+	}
+	return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr);
 }
 
 static const struct bpf_func_proto bpf_probe_read_compat_str_proto = {
@@ -276,6 +300,7 @@ static const struct bpf_func_proto bpf_p
 	.arg2_type	= ARG_CONST_SIZE_OR_ZERO,
 	.arg3_type	= ARG_ANYTHING,
 };
+#endif /* CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE */
 
 BPF_CALL_3(bpf_probe_write_user, void __user *, unsafe_ptr, const void *, src,
 	   u32, size)
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 86/93] tracing/kprobes: handle mixed kernel/userspace probes better
  2020-06-09  4:29 incoming Andrew Morton
                   ` (84 preceding siblings ...)
  2020-06-09  4:34 ` [patch 85/93] bpf: rework the compat kernel probe handling Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 87/93] maccess: remove strncpy_from_unsafe Andrew Morton
                   ` (9 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, svens, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: tracing/kprobes: handle mixed kernel/userspace probes better

Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe
helpers, rework probes to try a user probe based on the address if the
architecture has a common address space for kernel and userspace.

[svens@linux.ibm.com:use strncpy_from_kernel_nofault() in fetch_store_string()]
  Link: http://lkml.kernel.org/r/20200606181903.49384-1-svens@linux.ibm.com
Link: http://lkml.kernel.org/r/20200521152301.2587579-15-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/trace/trace_kprobe.c |   72 ++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 29 deletions(-)

--- a/kernel/trace/trace_kprobe.c~tracing-kprobes-handle-mixed-kernel-userspace-probes-better
+++ a/kernel/trace/trace_kprobe.c
@@ -1202,35 +1202,41 @@ static const struct file_operations kpro
 
 /* Return the length of string -- including null terminal byte */
 static nokprobe_inline int
+fetch_store_strlen_user(unsigned long addr)
+{
+	const void __user *uaddr =  (__force const void __user *)addr;
+
+	return strnlen_user_nofault(uaddr, MAX_STRING_SIZE);
+}
+
+/* Return the length of string -- including null terminal byte */
+static nokprobe_inline int
 fetch_store_strlen(unsigned long addr)
 {
 	int ret, len = 0;
 	u8 c;
 
+#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+	if (addr < TASK_SIZE)
+		return fetch_store_strlen_user(addr);
+#endif
+
 	do {
-		ret = probe_kernel_read(&c, (u8 *)addr + len, 1);
+		ret = probe_kernel_read_strict(&c, (u8 *)addr + len, 1);
 		len++;
 	} while (c && ret == 0 && len < MAX_STRING_SIZE);
 
 	return (ret < 0) ? ret : len;
 }
 
-/* Return the length of string -- including null terminal byte */
-static nokprobe_inline int
-fetch_store_strlen_user(unsigned long addr)
-{
-	const void __user *uaddr =  (__force const void __user *)addr;
-
-	return strnlen_user_nofault(uaddr, MAX_STRING_SIZE);
-}
-
 /*
- * Fetch a null-terminated string. Caller MUST set *(u32 *)buf with max
- * length and relative data location.
+ * Fetch a null-terminated string from user. Caller MUST set *(u32 *)buf
+ * with max length and relative data location.
  */
 static nokprobe_inline int
-fetch_store_string(unsigned long addr, void *dest, void *base)
+fetch_store_string_user(unsigned long addr, void *dest, void *base)
 {
+	const void __user *uaddr =  (__force const void __user *)addr;
 	int maxlen = get_loc_len(*(u32 *)dest);
 	void *__dest;
 	long ret;
@@ -1240,11 +1246,7 @@ fetch_store_string(unsigned long addr, v
 
 	__dest = get_loc_data(dest, base);
 
-	/*
-	 * Try to get string again, since the string can be changed while
-	 * probing.
-	 */
-	ret = strncpy_from_unsafe(__dest, (void *)addr, maxlen);
+	ret = strncpy_from_user_nofault(__dest, uaddr, maxlen);
 	if (ret >= 0)
 		*(u32 *)dest = make_data_loc(ret, __dest - base);
 
@@ -1252,23 +1254,31 @@ fetch_store_string(unsigned long addr, v
 }
 
 /*
- * Fetch a null-terminated string from user. Caller MUST set *(u32 *)buf
- * with max length and relative data location.
+ * Fetch a null-terminated string. Caller MUST set *(u32 *)buf with max
+ * length and relative data location.
  */
 static nokprobe_inline int
-fetch_store_string_user(unsigned long addr, void *dest, void *base)
+fetch_store_string(unsigned long addr, void *dest, void *base)
 {
-	const void __user *uaddr =  (__force const void __user *)addr;
 	int maxlen = get_loc_len(*(u32 *)dest);
 	void *__dest;
 	long ret;
 
+#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+	if ((unsigned long)addr < TASK_SIZE)
+		return fetch_store_string_user(addr, dest, base);
+#endif
+
 	if (unlikely(!maxlen))
 		return -ENOMEM;
 
 	__dest = get_loc_data(dest, base);
 
-	ret = strncpy_from_user_nofault(__dest, uaddr, maxlen);
+	/*
+	 * Try to get string again, since the string can be changed while
+	 * probing.
+	 */
+	ret = strncpy_from_kernel_nofault(__dest, (void *)addr, maxlen);
 	if (ret >= 0)
 		*(u32 *)dest = make_data_loc(ret, __dest - base);
 
@@ -1276,12 +1286,6 @@ fetch_store_string_user(unsigned long ad
 }
 
 static nokprobe_inline int
-probe_mem_read(void *dest, void *src, size_t size)
-{
-	return probe_kernel_read(dest, src, size);
-}
-
-static nokprobe_inline int
 probe_mem_read_user(void *dest, void *src, size_t size)
 {
 	const void __user *uaddr =  (__force const void __user *)src;
@@ -1289,6 +1293,16 @@ probe_mem_read_user(void *dest, void *sr
 	return probe_user_read(dest, uaddr, size);
 }
 
+static nokprobe_inline int
+probe_mem_read(void *dest, void *src, size_t size)
+{
+#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+	if ((unsigned long)src < TASK_SIZE)
+		return probe_mem_read_user(dest, src, size);
+#endif
+	return probe_kernel_read_strict(dest, src, size);
+}
+
 /* Note that we don't verify it, since the code does not come from user space */
 static int
 process_fetch_insn(struct fetch_insn *code, struct pt_regs *regs, void *dest,
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 87/93] maccess: remove strncpy_from_unsafe
  2020-06-09  4:29 incoming Andrew Morton
                   ` (85 preceding siblings ...)
  2020-06-09  4:34 ` [patch 86/93] tracing/kprobes: handle mixed kernel/userspace probes better Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 88/93] maccess: always use strict semantics for probe_kernel_read Andrew Morton
                   ` (8 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: remove strncpy_from_unsafe

All users are gone now.

Link: http://lkml.kernel.org/r/20200521152301.2587579-16-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/uaccess.h |    1 
 mm/maccess.c            |   39 --------------------------------------
 2 files changed, 1 insertion(+), 39 deletions(-)

--- a/include/linux/uaccess.h~maccess-remove-strncpy_from_unsafe
+++ a/include/linux/uaccess.h
@@ -311,7 +311,6 @@ extern long probe_user_read(void *dst, c
 extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
 extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
 
-extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
 		long count);
 
--- a/mm/maccess.c~maccess-remove-strncpy_from_unsafe
+++ a/mm/maccess.c
@@ -8,8 +8,6 @@
 
 static long __probe_kernel_read(void *dst, const void *src, size_t size,
 		bool strict);
-static long __strncpy_from_unsafe(char *dst, const void *unsafe_addr,
-		long count, bool strict);
 
 bool __weak probe_kernel_read_allowed(const void *unsafe_src, size_t size,
 		bool strict)
@@ -158,35 +156,6 @@ long probe_user_write(void __user *dst,
 EXPORT_SYMBOL_GPL(probe_user_write);
 
 /**
- * strncpy_from_unsafe: - Copy a NUL terminated string from unsafe address.
- * @dst:   Destination address, in kernel space.  This buffer must be at
- *         least @count bytes long.
- * @unsafe_addr: Unsafe address.
- * @count: Maximum number of bytes to copy, including the trailing NUL.
- *
- * Copies a NUL-terminated string from unsafe address to kernel buffer.
- *
- * On success, returns the length of the string INCLUDING the trailing NUL.
- *
- * If access fails, returns -EFAULT (some data may have been copied
- * and the trailing NUL added).
- *
- * If @count is smaller than the length of the string, copies @count-1 bytes,
- * sets the last byte of @dst buffer to NUL and returns @count.
- *
- * Same as strncpy_from_kernel_nofault() except that for architectures with
- * not fully separated user and kernel address spaces this function also works
- * for user address tanges.
- *
- * DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
- * separate kernel and user address spaces, and also a bad idea otherwise.
- */
-long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
-{
-	return __strncpy_from_unsafe(dst, unsafe_addr, count, false);
-}
-
-/**
  * strncpy_from_kernel_nofault: - Copy a NUL terminated string from unsafe
  *				 address.
  * @dst:   Destination address, in kernel space.  This buffer must be at
@@ -206,19 +175,13 @@ long strncpy_from_unsafe(char *dst, cons
  */
 long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
 {
-	return __strncpy_from_unsafe(dst, unsafe_addr, count, true);
-}
-
-static long __strncpy_from_unsafe(char *dst, const void *unsafe_addr,
-		long count, bool strict)
-{
 	mm_segment_t old_fs = get_fs();
 	const void *src = unsafe_addr;
 	long ret;
 
 	if (unlikely(count <= 0))
 		return 0;
-	if (!probe_kernel_read_allowed(unsafe_addr, count, strict))
+	if (!probe_kernel_read_allowed(unsafe_addr, count, true))
 		return -EFAULT;
 
 	set_fs(KERNEL_DS);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 88/93] maccess: always use strict semantics for probe_kernel_read
  2020-06-09  4:29 incoming Andrew Morton
                   ` (86 preceding siblings ...)
  2020-06-09  4:34 ` [patch 87/93] maccess: remove strncpy_from_unsafe Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 89/93] maccess: move user access routines together Andrew Morton
                   ` (7 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: always use strict semantics for probe_kernel_read

Except for historical confusion in the kprobes/uprobes and bpf tracers,
which has been fixed now, there is no good reason to ever allow user
memory accesses from probe_kernel_read.  Switch probe_kernel_read to only
read from kernel memory.

[akpm@linux-foundation.org: update it for "mm, dump_page(): do not crash with invalid mapping pointer"]
Link: http://lkml.kernel.org/r/20200521152301.2587579-17-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/parisc/lib/memcpy.c    |    2 -
 arch/um/kernel/maccess.c    |    2 -
 arch/x86/mm/maccess.c       |    9 +------
 include/linux/uaccess.h     |    4 ---
 kernel/trace/bpf_trace.c    |    2 -
 kernel/trace/trace_kprobe.c |    4 +--
 mm/debug.c                  |   10 ++++----
 mm/maccess.c                |   40 +++++-----------------------------
 8 files changed, 19 insertions(+), 54 deletions(-)

--- a/arch/parisc/lib/memcpy.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/arch/parisc/lib/memcpy.c
@@ -57,7 +57,7 @@ void * memcpy(void * dst,const void *src
 EXPORT_SYMBOL(raw_copy_in_user);
 EXPORT_SYMBOL(memcpy);
 
-bool probe_kernel_read_allowed(const void *unsafe_src, size_t size, bool strict)
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size)
 {
 	if ((unsigned long)unsafe_src < PAGE_SIZE)
 		return false;
--- a/arch/um/kernel/maccess.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/arch/um/kernel/maccess.c
@@ -7,7 +7,7 @@
 #include <linux/kernel.h>
 #include <os.h>
 
-bool probe_kernel_read_allowed(const void *src, size_t size, bool strict)
+bool probe_kernel_read_allowed(const void *src, size_t size)
 {
 	void *psrc = (void *)rounddown((unsigned long)src, PAGE_SIZE);
 
--- a/arch/x86/mm/maccess.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/arch/x86/mm/maccess.c
@@ -9,13 +9,10 @@ static __always_inline u64 canonical_add
 	return ((s64)vaddr << (64 - vaddr_bits)) >> (64 - vaddr_bits);
 }
 
-bool probe_kernel_read_allowed(const void *unsafe_src, size_t size, bool strict)
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size)
 {
 	unsigned long vaddr = (unsigned long)unsafe_src;
 
-	if (!strict)
-		return true;
-
 	/*
 	 * Range covering the highest possible canonical userspace address
 	 * as well as non-canonical address range. For the canonical range
@@ -25,10 +22,8 @@ bool probe_kernel_read_allowed(const voi
 	       canonical_address(vaddr, boot_cpu_data.x86_virt_bits) == vaddr;
 }
 #else
-bool probe_kernel_read_allowed(const void *unsafe_src, size_t size, bool strict)
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size)
 {
-	if (!strict)
-		return true;
 	return (unsigned long)unsafe_src >= TASK_SIZE_MAX;
 }
 #endif
--- a/include/linux/uaccess.h~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/include/linux/uaccess.h
@@ -301,11 +301,9 @@ copy_struct_from_user(void *dst, size_t
 	return 0;
 }
 
-bool probe_kernel_read_allowed(const void *unsafe_src, size_t size,
-		bool strict);
+bool probe_kernel_read_allowed(const void *unsafe_src, size_t size);
 
 extern long probe_kernel_read(void *dst, const void *src, size_t size);
-extern long probe_kernel_read_strict(void *dst, const void *src, size_t size);
 extern long probe_user_read(void *dst, const void __user *src, size_t size);
 
 extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
--- a/kernel/trace/bpf_trace.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/kernel/trace/bpf_trace.c
@@ -196,7 +196,7 @@ bpf_probe_read_kernel_common(void *dst,
 
 	if (unlikely(ret < 0))
 		goto fail;
-	ret = probe_kernel_read_strict(dst, unsafe_ptr, size);
+	ret = probe_kernel_read(dst, unsafe_ptr, size);
 	if (unlikely(ret < 0))
 		goto fail;
 	return ret;
--- a/kernel/trace/trace_kprobe.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/kernel/trace/trace_kprobe.c
@@ -1222,7 +1222,7 @@ fetch_store_strlen(unsigned long addr)
 #endif
 
 	do {
-		ret = probe_kernel_read_strict(&c, (u8 *)addr + len, 1);
+		ret = probe_kernel_read(&c, (u8 *)addr + len, 1);
 		len++;
 	} while (c && ret == 0 && len < MAX_STRING_SIZE);
 
@@ -1300,7 +1300,7 @@ probe_mem_read(void *dest, void *src, si
 	if ((unsigned long)src < TASK_SIZE)
 		return probe_mem_read_user(dest, src, size);
 #endif
-	return probe_kernel_read_strict(dest, src, size);
+	return probe_kernel_read(dest, src, size);
 }
 
 /* Note that we don't verify it, since the code does not come from user space */
--- a/mm/debug.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/mm/debug.c
@@ -120,9 +120,9 @@ void __dump_page(struct page *page, cons
 		 * mapping can be invalid pointer and we don't want to crash
 		 * accessing it, so probe everything depending on it carefully
 		 */
-		if (probe_kernel_read_strict(&host, &mapping->host,
-						sizeof(struct inode *)) ||
-		    probe_kernel_read_strict(&a_ops, &mapping->a_ops,
+		if (probe_kernel_read(&host, &mapping->host,
+					sizeof(struct inode *)) ||
+		    probe_kernel_read(&a_ops, &mapping->a_ops,
 				sizeof(struct address_space_operations *))) {
 			pr_warn("failed to read mapping->host or a_ops, mapping not a valid kernel address?\n");
 			goto out_mapping;
@@ -133,7 +133,7 @@ void __dump_page(struct page *page, cons
 			goto out_mapping;
 		}
 
-		if (probe_kernel_read_strict(&dentry_first,
+		if (probe_kernel_read(&dentry_first,
 			&host->i_dentry.first, sizeof(struct hlist_node *))) {
 			pr_warn("mapping->a_ops:%ps with invalid mapping->host inode address %px\n",
 				a_ops, host);
@@ -146,7 +146,7 @@ void __dump_page(struct page *page, cons
 		}
 
 		dentry_ptr = container_of(dentry_first, struct dentry, d_u.d_alias);
-		if (probe_kernel_read_strict(&dentry, dentry_ptr,
+		if (probe_kernel_read(&dentry, dentry_ptr,
 							sizeof(struct dentry))) {
 			pr_warn("mapping->aops:%ps with invalid mapping->host->i_dentry.first %px\n",
 				a_ops, dentry_ptr);
--- a/mm/maccess.c~maccess-always-use-strict-semantics-for-probe_kernel_read
+++ a/mm/maccess.c
@@ -6,36 +6,13 @@
 #include <linux/mm.h>
 #include <linux/uaccess.h>
 
-static long __probe_kernel_read(void *dst, const void *src, size_t size,
-		bool strict);
-
-bool __weak probe_kernel_read_allowed(const void *unsafe_src, size_t size,
-		bool strict)
+bool __weak probe_kernel_read_allowed(const void *unsafe_src, size_t size)
 {
 	return true;
 }
 
 /**
- * probe_kernel_read(): safely attempt to read from any location
- * @dst: pointer to the buffer that shall take the data
- * @src: address to read from
- * @size: size of the data chunk
- *
- * Same as probe_kernel_read_strict() except that for architectures with
- * not fully separated user and kernel address spaces this function also works
- * for user address tanges.
- *
- * DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
- * separate kernel and user address spaces, and also a bad idea otherwise.
- */
-long probe_kernel_read(void *dst, const void *src, size_t size)
-{
-	return __probe_kernel_read(dst, src, size, false);
-}
-EXPORT_SYMBOL_GPL(probe_kernel_read);
-
-/**
- * probe_kernel_read_strict(): safely attempt to read from kernel-space
+ * probe_kernel_read(): safely attempt to read from kernel-space
  * @dst: pointer to the buffer that shall take the data
  * @src: address to read from
  * @size: size of the data chunk
@@ -48,18 +25,12 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
  * probe_kernel_read() suitable for use within regions where the caller
  * already holds mmap_lock, or other locks which nest inside mmap_lock.
  */
-long probe_kernel_read_strict(void *dst, const void *src, size_t size)
-{
-	return __probe_kernel_read(dst, src, size, true);
-}
-
-static long __probe_kernel_read(void *dst, const void *src, size_t size,
-		bool strict)
+long probe_kernel_read(void *dst, const void *src, size_t size)
 {
 	long ret;
 	mm_segment_t old_fs = get_fs();
 
-	if (!probe_kernel_read_allowed(src, size, strict))
+	if (!probe_kernel_read_allowed(src, size))
 		return -EFAULT;
 
 	set_fs(KERNEL_DS);
@@ -73,6 +44,7 @@ static long __probe_kernel_read(void *ds
 		return -EFAULT;
 	return 0;
 }
+EXPORT_SYMBOL_GPL(probe_kernel_read);
 
 /**
  * probe_user_read(): safely attempt to read from a user-space location
@@ -181,7 +153,7 @@ long strncpy_from_kernel_nofault(char *d
 
 	if (unlikely(count <= 0))
 		return 0;
-	if (!probe_kernel_read_allowed(unsafe_addr, count, true))
+	if (!probe_kernel_read_allowed(unsafe_addr, count))
 		return -EFAULT;
 
 	set_fs(KERNEL_DS);
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 89/93] maccess: move user access routines together
  2020-06-09  4:29 incoming Andrew Morton
                   ` (87 preceding siblings ...)
  2020-06-09  4:34 ` [patch 88/93] maccess: always use strict semantics for probe_kernel_read Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:34 ` [patch 90/93] maccess: allow architectures to provide kernel probing directly Andrew Morton
                   ` (6 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: move user access routines together

Move kernel access vs user access routines together to ease upcoming
ifdefs.

Link: http://lkml.kernel.org/r/20200521152301.2587579-18-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |  112 ++++++++++++++++++++++++-------------------------
 1 file changed, 56 insertions(+), 56 deletions(-)

--- a/mm/maccess.c~maccess-move-user-access-routines-together
+++ a/mm/maccess.c
@@ -47,34 +47,6 @@ long probe_kernel_read(void *dst, const
 EXPORT_SYMBOL_GPL(probe_kernel_read);
 
 /**
- * probe_user_read(): safely attempt to read from a user-space location
- * @dst: pointer to the buffer that shall take the data
- * @src: address to read from. This must be a user address.
- * @size: size of the data chunk
- *
- * Safely read from user address @src to the buffer at @dst. If a kernel fault
- * happens, handle that and return -EFAULT.
- */
-long probe_user_read(void *dst, const void __user *src, size_t size)
-{
-	long ret = -EFAULT;
-	mm_segment_t old_fs = get_fs();
-
-	set_fs(USER_DS);
-	if (access_ok(src, size)) {
-		pagefault_disable();
-		ret = __copy_from_user_inatomic(dst, src, size);
-		pagefault_enable();
-	}
-	set_fs(old_fs);
-
-	if (ret)
-		return -EFAULT;
-	return 0;
-}
-EXPORT_SYMBOL_GPL(probe_user_read);
-
-/**
  * probe_kernel_write(): safely attempt to write to a location
  * @dst: address to write to
  * @src: pointer to the data that shall be written
@@ -100,34 +72,6 @@ long probe_kernel_write(void *dst, const
 }
 
 /**
- * probe_user_write(): safely attempt to write to a user-space location
- * @dst: address to write to
- * @src: pointer to the data that shall be written
- * @size: size of the data chunk
- *
- * Safely write to address @dst from the buffer at @src.  If a kernel fault
- * happens, handle that and return -EFAULT.
- */
-long probe_user_write(void __user *dst, const void *src, size_t size)
-{
-	long ret = -EFAULT;
-	mm_segment_t old_fs = get_fs();
-
-	set_fs(USER_DS);
-	if (access_ok(dst, size)) {
-		pagefault_disable();
-		ret = __copy_to_user_inatomic(dst, src, size);
-		pagefault_enable();
-	}
-	set_fs(old_fs);
-
-	if (ret)
-		return -EFAULT;
-	return 0;
-}
-EXPORT_SYMBOL_GPL(probe_user_write);
-
-/**
  * strncpy_from_kernel_nofault: - Copy a NUL terminated string from unsafe
  *				 address.
  * @dst:   Destination address, in kernel space.  This buffer must be at
@@ -171,6 +115,62 @@ long strncpy_from_kernel_nofault(char *d
 }
 
 /**
+ * probe_user_read(): safely attempt to read from a user-space location
+ * @dst: pointer to the buffer that shall take the data
+ * @src: address to read from. This must be a user address.
+ * @size: size of the data chunk
+ *
+ * Safely read from user address @src to the buffer at @dst. If a kernel fault
+ * happens, handle that and return -EFAULT.
+ */
+long probe_user_read(void *dst, const void __user *src, size_t size)
+{
+	long ret = -EFAULT;
+	mm_segment_t old_fs = get_fs();
+
+	set_fs(USER_DS);
+	if (access_ok(src, size)) {
+		pagefault_disable();
+		ret = __copy_from_user_inatomic(dst, src, size);
+		pagefault_enable();
+	}
+	set_fs(old_fs);
+
+	if (ret)
+		return -EFAULT;
+	return 0;
+}
+EXPORT_SYMBOL_GPL(probe_user_read);
+
+/**
+ * probe_user_write(): safely attempt to write to a user-space location
+ * @dst: address to write to
+ * @src: pointer to the data that shall be written
+ * @size: size of the data chunk
+ *
+ * Safely write to address @dst from the buffer at @src.  If a kernel fault
+ * happens, handle that and return -EFAULT.
+ */
+long probe_user_write(void __user *dst, const void *src, size_t size)
+{
+	long ret = -EFAULT;
+	mm_segment_t old_fs = get_fs();
+
+	set_fs(USER_DS);
+	if (access_ok(dst, size)) {
+		pagefault_disable();
+		ret = __copy_to_user_inatomic(dst, src, size);
+		pagefault_enable();
+	}
+	set_fs(old_fs);
+
+	if (ret)
+		return -EFAULT;
+	return 0;
+}
+EXPORT_SYMBOL_GPL(probe_user_write);
+
+/**
  * strncpy_from_user_nofault: - Copy a NUL terminated string from unsafe user
  *				address.
  * @dst:   Destination address, in kernel space.  This buffer must be at
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 90/93] maccess: allow architectures to provide kernel probing directly
  2020-06-09  4:29 incoming Andrew Morton
                   ` (88 preceding siblings ...)
  2020-06-09  4:34 ` [patch 89/93] maccess: move user access routines together Andrew Morton
@ 2020-06-09  4:34 ` Andrew Morton
  2020-06-09  4:35 ` [patch 91/93] x86: use non-set_fs based maccess routines Andrew Morton
                   ` (5 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:34 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: allow architectures to provide kernel probing directly

Provide alternative versions of probe_kernel_read, probe_kernel_write
and strncpy_from_kernel_unsafe that don't need set_fs magic, but instead
use arch hooks that are modelled after unsafe_{get,put}_user to access
kernel memory in an exception safe way.

Link: http://lkml.kernel.org/r/20200521152301.2587579-19-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |   76 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

--- a/mm/maccess.c~maccess-allow-architectures-to-provide-kernel-probing-directly
+++ a/mm/maccess.c
@@ -11,6 +11,81 @@ bool __weak probe_kernel_read_allowed(co
 	return true;
 }
 
+#ifdef HAVE_GET_KERNEL_NOFAULT
+
+#define probe_kernel_read_loop(dst, src, len, type, err_label)		\
+	while (len >= sizeof(type)) {					\
+		__get_kernel_nofault(dst, src, type, err_label);		\
+		dst += sizeof(type);					\
+		src += sizeof(type);					\
+		len -= sizeof(type);					\
+	}
+
+long probe_kernel_read(void *dst, const void *src, size_t size)
+{
+	if (!probe_kernel_read_allowed(src, size))
+		return -EFAULT;
+
+	pagefault_disable();
+	probe_kernel_read_loop(dst, src, size, u64, Efault);
+	probe_kernel_read_loop(dst, src, size, u32, Efault);
+	probe_kernel_read_loop(dst, src, size, u16, Efault);
+	probe_kernel_read_loop(dst, src, size, u8, Efault);
+	pagefault_enable();
+	return 0;
+Efault:
+	pagefault_enable();
+	return -EFAULT;
+}
+EXPORT_SYMBOL_GPL(probe_kernel_read);
+
+#define probe_kernel_write_loop(dst, src, len, type, err_label)		\
+	while (len >= sizeof(type)) {					\
+		__put_kernel_nofault(dst, src, type, err_label);		\
+		dst += sizeof(type);					\
+		src += sizeof(type);					\
+		len -= sizeof(type);					\
+	}
+
+long probe_kernel_write(void *dst, const void *src, size_t size)
+{
+	pagefault_disable();
+	probe_kernel_write_loop(dst, src, size, u64, Efault);
+	probe_kernel_write_loop(dst, src, size, u32, Efault);
+	probe_kernel_write_loop(dst, src, size, u16, Efault);
+	probe_kernel_write_loop(dst, src, size, u8, Efault);
+	pagefault_enable();
+	return 0;
+Efault:
+	pagefault_enable();
+	return -EFAULT;
+}
+
+long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
+{
+	const void *src = unsafe_addr;
+
+	if (unlikely(count <= 0))
+		return 0;
+	if (!probe_kernel_read_allowed(unsafe_addr, count))
+		return -EFAULT;
+
+	pagefault_disable();
+	do {
+		__get_kernel_nofault(dst, src, u8, Efault);
+		dst++;
+		src++;
+	} while (dst[-1] && src - unsafe_addr < count);
+	pagefault_enable();
+
+	dst[-1] = '\0';
+	return src - unsafe_addr;
+Efault:
+	pagefault_enable();
+	dst[-1] = '\0';
+	return -EFAULT;
+}
+#else /* HAVE_GET_KERNEL_NOFAULT */
 /**
  * probe_kernel_read(): safely attempt to read from kernel-space
  * @dst: pointer to the buffer that shall take the data
@@ -113,6 +188,7 @@ long strncpy_from_kernel_nofault(char *d
 
 	return ret ? -EFAULT : src - unsafe_addr;
 }
+#endif /* HAVE_GET_KERNEL_NOFAULT */
 
 /**
  * probe_user_read(): safely attempt to read from a user-space location
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 91/93] x86: use non-set_fs based maccess routines
  2020-06-09  4:29 incoming Andrew Morton
                   ` (89 preceding siblings ...)
  2020-06-09  4:34 ` [patch 90/93] maccess: allow architectures to provide kernel probing directly Andrew Morton
@ 2020-06-09  4:35 ` Andrew Morton
  2020-06-09 18:01   ` Linus Torvalds
  2020-06-09  4:35 ` [patch 92/93] maccess: return -ERANGE when probe_kernel_read() fails Andrew Morton
                   ` (4 subsequent siblings)
  95 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:35 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: x86: use non-set_fs based maccess routines

Provide arch_kernel_read and arch_kernel_write routines to implement the
maccess routines without messing with set_fs and without stac/clac that
opens up access to user space.

[akpm@linux-foundation.org: coding style fixes]
Link: http://lkml.kernel.org/r/20200521152301.2587579-20-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/include/asm/uaccess.h |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

--- a/arch/x86/include/asm/uaccess.h~x86-use-non-set_fs-based-maccess-routines
+++ a/arch/x86/include/asm/uaccess.h
@@ -523,5 +523,21 @@ do {									\
 	unsafe_copy_loop(__ucu_dst, __ucu_src, __ucu_len, u8, label);	\
 } while (0)
 
+#define HAVE_GET_KERNEL_NOFAULT
+
+#define __get_kernel_nofault(dst, src, type, err_label)			\
+do {									\
+	int __kr_err;							\
+									\
+	__get_user_size(*((type *)dst), (__force type __user *)src,	\
+			sizeof(type), __kr_err);			\
+	if (unlikely(__kr_err))						\
+		goto err_label;						\
+} while (0)
+
+#define __put_kernel_nofault(dst, src, type, err_label)			\
+	__put_user_size(*((type *)(src)), (__force type __user *)(dst),	\
+			sizeof(type), err_label)
+
 #endif /* _ASM_X86_UACCESS_H */
 
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 92/93] maccess: return -ERANGE when probe_kernel_read() fails
  2020-06-09  4:29 incoming Andrew Morton
                   ` (90 preceding siblings ...)
  2020-06-09  4:35 ` [patch 91/93] x86: use non-set_fs based maccess routines Andrew Morton
@ 2020-06-09  4:35 ` Andrew Morton
  2020-06-09  4:35 ` [patch 93/93] include/linux/cache.h: expand documentation over __read_mostly Andrew Morton
                   ` (3 subsequent siblings)
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:35 UTC (permalink / raw)
  To: akpm, ast, daniel, hch, hpa, linux-mm, mhiramat, mingo,
	mm-commits, tglx, torvalds

From: Christoph Hellwig <hch@lst.de>
Subject: maccess: return -ERANGE when probe_kernel_read() fails

Allow the callers to distinguish a real unmapped address vs a range
that can't be probed.

Link: http://lkml.kernel.org/r/20200521152301.2587579-24-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/maccess.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

--- a/mm/maccess.c~maccess-return-erange-when-copy_from_kernel_nofault_allowed-fails
+++ a/mm/maccess.c
@@ -24,7 +24,7 @@ bool __weak probe_kernel_read_allowed(co
 long probe_kernel_read(void *dst, const void *src, size_t size)
 {
 	if (!probe_kernel_read_allowed(src, size))
-		return -EFAULT;
+		return -ERANGE;
 
 	pagefault_disable();
 	probe_kernel_read_loop(dst, src, size, u64, Efault);
@@ -68,7 +68,7 @@ long strncpy_from_kernel_nofault(char *d
 	if (unlikely(count <= 0))
 		return 0;
 	if (!probe_kernel_read_allowed(unsafe_addr, count))
-		return -EFAULT;
+		return -ERANGE;
 
 	pagefault_disable();
 	do {
@@ -93,7 +93,8 @@ Efault:
  * @size: size of the data chunk
  *
  * Safely read from kernel address @src to the buffer at @dst.  If a kernel
- * fault happens, handle that and return -EFAULT.
+ * fault happens, handle that and return -EFAULT.  If @src is not a valid kernel
+ * address, return -ERANGE.
  *
  * We ensure that the copy_from_user is executed in atomic context so that
  * do_page_fault() doesn't attempt to take mmap_lock.  This makes
@@ -106,7 +107,7 @@ long probe_kernel_read(void *dst, const
 	mm_segment_t old_fs = get_fs();
 
 	if (!probe_kernel_read_allowed(src, size))
-		return -EFAULT;
+		return -ERANGE;
 
 	set_fs(KERNEL_DS);
 	pagefault_disable();
@@ -158,8 +159,9 @@ long probe_kernel_write(void *dst, const
  *
  * On success, returns the length of the string INCLUDING the trailing NUL.
  *
- * If access fails, returns -EFAULT (some data may have been copied
- * and the trailing NUL added).
+ * If access fails, returns -EFAULT (some data may have been copied and the
+ * trailing NUL added).  If @unsafe_addr is not a valid kernel address, return
+ * -ERANGE.
  *
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
@@ -173,7 +175,7 @@ long strncpy_from_kernel_nofault(char *d
 	if (unlikely(count <= 0))
 		return 0;
 	if (!probe_kernel_read_allowed(unsafe_addr, count))
-		return -EFAULT;
+		return -ERANGE;
 
 	set_fs(KERNEL_DS);
 	pagefault_disable();
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* [patch 93/93] include/linux/cache.h: expand documentation over __read_mostly
  2020-06-09  4:29 incoming Andrew Morton
                   ` (91 preceding siblings ...)
  2020-06-09  4:35 ` [patch 92/93] maccess: return -ERANGE when probe_kernel_read() fails Andrew Morton
@ 2020-06-09  4:35 ` Andrew Morton
  2020-06-17 15:51   ` Christopher Lameter
  2020-06-09  5:34 ` mmotm 2020-06-08-22-33 uploaded Andrew Morton
                   ` (2 subsequent siblings)
  95 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  4:35 UTC (permalink / raw)
  To: akpm, aquini, arnd, cl, keescook, linux-mm, mcgrof, mm-commits,
	torvalds, willy

From: Luis Chamberlain <mcgrof@kernel.org>
Subject: include/linux/cache.h: expand documentation over __read_mostly

__read_mostly can easily be misused by folks, its not meant for just
read-only data.  There are performance reasons for using it, but we also
don't provide any guidance about its use.  Provide a bit more guidance
over its use.

Link: http://lkml.kernel.org/r/20200507161424.2584-1-mcgrof@kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Christoph Lameter <cl@linux.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Rafael Aquini <aquini@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/cache.h |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/include/linux/cache.h~mm-expand-documentation-over-__read_mostly
+++ a/include/linux/cache.h
@@ -15,8 +15,14 @@
 
 /*
  * __read_mostly is used to keep rarely changing variables out of frequently
- * updated cachelines. If an architecture doesn't support it, ignore the
- * hint.
+ * updated cachelines. Its use should be reserved for data that is used
+ * frequently in hot paths. Performance traces can help decide when to use
+ * this. You want __read_mostly data to be tightly packed, so that in the
+ * best case multiple frequently read variables for a hot path will be next
+ * to each other in order to reduce the number of cachelines needed to
+ * execute a critical path. We should be mindful and selective of its use.
+ * ie: if you're going to use it please supply a *good* justification in your
+ * commit log
  */
 #ifndef __read_mostly
 #define __read_mostly
_


^ permalink raw reply	[flat|nested] 307+ messages in thread

* mmotm 2020-06-08-22-33 uploaded
  2020-06-09  4:29 incoming Andrew Morton
                   ` (92 preceding siblings ...)
  2020-06-09  4:35 ` [patch 93/93] include/linux/cache.h: expand documentation over __read_mostly Andrew Morton
@ 2020-06-09  5:34 ` Andrew Morton
  2020-06-09  5:36 ` mmotm 2020-06-08-22-35 uploaded Andrew Morton
  2020-06-09 16:58 ` incoming Linus Torvalds
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  5:34 UTC (permalink / raw)
  To: broonie, linux-fsdevel, linux-kernel, linux-mm, linux-next,
	mhocko, mm-commits, sfr

The mm-of-the-moment snapshot 2020-06-08-22-33 has been uploaded to

   http://www.ozlabs.org/~akpm/mmotm/

mmotm-readme.txt says

README for mm-of-the-moment:

http://www.ozlabs.org/~akpm/mmotm/

This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
more than once a week.

You will need quilt to apply these patches to the latest Linus release (5.x
or 5.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
http://ozlabs.org/~akpm/mmotm/series

The file broken-out.tar.gz contains two datestamp files: .DATE and
.DATE-yyyy-mm-dd-hh-mm-ss.  Both contain the string yyyy-mm-dd-hh-mm-ss,
followed by the base kernel version against which this patch series is to
be applied.

This tree is partially included in linux-next.  To see which patches are
included in linux-next, consult the `series' file.  Only the patches
within the #NEXT_PATCHES_START/#NEXT_PATCHES_END markers are included in
linux-next.


A full copy of the full kernel tree with the linux-next and mmotm patches
already applied is available through git within an hour of the mmotm
release.  Individual mmotm releases are tagged.  The master branch always
points to the latest release, so it's constantly rebasing.

	https://github.com/hnaz/linux-mm

The directory http://www.ozlabs.org/~akpm/mmots/ (mm-of-the-second)
contains daily snapshots of the -mm tree.  It is updated more frequently
than mmotm, and is untested.

A git copy of this tree is also available at

	https://github.com/hnaz/linux-mm



This mmotm tree contains the following patches against 5.7:
(patches marked "*" will be included in linux-next)

  origin.patch
* kallsyms-printk-add-loglvl-to-print_ip_sym.patch
* alpha-add-show_stack_loglvl.patch
* arc-add-show_stack_loglvl.patch
* arm-asm-add-loglvl-to-c_backtrace.patch
* arm-add-loglvl-to-unwind_backtrace.patch
* arm-add-loglvl-to-dump_backtrace.patch
* arm-wire-up-dump_backtrace_entrystm.patch
* arm-add-show_stack_loglvl.patch
* arm64-add-loglvl-to-dump_backtrace.patch
* arm64-add-show_stack_loglvl.patch
* c6x-add-show_stack_loglvl.patch
* csky-add-show_stack_loglvl.patch
* h8300-add-show_stack_loglvl.patch
* hexagon-add-show_stack_loglvl.patch
* ia64-pass-log-level-as-arg-into-ia64_do_show_stack.patch
* ia64-add-show_stack_loglvl.patch
* m68k-add-show_stack_loglvl.patch
* microblaze-add-loglvl-to-microblaze_unwind_inner.patch
* microblaze-add-loglvl-to-microblaze_unwind.patch
* microblaze-add-show_stack_loglvl.patch
* mips-add-show_stack_loglvl.patch
* nds32-add-show_stack_loglvl.patch
* nios2-add-show_stack_loglvl.patch
* openrisc-add-show_stack_loglvl.patch
* parisc-add-show_stack_loglvl.patch
* powerpc-add-show_stack_loglvl.patch
* riscv-add-show_stack_loglvl.patch
* s390-add-show_stack_loglvl.patch
* sh-add-loglvl-to-dump_mem.patch
* sh-remove-needless-printk.patch
* sh-add-loglvl-to-printk_address.patch
* sh-add-loglvl-to-show_trace.patch
* sh-add-show_stack_loglvl.patch
* sparc-add-show_stack_loglvl.patch
* um-sysrq-remove-needless-variable-sp.patch
* um-add-show_stack_loglvl.patch
* unicore32-remove-unused-pmode-argument-in-c_backtrace.patch
* unicore32-add-loglvl-to-c_backtrace.patch
* unicore32-add-show_stack_loglvl.patch
* x86-add-missing-const-qualifiers-for-log_lvl.patch
* x86-add-show_stack_loglvl.patch
* xtensa-add-loglvl-to-show_trace.patch
* xtensa-add-show_stack_loglvl.patch
* sysrq-use-show_stack_loglvl.patch
* x86-amd_gart-print-stacktrace-for-a-leak-with-kern_err.patch
* power-use-show_stack_loglvl.patch
* kdb-dont-play-with-console_loglevel.patch
* sched-print-stack-trace-with-kern_info.patch
* kernel-use-show_stack_loglvl.patch
* kernel-rename-show_stack_loglvl-=-show_stack.patch
* mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included.patch
* mm-introduce-include-linux-pgtableh.patch
* mm-reorder-includes-after-introduction-of-linux-pgtableh.patch
* csky-replace-definitions-of-__pxd_offset-with-pxd_index.patch
* m68k-mm-motorola-move-comment-about-page-table-allocation-funcitons.patch
* m68k-mm-move-cachenocahe_page-definitions-close-to-their-user.patch
* x86-mm-simplify-init_trampoline-and-surrounding-logic.patch
* mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte.patch
* mm-consolidate-pte_index-and-pte_offset_-definitions.patch
* mmap-locking-api-initial-implementation-as-rwsem-wrappers.patch
* mmu-notifier-use-the-new-mmap-locking-api.patch
* dma-reservations-use-the-new-mmap-locking-api.patch
* mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites.patch
* mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle.patch
* mmap-locking-api-convert-nested-write-lock-sites.patch
* mmap-locking-api-add-mmap_read_trylock_non_owner.patch
* mmap-locking-api-add-mmap_lock_initializer.patch
* mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked.patch
* mmap-locking-api-rename-mmap_sem-to-mmap_lock.patch
* mmap-locking-api-convert-mmap_sem-api-comments.patch
* mmap-locking-api-convert-mmap_sem-comments.patch
* maccess-unexport-probe_kernel_write-and-probe_user_write.patch
* maccess-remove-various-unused-weak-aliases.patch
* maccess-remove-duplicate-kerneldoc-comments.patch
* maccess-clarify-kerneldoc-comments.patch
* maccess-update-the-top-of-file-comment.patch
* maccess-rename-strncpy_from_unsafe_user-to-strncpy_from_user_nofault.patch
* maccess-rename-strncpy_from_unsafe_strict-to-strncpy_from_kernel_nofault.patch
* maccess-rename-strnlen_unsafe_user-to-strnlen_user_nofault.patch
* maccess-remove-probe_read_common-and-probe_write_common.patch
* maccess-unify-the-probe-kernel-arch-hooks.patch
* bpf-factor-out-a-bpf_trace_copy_string-helper.patch
* bpf-handle-the-compat-string-in-bpf_trace_copy_string-better.patch
* bpf-bpf_seq_printf-handle-potentially-unsafe-format-string-better.patch
* bpf-rework-the-compat-kernel-probe-handling.patch
* tracing-kprobes-handle-mixed-kernel-userspace-probes-better.patch
* maccess-remove-strncpy_from_unsafe.patch
* maccess-always-use-strict-semantics-for-probe_kernel_read.patch
* maccess-move-user-access-routines-together.patch
* maccess-allow-architectures-to-provide-kernel-probing-directly.patch
* x86-use-non-set_fs-based-maccess-routines.patch
* maccess-return-erange-when-copy_from_kernel_nofault_allowed-fails.patch
* mm-expand-documentation-over-__read_mostly.patch
* checkpatch-test-git_dir-changes.patch
* khugepaged-selftests-fix-timeout-condition-in-wait_for_scan.patch
* scripts-spelling-add-a-few-more-typos.patch
* kcov-check-kcov_softirq-in-kcov_remote_stop.patch
* lib-lz4-lz4_decompressc-document-deliberate-use-of.patch
* nilfs2-fix-null-pointer-dereference-at-nilfs_segctor_do_construct.patch
* checkpatch-correct-check-for-kernel-parameters-doc.patch
* lib-fix-bitmap_parse-on-64-bit-big-endian-archs.patch
* mm-debug_vm_pgtable-fix-kernel-crash-by-checking-for-thp-support.patch
* mm-memory-failure-prioritize-prctlpr_mce_kill-over-vmmemory_failure_early_kill.patch
* mm-memory-failure-send-sigbusbus_mceerr_ar-only-to-current-thread.patch
* fix-build-failure-of-ocfs2-when-tcp-ip-is-disabled.patch
* proc-kpageflags-prevent-an-integer-overflow-in-stable_page_flags.patch
* proc-kpageflags-do-not-use-uninitialized-struct-pages.patch
* lib-lzo-fix-ambiguous-encoding-bug-in-lzo-rle.patch
* fs-ocfs2-fix-spelling-mistake-and-grammar.patch
* ocfs2-clear-links-count-in-ocfs2_mknod-if-an-error-occurs.patch
* ocfs2-fix-ocfs2-corrupt-when-iputting-an-inode.patch
* drivers-tty-serial-sh-scic-suppress-uninitialized-var-warning.patch
* ramfs-support-o_tmpfile.patch
* kernel-watchdog-flush-all-printk-nmi-buffers-when-hardlockup-detected.patch
  mm.patch
* mm-mmap-fix-the-adjusted-length-error.patch
* mm-page_alloc-skip-waternark_boost-for-atomic-order-0-allocations.patch
* mm-add-comments-on-pglist_data-zones.patch
* mm-vmstat-add-events-for-pmd-based-thp-migration-without-split.patch
* mm-vmstat-add-events-for-pmd-based-thp-migration-without-split-fix.patch
* mm-vmstat-add-events-for-pmd-based-thp-migration-without-split-update.patch
* info-task-hung-in-generic_file_write_iter.patch
* info-task-hung-in-generic_file_write-fix.patch
* kernel-hung_taskc-monitor-killed-tasks.patch
* lib-optimize-cpumask_local_spread.patch
* lib-test-get_count_order-long-in-test_bitopsc.patch
* lib-test-get_count_order-long-in-test_bitopsc-fix.patch
* lib-test-get_count_order-long-in-test_bitopsc-fix-fix.patch
* checkpatch-add-test-for-possible-misuse-of-is_enabled-without-config_.patch
* exec-change-uselib2-is_sreg-failure-to-eacces.patch
* exec-move-s_isreg-check-earlier.patch
* exec-move-path_noexec-check-earlier.patch
* umh-fix-refcount-underflow-in-fork_usermode_blob.patch
* aio-simplify-read_events.patch
* ipc-convert-ipcs_idr-to-xarray.patch
* ipc-convert-ipcs_idr-to-xarray-update.patch
* ipc-convert-ipcs_idr-to-xarray-update-fix.patch
  linux-next.patch
  linux-next-rejects.patch
  linux-next-git-rejects.patch
* mm-kmemleak-silence-kcsan-splats-in-checksum.patch
* stacktrace-cleanup-inconsistent-variable-type.patch
* amdgpu-a-null-mm-does-not-mean-a-thread-is-a-kthread.patch
* kernel-move-use_mm-unuse_mm-to-kthreadc.patch
* kernel-move-use_mm-unuse_mm-to-kthreadc-v2.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract-v2.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract-v2-fix.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract-fix-2.patch
* kernel-set-user_ds-in-kthread_use_mm.patch
* mm-frontswap-mark-various-intentional-data-races.patch
* mm-page_io-mark-various-intentional-data-races.patch
* mm-page_io-mark-various-intentional-data-races-v2.patch
* mm-swap_state-mark-various-intentional-data-races.patch
* mm-filemap-fix-a-data-race-in-filemap_fault.patch
* mm-swapfile-fix-and-annotate-various-data-races.patch
* mm-swapfile-fix-and-annotate-various-data-races-v2.patch
* mm-page_counter-fix-various-data-races-at-memsw.patch
* mm-memcontrol-fix-a-data-race-in-scan-count.patch
* mm-list_lru-fix-a-data-race-in-list_lru_count_one.patch
* mm-mempool-fix-a-data-race-in-mempool_free.patch
* mm-rmap-annotate-a-data-race-at-tlb_flush_batched.patch
* mm-annotate-a-data-race-in-page_zonenum.patch
* mm-swap-annotate-data-races-for-lru_rotate_pvecs.patch
* net-zerocopy-use-vm_insert_pages-for-tcp-rcv-zerocopy.patch
* mm-pass-task-and-mm-to-do_madvise.patch
* mm-introduce-external-memory-hinting-api.patch
* mm-introduce-external-memory-hinting-api-fix.patch
* mm-introduce-external-memory-hinting-api-fix-2.patch
* mm-introduce-external-memory-hinting-api-fix-2-fix.patch
* mm-check-fatal-signal-pending-of-target-process.patch
* pid-move-pidfd_get_pid-function-to-pidc.patch
* mm-support-both-pid-and-pidfd-for-process_madvise.patch
* mm-madvise-allow-ksm-hints-for-remote-api.patch
* mm-support-vector-address-ranges-for-process_madvise.patch
* mm-support-vector-address-ranges-for-process_madvise-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix-fix-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix-fix-fix-fix.patch
* mm-use-only-pidfd-for-process_madvise-syscall.patch
* mm-use-only-pidfd-for-process_madvise-syscall-fix.patch
* mm-remove-duplicated-include-from-madvisec.patch
* include-asm-generic-vmlinuxldsh-align-ro_after_init.patch
* sh-clkfwk-remove-r8-r16-r32.patch
* sh-remove-call-to-memset-after-dma_alloc_coherent.patch
* sh-use-generic-strncpy.patch
* sh-add-missing-export_symbol-for-__delay.patch
  make-sure-nobodys-leaking-resources.patch
  releasing-resources-with-children.patch
  mutex-subsystem-synchro-test-module.patch
  kernel-forkc-export-kernel_thread-to-modules.patch
  workaround-for-a-pci-restoring-bug.patch


^ permalink raw reply	[flat|nested] 307+ messages in thread

* mmotm 2020-06-08-22-35 uploaded
  2020-06-09  4:29 incoming Andrew Morton
                   ` (93 preceding siblings ...)
  2020-06-09  5:34 ` mmotm 2020-06-08-22-33 uploaded Andrew Morton
@ 2020-06-09  5:36 ` Andrew Morton
  2020-06-09 16:58 ` incoming Linus Torvalds
  95 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-09  5:36 UTC (permalink / raw)
  To: broonie, linux-fsdevel, linux-kernel, linux-mm, linux-next,
	mhocko, mm-commits, sfr

The mm-of-the-moment snapshot 2020-06-08-22-35 has been uploaded to

   http://www.ozlabs.org/~akpm/mmotm/

mmotm-readme.txt says

README for mm-of-the-moment:

http://www.ozlabs.org/~akpm/mmotm/

This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
more than once a week.

You will need quilt to apply these patches to the latest Linus release (5.x
or 5.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
http://ozlabs.org/~akpm/mmotm/series

The file broken-out.tar.gz contains two datestamp files: .DATE and
.DATE-yyyy-mm-dd-hh-mm-ss.  Both contain the string yyyy-mm-dd-hh-mm-ss,
followed by the base kernel version against which this patch series is to
be applied.

This tree is partially included in linux-next.  To see which patches are
included in linux-next, consult the `series' file.  Only the patches
within the #NEXT_PATCHES_START/#NEXT_PATCHES_END markers are included in
linux-next.


A full copy of the full kernel tree with the linux-next and mmotm patches
already applied is available through git within an hour of the mmotm
release.  Individual mmotm releases are tagged.  The master branch always
points to the latest release, so it's constantly rebasing.

	https://github.com/hnaz/linux-mm

The directory http://www.ozlabs.org/~akpm/mmots/ (mm-of-the-second)
contains daily snapshots of the -mm tree.  It is updated more frequently
than mmotm, and is untested.

A git copy of this tree is also available at

	https://github.com/hnaz/linux-mm



This mmotm tree contains the following patches against 5.7:
(patches marked "*" will be included in linux-next)

  origin.patch
* kallsyms-printk-add-loglvl-to-print_ip_sym.patch
* alpha-add-show_stack_loglvl.patch
* arc-add-show_stack_loglvl.patch
* arm-asm-add-loglvl-to-c_backtrace.patch
* arm-add-loglvl-to-unwind_backtrace.patch
* arm-add-loglvl-to-dump_backtrace.patch
* arm-wire-up-dump_backtrace_entrystm.patch
* arm-add-show_stack_loglvl.patch
* arm64-add-loglvl-to-dump_backtrace.patch
* arm64-add-show_stack_loglvl.patch
* c6x-add-show_stack_loglvl.patch
* csky-add-show_stack_loglvl.patch
* h8300-add-show_stack_loglvl.patch
* hexagon-add-show_stack_loglvl.patch
* ia64-pass-log-level-as-arg-into-ia64_do_show_stack.patch
* ia64-add-show_stack_loglvl.patch
* m68k-add-show_stack_loglvl.patch
* microblaze-add-loglvl-to-microblaze_unwind_inner.patch
* microblaze-add-loglvl-to-microblaze_unwind.patch
* microblaze-add-show_stack_loglvl.patch
* mips-add-show_stack_loglvl.patch
* nds32-add-show_stack_loglvl.patch
* nios2-add-show_stack_loglvl.patch
* openrisc-add-show_stack_loglvl.patch
* parisc-add-show_stack_loglvl.patch
* powerpc-add-show_stack_loglvl.patch
* riscv-add-show_stack_loglvl.patch
* s390-add-show_stack_loglvl.patch
* sh-add-loglvl-to-dump_mem.patch
* sh-remove-needless-printk.patch
* sh-add-loglvl-to-printk_address.patch
* sh-add-loglvl-to-show_trace.patch
* sh-add-show_stack_loglvl.patch
* sparc-add-show_stack_loglvl.patch
* um-sysrq-remove-needless-variable-sp.patch
* um-add-show_stack_loglvl.patch
* unicore32-remove-unused-pmode-argument-in-c_backtrace.patch
* unicore32-add-loglvl-to-c_backtrace.patch
* unicore32-add-show_stack_loglvl.patch
* x86-add-missing-const-qualifiers-for-log_lvl.patch
* x86-add-show_stack_loglvl.patch
* xtensa-add-loglvl-to-show_trace.patch
* xtensa-add-show_stack_loglvl.patch
* sysrq-use-show_stack_loglvl.patch
* x86-amd_gart-print-stacktrace-for-a-leak-with-kern_err.patch
* power-use-show_stack_loglvl.patch
* kdb-dont-play-with-console_loglevel.patch
* sched-print-stack-trace-with-kern_info.patch
* kernel-use-show_stack_loglvl.patch
* kernel-rename-show_stack_loglvl-=-show_stack.patch
* mm-dont-include-asm-pgtableh-if-linux-mmh-is-already-included.patch
* mm-introduce-include-linux-pgtableh.patch
* mm-reorder-includes-after-introduction-of-linux-pgtableh.patch
* csky-replace-definitions-of-__pxd_offset-with-pxd_index.patch
* m68k-mm-motorola-move-comment-about-page-table-allocation-funcitons.patch
* m68k-mm-move-cachenocahe_page-definitions-close-to-their-user.patch
* x86-mm-simplify-init_trampoline-and-surrounding-logic.patch
* mm-pgtable-add-shortcuts-for-accessing-kernel-pmd-and-pte.patch
* mm-consolidate-pte_index-and-pte_offset_-definitions.patch
* mmap-locking-api-initial-implementation-as-rwsem-wrappers.patch
* mmu-notifier-use-the-new-mmap-locking-api.patch
* dma-reservations-use-the-new-mmap-locking-api.patch
* mmap-locking-api-use-coccinelle-to-convert-mmap_sem-rwsem-call-sites.patch
* mmap-locking-api-convert-mmap_sem-call-sites-missed-by-coccinelle.patch
* mmap-locking-api-convert-nested-write-lock-sites.patch
* mmap-locking-api-add-mmap_read_trylock_non_owner.patch
* mmap-locking-api-add-mmap_lock_initializer.patch
* mmap-locking-api-add-mmap_assert_locked-and-mmap_assert_write_locked.patch
* mmap-locking-api-rename-mmap_sem-to-mmap_lock.patch
* mmap-locking-api-convert-mmap_sem-api-comments.patch
* mmap-locking-api-convert-mmap_sem-comments.patch
* maccess-unexport-probe_kernel_write-and-probe_user_write.patch
* maccess-remove-various-unused-weak-aliases.patch
* maccess-remove-duplicate-kerneldoc-comments.patch
* maccess-clarify-kerneldoc-comments.patch
* maccess-update-the-top-of-file-comment.patch
* maccess-rename-strncpy_from_unsafe_user-to-strncpy_from_user_nofault.patch
* maccess-rename-strncpy_from_unsafe_strict-to-strncpy_from_kernel_nofault.patch
* maccess-rename-strnlen_unsafe_user-to-strnlen_user_nofault.patch
* maccess-remove-probe_read_common-and-probe_write_common.patch
* maccess-unify-the-probe-kernel-arch-hooks.patch
* bpf-factor-out-a-bpf_trace_copy_string-helper.patch
* bpf-handle-the-compat-string-in-bpf_trace_copy_string-better.patch
* bpf-bpf_seq_printf-handle-potentially-unsafe-format-string-better.patch
* bpf-rework-the-compat-kernel-probe-handling.patch
* tracing-kprobes-handle-mixed-kernel-userspace-probes-better.patch
* maccess-remove-strncpy_from_unsafe.patch
* maccess-always-use-strict-semantics-for-probe_kernel_read.patch
* maccess-move-user-access-routines-together.patch
* maccess-allow-architectures-to-provide-kernel-probing-directly.patch
* x86-use-non-set_fs-based-maccess-routines.patch
* maccess-return-erange-when-copy_from_kernel_nofault_allowed-fails.patch
* mm-expand-documentation-over-__read_mostly.patch
* checkpatch-test-git_dir-changes.patch
* khugepaged-selftests-fix-timeout-condition-in-wait_for_scan.patch
* scripts-spelling-add-a-few-more-typos.patch
* kcov-check-kcov_softirq-in-kcov_remote_stop.patch
* lib-lz4-lz4_decompressc-document-deliberate-use-of.patch
* nilfs2-fix-null-pointer-dereference-at-nilfs_segctor_do_construct.patch
* checkpatch-correct-check-for-kernel-parameters-doc.patch
* lib-fix-bitmap_parse-on-64-bit-big-endian-archs.patch
* mm-debug_vm_pgtable-fix-kernel-crash-by-checking-for-thp-support.patch
* mm-memory-failure-prioritize-prctlpr_mce_kill-over-vmmemory_failure_early_kill.patch
* mm-memory-failure-send-sigbusbus_mceerr_ar-only-to-current-thread.patch
* fix-build-failure-of-ocfs2-when-tcp-ip-is-disabled.patch
* proc-kpageflags-prevent-an-integer-overflow-in-stable_page_flags.patch
* proc-kpageflags-do-not-use-uninitialized-struct-pages.patch
* lib-lzo-fix-ambiguous-encoding-bug-in-lzo-rle.patch
* fs-ocfs2-fix-spelling-mistake-and-grammar.patch
* ocfs2-clear-links-count-in-ocfs2_mknod-if-an-error-occurs.patch
* ocfs2-fix-ocfs2-corrupt-when-iputting-an-inode.patch
* drivers-tty-serial-sh-scic-suppress-uninitialized-var-warning.patch
* ramfs-support-o_tmpfile.patch
* kernel-watchdog-flush-all-printk-nmi-buffers-when-hardlockup-detected.patch
  mm.patch
* mm-mmap-fix-the-adjusted-length-error.patch
* mm-page_alloc-skip-waternark_boost-for-atomic-order-0-allocations.patch
* mm-add-comments-on-pglist_data-zones.patch
* mm-vmstat-add-events-for-pmd-based-thp-migration-without-split.patch
* mm-vmstat-add-events-for-pmd-based-thp-migration-without-split-fix.patch
* mm-vmstat-add-events-for-pmd-based-thp-migration-without-split-update.patch
* info-task-hung-in-generic_file_write_iter.patch
* info-task-hung-in-generic_file_write-fix.patch
* kernel-hung_taskc-monitor-killed-tasks.patch
* lib-optimize-cpumask_local_spread.patch
* lib-test-get_count_order-long-in-test_bitopsc.patch
* lib-test-get_count_order-long-in-test_bitopsc-fix.patch
* lib-test-get_count_order-long-in-test_bitopsc-fix-fix.patch
* checkpatch-add-test-for-possible-misuse-of-is_enabled-without-config_.patch
* exec-change-uselib2-is_sreg-failure-to-eacces.patch
* exec-move-s_isreg-check-earlier.patch
* exec-move-path_noexec-check-earlier.patch
* umh-fix-refcount-underflow-in-fork_usermode_blob.patch
* aio-simplify-read_events.patch
* ipc-convert-ipcs_idr-to-xarray.patch
* ipc-convert-ipcs_idr-to-xarray-update.patch
* ipc-convert-ipcs_idr-to-xarray-update-fix.patch
  linux-next.patch
  linux-next-rejects.patch
  linux-next-git-rejects.patch
* mm-kmemleak-silence-kcsan-splats-in-checksum.patch
* stacktrace-cleanup-inconsistent-variable-type.patch
* amdgpu-a-null-mm-does-not-mean-a-thread-is-a-kthread.patch
* kernel-move-use_mm-unuse_mm-to-kthreadc.patch
* kernel-move-use_mm-unuse_mm-to-kthreadc-v2.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract-v2.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract-v2-fix.patch
* kernel-better-document-the-use_mm-unuse_mm-api-contract-fix-2.patch
* kernel-set-user_ds-in-kthread_use_mm.patch
* mm-frontswap-mark-various-intentional-data-races.patch
* mm-page_io-mark-various-intentional-data-races.patch
* mm-page_io-mark-various-intentional-data-races-v2.patch
* mm-swap_state-mark-various-intentional-data-races.patch
* mm-filemap-fix-a-data-race-in-filemap_fault.patch
* mm-swapfile-fix-and-annotate-various-data-races.patch
* mm-swapfile-fix-and-annotate-various-data-races-v2.patch
* mm-page_counter-fix-various-data-races-at-memsw.patch
* mm-memcontrol-fix-a-data-race-in-scan-count.patch
* mm-list_lru-fix-a-data-race-in-list_lru_count_one.patch
* mm-mempool-fix-a-data-race-in-mempool_free.patch
* mm-rmap-annotate-a-data-race-at-tlb_flush_batched.patch
* mm-annotate-a-data-race-in-page_zonenum.patch
* mm-swap-annotate-data-races-for-lru_rotate_pvecs.patch
* net-zerocopy-use-vm_insert_pages-for-tcp-rcv-zerocopy.patch
* mm-pass-task-and-mm-to-do_madvise.patch
* mm-introduce-external-memory-hinting-api.patch
* mm-introduce-external-memory-hinting-api-fix.patch
* mm-introduce-external-memory-hinting-api-fix-2.patch
* mm-introduce-external-memory-hinting-api-fix-2-fix.patch
* mm-check-fatal-signal-pending-of-target-process.patch
* pid-move-pidfd_get_pid-function-to-pidc.patch
* mm-support-both-pid-and-pidfd-for-process_madvise.patch
* mm-madvise-allow-ksm-hints-for-remote-api.patch
* mm-support-vector-address-ranges-for-process_madvise.patch
* mm-support-vector-address-ranges-for-process_madvise-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix-fix-fix.patch
* mm-support-vector-address-ranges-for-process_madvise-fix-fix-fix-fix-fix.patch
* mm-use-only-pidfd-for-process_madvise-syscall.patch
* mm-use-only-pidfd-for-process_madvise-syscall-fix.patch
* mm-remove-duplicated-include-from-madvisec.patch
* include-asm-generic-vmlinuxldsh-align-ro_after_init.patch
* sh-clkfwk-remove-r8-r16-r32.patch
* sh-remove-call-to-memset-after-dma_alloc_coherent.patch
* sh-use-generic-strncpy.patch
* sh-add-missing-export_symbol-for-__delay.patch
  make-sure-nobodys-leaking-resources.patch
  releasing-resources-with-children.patch
  mutex-subsystem-synchro-test-module.patch
  kernel-forkc-export-kernel_thread-to-modules.patch
  workaround-for-a-pci-restoring-bug.patch


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-09  4:29 incoming Andrew Morton
                   ` (94 preceding siblings ...)
  2020-06-09  5:36 ` mmotm 2020-06-08-22-35 uploaded Andrew Morton
@ 2020-06-09 16:58 ` Linus Torvalds
  95 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-06-09 16:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Mon, Jun 8, 2020 at 9:29 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
>  942 files changed, 4580 insertions(+), 5662 deletions(-)

If you use proper tools, add a "-M" to your diff script, so that you see

   941 files changed, 2614 insertions(+), 3696 deletions(-)

because a big portion of the lines were due to a rename:

   rename include/{asm-generic => linux}/pgtable.h (91%)

but at some earlier point you mentioned "diffstat", so I guess "proper
tools" isn't an option ;(

                 Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: [patch 91/93] x86: use non-set_fs based maccess routines
  2020-06-09  4:35 ` [patch 91/93] x86: use non-set_fs based maccess routines Andrew Morton
@ 2020-06-09 18:01   ` Linus Torvalds
  2020-06-09 18:06     ` Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-06-09 18:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Alexei Starovoitov, Daniel Borkmann, Christoph Hellwig,
	Peter Anvin, Linux-MM, Masami Hiramatsu, Ingo Molnar, mm-commits,
	Thomas Gleixner

On Mon, Jun 8, 2020 at 9:35 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> From: Christoph Hellwig <hch@lst.de>
> Subject: x86: use non-set_fs based maccess routines

Ugh. I've seen this patch before, but only after I had applied it and
then pushed out the result did I notice that it has some nasty
behavior:

> +       __get_user_size(*((type *)dst), (__force type __user *)src,     \

Those casts of 'dst' and 'src' don't have the parentheses to make it
safe with random arguments. No such use exists right now, but these
aren't just some internal helper, they are used by code in
mm/maccess.c, and the arguments easily _could_ be something like
"ptr+offset", and then the pointer cast would do potentially very very
bad things.

I'm fixing it up, this is just a notice.

That's the trivial problem with that new macro, a more serious problem
is that I really think it should use

        __inttype(*(src)) __gk_val;
        __get_user_size(__gu_val, (__force type __user *)(src), ..
        (dst) = (__force __typeof__(*(src)))__gk_val;

instead.

Because right now it does something horribly horribly wrong if the
type of 'src' is at all different from the type of dst, or either of
them is different from 'type'

But the fix to that is to remove the 'type' argument and the users, so
I'm not doing that part.

Christoph? I'm not seeing why you insisted on making
__get_kernel_nofault different from unsafe_get_user().

Because as far as I can tell, every single difference is basically a
bug waiting to happen.

                   Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: [patch 91/93] x86: use non-set_fs based maccess routines
  2020-06-09 18:01   ` Linus Torvalds
@ 2020-06-09 18:06     ` Linus Torvalds
  2020-06-10  6:57       ` Christoph Hellwig
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-06-09 18:06 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Alexei Starovoitov, Daniel Borkmann, Christoph Hellwig,
	Peter Anvin, Linux-MM, Masami Hiramatsu, Ingo Molnar, mm-commits,
	Thomas Gleixner

On Tue, Jun 9, 2020 at 11:01 AM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Because right now it does something horribly horribly wrong if the
> type of 'src' is at all different from the type of dst, or either of
> them is different from 'type'

Never mind, it's intentional, and the macro always uses 'type' for the
access size. I guess I can see the reason for that, and despite the
name it's more akin to the unsafe_copy_loop() helper than
unsafe_get_user().

The lack parentheses was a real issue, though. And I still think it
_should_ have been more like unsafe_get_user(), since now it's
basically useless for anything but that copy loop.

                  Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: [patch 91/93] x86: use non-set_fs based maccess routines
  2020-06-09 18:06     ` Linus Torvalds
@ 2020-06-10  6:57       ` Christoph Hellwig
  0 siblings, 0 replies; 307+ messages in thread
From: Christoph Hellwig @ 2020-06-10  6:57 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Alexei Starovoitov, Daniel Borkmann,
	Christoph Hellwig, Peter Anvin, Linux-MM, Masami Hiramatsu,
	Ingo Molnar, mm-commits, Thomas Gleixner

On Tue, Jun 09, 2020 at 11:06:31AM -0700, Linus Torvalds wrote:
> On Tue, Jun 9, 2020 at 11:01 AM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > Because right now it does something horribly horribly wrong if the
> > type of 'src' is at all different from the type of dst, or either of
> > them is different from 'type'
> 
> Never mind, it's intentional, and the macro always uses 'type' for the
> access size. I guess I can see the reason for that, and despite the
> name it's more akin to the unsafe_copy_loop() helper than
> unsafe_get_user().

Yes.  At least for now - I've not forgotten your ideas about a more
direct API.  But for that I want to wait until:

 a) all architectures actually use this scheme
 b) find a user that cares enough about performance to bother with a
    direct get/put scheme vs the copy calling conventons.

> The lack parentheses was a real issue, though.

Thanks for fixing it.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: [patch 93/93] include/linux/cache.h: expand documentation over __read_mostly
  2020-06-09  4:35 ` [patch 93/93] include/linux/cache.h: expand documentation over __read_mostly Andrew Morton
@ 2020-06-17 15:51   ` Christopher Lameter
  0 siblings, 0 replies; 307+ messages in thread
From: Christopher Lameter @ 2020-06-17 15:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: aquini, arnd, keescook, linux-mm, mcgrof, mm-commits, torvalds, willy

On Mon, 8 Jun 2020, Andrew Morton wrote:

> __read_mostly can easily be misused by folks, its not meant for just
> read-only data.  There are performance reasons for using it, but we also
> don't provide any guidance about its use.  Provide a bit more guidance
> over its use.

Acked-by: Christoph Lameter <cl@linux.com>


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-04-27 19:41 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-04-27 19:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches

2 patches, based on d615b5416f8a1afeb82d13b238f8152c572d59c0.

Subsystems affected by this patch series:

  mm/kasan
  mm/debug

Subsystem: mm/kasan

    Zqiang <qiang1.zhang@intel.com>:
      kasan: prevent cpu_quarantine corruption when CPU offline and cache shrink occur at same time

Subsystem: mm/debug

    Akira Yokosawa <akiyks@gmail.com>:
      docs: vm/page_owner: use literal blocks for param description

 Documentation/vm/page_owner.rst |    5 +++--
 mm/kasan/quarantine.c           |    7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-04-21 23:35 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-04-21 23:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm, patches

13 patches, based on b253435746d9a4a701b5f09211b9c14d3370d0da.

Subsystems affected by this patch series:

  mm/memory-failure
  mm/memcg
  mm/userfaultfd
  mm/hugetlbfs
  mm/mremap
  mm/oom-kill
  mm/kasan
  kcov
  mm/hmm

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb()

    Xu Yu <xuyu@linux.alibaba.com>:
      mm/memory-failure.c: skip huge_zero_page in memory_failure()

Subsystem: mm/memcg

    Shakeel Butt <shakeelb@google.com>:
      memcg: sync flush only if periodic flush is delayed

Subsystem: mm/userfaultfd

    Nadav Amit <namit@vmware.com>:
      userfaultfd: mark uffd_wp regardless of VM_WRITE flag

Subsystem: mm/hugetlbfs

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm, hugetlb: allow for "high" userspace addresses

Subsystem: mm/mremap

    Sidhartha Kumar <sidhartha.kumar@oracle.com>:
      selftest/vm: verify mmap addr in mremap_test
      selftest/vm: verify remap destination address in mremap_test
      selftest/vm: support xfail in mremap_test
      selftest/vm: add skip support to mremap_test

Subsystem: mm/oom-kill

    Nico Pache <npache@redhat.com>:
      oom_kill.c: futex: delay the OOM reaper to allow time for proper futex cleanup

Subsystem: mm/kasan

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      MAINTAINERS: add Vincenzo Frascino to KASAN reviewers

Subsystem: kcov

    Aleksandr Nogikh <nogikh@google.com>:
      kcov: don't generate a warning on vm_insert_page()'s failure

Subsystem: mm/hmm

    Alistair Popple <apopple@nvidia.com>:
      mm/mmu_notifier.c: fix race in mmu_interval_notifier_remove()

 MAINTAINERS                               |    1 
 fs/hugetlbfs/inode.c                      |    9 -
 include/linux/hugetlb.h                   |    6 +
 include/linux/memcontrol.h                |    5 
 include/linux/mm.h                        |    8 +
 include/linux/sched.h                     |    1 
 include/linux/sched/mm.h                  |    8 +
 kernel/kcov.c                             |    7 -
 mm/hugetlb.c                              |   10 +
 mm/memcontrol.c                           |   12 ++
 mm/memory-failure.c                       |  158 ++++++++++++++++++++++--------
 mm/mmap.c                                 |    8 -
 mm/mmu_notifier.c                         |   14 ++
 mm/oom_kill.c                             |   54 +++++++---
 mm/userfaultfd.c                          |   15 +-
 mm/workingset.c                           |    2 
 tools/testing/selftests/vm/mremap_test.c  |   85 +++++++++++++++-
 tools/testing/selftests/vm/run_vmtests.sh |   11 +-
 18 files changed, 327 insertions(+), 87 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-04-15  2:12 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-04-15  2:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches

14 patches, based on 115acbb56978941bb7537a97dfc303da286106c1.

Subsystems affected by this patch series:

  MAINTAINERS
  mm/tmpfs
  m/secretmem
  mm/kasan
  mm/kfence
  mm/pagealloc
  mm/zram
  mm/compaction
  mm/hugetlb
  binfmt
  mm/vmalloc
  mm/kmemleak

Subsystem: MAINTAINERS

    Joe Perches <joe@perches.com>:
      MAINTAINERS: Broadcom internal lists aren't maintainers

Subsystem: mm/tmpfs

    Hugh Dickins <hughd@google.com>:
      tmpfs: fix regressions from wider use of ZERO_PAGE

Subsystem: m/secretmem

    Axel Rasmussen <axelrasmussen@google.com>:
      mm/secretmem: fix panic when growing a memfd_secret

Subsystem: mm/kasan

    Zqiang <qiang1.zhang@intel.com>:
      irq_work: use kasan_record_aux_stack_noalloc() record callstack

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      kasan: fix hw tags enablement when KUNIT tests are disabled

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      mm, kfence: support kmem_dump_obj() for KFENCE objects

Subsystem: mm/pagealloc

    Juergen Gross <jgross@suse.com>:
      mm, page_alloc: fix build_zonerefs_node()

Subsystem: mm/zram

    Minchan Kim <minchan@kernel.org>:
      mm: fix unexpected zeroed page mapping with zram swap

Subsystem: mm/compaction

    Charan Teja Kalla <quic_charante@quicinc.com>:
      mm: compaction: fix compiler warning when CONFIG_COMPACTION=n

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: do not demote poisoned hugetlb pages

Subsystem: binfmt

    Andrew Morton <akpm@linux-foundation.org>:
      revert "fs/binfmt_elf: fix PT_LOAD p_align values for loaders"
      revert "fs/binfmt_elf: use PT_LOAD p_align values for static PIE"

Subsystem: mm/vmalloc

    Omar Sandoval <osandov@fb.com>:
      mm/vmalloc: fix spinning drain_vmap_work after reading from /proc/vmcore

Subsystem: mm/kmemleak

    Patrick Wang <patrick.wang.shcn@gmail.com>:
      mm: kmemleak: take a full lowmem check in kmemleak_*_phys()

 MAINTAINERS                     |   64 ++++++++++++++++++++--------------------
 arch/x86/include/asm/io.h       |    2 -
 arch/x86/kernel/crash_dump_64.c |    1 
 fs/binfmt_elf.c                 |    6 +--
 include/linux/kfence.h          |   24 +++++++++++++++
 kernel/irq_work.c               |    2 -
 mm/compaction.c                 |   10 +++---
 mm/filemap.c                    |    6 ---
 mm/hugetlb.c                    |   17 ++++++----
 mm/kasan/hw_tags.c              |    5 +--
 mm/kasan/kasan.h                |   10 +++---
 mm/kfence/core.c                |   21 -------------
 mm/kfence/kfence.h              |   21 +++++++++++++
 mm/kfence/report.c              |   47 +++++++++++++++++++++++++++++
 mm/kmemleak.c                   |    8 ++---
 mm/page_alloc.c                 |    2 -
 mm/page_io.c                    |   54 ---------------------------------
 mm/secretmem.c                  |   17 ++++++++++
 mm/shmem.c                      |   31 ++++++++++++-------
 mm/slab.c                       |    2 -
 mm/slab.h                       |    2 -
 mm/slab_common.c                |    9 +++++
 mm/slob.c                       |    2 -
 mm/slub.c                       |    2 -
 mm/vmalloc.c                    |   11 ------
 25 files changed, 207 insertions(+), 169 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-04-08 20:08 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-04-08 20:08 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches

9 patches, based on d00c50b35101b862c3db270ffeba53a63a1063d9.

Subsystems affected by this patch series:

  mm/migration
  mm/highmem
  lz4
  mm/sparsemem
  mm/mremap
  mm/mempolicy
  mailmap
  mm/memcg
  MAINTAINERS

Subsystem: mm/migration

    Zi Yan <ziy@nvidia.com>:
      mm: migrate: use thp_order instead of HPAGE_PMD_ORDER for new page allocation.

Subsystem: mm/highmem

    Max Filippov <jcmvbkbc@gmail.com>:
      highmem: fix checks in __kmap_local_sched_{in,out}

Subsystem: lz4

    Guo Xuenan <guoxuenan@huawei.com>:
      lz4: fix LZ4_decompress_safe_partial read out of bound

Subsystem: mm/sparsemem

    Waiman Long <longman@redhat.com>:
      mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning

Subsystem: mm/mremap

    Paolo Bonzini <pbonzini@redhat.com>:
      mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0)

Subsystem: mm/mempolicy

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mempolicy: fix mpol_new leak in shared_policy_replace

Subsystem: mailmap

    Vasily Averin <vasily.averin@linux.dev>:
      mailmap: update Vasily Averin's email address

Subsystem: mm/memcg

    Andrew Morton <akpm@linux-foundation.org>:
      mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_node()"

Subsystem: MAINTAINERS

    Tom Rix <trix@redhat.com>:
      MAINTAINERS: add Tom as clang reviewer

 .mailmap                 |    4 ++++
 MAINTAINERS              |    1 +
 include/linux/mmzone.h   |   11 +++++++----
 lib/lz4/lz4_decompress.c |    8 ++++++--
 mm/highmem.c             |    4 ++--
 mm/list_lru.c            |    6 ------
 mm/mempolicy.c           |    3 ++-
 mm/migrate.c             |    2 +-
 mm/mremap.c              |    3 +++
 9 files changed, 26 insertions(+), 16 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-04-01 18:27 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-04-01 18:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches

16 patches, based on e8b767f5e04097aaedcd6e06e2270f9fe5282696.

Subsystems affected by this patch series:

  mm/madvise
  ofs2
  nilfs2
  mm/mlock
  mm/mfence
  mailmap
  mm/memory-failure
  mm/kasan
  mm/debug
  mm/kmemleak
  mm/damon

Subsystem: mm/madvise

    Charan Teja Kalla <quic_charante@quicinc.com>:
      Revert "mm: madvise: skip unmapped vma holes passed to process_madvise"

Subsystem: ofs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: fix crash when mount with quota enabled

Subsystem: nilfs2

    Ryusuke Konishi <konishi.ryusuke@gmail.com>:
    Patch series "nilfs2 lockdep warning fixes":
      nilfs2: fix lockdep warnings in page operations for btree nodes
      nilfs2: fix lockdep warnings during disk space reclamation
      nilfs2: get rid of nilfs_mapping_init()

Subsystem: mm/mlock

    Hugh Dickins <hughd@google.com>:
      mm/munlock: add lru_add_drain() to fix memcg_stat_test
      mm/munlock: update Documentation/vm/unevictable-lru.rst

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/munlock: protect the per-CPU pagevec by a local_lock_t

Subsystem: mm/kfence

    Muchun Song <songmuchun@bytedance.com>:
      mm: kfence: fix objcgs vector allocation

Subsystem: mailmap

    Kirill Tkhai <kirill.tkhai@openvz.org>:
      mailmap: update Kirill's email

Subsystem: mm/memory-failure

    Rik van Riel <riel@surriel.com>:
      mm,hwpoison: unmap poisoned page before invalidation

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      mm, kasan: fix __GFP_BITS_SHIFT definition breaking LOCKDEP

Subsystem: mm/debug

    Yinan Zhang <zhangyinan2019@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: remove -c option
      doc/vm/page_owner.rst: remove content related to -c option

Subsystem: mm/kmemleak

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
      mm/kmemleak: reset tag when compare object pointer

Subsystem: mm/damon

    Jonghyeon Kim <tome01@ajou.ac.kr>:
      mm/damon: prevent activated scheme from sleeping by deactivated schemes

 .mailmap                             |    1 
 Documentation/vm/page_owner.rst      |    1 
 Documentation/vm/unevictable-lru.rst |  473 +++++++++++++++--------------------
 fs/nilfs2/btnode.c                   |   23 +
 fs/nilfs2/btnode.h                   |    1 
 fs/nilfs2/btree.c                    |   27 +
 fs/nilfs2/dat.c                      |    4 
 fs/nilfs2/gcinode.c                  |    7 
 fs/nilfs2/inode.c                    |  167 +++++++++++-
 fs/nilfs2/mdt.c                      |   45 ++-
 fs/nilfs2/mdt.h                      |    6 
 fs/nilfs2/nilfs.h                    |   16 -
 fs/nilfs2/page.c                     |   16 -
 fs/nilfs2/page.h                     |    1 
 fs/nilfs2/segment.c                  |    9 
 fs/nilfs2/super.c                    |    5 
 fs/ocfs2/quota_global.c              |   23 -
 fs/ocfs2/quota_local.c               |    2 
 include/linux/gfp.h                  |    4 
 mm/damon/core.c                      |    5 
 mm/gup.c                             |   10 
 mm/internal.h                        |    6 
 mm/kfence/core.c                     |   11 
 mm/kfence/kfence.h                   |    3 
 mm/kmemleak.c                        |    9 
 mm/madvise.c                         |    9 
 mm/memory.c                          |   12 
 mm/migrate.c                         |    2 
 mm/mlock.c                           |   46 ++-
 mm/page_alloc.c                      |    1 
 mm/rmap.c                            |    4 
 mm/swap.c                            |    4 
 tools/vm/page_owner_sort.c           |    6 
 33 files changed, 560 insertions(+), 399 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2022-04-01 18:20 incoming Andrew Morton
@ 2022-04-01 18:27 ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-04-01 18:27 UTC (permalink / raw)
  To: Linus Torvalds, linux-mm, mm-commits, patches

Argh, messed up in-reply-to.  Let me redo...


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-04-01 18:20 Andrew Morton
  2022-04-01 18:27 ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2022-04-01 18:20 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches

16 patches, based on e8b767f5e04097aaedcd6e06e2270f9fe5282696.

Subsystems affected by this patch series:

  mm/madvise
  ofs2
  nilfs2
  mm/mlock
  mm/mfence
  mailmap
  mm/memory-failure
  mm/kasan
  mm/debug
  mm/kmemleak
  mm/damon

Subsystem: mm/madvise

    Charan Teja Kalla <quic_charante@quicinc.com>:
      Revert "mm: madvise: skip unmapped vma holes passed to process_madvise"

Subsystem: ofs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: fix crash when mount with quota enabled

Subsystem: nilfs2

    Ryusuke Konishi <konishi.ryusuke@gmail.com>:
    Patch series "nilfs2 lockdep warning fixes":
      nilfs2: fix lockdep warnings in page operations for btree nodes
      nilfs2: fix lockdep warnings during disk space reclamation
      nilfs2: get rid of nilfs_mapping_init()

Subsystem: mm/mlock

    Hugh Dickins <hughd@google.com>:
      mm/munlock: add lru_add_drain() to fix memcg_stat_test
      mm/munlock: update Documentation/vm/unevictable-lru.rst

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/munlock: protect the per-CPU pagevec by a local_lock_t

Subsystem: mm/kfence

    Muchun Song <songmuchun@bytedance.com>:
      mm: kfence: fix objcgs vector allocation

Subsystem: mailmap

    Kirill Tkhai <kirill.tkhai@openvz.org>:
      mailmap: update Kirill's email

Subsystem: mm/memory-failure

    Rik van Riel <riel@surriel.com>:
      mm,hwpoison: unmap poisoned page before invalidation

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      mm, kasan: fix __GFP_BITS_SHIFT definition breaking LOCKDEP

Subsystem: mm/debug

    Yinan Zhang <zhangyinan2019@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: remove -c option
      doc/vm/page_owner.rst: remove content related to -c option

Subsystem: mm/kmemleak

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
      mm/kmemleak: reset tag when compare object pointer

Subsystem: mm/damon

    Jonghyeon Kim <tome01@ajou.ac.kr>:
      mm/damon: prevent activated scheme from sleeping by deactivated schemes

 .mailmap                             |    1 
 Documentation/vm/page_owner.rst      |    1 
 Documentation/vm/unevictable-lru.rst |  473 +++++++++++++++--------------------
 fs/nilfs2/btnode.c                   |   23 +
 fs/nilfs2/btnode.h                   |    1 
 fs/nilfs2/btree.c                    |   27 +
 fs/nilfs2/dat.c                      |    4 
 fs/nilfs2/gcinode.c                  |    7 
 fs/nilfs2/inode.c                    |  167 +++++++++++-
 fs/nilfs2/mdt.c                      |   45 ++-
 fs/nilfs2/mdt.h                      |    6 
 fs/nilfs2/nilfs.h                    |   16 -
 fs/nilfs2/page.c                     |   16 -
 fs/nilfs2/page.h                     |    1 
 fs/nilfs2/segment.c                  |    9 
 fs/nilfs2/super.c                    |    5 
 fs/ocfs2/quota_global.c              |   23 -
 fs/ocfs2/quota_local.c               |    2 
 include/linux/gfp.h                  |    4 
 mm/damon/core.c                      |    5 
 mm/gup.c                             |   10 
 mm/internal.h                        |    6 
 mm/kfence/core.c                     |   11 
 mm/kfence/kfence.h                   |    3 
 mm/kmemleak.c                        |    9 
 mm/madvise.c                         |    9 
 mm/memory.c                          |   12 
 mm/migrate.c                         |    2 
 mm/mlock.c                           |   46 ++-
 mm/page_alloc.c                      |    1 
 mm/rmap.c                            |    4 
 mm/swap.c                            |    4 
 tools/vm/page_owner_sort.c           |    6 
 33 files changed, 560 insertions(+), 399 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-03-25  1:07 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-03-25  1:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm, patches


This is the material which was staged after willystuff in linux-next. 
Everything applied seamlessly on your latest, all looks well.



114 patches, based on 52deda9551a01879b3562e7b41748e85c591f14c.

Subsystems affected by this patch series:

  mm/debug
  mm/selftests
  mm/pagecache
  mm/thp
  mm/rmap
  mm/migration
  mm/kasan
  mm/hugetlb
  mm/pagemap
  mm/madvise
  selftests

Subsystem: mm/debug

    Sean Anderson <seanga2@gmail.com>:
      tools/vm/page_owner_sort.c: sort by stacktrace before culling
      tools/vm/page_owner_sort.c: support sorting by stack trace

    Yinan Zhang <zhangyinan2019@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: add switch between culling by stacktrace and txt

    Chongxi Zhao <zhaochongxi2019@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: support sorting pid and time

    Shenghong Han <hanshenghong2019@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: two trivial fixes

    Yixuan Cao <caoyixuan2019@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: delete invalid duplicate code

    Shenghong Han <hanshenghong2019@email.szu.edu.cn>:
      Documentation/vm/page_owner.rst: update the documentation

    Shuah Khan <skhan@linuxfoundation.org>:
      Documentation/vm/page_owner.rst: fix unexpected indentation warns

    Waiman Long <longman@redhat.com>:
    Patch series "mm/page_owner: Extend page_owner to show memcg information", v4:
      lib/vsprintf: avoid redundant work with 0 size
      mm/page_owner: use scnprintf() to avoid excessive buffer overrun check
      mm/page_owner: print memcg information
      mm/page_owner: record task command name

    Yixuan Cao <caoyixuan2019@email.szu.edu.cn>:
      mm/page_owner.c: record tgid
      tools/vm/page_owner_sort.c: fix the instructions for use

    Jiajian Ye <yejiajian2018@email.szu.edu.cn>:
      tools/vm/page_owner_sort.c: fix comments
      tools/vm/page_owner_sort.c: add a security check
      tools/vm/page_owner_sort.c: support sorting by tgid and update documentation
      tools/vm/page_owner_sort: fix three trivival places
      tools/vm/page_owner_sort: support for sorting by task command name
      tools/vm/page_owner_sort.c: support for selecting by PID, TGID or task command name
      tools/vm/page_owner_sort.c: support for user-defined culling rules

    Christoph Hellwig <hch@lst.de>:
      mm: unexport page_init_poison

Subsystem: mm/selftests

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      selftest/vm: add util.h and and move helper functions there

    Mike Rapoport <rppt@kernel.org>:
      selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT

Subsystem: mm/pagecache

    Hugh Dickins <hughd@google.com>:
      mm: delete __ClearPageWaiters()
      mm: filemap_unaccount_folio() large skip mapcount fixup

Subsystem: mm/thp

    Hugh Dickins <hughd@google.com>:
      mm/thp: fix NR_FILE_MAPPED accounting in page_*_file_rmap()

Subsystem: mm/rmap

Subsystem: mm/migration

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/migration: Add trace events", v3:
      mm/migration: add trace events for THP migrations
      mm/migration: add trace events for base page and HugeTLB migrations

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan, vmalloc, arm64: add vmalloc tagging support for SW/HW_TAGS", v6:
      kasan, page_alloc: deduplicate should_skip_kasan_poison
      kasan, page_alloc: move tag_clear_highpage out of kernel_init_free_pages
      kasan, page_alloc: merge kasan_free_pages into free_pages_prepare
      kasan, page_alloc: simplify kasan_poison_pages call site
      kasan, page_alloc: init memory of skipped pages on free
      kasan: drop skip_kasan_poison variable in free_pages_prepare
      mm: clarify __GFP_ZEROTAGS comment
      kasan: only apply __GFP_ZEROTAGS when memory is zeroed
      kasan, page_alloc: refactor init checks in post_alloc_hook
      kasan, page_alloc: merge kasan_alloc_pages into post_alloc_hook
      kasan, page_alloc: combine tag_clear_highpage calls in post_alloc_hook
      kasan, page_alloc: move SetPageSkipKASanPoison in post_alloc_hook
      kasan, page_alloc: move kernel_init_free_pages in post_alloc_hook
      kasan, page_alloc: rework kasan_unpoison_pages call site
      kasan: clean up metadata byte definitions
      kasan: define KASAN_VMALLOC_INVALID for SW_TAGS
      kasan, x86, arm64, s390: rename functions for modules shadow
      kasan, vmalloc: drop outdated VM_KASAN comment
      kasan: reorder vmalloc hooks
      kasan: add wrappers for vmalloc hooks
      kasan, vmalloc: reset tags in vmalloc functions
      kasan, fork: reset pointer tags of vmapped stacks
      kasan, arm64: reset pointer tags of vmapped stacks
      kasan, vmalloc: add vmalloc tagging for SW_TAGS
      kasan, vmalloc, arm64: mark vmalloc mappings as pgprot_tagged
      kasan, vmalloc: unpoison VM_ALLOC pages after mapping
      kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS
      kasan, page_alloc: allow skipping unpoisoning for HW_TAGS
      kasan, page_alloc: allow skipping memory init for HW_TAGS
      kasan, vmalloc: add vmalloc tagging for HW_TAGS
      kasan, vmalloc: only tag normal vmalloc allocations
      kasan, arm64: don't tag executable vmalloc allocations
      kasan: mark kasan_arg_stacktrace as __initdata
      kasan: clean up feature flags for HW_TAGS mode
      kasan: add kasan.vmalloc command line flag
      kasan: allow enabling KASAN_VMALLOC and SW/HW_TAGS
      arm64: select KASAN_VMALLOC for SW/HW_TAGS modes
      kasan: documentation updates
      kasan: improve vmalloc tests
      kasan: test: support async (again) and asymm modes for HW_TAGS

    tangmeng <tangmeng@uniontech.com>:
      mm/kasan: remove unnecessary CONFIG_KASAN option

    Peter Collingbourne <pcc@google.com>:
      kasan: update function name in comments

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: print virtual mapping info in reports
    Patch series "kasan: report clean-ups and improvements":
      kasan: drop addr check from describe_object_addr
      kasan: more line breaks in reports
      kasan: rearrange stack frame info in reports
      kasan: improve stack frame info in reports
      kasan: print basic stack frame info for SW_TAGS
      kasan: simplify async check in end_report()
      kasan: simplify kasan_update_kunit_status() and call sites
      kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT
      kasan: move update_kunit_status to start_report
      kasan: move disable_trace_on_warning to start_report
      kasan: split out print_report from __kasan_report
      kasan: simplify kasan_find_first_bad_addr call sites
      kasan: restructure kasan_report
      kasan: merge __kasan_report into kasan_report
      kasan: call print_report from kasan_report_invalid_free
      kasan: move and simplify kasan_report_async
      kasan: rename kasan_access_info to kasan_report_info
      kasan: add comment about UACCESS regions to kasan_report
      kasan: respect KASAN_BIT_REPORTED in all reporting routines
      kasan: reorder reporting functions
      kasan: move and hide kasan_save_enable/restore_multi_shot
      kasan: disable LOCKDEP when printing reports

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "Add hugetlb MADV_DONTNEED support", v3:
      mm: enable MADV_DONTNEED for hugetlb mappings
      selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test
      userfaultfd/selftests: enable hugetlb remap and remove event testing

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/huge_memory: make is_transparent_hugepage() static

Subsystem: mm/pagemap

    David Hildenbrand <david@redhat.com>:
    Patch series "mm: COW fixes part 1: fix the COW security issue for THP and swap", v3:
      mm: optimize do_wp_page() for exclusive pages in the swapcache
      mm: optimize do_wp_page() for fresh pages in local LRU pagevecs
      mm: slightly clarify KSM logic in do_swap_page()
      mm: streamline COW logic in do_swap_page()
      mm/huge_memory: streamline COW logic in do_huge_pmd_wp_page()
      mm/khugepaged: remove reuse_swap_page() usage
      mm/swapfile: remove stale reuse_swap_page()
      mm/huge_memory: remove stale page_trans_huge_mapcount()
      mm/huge_memory: remove stale locking logic from __split_huge_pmd()

    Hugh Dickins <hughd@google.com>:
      mm: warn on deleting redirtied only if accounted
      mm: unmap_mapping_range_tree() with i_mmap_rwsem shared

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm: generalize ARCH_HAS_FILTER_PGPROT

Subsystem: mm/madvise

    Mauricio Faria de Oliveira <mfo@canonical.com>:
      mm: fix race between MADV_FREE reclaim and blkdev direct IO read

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: madvise: MADV_DONTNEED_LOCKED

Subsystem: selftests

    Muhammad Usama Anjum <usama.anjum@collabora.com>:
      selftests: vm: remove dependecy from internal kernel macros

    Kees Cook <keescook@chromium.org>:
      selftests: kselftest framework: provide "finished" helper

 Documentation/dev-tools/kasan.rst             |   17 
 Documentation/vm/page_owner.rst               |   72 ++
 arch/alpha/include/uapi/asm/mman.h            |    2 
 arch/arm64/Kconfig                            |    2 
 arch/arm64/include/asm/vmalloc.h              |    6 
 arch/arm64/include/asm/vmap_stack.h           |    5 
 arch/arm64/kernel/module.c                    |    5 
 arch/arm64/mm/pageattr.c                      |    2 
 arch/arm64/net/bpf_jit_comp.c                 |    3 
 arch/mips/include/uapi/asm/mman.h             |    2 
 arch/parisc/include/uapi/asm/mman.h           |    2 
 arch/powerpc/mm/book3s64/trace.c              |    1 
 arch/s390/kernel/module.c                     |    2 
 arch/x86/Kconfig                              |    3 
 arch/x86/kernel/module.c                      |    2 
 arch/x86/mm/init.c                            |    1 
 arch/xtensa/include/uapi/asm/mman.h           |    2 
 include/linux/gfp.h                           |   53 +-
 include/linux/huge_mm.h                       |    6 
 include/linux/kasan.h                         |  136 +++--
 include/linux/mm.h                            |    5 
 include/linux/page-flags.h                    |    2 
 include/linux/pagemap.h                       |    3 
 include/linux/swap.h                          |    4 
 include/linux/vmalloc.h                       |   18 
 include/trace/events/huge_memory.h            |    1 
 include/trace/events/migrate.h                |   31 +
 include/trace/events/mmflags.h                |   18 
 include/trace/events/thp.h                    |   27 +
 include/uapi/asm-generic/mman-common.h        |    2 
 kernel/fork.c                                 |   13 
 kernel/scs.c                                  |   16 
 lib/Kconfig.kasan                             |   18 
 lib/test_kasan.c                              |  239 ++++++++-
 lib/vsprintf.c                                |    8 
 mm/Kconfig                                    |    3 
 mm/debug.c                                    |    1 
 mm/filemap.c                                  |   63 +-
 mm/huge_memory.c                              |  109 ----
 mm/kasan/Makefile                             |    2 
 mm/kasan/common.c                             |    4 
 mm/kasan/hw_tags.c                            |  243 +++++++---
 mm/kasan/kasan.h                              |   76 ++-
 mm/kasan/report.c                             |  516 +++++++++++----------
 mm/kasan/report_generic.c                     |   34 -
 mm/kasan/report_hw_tags.c                     |    1 
 mm/kasan/report_sw_tags.c                     |   16 
 mm/kasan/report_tags.c                        |    2 
 mm/kasan/shadow.c                             |   76 +--
 mm/khugepaged.c                               |   11 
 mm/madvise.c                                  |   57 +-
 mm/memory.c                                   |  129 +++--
 mm/memremap.c                                 |    2 
 mm/migrate.c                                  |    4 
 mm/page-writeback.c                           |   18 
 mm/page_alloc.c                               |  270 ++++++-----
 mm/page_owner.c                               |   86 ++-
 mm/rmap.c                                     |   62 +-
 mm/swap.c                                     |    4 
 mm/swapfile.c                                 |  104 ----
 mm/vmalloc.c                                  |  167 ++++--
 tools/testing/selftests/kselftest.h           |   10 
 tools/testing/selftests/vm/.gitignore         |    1 
 tools/testing/selftests/vm/Makefile           |    1 
 tools/testing/selftests/vm/gup_test.c         |    3 
 tools/testing/selftests/vm/hugetlb-madvise.c  |  410 ++++++++++++++++
 tools/testing/selftests/vm/ksm_tests.c        |   38 -
 tools/testing/selftests/vm/memfd_secret.c     |    2 
 tools/testing/selftests/vm/run_vmtests.sh     |   15 
 tools/testing/selftests/vm/transhuge-stress.c |   41 -
 tools/testing/selftests/vm/userfaultfd.c      |   72 +-
 tools/testing/selftests/vm/util.h             |   75 ++-
 tools/vm/page_owner_sort.c                    |  628 +++++++++++++++++++++-----
 73 files changed, 2797 insertions(+), 1288 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-03-23 23:04 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-03-23 23:04 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm, patches


Various misc subsystems, before getting into the post-linux-next material.

This is all based on v5.17.  I tested applying and compiling against
today's 1bc191051dca28fa6.  One patch required an extra whack, all
looks good.


41 patches, based on f443e374ae131c168a065ea1748feac6b2e76613.

Subsystems affected by this patch series:

  procfs
  misc
  core-kernel
  lib
  checkpatch
  init
  pipe
  minix
  fat
  cgroups
  kexec
  kdump
  taskstats
  panic
  kcov
  resource
  ubsan

Subsystem: procfs

    Hao Lee <haolee.swjtu@gmail.com>:
      proc: alloc PATH_MAX bytes for /proc/${pid}/fd/ symlinks

    David Hildenbrand <david@redhat.com>:
      proc/vmcore: fix possible deadlock on concurrent mmap and read

    Yang Li <yang.lee@linux.alibaba.com>:
      proc/vmcore: fix vmcore_alloc_buf() kernel-doc comment

Subsystem: misc

    Bjorn Helgaas <bhelgaas@google.com>:
      linux/types.h: remove unnecessary __bitwise__
      Documentation/sparse: add hints about __CHECKER__

Subsystem: core-kernel

    Miaohe Lin <linmiaohe@huawei.com>:
      kernel/ksysfs.c: use helper macro __ATTR_RW

Subsystem: lib

    Kees Cook <keescook@chromium.org>:
      Kconfig.debug: make DEBUG_INFO selectable from a choice

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      include: drop pointless __compiler_offsetof indirection

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      ilog2: force inlining of __ilog2_u32() and __ilog2_u64()

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      bitfield: add explicit inclusions to the example

    Feng Tang <feng.tang@intel.com>:
      lib/Kconfig.debug: add ARCH dependency for FUNCTION_ALIGN option

    Randy Dunlap <rdunlap@infradead.org>:
      lib: bitmap: fix many kernel-doc warnings

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: prefer MODULE_LICENSE("GPL") over MODULE_LICENSE("GPL v2")
      checkpatch: add --fix option for some TRAILING_STATEMENTS
      checkpatch: add early_param exception to blank line after struct/function test

    Sagar Patel <sagarmp@cs.unc.edu>:
      checkpatch: use python3 to find codespell dictionary

Subsystem: init

    Mark-PK Tsai <mark-pk.tsai@mediatek.com>:
      init: use ktime_us_delta() to make initcall_debug log more precise

    Randy Dunlap <rdunlap@infradead.org>:
      init.h: improve __setup and early_param documentation
      init/main.c: return 1 from handled __setup() functions

Subsystem: pipe

    Andrei Vagin <avagin@gmail.com>:
      fs/pipe: use kvcalloc to allocate a pipe_buffer array
      fs/pipe.c: local vars have to match types of proper pipe_inode_info fields

Subsystem: minix

    Qinghua Jin <qhjin.dev@gmail.com>:
      minix: fix bug when opening a file with O_DIRECT

Subsystem: fat

    Helge Deller <deller@gmx.de>:
      fat: use pointer to simple type in put_user()

Subsystem: cgroups

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      cgroup: use irqsave in cgroup_rstat_flush_locked().
cgroup: add a comment to cgroup_rstat_flush_locked().

Subsystem: kexec

    Jisheng Zhang <jszhang@kernel.org>:
    Patch series "kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef", v2:
      kexec: make crashk_res, crashk_low_res and crash_notes symbols always visible
      riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
      x86/setup: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
      arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef

Subsystem: kdump

    Tiezhu Yang <yangtiezhu@loongson.cn>:
    Patch series "Update doc and fix some issues about kdump", v2:
      docs: kdump: update description about sysfs file system support
      docs: kdump: add scp example to write out the dump file
      panic: unset panic_on_warn inside panic()
      ubsan: no need to unset panic_on_warn in ubsan_epilogue()
      kasan: no need to unset panic_on_warn in end_report()

Subsystem: taskstats

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      taskstats: remove unneeded dead assignment

Subsystem: panic

    "Guilherme G. Piccoli" <gpiccoli@igalia.com>:
    Patch series "Some improvements on panic_print":
      docs: sysctl/kernel: add missing bit to panic_print
      panic: add option to dump all CPUs backtraces in panic_print
      panic: move panic_print before kmsg dumpers

Subsystem: kcov

    Aleksandr Nogikh <nogikh@google.com>:
    Patch series "kcov: improve mmap processing", v3:
      kcov: split ioctl handling into locked and unlocked parts
      kcov: properly handle subsequent mmap calls

Subsystem: resource

    Miaohe Lin <linmiaohe@huawei.com>:
      kernel/resource: fix kfree() of bootmem memory again

Subsystem: ubsan

    Marco Elver <elver@google.com>:
      Revert "ubsan, kcsan: Don't combine sanitizer with kcov on clang"

 Documentation/admin-guide/kdump/kdump.rst       |   10 +
 Documentation/admin-guide/kernel-parameters.txt |    5 
 Documentation/admin-guide/sysctl/kernel.rst     |    2 
 Documentation/dev-tools/sparse.rst              |    2 
 arch/arm64/mm/init.c                            |    9 -
 arch/riscv/mm/init.c                            |    6 -
 arch/x86/kernel/setup.c                         |   10 -
 fs/fat/dir.c                                    |    2 
 fs/minix/inode.c                                |    3 
 fs/pipe.c                                       |   13 +-
 fs/proc/base.c                                  |    8 -
 fs/proc/vmcore.c                                |   43 +++----
 include/linux/bitfield.h                        |    3 
 include/linux/compiler_types.h                  |    3 
 include/linux/init.h                            |   11 +
 include/linux/kexec.h                           |   12 +-
 include/linux/log2.h                            |    4 
 include/linux/stddef.h                          |    6 -
 include/uapi/linux/types.h                      |    6 -
 init/main.c                                     |   14 +-
 kernel/cgroup/rstat.c                           |   13 +-
 kernel/kcov.c                                   |  102 ++++++++---------
 kernel/ksysfs.c                                 |    3 
 kernel/panic.c                                  |   37 ++++--
 kernel/resource.c                               |   41 +-----
 kernel/taskstats.c                              |    5 
 lib/Kconfig.debug                               |  142 ++++++++++++------------
 lib/Kconfig.kcsan                               |   11 -
 lib/Kconfig.ubsan                               |   12 --
 lib/bitmap.c                                    |   24 ++--
 lib/ubsan.c                                     |   10 -
 mm/kasan/report.c                               |   10 -
 scripts/checkpatch.pl                           |   31 ++++-
 tools/include/linux/types.h                     |    5 
 34 files changed, 313 insertions(+), 305 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-03-22 21:38 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-03-22 21:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches


- A few misc subsystems

- There is a lot of MM material in Willy's tree.  Folio work and
  non-folio patches which depended on that work.

  Here I send almost all the MM patches which precede the patches in
  Willy's tree.  The remaining ~100 MM patches are staged on Willy's
  tree and I'll send those along once Willy is merged up.

  I tried this batch against your current tree (as of
  51912904076680281) and a couple need some extra persuasion to apply,
  but all looks OK otherwise.


227 patches, based on f443e374ae131c168a065ea1748feac6b2e76613

Subsystems affected by this patch series:

  kthread
  scripts
  ntfs
  ocfs2
  block
  vfs
  mm/kasan
  mm/pagecache
  mm/gup
  mm/swap
  mm/shmem
  mm/memcg
  mm/selftests
  mm/pagemap
  mm/mremap
  mm/sparsemem
  mm/vmalloc
  mm/pagealloc
  mm/memory-failure
  mm/mlock
  mm/hugetlb
  mm/userfaultfd
  mm/vmscan
  mm/compaction
  mm/mempolicy
  mm/oom-kill
  mm/migration
  mm/thp
  mm/cma
  mm/autonuma
  mm/psi
  mm/ksm
  mm/page-poison
  mm/madvise
  mm/memory-hotplug
  mm/rmap
  mm/zswap
  mm/uaccess
  mm/ioremap
  mm/highmem
  mm/cleanups
  mm/kfence
  mm/hmm
  mm/damon

Subsystem: kthread

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      linux/kthread.h: remove unused macros

Subsystem: scripts

    Colin Ian King <colin.i.king@gmail.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

Subsystem: ntfs

    Dongliang Mu <mudongliangabcd@gmail.com>:
      ntfs: add sanity check on allocation size

Subsystem: ocfs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: cleanup some return variables

    hongnanli <hongnan.li@linux.alibaba.com>:
      fs/ocfs2: fix comments mentioning i_mutex

Subsystem: block

    NeilBrown <neilb@suse.de>:
    Patch series "Remove remaining parts of congestion tracking code", v2:
      doc: convert 'subsection' to 'section' in gfp.h
      mm: document and polish read-ahead code
      mm: improve cleanup when ->readpages doesn't process all pages
      fuse: remove reliance on bdi congestion
      nfs: remove reliance on bdi congestion
      ceph: remove reliance on bdi congestion
      remove inode_congested()
      remove bdi_congested() and wb_congested() and related functions
      f2fs: replace congestion_wait() calls with io_schedule_timeout()
      block/bfq-iosched.c: use "false" rather than "BLK_RW_ASYNC"
      remove congestion tracking framework

Subsystem: vfs

    Anthony Iliopoulos <ailiop@suse.com>:
      mount: warn only once about timestamp range expiration

Subsystem: mm/kasan

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/memremap: avoid calling kasan_remove_zero_shadow() for device private memory

Subsystem: mm/pagecache

    Miaohe Lin <linmiaohe@huawei.com>:
      filemap: remove find_get_pages()
      mm/writeback: minor clean up for highmem_dirtyable_memory

    Minchan Kim <minchan@kernel.org>:
      mm: fs: fix lru_cache_disabled race in bh_lru

Subsystem: mm/gup

    Peter Xu <peterx@redhat.com>:
    Patch series "mm/gup: some cleanups", v5:
      mm: fix invalid page pointer returned with FOLL_PIN gups

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup: follow_pfn_pte(): -EEXIST cleanup
      mm/gup: remove unused pin_user_pages_locked()
      mm: change lookup_node() to use get_user_pages_fast()
      mm/gup: remove unused get_user_pages_locked()

Subsystem: mm/swap

    Bang Li <libang.linuxer@gmail.com>:
      mm/swap: fix confusing comment in folio_mark_accessed

Subsystem: mm/shmem

    Xavier Roche <xavier.roche@algolia.com>:
      tmpfs: support for file creation time

    Hugh Dickins <hughd@google.com>:
      shmem: mapping_set_exiting() to help mapped resilience
      tmpfs: do not allocate pages on read

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: shmem: use helper macro __ATTR_RW

Subsystem: mm/memcg

    Shakeel Butt <shakeelb@google.com>:
      memcg: replace in_interrupt() with !in_task()

    Yosry Ahmed <yosryahmed@google.com>:
      memcg: add per-memcg total kernel memory stat

    Wei Yang <richard.weiyang@gmail.com>:
      mm/memcg: mem_cgroup_per_node is already set to 0 on allocation
      mm/memcg: retrieve parent memcg from css.parent

    Shakeel Butt <shakeelb@google.com>:
    Patch series "memcg: robust enforcement of memory.high", v2:
      memcg: refactor mem_cgroup_oom
      memcg: unify force charging conditions
      selftests: memcg: test high limit for single entry allocation
      memcg: synchronously enforce memory.high for large overcharges

    Randy Dunlap <rdunlap@infradead.org>:
      mm/memcontrol: return 1 from cgroup.memory __setup() handler

    Michal Hocko <mhocko@suse.com>:
    Patch series "mm/memcg: Address PREEMPT_RT problems instead of disabling it", v5:
      mm/memcg: revert ("mm/memcg: optimize user context object stock access")

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/memcg: disable threshold event handlers on PREEMPT_RT
      mm/memcg: protect per-CPU counter by disabling preemption on PREEMPT_RT where needed.

    Johannes Weiner <hannes@cmpxchg.org>:
      mm/memcg: opencode the inner part of obj_cgroup_uncharge_pages() in drain_obj_stock()

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/memcg: protect memcg_stock with a local_lock_t
      mm/memcg: disable migration instead of preemption in drain_all_stock().

    Muchun Song <songmuchun@bytedance.com>:
    Patch series "Optimize list lru memory consumption", v6:
      mm: list_lru: transpose the array of per-node per-memcg lru lists
      mm: introduce kmem_cache_alloc_lru
      fs: introduce alloc_inode_sb() to allocate filesystems specific inode
      fs: allocate inode by using alloc_inode_sb()
      f2fs: allocate inode by using alloc_inode_sb()
      mm: dcache: use kmem_cache_alloc_lru() to allocate dentry
      xarray: use kmem_cache_alloc_lru to allocate xa_node
      mm: memcontrol: move memcg_online_kmem() to mem_cgroup_css_online()
      mm: list_lru: allocate list_lru_one only when needed
      mm: list_lru: rename memcg_drain_all_list_lrus to memcg_reparent_list_lrus
      mm: list_lru: replace linear array with xarray
      mm: memcontrol: reuse memory cgroup ID for kmem ID
      mm: memcontrol: fix cannot alloc the maximum memcg ID
      mm: list_lru: rename list_lru_per_memcg to list_lru_memcg
      mm: memcontrol: rename memcg_cache_id to memcg_kmem_id

    Vasily Averin <vvs@virtuozzo.com>:
      memcg: enable accounting for tty-related objects

Subsystem: mm/selftests

    Guillaume Tucker <guillaume.tucker@collabora.com>:
      selftests, x86: fix how check_cc.sh is being invoked

Subsystem: mm/pagemap

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm: merge pte_mkhuge() call into arch_make_huge_pte()

    Stafford Horne <shorne@gmail.com>:
      mm: remove mmu_gathers storage from remaining architectures

    Muchun Song <songmuchun@bytedance.com>:
    Patch series "Fix some cache flush bugs", v5:
      mm: thp: fix wrong cache flush in remove_migration_pmd()
      mm: fix missing cache flush for all tail pages of compound page
      mm: hugetlb: fix missing cache flush in copy_huge_page_from_user()
      mm: hugetlb: fix missing cache flush in hugetlb_mcopy_atomic_pte()
      mm: shmem: fix missing cache flush in shmem_mfill_atomic_pte()
      mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic()
      mm: replace multiple dcache flush with flush_dcache_folio()

    Peter Xu <peterx@redhat.com>:
    Patch series "mm: Rework zap ptes on swap entries", v5:
      mm: don't skip swap entry even if zap_details specified
      mm: rename zap_skip_check_mapping() to should_zap_page()
      mm: change zap_details.zap_mapping into even_cows
      mm: rework swap handling of zap_pte_range

    Randy Dunlap <rdunlap@infradead.org>:
      mm/mmap: return 1 from stack_guard_gap __setup() handler

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/memory.c: use helper function range_in_vma()
      mm/memory.c: use helper macro min and max in unmap_mapping_range_tree()

    Hugh Dickins <hughd@google.com>:
      mm: _install_special_mapping() apply VM_LOCKED_CLEAR_MASK

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mmap: remove obsolete comment in ksys_mmap_pgoff

Subsystem: mm/mremap

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mremap:: use vma_lookup() instead of find_vma()

Subsystem: mm/sparsemem

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/sparse: make mminit_validate_memmodel_limits() static

Subsystem: mm/vmalloc

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/vmalloc: remove unneeded function forward declaration

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: Move draining areas out of caller context

    Uladzislau Rezki <uladzislau.rezki@sony.com>:
      mm/vmalloc: add adjust_search_size parameter

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: eliminate an extra orig_gfp_mask

    Jiapeng Chong <jiapeng.chong@linux.alibaba.com>:
      mm/vmalloc.c: fix "unused function" warning

    Bang Li <libang.linuxer@gmail.com>:
      mm/vmalloc: fix comments about vmap_area struct

Subsystem: mm/pagealloc

    Zi Yan <ziy@nvidia.com>:
      mm: page_alloc: avoid merging non-fallbackable pageblocks with others

    Peter Collingbourne <pcc@google.com>:
      mm/mmzone.c: use try_cmpxchg() in page_cpupid_xchg_last()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mmzone.h: remove unused macros

    Nicolas Saenz Julienne <nsaenzju@redhat.com>:
      mm/page_alloc: don't pass pfn to free_unref_page_commit()

    David Hildenbrand <david@redhat.com>:
    Patch series "mm: enforce pageblock_order < MAX_ORDER":
      cma: factor out minimum alignment requirement
      mm: enforce pageblock_order < MAX_ORDER

    Nathan Chancellor <nathan@kernel.org>:
      mm/page_alloc: mark pagesets as __maybe_unused

    Alistair Popple <apopple@nvidia.com>:
      mm/pages_alloc.c: don't create ZONE_MOVABLE beyond the end of a node

    Mel Gorman <mgorman@techsingularity.net>:
    Patch series "Follow-up on high-order PCP caching", v2:
      mm/page_alloc: fetch the correct pcp buddy during bulk free
      mm/page_alloc: track range of active PCP lists during bulk free
      mm/page_alloc: simplify how many pages are selected per pcp list during bulk free
      mm/page_alloc: drain the requested list first during bulk free
      mm/page_alloc: free pages in a single pass during bulk free
      mm/page_alloc: limit number of high-order pages on PCP during bulk free
      mm/page_alloc: do not prefetch buddies during bulk free

    Oscar Salvador <osalvador@suse.de>:
      arch/x86/mm/numa: Do not initialize nodes twice

    Suren Baghdasaryan <surenb@google.com>:
      mm: count time in drain_all_pages during direct reclaim as memory pressure

    Eric Dumazet <edumazet@google.com>:
      mm/page_alloc: call check_new_pages() while zone spinlock is not held

    Mel Gorman <mgorman@techsingularity.net>:
      mm/page_alloc: check high-order pages for corruption during PCP operations

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm/memory-failure.c: remove obsolete comment
      mm/hwpoison: fix error page recovered but reported "not recovered"

    Rik van Riel <riel@surriel.com>:
      mm: invalidate hwpoison page cache page in fault path

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "A few cleanup and fixup patches for memory failure", v3:
      mm/memory-failure.c: minor clean up for memory_failure_dev_pagemap
      mm/memory-failure.c: catch unexpected -EFAULT from vma_address()
      mm/memory-failure.c: rework the signaling logic in kill_proc
      mm/memory-failure.c: fix race with changing page more robustly
      mm/memory-failure.c: remove PageSlab check in hwpoison_filter_dev
      mm/memory-failure.c: rework the try_to_unmap logic in hwpoison_user_mappings()
      mm/memory-failure.c: remove obsolete comment in __soft_offline_page
      mm/memory-failure.c: remove unnecessary PageTransTail check
      mm/hwpoison-inject: support injecting hwpoison to free page

    luofei <luofei@unicloud.com>:
      mm/hwpoison: avoid the impact of hwpoison_filter() return value on mce handler
      mm/hwpoison: add in-use hugepage hwpoison filter judgement

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "A few fixup patches for memory failure", v2:
      mm/memory-failure.c: fix race with changing page compound again
      mm/memory-failure.c: avoid calling invalidate_inode_page() with unexpected pages
      mm/memory-failure.c: make non-LRU movable pages unhandlable

    Vlastimil Babka <vbabka@suse.cz>:
      mm, fault-injection: declare should_fail_alloc_page()

Subsystem: mm/mlock

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mlock: fix potential imbalanced rlimit ucounts adjustment

Subsystem: mm/hugetlb

    Muchun Song <songmuchun@bytedance.com>:
    Patch series "Free the 2nd vmemmap page associated with each HugeTLB page", v7:
      mm: hugetlb: free the 2nd vmemmap page associated with each HugeTLB page
      mm: hugetlb: replace hugetlb_free_vmemmap_enabled with a static_key
      mm: sparsemem: use page table lock to protect kernel pmd operations
      selftests: vm: add a hugetlb test case
      mm: sparsemem: move vmemmap related to HugeTLB to CONFIG_HUGETLB_PAGE_FREE_VMEMMAP

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/hugetlb: generalize ARCH_WANT_GENERAL_HUGETLB

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: clean up potential spectre issue warnings

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hugetlb: use helper macro __ATTR_RW

    David Howells <dhowells@redhat.com>:
      mm/hugetlb.c: export PageHeadHuge()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: remove unneeded local variable follflags

Subsystem: mm/userfaultfd

    Nadav Amit <namit@vmware.com>:
      userfaultfd: provide unmasked address on page-fault

    Guo Zhengkui <guozhengkui@vivo.com>:
      userfaultfd/selftests: fix uninitialized_var.cocci warning

Subsystem: mm/vmscan

    Hugh Dickins <hughd@google.com>:
      mm/fs: delete PF_SWAPWRITE
      mm: __isolate_lru_page_prepare() in isolate_migratepages_block()

    Waiman Long <longman@redhat.com>:
      mm/list_lru: optimize memcg_reparent_list_lru_node()

    Marcelo Tosatti <mtosatti@redhat.com>:
      mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm: workingset: replace IRQ-off check with a lockdep assert.

    Charan Teja Kalla <quic_charante@quicinc.com>:
      mm: vmscan: fix documentation for page_check_references()

Subsystem: mm/compaction

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm: compaction: cleanup the compaction trace events

Subsystem: mm/mempolicy

    Hugh Dickins <hughd@google.com>:
      mempolicy: mbind_range() set_policy() after vma_merge()

Subsystem: mm/oom-kill

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/oom_kill: remove unneeded is_memcg_oom check

Subsystem: mm/migration

    Huang Ying <ying.huang@intel.com>:
      mm,migrate: fix establishing demotion target

    "andrew.yang" <andrew.yang@mediatek.com>:
      mm/migrate: fix race between lock page and clear PG_Isolated

Subsystem: mm/thp

    Hugh Dickins <hughd@google.com>:
      mm/thp: refix __split_huge_pmd_locked() for migration PMD

Subsystem: mm/cma

    Hari Bathini <hbathini@linux.ibm.com>:
    Patch series "powerpc/fadump: handle CMA activation failure appropriately", v3:
      mm/cma: provide option to opt out from exposing pages on activation failure
      powerpc/fadump: opt out from freeing pages on cma activation failure

Subsystem: mm/autonuma

    Huang Ying <ying.huang@intel.com>:
    Patch series "NUMA balancing: optimize memory placement for memory tiering system", v13:
      NUMA Balancing: add page promotion counter
      NUMA balancing: optimize page placement for memory tiering system
      memory tiering: skip to scan fast memory

Subsystem: mm/psi

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: page_io: fix psi memory pressure error on cold swapins

Subsystem: mm/ksm

    Yang Yang <yang.yang29@zte.com.cn>:
      mm/vmstat: add event for ksm swapping in copy

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/ksm: use helper macro __ATTR_RW

Subsystem: mm/page-poison

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/hwpoison: check the subpage, not the head page

Subsystem: mm/madvise

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/madvise: use vma_lookup() instead of find_vma()

    Charan Teja Kalla <quic_charante@quicinc.com>:
    Patch series "mm: madvise: return correct bytes processed with:
      mm: madvise: return correct bytes advised with process_madvise
      mm: madvise: skip unmapped vma holes passed to process_madvise

Subsystem: mm/memory-hotplug

    Michal Hocko <mhocko@suse.com>:
    Patch series "mm, memory_hotplug: handle unitialized numa node gracefully":
      mm, memory_hotplug: make arch_alloc_nodedata independent on CONFIG_MEMORY_HOTPLUG
      mm: handle uninitialized numa nodes gracefully
      mm, memory_hotplug: drop arch_free_nodedata
      mm, memory_hotplug: reorganize new pgdat initialization
      mm: make free_area_init_node aware of memory less nodes

    Wei Yang <richard.weiyang@gmail.com>:
      memcg: do not tweak node in alloc_mem_cgroup_per_node_info

    David Hildenbrand <david@redhat.com>:
      drivers/base/memory: add memory block to memory group after registration succeeded
      drivers/base/node: consolidate node device subsystem initialization in node_dev_init()

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "A few cleanup patches around memory_hotplug":
      mm/memory_hotplug: remove obsolete comment of __add_pages
      mm/memory_hotplug: avoid calling zone_intersects() for ZONE_NORMAL
      mm/memory_hotplug: clean up try_offline_node
      mm/memory_hotplug: fix misplaced comment in offline_pages

    David Hildenbrand <david@redhat.com>:
    Patch series "drivers/base/memory: determine and store zone for single-zone memory blocks", v2:
      drivers/base/node: rename link_mem_sections() to register_memory_block_under_node()
      drivers/base/memory: determine and store zone for single-zone memory blocks
      drivers/base/memory: clarify adding and removing of memory blocks

    Oscar Salvador <osalvador@suse.de>:
      mm: only re-generate demotion targets when a numa node changes its N_CPU state

Subsystem: mm/rmap

    Hugh Dickins <hughd@google.com>:
      mm/thp: ClearPageDoubleMap in first page_add_file_rmap()

Subsystem: mm/zswap

    "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>:
      mm/zswap.c: allow handling just same-value filled pages

Subsystem: mm/uaccess

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm: remove usercopy_warn()
      mm: uninline copy_overflow()

    Randy Dunlap <rdunlap@infradead.org>:
      mm/usercopy: return 1 from hardened_usercopy __setup() handler

Subsystem: mm/ioremap

    Vlastimil Babka <vbabka@suse.cz>:
      mm/early_ioremap: declare early_memremap_pgprot_adjust()

Subsystem: mm/highmem

    Ira Weiny <ira.weiny@intel.com>:
      highmem: document kunmap_local()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/highmem: remove unnecessary done label

Subsystem: mm/cleanups

    "Dr. David Alan Gilbert" <linux@treblig.org>:
      mm/page_table_check.c: use strtobool for param parsing

Subsystem: mm/kfence

    tangmeng <tangmeng@uniontech.com>:
      mm/kfence: remove unnecessary CONFIG_KFENCE option

    Tianchen Ding <dtcccc@linux.alibaba.com>:
    Patch series "provide the flexibility to enable KFENCE", v3:
      kfence: allow re-enabling KFENCE after system startup
      kfence: alloc kfence_pool after system startup

    Peng Liu <liupeng256@huawei.com>:
    Patch series "kunit: fix a UAF bug and do some optimization", v2:
      kunit: fix UAF when run kfence test case test_gfpzero
      kunit: make kunit_test_timeout compatible with comment
      kfence: test: try to avoid test_gfpzero trigger rcu_stall

    Marco Elver <elver@google.com>:
      kfence: allow use of a deferrable timer

Subsystem: mm/hmm

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hmm.c: remove unneeded local variable ret

Subsystem: mm/damon

    SeongJae Park <sj@kernel.org>:
    Patch series "Remove the type-unclear target id concept":
      mm/damon/dbgfs/init_regions: use target index instead of target id
      Docs/admin-guide/mm/damon/usage: update for changed initail_regions file input
      mm/damon/core: move damon_set_targets() into dbgfs
      mm/damon: remove the target id concept

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm/damon: remove redundant page validation

    SeongJae Park <sj@kernel.org>:
    Patch series "Allow DAMON user code independent of monitoring primitives":
      mm/damon: rename damon_primitives to damon_operations
      mm/damon: let monitoring operations can be registered and selected
      mm/damon/paddr,vaddr: register themselves to DAMON in subsys_initcall
      mm/damon/reclaim: use damon_select_ops() instead of damon_{v,p}a_set_operations()
      mm/damon/dbgfs: use damon_select_ops() instead of damon_{v,p}a_set_operations()
      mm/damon/dbgfs: use operations id for knowing if the target has pid
      mm/damon/dbgfs-test: fix is_target_id() change
      mm/damon/paddr,vaddr: remove damon_{p,v}a_{target_valid,set_operations}()

    tangmeng <tangmeng@uniontech.com>:
      mm/damon: remove unnecessary CONFIG_DAMON option

    SeongJae Park <sj@kernel.org>:
    Patch series "Docs/damon: Update documents for better consistency":
      Docs/vm/damon: call low level monitoring primitives the operations
      Docs/vm/damon/design: update DAMON-Idle Page Tracking interference handling
      Docs/damon: update outdated term 'regions update interval'
    Patch series "Introduce DAMON sysfs interface", v3:
      mm/damon/core: allow non-exclusive DAMON start/stop
      mm/damon/core: add number of each enum type values
      mm/damon: implement a minimal stub for sysfs-based DAMON interface
      mm/damon/sysfs: link DAMON for virtual address spaces monitoring
      mm/damon/sysfs: support the physical address space monitoring
      mm/damon/sysfs: support DAMON-based Operation Schemes
      mm/damon/sysfs: support DAMOS quotas
      mm/damon/sysfs: support schemes prioritization
      mm/damon/sysfs: support DAMOS watermarks
      mm/damon/sysfs: support DAMOS stats
      selftests/damon: add a test for DAMON sysfs interface
      Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface
      Docs/ABI/testing: add DAMON sysfs interface ABI document

    Xin Hao <xhao@linux.alibaba.com>:
      mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release()

 Documentation/ABI/testing/sysfs-kernel-mm-damon  |  274 ++
 Documentation/admin-guide/cgroup-v1/memory.rst   |    2 
 Documentation/admin-guide/cgroup-v2.rst          |    5 
 Documentation/admin-guide/kernel-parameters.txt  |    2 
 Documentation/admin-guide/mm/damon/usage.rst     |  380 +++
 Documentation/admin-guide/mm/zswap.rst           |   22 
 Documentation/admin-guide/sysctl/kernel.rst      |   31 
 Documentation/core-api/mm-api.rst                |   19 
 Documentation/dev-tools/kfence.rst               |   12 
 Documentation/filesystems/porting.rst            |    6 
 Documentation/filesystems/vfs.rst                |   16 
 Documentation/vm/damon/design.rst                |   43 
 Documentation/vm/damon/faq.rst                   |    2 
 MAINTAINERS                                      |    1 
 arch/arm/Kconfig                                 |    4 
 arch/arm64/kernel/setup.c                        |    3 
 arch/arm64/mm/hugetlbpage.c                      |    1 
 arch/hexagon/mm/init.c                           |    2 
 arch/ia64/kernel/topology.c                      |   10 
 arch/ia64/mm/discontig.c                         |   11 
 arch/mips/kernel/topology.c                      |    5 
 arch/nds32/mm/init.c                             |    1 
 arch/openrisc/mm/init.c                          |    2 
 arch/powerpc/include/asm/fadump-internal.h       |    5 
 arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h |    4 
 arch/powerpc/kernel/fadump.c                     |    8 
 arch/powerpc/kernel/sysfs.c                      |   17 
 arch/riscv/Kconfig                               |    4 
 arch/riscv/kernel/setup.c                        |    3 
 arch/s390/kernel/numa.c                          |    7 
 arch/sh/kernel/topology.c                        |    5 
 arch/sparc/kernel/sysfs.c                        |   12 
 arch/sparc/mm/hugetlbpage.c                      |    1 
 arch/x86/Kconfig                                 |    4 
 arch/x86/kernel/cpu/mce/core.c                   |    8 
 arch/x86/kernel/topology.c                       |    5 
 arch/x86/mm/numa.c                               |   33 
 block/bdev.c                                     |    2 
 block/bfq-iosched.c                              |    2 
 drivers/base/init.c                              |    1 
 drivers/base/memory.c                            |  149 +
 drivers/base/node.c                              |   48 
 drivers/block/drbd/drbd_int.h                    |    3 
 drivers/block/drbd/drbd_req.c                    |    3 
 drivers/dax/super.c                              |    2 
 drivers/of/of_reserved_mem.c                     |    9 
 drivers/tty/tty_io.c                             |    2 
 drivers/virtio/virtio_mem.c                      |    9 
 fs/9p/vfs_inode.c                                |    2 
 fs/adfs/super.c                                  |    2 
 fs/affs/super.c                                  |    2 
 fs/afs/super.c                                   |    2 
 fs/befs/linuxvfs.c                               |    2 
 fs/bfs/inode.c                                   |    2 
 fs/btrfs/inode.c                                 |    2 
 fs/buffer.c                                      |    8 
 fs/ceph/addr.c                                   |   22 
 fs/ceph/inode.c                                  |    2 
 fs/ceph/super.c                                  |    1 
 fs/ceph/super.h                                  |    1 
 fs/cifs/cifsfs.c                                 |    2 
 fs/coda/inode.c                                  |    2 
 fs/dcache.c                                      |    3 
 fs/ecryptfs/super.c                              |    2 
 fs/efs/super.c                                   |    2 
 fs/erofs/super.c                                 |    2 
 fs/exfat/super.c                                 |    2 
 fs/ext2/ialloc.c                                 |    5 
 fs/ext2/super.c                                  |    2 
 fs/ext4/super.c                                  |    2 
 fs/f2fs/compress.c                               |    4 
 fs/f2fs/data.c                                   |    3 
 fs/f2fs/f2fs.h                                   |    6 
 fs/f2fs/segment.c                                |    8 
 fs/f2fs/super.c                                  |   14 
 fs/fat/inode.c                                   |    2 
 fs/freevxfs/vxfs_super.c                         |    2 
 fs/fs-writeback.c                                |   40 
 fs/fuse/control.c                                |   17 
 fs/fuse/dev.c                                    |    8 
 fs/fuse/file.c                                   |   17 
 fs/fuse/inode.c                                  |    2 
 fs/gfs2/super.c                                  |    2 
 fs/hfs/super.c                                   |    2 
 fs/hfsplus/super.c                               |    2 
 fs/hostfs/hostfs_kern.c                          |    2 
 fs/hpfs/super.c                                  |    2 
 fs/hugetlbfs/inode.c                             |    2 
 fs/inode.c                                       |    2 
 fs/isofs/inode.c                                 |    2 
 fs/jffs2/super.c                                 |    2 
 fs/jfs/super.c                                   |    2 
 fs/minix/inode.c                                 |    2 
 fs/namespace.c                                   |    2 
 fs/nfs/inode.c                                   |    2 
 fs/nfs/write.c                                   |   14 
 fs/nilfs2/segbuf.c                               |   16 
 fs/nilfs2/super.c                                |    2 
 fs/ntfs/inode.c                                  |    6 
 fs/ntfs3/super.c                                 |    2 
 fs/ocfs2/alloc.c                                 |    2 
 fs/ocfs2/aops.c                                  |    2 
 fs/ocfs2/cluster/nodemanager.c                   |    2 
 fs/ocfs2/dir.c                                   |    4 
 fs/ocfs2/dlmfs/dlmfs.c                           |    2 
 fs/ocfs2/file.c                                  |   13 
 fs/ocfs2/inode.c                                 |    2 
 fs/ocfs2/localalloc.c                            |    6 
 fs/ocfs2/namei.c                                 |    2 
 fs/ocfs2/ocfs2.h                                 |    4 
 fs/ocfs2/quota_global.c                          |    2 
 fs/ocfs2/stack_user.c                            |   18 
 fs/ocfs2/super.c                                 |    2 
 fs/ocfs2/xattr.c                                 |    2 
 fs/openpromfs/inode.c                            |    2 
 fs/orangefs/super.c                              |    2 
 fs/overlayfs/super.c                             |    2 
 fs/proc/inode.c                                  |    2 
 fs/qnx4/inode.c                                  |    2 
 fs/qnx6/inode.c                                  |    2 
 fs/reiserfs/super.c                              |    2 
 fs/romfs/super.c                                 |    2 
 fs/squashfs/super.c                              |    2 
 fs/sysv/inode.c                                  |    2 
 fs/ubifs/super.c                                 |    2 
 fs/udf/super.c                                   |    2 
 fs/ufs/super.c                                   |    2 
 fs/userfaultfd.c                                 |    5 
 fs/vboxsf/super.c                                |    2 
 fs/xfs/libxfs/xfs_btree.c                        |    2 
 fs/xfs/xfs_buf.c                                 |    3 
 fs/xfs/xfs_icache.c                              |    2 
 fs/zonefs/super.c                                |    2 
 include/linux/backing-dev-defs.h                 |    8 
 include/linux/backing-dev.h                      |   50 
 include/linux/cma.h                              |   14 
 include/linux/damon.h                            |   95 
 include/linux/fault-inject.h                     |    2 
 include/linux/fs.h                               |   21 
 include/linux/gfp.h                              |   10 
 include/linux/highmem-internal.h                 |   10 
 include/linux/hugetlb.h                          |    8 
 include/linux/kthread.h                          |   22 
 include/linux/list_lru.h                         |   45 
 include/linux/memcontrol.h                       |   46 
 include/linux/memory.h                           |   12 
 include/linux/memory_hotplug.h                   |  132 -
 include/linux/migrate.h                          |    8 
 include/linux/mm.h                               |   11 
 include/linux/mmzone.h                           |   22 
 include/linux/nfs_fs_sb.h                        |    1 
 include/linux/node.h                             |   25 
 include/linux/page-flags.h                       |   96 
 include/linux/pageblock-flags.h                  |    7 
 include/linux/pagemap.h                          |    7 
 include/linux/sched.h                            |    1 
 include/linux/sched/sysctl.h                     |   10 
 include/linux/shmem_fs.h                         |    1 
 include/linux/slab.h                             |    3 
 include/linux/swap.h                             |    6 
 include/linux/thread_info.h                      |    5 
 include/linux/uaccess.h                          |    2 
 include/linux/vm_event_item.h                    |    3 
 include/linux/vmalloc.h                          |    4 
 include/linux/xarray.h                           |    9 
 include/ras/ras_event.h                          |    1 
 include/trace/events/compaction.h                |   26 
 include/trace/events/writeback.h                 |   28 
 include/uapi/linux/userfaultfd.h                 |    8 
 ipc/mqueue.c                                     |    2 
 kernel/dma/contiguous.c                          |    4 
 kernel/sched/core.c                              |   21 
 kernel/sysctl.c                                  |    2 
 lib/Kconfig.kfence                               |   12 
 lib/kunit/try-catch.c                            |    3 
 lib/xarray.c                                     |   10 
 mm/Kconfig                                       |    6 
 mm/backing-dev.c                                 |   57 
 mm/cma.c                                         |   31 
 mm/cma.h                                         |    1 
 mm/compaction.c                                  |   60 
 mm/damon/Kconfig                                 |   19 
 mm/damon/Makefile                                |    7 
 mm/damon/core-test.h                             |   23 
 mm/damon/core.c                                  |  190 +
 mm/damon/dbgfs-test.h                            |  103 
 mm/damon/dbgfs.c                                 |  264 +-
 mm/damon/ops-common.c                            |  133 +
 mm/damon/ops-common.h                            |   16 
 mm/damon/paddr.c                                 |   62 
 mm/damon/prmtv-common.c                          |  133 -
 mm/damon/prmtv-common.h                          |   16 
 mm/damon/reclaim.c                               |   11 
 mm/damon/sysfs.c                                 | 2632 ++++++++++++++++++++++-
 mm/damon/vaddr-test.h                            |    8 
 mm/damon/vaddr.c                                 |   67 
 mm/early_ioremap.c                               |    1 
 mm/fadvise.c                                     |    5 
 mm/filemap.c                                     |   17 
 mm/gup.c                                         |  103 
 mm/highmem.c                                     |    9 
 mm/hmm.c                                         |    3 
 mm/huge_memory.c                                 |   41 
 mm/hugetlb.c                                     |   23 
 mm/hugetlb_vmemmap.c                             |   74 
 mm/hwpoison-inject.c                             |    7 
 mm/internal.h                                    |   19 
 mm/kfence/Makefile                               |    2 
 mm/kfence/core.c                                 |  147 +
 mm/kfence/kfence_test.c                          |    3 
 mm/ksm.c                                         |    6 
 mm/list_lru.c                                    |  690 ++----
 mm/maccess.c                                     |    6 
 mm/madvise.c                                     |   18 
 mm/memcontrol.c                                  |  549 ++--
 mm/memory-failure.c                              |  148 -
 mm/memory.c                                      |  116 -
 mm/memory_hotplug.c                              |  136 -
 mm/mempolicy.c                                   |   29 
 mm/memremap.c                                    |    3 
 mm/migrate.c                                     |  128 -
 mm/mlock.c                                       |    1 
 mm/mmap.c                                        |    5 
 mm/mmzone.c                                      |    7 
 mm/mprotect.c                                    |   13 
 mm/mremap.c                                      |    4 
 mm/oom_kill.c                                    |    3 
 mm/page-writeback.c                              |   12 
 mm/page_alloc.c                                  |  429 +--
 mm/page_io.c                                     |    7 
 mm/page_table_check.c                            |   10 
 mm/ptdump.c                                      |   16 
 mm/readahead.c                                   |  124 +
 mm/rmap.c                                        |   15 
 mm/shmem.c                                       |   46 
 mm/slab.c                                        |   39 
 mm/slab.h                                        |   25 
 mm/slob.c                                        |    6 
 mm/slub.c                                        |   42 
 mm/sparse-vmemmap.c                              |   70 
 mm/sparse.c                                      |    2 
 mm/swap.c                                        |   25 
 mm/swapfile.c                                    |    1 
 mm/usercopy.c                                    |   16 
 mm/userfaultfd.c                                 |    3 
 mm/vmalloc.c                                     |  102 
 mm/vmscan.c                                      |  138 -
 mm/vmstat.c                                      |   19 
 mm/workingset.c                                  |    7 
 mm/zswap.c                                       |   15 
 net/socket.c                                     |    2 
 net/sunrpc/rpc_pipe.c                            |    2 
 scripts/spelling.txt                             |   16 
 tools/testing/selftests/cgroup/cgroup_util.c     |   15 
 tools/testing/selftests/cgroup/cgroup_util.h     |    1 
 tools/testing/selftests/cgroup/test_memcontrol.c |   78 
 tools/testing/selftests/damon/Makefile           |    1 
 tools/testing/selftests/damon/sysfs.sh           |  306 ++
 tools/testing/selftests/vm/.gitignore            |    1 
 tools/testing/selftests/vm/Makefile              |    7 
 tools/testing/selftests/vm/hugepage-vmemmap.c    |  144 +
 tools/testing/selftests/vm/run_vmtests.sh        |   11 
 tools/testing/selftests/vm/userfaultfd.c         |    2 
 tools/testing/selftests/x86/Makefile             |    6 
 264 files changed, 7205 insertions(+), 3090 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-03-16 23:14 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-03-16 23:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm, patches

4 patches, based on 56e337f2cf1326323844927a04e9dbce9a244835.

Subsystems affected by this patch series:

  mm/swap
  kconfig
  ocfs2
  selftests

Subsystem: mm/swap

    Guo Ziliang <guo.ziliang@zte.com.cn>:
      mm: swap: get rid of deadloop in swapin readahead

Subsystem: kconfig

    Qian Cai <quic_qiancai@quicinc.com>:
      configs/debug: restore DEBUG_INFO=y for overriding

Subsystem: ocfs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: fix crash when initialize filecheck kobj fails

Subsystem: selftests

    Yosry Ahmed <yosryahmed@google.com>:
      selftests: vm: fix clang build error multiple output files

 fs/ocfs2/super.c                    |   22 +++++++++++-----------
 kernel/configs/debug.config         |    1 +
 mm/swap_state.c                     |    2 +-
 tools/testing/selftests/vm/Makefile |    6 ++----
 4 files changed, 15 insertions(+), 16 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-03-05  4:28 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-03-05  4:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm, patches

8 patches, based on 07ebd38a0da24d2534da57b4841346379db9f354.

Subsystems affected by this patch series:

  mm/hugetlb
  mm/pagemap
  memfd
  selftests
  mm/userfaultfd
  kconfig

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      selftests/vm: cleanup hugetlb file after mremap test

Subsystem: mm/pagemap

    Suren Baghdasaryan <surenb@google.com>:
      mm: refactor vm_area_struct::anon_vma_name usage code
      mm: prevent vm_area_struct::anon_name refcount saturation
      mm: fix use-after-free when anon vma name is used after vma is freed

Subsystem: memfd

    Hugh Dickins <hughd@google.com>:
      memfd: fix F_SEAL_WRITE after shmem huge page allocated

Subsystem: selftests

    Chengming Zhou <zhouchengming@bytedance.com>:
      kselftest/vm: fix tests build with old libc

Subsystem: mm/userfaultfd

    Yun Zhou <yun.zhou@windriver.com>:
      proc: fix documentation and description of pagemap

Subsystem: kconfig

    Qian Cai <quic_qiancai@quicinc.com>:
      configs/debug: set CONFIG_DEBUG_INFO=y properly

 Documentation/admin-guide/mm/pagemap.rst     |    2 
 fs/proc/task_mmu.c                           |    9 +-
 fs/userfaultfd.c                             |    6 -
 include/linux/mm.h                           |    7 +
 include/linux/mm_inline.h                    |  105 ++++++++++++++++++---------
 include/linux/mm_types.h                     |    5 +
 kernel/configs/debug.config                  |    2 
 kernel/fork.c                                |    4 -
 kernel/sys.c                                 |   19 +++-
 mm/madvise.c                                 |   98 +++++++++----------------
 mm/memfd.c                                   |   40 +++++++---
 mm/mempolicy.c                               |    2 
 mm/mlock.c                                   |    2 
 mm/mmap.c                                    |   12 +--
 mm/mprotect.c                                |    2 
 tools/testing/selftests/vm/hugepage-mremap.c |   26 ++++--
 tools/testing/selftests/vm/run_vmtests.sh    |    3 
 tools/testing/selftests/vm/userfaultfd.c     |    1 
 18 files changed, 201 insertions(+), 144 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-02-26  3:10 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-02-26  3:10 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm, patches

12 patches, based on c47658311d60be064b839f329c0e4d34f5f0735b.

Subsystems affected by this patch series:

  MAINTAINERS
  mm/hugetlb
  mm/kasan
  mm/hugetlbfs
  mm/pagemap
  mm/selftests
  mm/memcg
  m/slab
  mailmap
  memfd

Subsystem: MAINTAINERS

    Luis Chamberlain <mcgrof@kernel.org>:
      MAINTAINERS: add sysctl-next git tree

Subsystem: mm/hugetlb

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm/hugetlb: fix kernel crash with hugetlb mremap

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: test: prevent cache merging in kmem_cache_double_destroy

Subsystem: mm/hugetlbfs

    Liu Yuntao <liuyuntao10@huawei.com>:
      hugetlbfs: fix a truncation issue in hugepages parameter

Subsystem: mm/pagemap

    Suren Baghdasaryan <surenb@google.com>:
      mm: fix use-after-free bug when mm->mmap is reused after being freed

Subsystem: mm/selftests

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      selftest/vm: fix map_fixed_noreplace test failure

Subsystem: mm/memcg

    Roman Gushchin <roman.gushchin@linux.dev>:
      MAINTAINERS: add Roman as a memcg co-maintainer

    Vladimir Davydov <vdavydov.dev@gmail.com>:
      MAINTAINERS: remove Vladimir from memcg maintainers

    Shakeel Butt <shakeelb@google.com>:
      MAINTAINERS: add Shakeel as a memcg co-maintainer

Subsystem: m/slab

    Vlastimil Babka <vbabka@suse.cz>:
      MAINTAINERS, SLAB: add Roman as reviewer, git tree

Subsystem: mailmap

    Roman Gushchin <roman.gushchin@linux.dev>:
      mailmap: update Roman Gushchin's email

Subsystem: memfd

    Mike Kravetz <mike.kravetz@oracle.com>:
      selftests/memfd: clean up mapping in mfd_fail_write

 .mailmap                                         |    3 +
 MAINTAINERS                                      |    6 ++
 lib/test_kasan.c                                 |    5 +-
 mm/hugetlb.c                                     |   11 ++---
 mm/mmap.c                                        |    1 
 tools/testing/selftests/memfd/memfd_test.c       |    1 
 tools/testing/selftests/vm/map_fixed_noreplace.c |   49 +++++++++++++++++------
 7 files changed, 56 insertions(+), 20 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2022-02-12  2:02 ` incoming Linus Torvalds
@ 2022-02-12  5:24   ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-02-12  5:24 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-MM, mm-commits, patches

On Fri, 11 Feb 2022 18:02:53 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Fri, Feb 11, 2022 at 4:27 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > 5 patches, based on f1baf68e1383f6ed93eb9cff2866d46562607a43.
> 
> So this *completely* flummoxed 'b4', because you first sent the wrong
> series, and then sent the right one in the same thread.
> 
> I fetched the emails  manually, but honestly, this was confusing even
> then, with two "[PATCH x/5]" series where the only way to tell the
> right one was basically by date of email. They did arrive in the same
> order in my mailbox, but even that wouldn't have been guaranteed if
> there had been some mailer delays somewhere..

Yes, I wondered.  Sorry bout that.

> So next time when you mess up, resend it all as a completely new
> series and completely new threading - so with a new header email too.
> Please?

Wilco.

> And since I'm here, let me just verify that yes, the series you
> actually want me to apply is this one (as described by the head
> email):
> 
>   Subject: [patch 1/5] fs/binfmt_elf: fix PT_LOAD p_align values ..
>   Subject: [patch 2/5] fs/proc: task_mmu.c: don't read mapcount f..
>   Subject: [patch 3/5] mm: vmscan: remove deadlock due to throttl..
>   Subject: [patch 4/5] mm: memcg: synchronize objcg lists with a ..
>   Subject: [patch 5/5] kfence: make test case compatible with run..
> 
> and not the other one with GUP patches?

Those are the ones.  Five fixes, three with cc:stable.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2022-02-12  0:27 incoming Andrew Morton
@ 2022-02-12  2:02 ` Linus Torvalds
  2022-02-12  5:24   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2022-02-12  2:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits, patches

On Fri, Feb 11, 2022 at 4:27 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> 5 patches, based on f1baf68e1383f6ed93eb9cff2866d46562607a43.

So this *completely* flummoxed 'b4', because you first sent the wrong
series, and then sent the right one in the same thread.

I fetched the emails  manually, but honestly, this was confusing even
then, with two "[PATCH x/5]" series where the only way to tell the
right one was basically by date of email. They did arrive in the same
order in my mailbox, but even that wouldn't have been guaranteed if
there had been some mailer delays somewhere..

So next time when you mess up, resend it all as a completely new
series and completely new threading - so with a new header email too.
Please?

And since I'm here, let me just verify that yes, the series you
actually want me to apply is this one (as described by the head
email):

  Subject: [patch 1/5] fs/binfmt_elf: fix PT_LOAD p_align values ..
  Subject: [patch 2/5] fs/proc: task_mmu.c: don't read mapcount f..
  Subject: [patch 3/5] mm: vmscan: remove deadlock due to throttl..
  Subject: [patch 4/5] mm: memcg: synchronize objcg lists with a ..
  Subject: [patch 5/5] kfence: make test case compatible with run..

and not the other one with GUP patches?

             Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-02-12  0:27 Andrew Morton
  2022-02-12  2:02 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2022-02-12  0:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits, patches

5 patches, based on f1baf68e1383f6ed93eb9cff2866d46562607a43.

Subsystems affected by this patch series:

  binfmt
  procfs
  mm/vmscan
  mm/memcg
  mm/kfence

Subsystem: binfmt

    Mike Rapoport <rppt@linux.ibm.com>:
      fs/binfmt_elf: fix PT_LOAD p_align values for loaders

Subsystem: procfs

    Yang Shi <shy828301@gmail.com>:
      fs/proc: task_mmu.c: don't read mapcount for migration entry

Subsystem: mm/vmscan

    Mel Gorman <mgorman@suse.de>:
      mm: vmscan: remove deadlock due to throttling failing to make progress

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm: memcg: synchronize objcg lists with a dedicated spinlock

Subsystem: mm/kfence

    Peng Liu <liupeng256@huawei.com>:
      kfence: make test case compatible with run time set sample interval

 fs/binfmt_elf.c            |    2 +-
 fs/proc/task_mmu.c         |   40 +++++++++++++++++++++++++++++++---------
 include/linux/kfence.h     |    2 ++
 include/linux/memcontrol.h |    5 +++--
 mm/kfence/core.c           |    3 ++-
 mm/kfence/kfence_test.c    |    8 ++++----
 mm/memcontrol.c            |   10 +++++-----
 mm/vmscan.c                |    4 +++-
 8 files changed, 51 insertions(+), 23 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-02-04  4:48 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-02-04  4:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

10 patches, based on 1f2cfdd349b7647f438c1e552dc1b983da86d830.

Subsystems affected by this patch series:

  mm/vmscan
  mm/debug
  mm/pagemap
  ipc
  mm/kmemleak
  MAINTAINERS
  mm/selftests

Subsystem: mm/vmscan

    Chen Wandun <chenwandun@huawei.com>:
      Revert "mm/page_isolation: unset migratetype directly for non Buddy page"

Subsystem: mm/debug

    Pasha Tatashin <pasha.tatashin@soleen.com>:
    Patch series "page table check fixes and cleanups", v5:
      mm/debug_vm_pgtable: remove pte entry from the page table
      mm/page_table_check: use unsigned long for page counters and cleanup
      mm/khugepaged: unify collapse pmd clear, flush and free
      mm/page_table_check: check entries at pmd levels

Subsystem: mm/pagemap

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/pgtable: define pte_index so that preprocessor could recognize it

Subsystem: ipc

    Minghao Chi <chi.minghao@zte.com.cn>:
      ipc/sem: do not sleep with a spin lock held

Subsystem: mm/kmemleak

    Lang Yu <lang.yu@amd.com>:
      mm/kmemleak: avoid scanning potential huge holes

Subsystem: MAINTAINERS

    Mike Rapoport <rppt@linux.ibm.com>:
      MAINTAINERS: update rppt's email

Subsystem: mm/selftests

    Shuah Khan <skhan@linuxfoundation.org>:
      kselftest/vm: revert "tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner"

 MAINTAINERS                              |    2 -
 include/linux/page_table_check.h         |   19 ++++++++++
 include/linux/pgtable.h                  |    1 
 ipc/sem.c                                |    4 +-
 mm/debug_vm_pgtable.c                    |    2 +
 mm/khugepaged.c                          |   37 +++++++++++---------
 mm/kmemleak.c                            |   13 +++----
 mm/page_isolation.c                      |    2 -
 mm/page_table_check.c                    |   55 +++++++++++++++----------------
 tools/testing/selftests/vm/userfaultfd.c |   11 ++++--
 10 files changed, 89 insertions(+), 57 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-01-29 21:40 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-01-29 21:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

12 patches, based on f8c7e4ede46fe63ff10000669652648aab09d112.

Subsystems affected by this patch series:

  sysctl
  binfmt
  ia64
  mm/memory-failure
  mm/folios
  selftests
  mm/kasan
  mm/psi
  ocfs2

Subsystem: sysctl

    Andrew Morton <akpm@linux-foundation.org>:
      include/linux/sysctl.h: fix register_sysctl_mount_point() return type

Subsystem: binfmt

    Tong Zhang <ztong0001@gmail.com>:
      binfmt_misc: fix crash when load/unload module

Subsystem: ia64

    Randy Dunlap <rdunlap@infradead.org>:
      ia64: make IA64_MCA_RECOVERY bool instead of tristate

Subsystem: mm/memory-failure

    Joao Martins <joao.m.martins@oracle.com>:
      memory-failure: fetch compound_head after pgmap_pfn_valid()

Subsystem: mm/folios

    Wei Yang <richard.weiyang@gmail.com>:
      mm: page->mapping folio->mapping should have the same offset

Subsystem: selftests

    Maor Gottlieb <maorg@nvidia.com>:
      tools/testing/scatterlist: add missing defines

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
      kasan: test: fix compatibility with FORTIFY_SOURCE

    Peter Collingbourne <pcc@google.com>:
      mm, kasan: use compare-exchange operation to set KASAN page tag

Subsystem: mm/psi

    Suren Baghdasaryan <surenb@google.com>:
      psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n
      psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n

Subsystem: ocfs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
    Patch series "ocfs2: fix a deadlock case":
      jbd2: export jbd2_journal_[grab|put]_journal_head
      ocfs2: fix a deadlock when commit trans

 arch/ia64/Kconfig                    |    2 
 fs/binfmt_misc.c                     |    8 +--
 fs/jbd2/journal.c                    |    2 
 fs/ocfs2/suballoc.c                  |   25 ++++-------
 include/linux/mm.h                   |   17 +++++--
 include/linux/mm_types.h             |    1 
 include/linux/psi.h                  |   11 ++--
 include/linux/sysctl.h               |    2 
 kernel/sched/psi.c                   |   79 ++++++++++++++++++-----------------
 lib/test_kasan.c                     |    5 ++
 mm/memory-failure.c                  |    6 ++
 tools/testing/scatterlist/linux/mm.h |    3 -
 12 files changed, 91 insertions(+), 70 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2022-01-29  4:25 ` incoming Matthew Wilcox
@ 2022-01-29  6:23   ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-01-29  6:23 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Linus Torvalds, mm-commits, linux-mm

On Sat, 29 Jan 2022 04:25:33 +0000 Matthew Wilcox <willy@infradead.org> wrote:

> On Fri, Jan 28, 2022 at 06:13:41PM -0800, Andrew Morton wrote:
> > 12 patches, based on 169387e2aa291a4e3cb856053730fe99d6cec06f.
>   ^^
> 
> I see 7?

Crap, sorry, ignore all this, shall redo tomorrow.

(It wasn't a good day over here.  The thing with disk drives is that
the bigger they are, the harder they fall).



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2022-01-29  2:13 incoming Andrew Morton
@ 2022-01-29  4:25 ` Matthew Wilcox
  2022-01-29  6:23   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Matthew Wilcox @ 2022-01-29  4:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linus Torvalds, mm-commits, linux-mm

On Fri, Jan 28, 2022 at 06:13:41PM -0800, Andrew Morton wrote:
> 12 patches, based on 169387e2aa291a4e3cb856053730fe99d6cec06f.
  ^^

I see 7?


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-01-29  2:13 Andrew Morton
  2022-01-29  4:25 ` incoming Matthew Wilcox
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2022-01-29  2:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

12 patches, based on 169387e2aa291a4e3cb856053730fe99d6cec06f.

Subsystems affected by this patch series:

  sysctl
  binfmt
  ia64
  mm/memory-failure
  mm/folios
  selftests
  mm/kasan
  mm/psi
  ocfs2

Subsystem: sysctl

    Andrew Morton <akpm@linux-foundation.org>:
      include/linux/sysctl.h: fix register_sysctl_mount_point() return type

Subsystem: binfmt

    Tong Zhang <ztong0001@gmail.com>:
      binfmt_misc: fix crash when load/unload module

Subsystem: ia64

    Randy Dunlap <rdunlap@infradead.org>:
      ia64: make IA64_MCA_RECOVERY bool instead of tristate

Subsystem: mm/memory-failure

    Joao Martins <joao.m.martins@oracle.com>:
      memory-failure: fetch compound_head after pgmap_pfn_valid()

Subsystem: mm/folios

    Wei Yang <richard.weiyang@gmail.com>:
      mm: page->mapping folio->mapping should have the same offset

Subsystem: selftests

    Maor Gottlieb <maorg@nvidia.com>:
      tools/testing/scatterlist: add missing defines

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
      kasan: test: fix compatibility with FORTIFY_SOURCE

    Peter Collingbourne <pcc@google.com>:
      mm, kasan: use compare-exchange operation to set KASAN page tag

Subsystem: mm/psi

    Suren Baghdasaryan <surenb@google.com>:
      psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n
      psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n

Subsystem: ocfs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
    Patch series "ocfs2: fix a deadlock case":
      jbd2: export jbd2_journal_[grab|put]_journal_head
      ocfs2: fix a deadlock when commit trans

 arch/ia64/Kconfig                    |    2 
 fs/binfmt_misc.c                     |    8 +--
 fs/jbd2/journal.c                    |    2 
 fs/ocfs2/suballoc.c                  |   25 ++++-------
 include/linux/mm.h                   |   17 +++++--
 include/linux/mm_types.h             |    1 
 include/linux/psi.h                  |   11 ++--
 include/linux/sysctl.h               |    2 
 kernel/sched/psi.c                   |   79 ++++++++++++++++++-----------------
 lib/test_kasan.c                     |    5 ++
 mm/memory-failure.c                  |    6 ++
 tools/testing/scatterlist/linux/mm.h |    3 -
 12 files changed, 91 insertions(+), 70 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-01-22  6:10 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-01-22  6:10 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


This is the post-linux-next queue.  Material which was based on or
dependent upon material which was in -next.

69 patches, based on 9b57f458985742bd1c585f4c7f36d04634ce1143.

Subsystems affected by this patch series:

  mm/migration
  sysctl
  mm/zsmalloc
  proc
  lib

Subsystem: mm/migration

    Alistair Popple <apopple@nvidia.com>:
      mm/migrate.c: rework migration_entry_wait() to not take a pageref

Subsystem: sysctl

    Xiaoming Ni <nixiaoming@huawei.com>:
    Patch series "sysctl: first set of kernel/sysctl cleanups", v2:
      sysctl: add a new register_sysctl_init() interface
      sysctl: move some boundary constants from sysctl.c to sysctl_vals
      hung_task: move hung_task sysctl interface to hung_task.c
      watchdog: move watchdog sysctl interface to watchdog.c

    Stephen Kitt <steve@sk2.org>:
      sysctl: make ngroups_max const

    Xiaoming Ni <nixiaoming@huawei.com>:
      sysctl: use const for typically used max/min proc sysctls
      sysctl: use SYSCTL_ZERO to replace some static int zero uses
      aio: move aio sysctl to aio.c
      dnotify: move dnotify sysctl to dnotify.c

    Luis Chamberlain <mcgrof@kernel.org>:
    Patch series "sysctl: second set of kernel/sysctl cleanups", v2:
      hpet: simplify subdirectory registration with register_sysctl()
      i915: simplify subdirectory registration with register_sysctl()
      macintosh/mac_hid.c: simplify subdirectory registration with register_sysctl()
      ocfs2: simplify subdirectory registration with register_sysctl()
      test_sysctl: simplify subdirectory registration with register_sysctl()

    Xiaoming Ni <nixiaoming@huawei.com>:
      inotify: simplify subdirectory registration with register_sysctl()

    Luis Chamberlain <mcgrof@kernel.org>:
      cdrom: simplify subdirectory registration with register_sysctl()

    Xiaoming Ni <nixiaoming@huawei.com>:
      eventpoll: simplify sysctl declaration with register_sysctl()
    Patch series "sysctl: 3rd set of kernel/sysctl cleanups", v2:
      firmware_loader: move firmware sysctl to its own files
      random: move the random sysctl declarations to its own file

    Luis Chamberlain <mcgrof@kernel.org>:
      sysctl: add helper to register a sysctl mount point
      fs: move binfmt_misc sysctl to its own file

    Xiaoming Ni <nixiaoming@huawei.com>:
      printk: move printk sysctl to printk/sysctl.c
      scsi/sg: move sg-big-buff sysctl to scsi/sg.c
      stackleak: move stack_erasing sysctl to stackleak.c

    Luis Chamberlain <mcgrof@kernel.org>:
      sysctl: share unsigned long const values
    Patch series "sysctl: 4th set of kernel/sysctl cleanups":
      fs: move inode sysctls to its own file
      fs: move fs stat sysctls to file_table.c
      fs: move dcache sysctls to its own file
      sysctl: move maxolduid as a sysctl specific const
      fs: move shared sysctls to fs/sysctls.c
      fs: move locking sysctls where they are used
      fs: move namei sysctls to its own file
      fs: move fs/exec.c sysctls into its own file
      fs: move pipe sysctls to is own file
    Patch series "sysctl: add and use base directory declarer and registration helper":
      sysctl: add and use base directory declarer and registration helper
      fs: move namespace sysctls and declare fs base directory
      kernel/sysctl.c: rename sysctl_init() to sysctl_init_bases()

    Xiaoming Ni <nixiaoming@huawei.com>:
      printk: fix build warning when CONFIG_PRINTK=n
      fs/coredump: move coredump sysctls into its own file
      kprobe: move sysctl_kprobes_optimization to kprobes.c

    Colin Ian King <colin.i.king@gmail.com>:
      kernel/sysctl.c: remove unused variable ten_thousand

    Baokun Li <libaokun1@huawei.com>:
      sysctl: returns -EINVAL when a negative value is passed to proc_doulongvec_minmax

Subsystem: mm/zsmalloc

    Minchan Kim <minchan@kernel.org>:
    Patch series "zsmalloc: remove bit_spin_lock", v2:
      zsmalloc: introduce some helper functions
      zsmalloc: rename zs_stat_type to class_stat_type
      zsmalloc: decouple class actions from zspage works
      zsmalloc: introduce obj_allocated
      zsmalloc: move huge compressed obj from page to zspage
      zsmalloc: remove zspage isolation for migration
      locking/rwlocks: introduce write_lock_nested
      zsmalloc: replace per zpage lock with pool->migrate_lock

    Mike Galbraith <umgwanakikbuti@gmail.com>:
      zsmalloc: replace get_cpu_var with local_lock

Subsystem: proc

    Muchun Song <songmuchun@bytedance.com>:
      fs: proc: store PDE()->data into inode->i_private
      proc: remove PDE_DATA() completely

Subsystem: lib

    Vlastimil Babka <vbabka@suse.cz>:
      lib/stackdepot: allow optional init and stack_table allocation by kvmalloc()
lib/stackdepot: fix spelling mistake and grammar in pr_err message
lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup
lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup3
lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup4

    Marco Elver <elver@google.com>:
      lib/stackdepot: always do filter_irq_stacks() in stack_depot_save()

    Christoph Hellwig <hch@lst.de>:
    Patch series "remove Xen tmem leftovers":
      mm: remove cleancache
      frontswap: remove frontswap_writethrough
      frontswap: remove frontswap_tmem_exclusive_gets
      frontswap: remove frontswap_shrink
      frontswap: remove frontswap_curr_pages
      frontswap: simplify frontswap_init
      frontswap: remove the frontswap exports
      mm: simplify try_to_unuse
      frontswap: remove frontswap_test
      frontswap: simplify frontswap_register_ops
      mm: mark swap_lock and swap_active_head static
      frontswap: remove support for multiple ops
      mm: hide the FRONTSWAP Kconfig symbol

 Documentation/vm/cleancache.rst                        |  296 ------
 Documentation/vm/frontswap.rst                         |   31 
 Documentation/vm/index.rst                             |    1 
 MAINTAINERS                                            |    7 
 arch/alpha/kernel/srm_env.c                            |    4 
 arch/arm/configs/bcm2835_defconfig                     |    1 
 arch/arm/configs/qcom_defconfig                        |    1 
 arch/arm/kernel/atags_proc.c                           |    2 
 arch/arm/mm/alignment.c                                |    2 
 arch/ia64/kernel/salinfo.c                             |   10 
 arch/m68k/configs/amiga_defconfig                      |    1 
 arch/m68k/configs/apollo_defconfig                     |    1 
 arch/m68k/configs/atari_defconfig                      |    1 
 arch/m68k/configs/bvme6000_defconfig                   |    1 
 arch/m68k/configs/hp300_defconfig                      |    1 
 arch/m68k/configs/mac_defconfig                        |    1 
 arch/m68k/configs/multi_defconfig                      |    1 
 arch/m68k/configs/mvme147_defconfig                    |    1 
 arch/m68k/configs/mvme16x_defconfig                    |    1 
 arch/m68k/configs/q40_defconfig                        |    1 
 arch/m68k/configs/sun3_defconfig                       |    1 
 arch/m68k/configs/sun3x_defconfig                      |    1 
 arch/powerpc/kernel/proc_powerpc.c                     |    4 
 arch/s390/configs/debug_defconfig                      |    1 
 arch/s390/configs/defconfig                            |    1 
 arch/sh/mm/alignment.c                                 |    4 
 arch/xtensa/platforms/iss/simdisk.c                    |    4 
 block/bdev.c                                           |    5 
 drivers/acpi/proc.c                                    |    2 
 drivers/base/firmware_loader/fallback.c                |    7 
 drivers/base/firmware_loader/fallback.h                |   11 
 drivers/base/firmware_loader/fallback_table.c          |   25 
 drivers/cdrom/cdrom.c                                  |   23 
 drivers/char/hpet.c                                    |   22 
 drivers/char/random.c                                  |   14 
 drivers/gpu/drm/drm_dp_mst_topology.c                  |    1 
 drivers/gpu/drm/drm_mm.c                               |    4 
 drivers/gpu/drm/drm_modeset_lock.c                     |    9 
 drivers/gpu/drm/i915/i915_perf.c                       |   22 
 drivers/gpu/drm/i915/intel_runtime_pm.c                |    3 
 drivers/hwmon/dell-smm-hwmon.c                         |    4 
 drivers/macintosh/mac_hid.c                            |   24 
 drivers/net/bonding/bond_procfs.c                      |    8 
 drivers/net/wireless/cisco/airo.c                      |   22 
 drivers/net/wireless/intersil/hostap/hostap_ap.c       |   16 
 drivers/net/wireless/intersil/hostap/hostap_download.c |    2 
 drivers/net/wireless/intersil/hostap/hostap_proc.c     |   24 
 drivers/net/wireless/ray_cs.c                          |    2 
 drivers/nubus/proc.c                                   |   36 
 drivers/parisc/led.c                                   |    4 
 drivers/pci/proc.c                                     |   10 
 drivers/platform/x86/thinkpad_acpi.c                   |    4 
 drivers/platform/x86/toshiba_acpi.c                    |   16 
 drivers/pnp/isapnp/proc.c                              |    2 
 drivers/pnp/pnpbios/proc.c                             |    4 
 drivers/scsi/scsi_proc.c                               |    4 
 drivers/scsi/sg.c                                      |   35 
 drivers/usb/gadget/function/rndis.c                    |    4 
 drivers/zorro/proc.c                                   |    2 
 fs/Makefile                                            |    4 
 fs/afs/proc.c                                          |    6 
 fs/aio.c                                               |   31 
 fs/binfmt_misc.c                                       |    6 
 fs/btrfs/extent_io.c                                   |   10 
 fs/btrfs/super.c                                       |    2 
 fs/coredump.c                                          |   66 +
 fs/dcache.c                                            |   37 
 fs/eventpoll.c                                         |   10 
 fs/exec.c                                              |  145 +--
 fs/ext4/mballoc.c                                      |   14 
 fs/ext4/readpage.c                                     |    6 
 fs/ext4/super.c                                        |    3 
 fs/f2fs/data.c                                         |   13 
 fs/file_table.c                                        |   47 -
 fs/inode.c                                             |   39 
 fs/jbd2/journal.c                                      |    2 
 fs/locks.c                                             |   34 
 fs/mpage.c                                             |    7 
 fs/namei.c                                             |   58 +
 fs/namespace.c                                         |   24 
 fs/notify/dnotify/dnotify.c                            |   21 
 fs/notify/fanotify/fanotify_user.c                     |   10 
 fs/notify/inotify/inotify_user.c                       |   11 
 fs/ntfs3/ntfs_fs.h                                     |    1 
 fs/ocfs2/stackglue.c                                   |   25 
 fs/ocfs2/super.c                                       |    2 
 fs/pipe.c                                              |   64 +
 fs/proc/generic.c                                      |    6 
 fs/proc/inode.c                                        |    1 
 fs/proc/internal.h                                     |    5 
 fs/proc/proc_net.c                                     |    8 
 fs/proc/proc_sysctl.c                                  |   67 +
 fs/super.c                                             |    3 
 fs/sysctls.c                                           |   47 -
 include/linux/aio.h                                    |    4 
 include/linux/cleancache.h                             |  124 --
 include/linux/coredump.h                               |   10 
 include/linux/dcache.h                                 |   10 
 include/linux/dnotify.h                                |    1 
 include/linux/fanotify.h                               |    2 
 include/linux/frontswap.h                              |   35 
 include/linux/fs.h                                     |   18 
 include/linux/inotify.h                                |    3 
 include/linux/kprobes.h                                |    6 
 include/linux/migrate.h                                |    2 
 include/linux/mount.h                                  |    3 
 include/linux/pipe_fs_i.h                              |    4 
 include/linux/poll.h                                   |    2 
 include/linux/printk.h                                 |    4 
 include/linux/proc_fs.h                                |   17 
 include/linux/ref_tracker.h                            |    2 
 include/linux/rwlock.h                                 |    6 
 include/linux/rwlock_api_smp.h                         |    8 
 include/linux/rwlock_rt.h                              |   10 
 include/linux/sched/sysctl.h                           |   14 
 include/linux/seq_file.h                               |    2 
 include/linux/shmem_fs.h                               |    3 
 include/linux/spinlock_api_up.h                        |    1 
 include/linux/stackdepot.h                             |   25 
 include/linux/stackleak.h                              |    5 
 include/linux/swapfile.h                               |    3 
 include/linux/sysctl.h                                 |   67 +
 include/scsi/sg.h                                      |    4 
 init/main.c                                            |    9 
 ipc/util.c                                             |    2 
 kernel/hung_task.c                                     |   81 +
 kernel/irq/proc.c                                      |    8 
 kernel/kprobes.c                                       |   30 
 kernel/locking/spinlock.c                              |   10 
 kernel/locking/spinlock_rt.c                           |   12 
 kernel/printk/Makefile                                 |    5 
 kernel/printk/internal.h                               |    8 
 kernel/printk/printk.c                                 |    4 
 kernel/printk/sysctl.c                                 |   85 +
 kernel/resource.c                                      |    4 
 kernel/stackleak.c                                     |   26 
 kernel/sysctl.c                                        |  790 +----------------
 kernel/watchdog.c                                      |  101 ++
 lib/Kconfig                                            |    4 
 lib/Kconfig.kasan                                      |    2 
 lib/stackdepot.c                                       |   46 
 lib/test_sysctl.c                                      |   22 
 mm/Kconfig                                             |   40 
 mm/Makefile                                            |    1 
 mm/cleancache.c                                        |  315 ------
 mm/filemap.c                                           |  102 +-
 mm/frontswap.c                                         |  259 -----
 mm/kasan/common.c                                      |    1 
 mm/migrate.c                                           |   38 
 mm/page_owner.c                                        |    2 
 mm/shmem.c                                             |   33 
 mm/swapfile.c                                          |   90 -
 mm/truncate.c                                          |   15 
 mm/zsmalloc.c                                          |  557 ++++-------
 mm/zswap.c                                             |    8 
 net/atm/proc.c                                         |    4 
 net/bluetooth/af_bluetooth.c                           |    8 
 net/can/bcm.c                                          |    2 
 net/can/proc.c                                         |    2 
 net/core/neighbour.c                                   |    6 
 net/core/pktgen.c                                      |    6 
 net/ipv4/netfilter/ipt_CLUSTERIP.c                     |    6 
 net/ipv4/raw.c                                         |    8 
 net/ipv4/tcp_ipv4.c                                    |    2 
 net/ipv4/udp.c                                         |    6 
 net/netfilter/x_tables.c                               |   10 
 net/netfilter/xt_hashlimit.c                           |   18 
 net/netfilter/xt_recent.c                              |    4 
 net/sunrpc/auth_gss/svcauth_gss.c                      |    4 
 net/sunrpc/cache.c                                     |   24 
 net/sunrpc/stats.c                                     |    2 
 sound/core/info.c                                      |    4 
 172 files changed, 1877 insertions(+), 2931 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-01-20  2:07 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-01-20  2:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

55 patches, based on df0cc57e057f18e44dac8e6c18aba47ab53202f9 ("Linux 5.16")

Subsystems affected by this patch series:

  percpu
  procfs
  sysctl
  misc
  core-kernel
  get_maintainer
  lib
  checkpatch
  binfmt
  nilfs2
  hfs
  fat
  adfs
  panic
  delayacct
  kconfig
  kcov
  ubsan

Subsystem: percpu

    Kefeng Wang <wangkefeng.wang@huawei.com>:
    Patch series "mm: percpu: Cleanup percpu first chunk function":
      mm: percpu: generalize percpu related config
      mm: percpu: add pcpu_fc_cpu_to_node_fn_t typedef
      mm: percpu: add generic pcpu_fc_alloc/free funciton
      mm: percpu: add generic pcpu_populate_pte() function

Subsystem: procfs

    David Hildenbrand <david@redhat.com>:
      proc/vmcore: don't fake reading zeroes on surprise vmcore_cb unregistration

    Hans de Goede <hdegoede@redhat.com>:
      proc: make the proc_create[_data]() stubs static inlines

    Qi Zheng <zhengqi.arch@bytedance.com>:
      proc: convert the return type of proc_fd_access_allowed() to be boolean

Subsystem: sysctl

    Geert Uytterhoeven <geert+renesas@glider.be>:
      sysctl: fix duplicate path separator in printed entries

    luo penghao <luo.penghao@zte.com.cn>:
      sysctl: remove redundant ret assignment

Subsystem: misc

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      include/linux/unaligned: replace kernel.h with the necessary inclusions
      kernel.h: include a note to discourage people from including it in headers

Subsystem: core-kernel

    Yafang Shao <laoar.shao@gmail.com>:
    Patch series "task comm cleanups", v2:
      fs/exec: replace strlcpy with strscpy_pad in __set_task_comm
      fs/exec: replace strncpy with strscpy_pad in __get_task_comm
      drivers/infiniband: replace open-coded string copy with get_task_comm
      fs/binfmt_elf: replace open-coded string copy with get_task_comm
      samples/bpf/test_overhead_kprobe_kern: replace bpf_probe_read_kernel with bpf_probe_read_kernel_str to get task comm
      tools/bpf/bpftool/skeleton: replace bpf_probe_read_kernel with bpf_probe_read_kernel_str to get task comm
      tools/testing/selftests/bpf: replace open-coded 16 with TASK_COMM_LEN
      kthread: dynamically allocate memory to store kthread's full name

    Davidlohr Bueso <dave@stgolabs.net>:
      kernel/sys.c: only take tasklist_lock for get/setpriority(PRIO_PGRP)

Subsystem: get_maintainer

    Randy Dunlap <rdunlap@infradead.org>:
      get_maintainer: don't remind about no git repo when --nogit is used

Subsystem: lib

    Alexey Dobriyan <adobriyan@gmail.com>:
      kstrtox: uninline everything

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      list: introduce list_is_head() helper and re-use it in list.h

    Zhen Lei <thunder.leizhen@huawei.com>:
      lib/list_debug.c: print more list debugging context in __list_del_entry_valid()

    Isabella Basso <isabbasso@riseup.net>:
    Patch series "test_hash.c: refactor into KUnit", v3:
      hash.h: remove unused define directive
      test_hash.c: split test_int_hash into arch-specific functions
      test_hash.c: split test_hash_init
      lib/Kconfig.debug: properly split hash test kernel entries
      test_hash.c: refactor into kunit

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kunit: replace kernel.h with the necessary inclusions
      uuid: discourage people from using UAPI header in new code
      uuid: remove licence boilerplate text from the header

    Andrey Konovalov <andreyknvl@google.com>:
      lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test

Subsystem: checkpatch

    Jerome Forissier <jerome@forissier.org>:
      checkpatch: relax regexp for COMMIT_LOG_LONG_LINE

    Joe Perches <joe@perches.com>:
      checkpatch: improve Kconfig help test

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      const_structs.checkpatch: add frequently used ops structs

Subsystem: binfmt

    "H.J. Lu" <hjl.tools@gmail.com>:
      fs/binfmt_elf: use PT_LOAD p_align values for static PIE

Subsystem: nilfs2

    Colin Ian King <colin.i.king@gmail.com>:
      nilfs2: remove redundant pointer sbufs

Subsystem: hfs

    Kees Cook <keescook@chromium.org>:
      hfsplus: use struct_group_attr() for memcpy() region

Subsystem: fat

    "NeilBrown" <neilb@suse.de>:
       FAT: use io_schedule_timeout() instead of congestion_wait()

Subsystem: adfs

    Minghao Chi <chi.minghao@zte.com.cn>:
      fs/adfs: remove unneeded variable make code cleaner

Subsystem: panic

    Marco Elver <elver@google.com>:
      panic: use error_report_end tracepoint on warnings

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      panic: remove oops_id

Subsystem: delayacct

    Yang Yang <yang.yang29@zte.com.cn>:
      delayacct: support swapin delay accounting for swapping without blkio
      delayacct: fix incomplete disable operation when switch enable to disable
      delayacct: cleanup flags in struct task_delay_info and functions use it

    wangyong <wang.yong12@zte.com.cn>:
      Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact
      delayacct: track delays from memory compact

Subsystem: kconfig

    Qian Cai <quic_qiancai@quicinc.com>:
      configs: introduce debug.config for CI-like setup

    Nathan Chancellor <nathan@kernel.org>:
    Patch series "Fix CONFIG_TEST_KMOD with 256kB page size":
      arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB
      btrfs: use generic Kconfig option for 256kB page size limit
      lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB

Subsystem: kcov

    Marco Elver <elver@google.com>:
      kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR

Subsystem: ubsan

    Kees Cook <keescook@chromium.org>:
      ubsan: remove CONFIG_UBSAN_OBJECT_SIZE

    Colin Ian King <colin.i.king@gmail.com>:
      lib: remove redundant assignment to variable ret

 Documentation/accounting/delay-accounting.rst           |   63 +-
 arch/Kconfig                                            |    4 
 arch/arm64/Kconfig                                      |   20 
 arch/ia64/Kconfig                                       |    9 
 arch/mips/Kconfig                                       |   10 
 arch/mips/mm/init.c                                     |   28 -
 arch/powerpc/Kconfig                                    |   17 
 arch/powerpc/kernel/setup_64.c                          |  113 ----
 arch/riscv/Kconfig                                      |   10 
 arch/sparc/Kconfig                                      |   12 
 arch/sparc/kernel/led.c                                 |    8 
 arch/sparc/kernel/smp_64.c                              |  119 -----
 arch/x86/Kconfig                                        |   19 
 arch/x86/kernel/setup_percpu.c                          |   82 ---
 drivers/base/arch_numa.c                                |   78 ---
 drivers/infiniband/hw/qib/qib.h                         |    2 
 drivers/infiniband/hw/qib/qib_file_ops.c                |    2 
 drivers/infiniband/sw/rxe/rxe_qp.c                      |    3 
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/xtlv.c |    2 
 fs/adfs/inode.c                                         |    4 
 fs/binfmt_elf.c                                         |    6 
 fs/btrfs/Kconfig                                        |    3 
 fs/exec.c                                               |    5 
 fs/fat/file.c                                           |    5 
 fs/hfsplus/hfsplus_raw.h                                |   12 
 fs/hfsplus/xattr.c                                      |    4 
 fs/nilfs2/page.c                                        |    4 
 fs/proc/array.c                                         |    3 
 fs/proc/base.c                                          |    4 
 fs/proc/proc_sysctl.c                                   |    9 
 fs/proc/vmcore.c                                        |   10 
 include/kunit/assert.h                                  |    2 
 include/linux/delayacct.h                               |  107 ++--
 include/linux/elfcore-compat.h                          |    5 
 include/linux/elfcore.h                                 |    5 
 include/linux/hash.h                                    |    5 
 include/linux/kernel.h                                  |    9 
 include/linux/kthread.h                                 |    1 
 include/linux/list.h                                    |   36 -
 include/linux/percpu.h                                  |   21 
 include/linux/proc_fs.h                                 |   12 
 include/linux/sched.h                                   |    9 
 include/linux/unaligned/packed_struct.h                 |    2 
 include/trace/events/error_report.h                     |    8 
 include/uapi/linux/taskstats.h                          |    6 
 include/uapi/linux/uuid.h                               |   10 
 kernel/configs/debug.config                             |  105 ++++
 kernel/delayacct.c                                      |   49 +-
 kernel/kthread.c                                        |   32 +
 kernel/panic.c                                          |   21 
 kernel/sys.c                                            |   16 
 lib/Kconfig.debug                                       |   45 +
 lib/Kconfig.ubsan                                       |   13 
 lib/Makefile                                            |    5 
 lib/asn1_encoder.c                                      |    2 
 lib/kstrtox.c                                           |   12 
 lib/list_debug.c                                        |    8 
 lib/lz4/lz4defs.h                                       |    2 
 lib/test_hash.c                                         |  375 +++++++---------
 lib/test_meminit.c                                      |    1 
 lib/test_ubsan.c                                        |   22 
 mm/Kconfig                                              |   12 
 mm/memory.c                                             |    4 
 mm/page_alloc.c                                         |    3 
 mm/page_io.c                                            |    3 
 mm/percpu.c                                             |  168 +++++--
 samples/bpf/offwaketime_kern.c                          |    4 
 samples/bpf/test_overhead_kprobe_kern.c                 |   11 
 samples/bpf/test_overhead_tp_kern.c                     |    5 
 scripts/Makefile.ubsan                                  |    1 
 scripts/checkpatch.pl                                   |   54 +-
 scripts/const_structs.checkpatch                        |   23 
 scripts/get_maintainer.pl                               |    2 
 tools/accounting/getdelays.c                            |    8 
 tools/bpf/bpftool/skeleton/pid_iter.bpf.c               |    4 
 tools/include/linux/hash.h                              |    5 
 tools/testing/selftests/bpf/progs/test_stacktrace_map.c |    6 
 tools/testing/selftests/bpf/progs/test_tracepoint.c     |    6 
 78 files changed, 943 insertions(+), 992 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2022-01-14 22:02 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2022-01-14 22:02 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

146 patches, based on df0cc57e057f18e44dac8e6c18aba47ab53202f9 ("Linux 5.16")

Subsystems affected by this patch series:

  kthread
  ia64
  scripts
  ntfs
  squashfs
  ocfs2
  vfs
  mm/slab-generic
  mm/slab
  mm/kmemleak
  mm/dax
  mm/kasan
  mm/debug
  mm/pagecache
  mm/gup
  mm/shmem
  mm/frontswap
  mm/memremap
  mm/memcg
  mm/selftests
  mm/pagemap
  mm/dma
  mm/vmalloc
  mm/memory-failure
  mm/hugetlb
  mm/userfaultfd
  mm/vmscan
  mm/mempolicy
  mm/oom-kill
  mm/hugetlbfs
  mm/migration
  mm/thp
  mm/ksm
  mm/page-poison
  mm/percpu
  mm/rmap
  mm/zswap
  mm/zram
  mm/cleanups
  mm/hmm
  mm/damon

Subsystem: kthread

    Cai Huoqing <caihuoqing@baidu.com>:
      kthread: add the helper function kthread_run_on_cpu()
      RDMA/siw: make use of the helper function kthread_run_on_cpu()
      ring-buffer: make use of the helper function kthread_run_on_cpu()
      rcutorture: make use of the helper function kthread_run_on_cpu()
      trace/osnoise: make use of the helper function kthread_run_on_cpu()
      trace/hwlat: make use of the helper function kthread_run_on_cpu()

Subsystem: ia64

    Yang Guang <yang.guang5@zte.com.cn>:
      ia64: module: use swap() to make code cleaner
      arch/ia64/kernel/setup.c: use swap() to make code cleaner

    Jason Wang <wangborong@cdjrlc.com>:
      ia64: fix typo in a comment

    Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
      ia64: topology: use default_groups in kobj_type

Subsystem: scripts

    Drew Fustini <dfustini@baylibre.com>:
      scripts/spelling.txt: add "oveflow"

Subsystem: ntfs

    Yang Li <yang.lee@linux.alibaba.com>:
      fs/ntfs/attrib.c: fix one kernel-doc comment

Subsystem: squashfs

    Zheng Liang <zhengliang6@huawei.com>:
      squashfs: provide backing_dev_info in order to disable read-ahead

Subsystem: ocfs2

    Zhang Mingyu <zhang.mingyu@zte.com.cn>:
      ocfs2: use BUG_ON instead of if condition followed by BUG.

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: clearly handle ocfs2_grab_pages_for_write() return value

    Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
      ocfs2: use default_groups in kobj_type

    Colin Ian King <colin.i.king@gmail.com>:
      ocfs2: remove redundant assignment to pointer root_bh

    Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
      ocfs2: cluster: use default_groups in kobj_type

    Colin Ian King <colin.i.king@gmail.com>:
      ocfs2: remove redundant assignment to variable free_space

Subsystem: vfs

    Amit Daniel Kachhap <amit.kachhap@arm.com>:
      fs/ioctl: remove unnecessary __user annotation

Subsystem: mm/slab-generic

    Marco Elver <elver@google.com>:
      mm/slab_common: use WARN() if cache still has objects on destroy

Subsystem: mm/slab

    Muchun Song <songmuchun@bytedance.com>:
      mm: slab: make slab iterator functions static

Subsystem: mm/kmemleak

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
      kmemleak: fix kmemleak false positive report with HW tag-based kasan enable

    Calvin Zhang <calvinzhang.cool@gmail.com>:
      mm: kmemleak: alloc gray object for reserved region with direct map

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm: defer kmemleak object creation of module_alloc()

Subsystem: mm/dax

    Joao Martins <joao.m.martins@oracle.com>:
    Patch series "mm, device-dax: Introduce compound pages in devmap", v7:
      mm/page_alloc: split prep_compound_page into head and tail subparts
      mm/page_alloc: refactor memmap_init_zone_device() page init
      mm/memremap: add ZONE_DEVICE support for compound pages
      device-dax: use ALIGN() for determining pgoff
      device-dax: use struct_size()
      device-dax: ensure dev_dax->pgmap is valid for dynamic devices
      device-dax: factor out page mapping initialization
      device-dax: set mapping prior to vmf_insert_pfn{,_pmd,pud}()
      device-dax: remove pfn from __dev_dax_{pte,pmd,pud}_fault()
      device-dax: compound devmap support

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
      kasan: test: add globals left-out-of-bounds test
      kasan: add ability to detect double-kmem_cache_destroy()
      kasan: test: add test case for double-kmem_cache_destroy()

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix quarantine conflicting with init_on_free

Subsystem: mm/debug

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm,fs: split dump_mapping() out from dump_page()

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/debug_vm_pgtable: update comments regarding migration swap entries

Subsystem: mm/pagecache

    chiminghao <chi.minghao@zte.com.cn>:
      mm/truncate.c: remove unneeded variable

Subsystem: mm/gup

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      gup: avoid multiple user access locking/unlocking in fault_in_{read/write}able

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm/gup.c: stricter check on THP migration entry during follow_pmd_mask

Subsystem: mm/shmem

    Yang Shi <shy828301@gmail.com>:
      mm: shmem: don't truncate page if memory failure happens

    Gang Li <ligang.bdlg@bytedance.com>:
      shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode

Subsystem: mm/frontswap

    Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
      mm/frontswap.c: use non-atomic '__set_bit()' when possible

Subsystem: mm/memremap

Subsystem: mm/memcg

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: make cgroup_memory_nokmem static

    Donghai Qiao <dqiao@redhat.com>:
      mm/page_counter: remove an incorrect call to propagate_protected_usage()

    Dan Schatzberg <schatzberg.dan@gmail.com>:
      mm/memcg: add oom_group_kill memory event

    Shakeel Butt <shakeelb@google.com>:
      memcg: better bounds on the memcg stats updates

    Wang Weiyang <wangweiyang2@huawei.com>:
      mm/memcg: use struct_size() helper in kzalloc()

    Shakeel Butt <shakeelb@google.com>:
      memcg: add per-memcg vmalloc stat

Subsystem: mm/selftests

    chiminghao <chi.minghao@zte.com.cn>:
      tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner

Subsystem: mm/pagemap

    Qi Zheng <zhengqi.arch@bytedance.com>:
      mm: remove redundant check about FAULT_FLAG_ALLOW_RETRY bit

    Colin Cross <ccross@google.com>:
    Patch series "mm: rearrange madvise code to allow for reuse", v11:
      mm: rearrange madvise code to allow for reuse
      mm: add a field to store names for private anonymous memory

    Suren Baghdasaryan <surenb@google.com>:
      mm: add anonymous vma name refcounting

    Arnd Bergmann <arnd@arndb.de>:
      mm: move anon_vma declarations to linux/mm_inline.h
      mm: move tlb_flush_pending inline helpers to mm_inline.h

    Suren Baghdasaryan <surenb@google.com>:
      mm: protect free_pgtables with mmap_lock write lock in exit_mmap
      mm: document locking restrictions for vm_operations_struct::close
      mm/oom_kill: allow process_mrelease to run under mmap_lock protection

    Shuah Khan <skhan@linuxfoundation.org>:
      docs/vm: add vmalloced-kernel-stacks document

    Pasha Tatashin <pasha.tatashin@soleen.com>:
    Patch series "page table check", v3:
      mm: change page type prior to adding page table entry
      mm: ptep_clear() page table helper
      mm: page table check
      x86: mm: add x86_64 support for page table check

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: remove last argument of reuse_swap_page()
      mm: remove the total_mapcount argument from page_trans_huge_map_swapcount()
      mm: remove the total_mapcount argument from page_trans_huge_mapcount()

Subsystem: mm/dma

    Christian König <christian.koenig@amd.com>:
      mm/dmapool.c: revert "make dma pool to use kmalloc_node"

Subsystem: mm/vmalloc

    Michal Hocko <mhocko@suse.com>:
    Patch series "extend vmalloc support for constrained allocations", v2:
      mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc
      mm/vmalloc: add support for __GFP_NOFAIL
      mm/vmalloc: be more explicit about supported gfp flags.
      mm: allow !GFP_KERNEL allocations for kvmalloc
      mm: make slab and vmalloc allocators __GFP_NOLOCKDEP aware

    "NeilBrown" <neilb@suse.de>:
      mm: introduce memalloc_retry_wait()

    Suren Baghdasaryan <surenb@google.com>:
      mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%

    Changcheng Deng <deng.changcheng@zte.com.cn>:
      mm: fix boolreturn.cocci warning

    Xiongwei Song <sxwjean@gmail.com>:
      mm: page_alloc: fix building error on -Werror=array-compare

    Michal Hocko <mhocko@suse.com>:
      mm: drop node from alloc_pages_vma

    Miles Chen <miles.chen@mediatek.com>:
      include/linux/gfp.h: further document GFP_DMA32

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/page_alloc.c: modify the comment section for alloc_contig_pages()

    Baoquan He <bhe@redhat.com>:
    Patch series "Handle warning of allocation failure on DMA zone w/o managed pages", v4:
      mm_zone: add function to check if managed dma zone exists
      dma/pool: create dma atomic pool only if dma zone has managed pages
      mm/page_alloc.c: do not warn allocation failure on zone DMA if no managed pages

Subsystem: mm/memory-failure

Subsystem: mm/hugetlb

    Mina Almasry <almasrymina@google.com>:
      hugetlb: add hugetlb.*.numa_stat file

    Yosry Ahmed <yosryahmed@google.com>:
      mm, hugepages: make memory size variable in hugepage-mremap selftest

    Yang Yang <yang.yang29@zte.com.cn>:
      mm/vmstat: add events for THP max_ptes_* exceeds

    Waiman Long <longman@redhat.com>:
      selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting

Subsystem: mm/userfaultfd

    Peter Xu <peterx@redhat.com>:
      selftests/uffd: allow EINTR/EAGAIN

    Mike Kravetz <mike.kravetz@oracle.com>:
      userfaultfd/selftests: clean up hugetlb allocation code

Subsystem: mm/vmscan

    Gang Li <ligang.bdlg@bytedance.com>:
      vmscan: make drop_slab_node static

    Chen Wandun <chenwandun@huawei.com>:
      mm/page_isolation: unset migratetype directly for non Buddy page

Subsystem: mm/mempolicy

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
    Patch series "mm: add new syscall set_mempolicy_home_node", v6:
      mm/mempolicy: use policy_node helper with MPOL_PREFERRED_MANY
      mm/mempolicy: add set_mempolicy_home_node syscall
      mm/mempolicy: wire up syscall set_mempolicy_home_node

    Randy Dunlap <rdunlap@infradead.org>:
      mm/mempolicy: fix all kernel-doc warnings

Subsystem: mm/oom-kill

    Jann Horn <jannh@google.com>:
      mm, oom: OOM sysrq should always kill a process

Subsystem: mm/hugetlbfs

    Sean Christopherson <seanjc@google.com>:
      hugetlbfs: fix off-by-one error in hugetlb_vmdelete_list()

Subsystem: mm/migration

    Baolin Wang <baolin.wang@linux.alibaba.com>:
    Patch series "Improve the migration stats":
      mm: migrate: fix the return value of migrate_pages()
      mm: migrate: correct the hugetlb migration stats
      mm: compaction: fix the migration stats in trace_mm_compaction_migratepages()
      mm: migrate: support multiple target nodes demotion
      mm: migrate: add more comments for selecting target node randomly

    Huang Ying <ying.huang@intel.com>:
      mm/migrate: move node demotion code to near its user

    Colin Ian King <colin.i.king@gmail.com>:
      mm/migrate: remove redundant variables used in a for-loop

Subsystem: mm/thp

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/thp: drop unused trace events hugepage_[invalidate|splitting]

Subsystem: mm/ksm

    Nanyong Sun <sunnanyong@huawei.com>:
      mm: ksm: fix use-after-free kasan report in ksm_might_need_to_copy

Subsystem: mm/page-poison

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
    Patch series "mm/hwpoison: fix unpoison_memory()", v4:
      mm/hwpoison: mf_mutex for soft offline and unpoison
      mm/hwpoison: remove MF_MSG_BUDDY_2ND and MF_MSG_POISONED_HUGE
      mm/hwpoison: fix unpoison_memory()

Subsystem: mm/percpu

    Qi Zheng <zhengqi.arch@bytedance.com>:
      mm: memcg/percpu: account extra objcg space to memory cgroups

Subsystem: mm/rmap

    Huang Ying <ying.huang@intel.com>:
      mm/rmap: fix potential batched TLB flush race

Subsystem: mm/zswap

    Zhaoyu Liu <zackary.liu.pro@gmail.com>:
      zpool: remove the list of pools_head

Subsystem: mm/zram

    Luis Chamberlain <mcgrof@kernel.org>:
      zram: use ATTRIBUTE_GROUPS

Subsystem: mm/cleanups

    Quanfa Fu <fuqf0919@gmail.com>:
      mm: fix some comment errors

    Ting Liu <liuting.0x7c00@bytedance.com>:
      mm: make some vars and functions static or __init

Subsystem: mm/hmm

    Alistair Popple <apopple@nvidia.com>:
      mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault

Subsystem: mm/damon

    Xin Hao <xhao@linux.alibaba.com>:
    Patch series "mm/damon: Do some small changes", v4:
      mm/damon: unified access_check function naming rules
      mm/damon: add 'age' of region tracepoint support
      mm/damon/core: use abs() instead of diff_of()
      mm/damon: remove some unneeded function definitions in damon.h

    Yihao Han <hanyihao@vivo.com>:
      mm/damon/vaddr: remove swap_ranges() and replace it with swap()

    Xin Hao <xhao@linux.alibaba.com>:
      mm/damon/schemes: add the validity judgment of thresholds
      mm/damon: move damon_rand() definition into damon.h
      mm/damon: modify damon_rand() macro to static inline function

    SeongJae Park <sj@kernel.org>:
    Patch series "mm/damon: Misc cleanups":
      mm/damon: convert macro functions to static inline functions
      Docs/admin-guide/mm/damon/usage: update for scheme quotas and watermarks
      Docs/admin-guide/mm/damon/usage: remove redundant information
      Docs/admin-guide/mm/damon/usage: mention tracepoint at the beginning
      Docs/admin-guide/mm/damon/usage: update for kdamond_pid and (mk|rm)_contexts
      mm/damon: remove a mistakenly added comment for a future feature
    Patch series "mm/damon/schemes: Extend stats for better online analysis and tuning":
      mm/damon/schemes: account scheme actions that successfully applied
      mm/damon/schemes: account how many times quota limit has exceeded
      mm/damon/reclaim: provide reclamation statistics
      Docs/admin-guide/mm/damon/reclaim: document statistics parameters
      mm/damon/dbgfs: support all DAMOS stats
      Docs/admin-guide/mm/damon/usage: update for schemes statistics

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm/damon: add access checking for hugetlb pages

    Guoqing Jiang <guoqing.jiang@linux.dev>:
      mm/damon: move the implementation of damon_insert_region to damon.h

    SeongJae Park <sj@kernel.org>:
    Patch series "mm/damon: Hide unnecessary information disclosures":
      mm/damon/dbgfs: remove an unnecessary variable
      mm/damon/vaddr: use pr_debug() for damon_va_three_regions() failure logging
      mm/damon/vaddr: hide kernel pointer from damon_va_three_regions() failure log
      mm/damon: hide kernel pointer from tracepoint event

 Documentation/admin-guide/cgroup-v1/hugetlb.rst        |    4 
 Documentation/admin-guide/cgroup-v2.rst                |   11 
 Documentation/admin-guide/mm/damon/reclaim.rst         |   25 
 Documentation/admin-guide/mm/damon/usage.rst           |  235 +++++--
 Documentation/admin-guide/mm/numa_memory_policy.rst    |   16 
 Documentation/admin-guide/sysctl/vm.rst                |    2 
 Documentation/filesystems/proc.rst                     |    6 
 Documentation/vm/arch_pgtable_helpers.rst              |   20 
 Documentation/vm/index.rst                             |    2 
 Documentation/vm/page_migration.rst                    |   12 
 Documentation/vm/page_table_check.rst                  |   56 +
 Documentation/vm/vmalloced-kernel-stacks.rst           |  153 ++++
 MAINTAINERS                                            |    9 
 arch/Kconfig                                           |    3 
 arch/alpha/kernel/syscalls/syscall.tbl                 |    1 
 arch/alpha/mm/fault.c                                  |   16 
 arch/arc/mm/fault.c                                    |    3 
 arch/arm/mm/fault.c                                    |    2 
 arch/arm/tools/syscall.tbl                             |    1 
 arch/arm64/include/asm/unistd.h                        |    2 
 arch/arm64/include/asm/unistd32.h                      |    2 
 arch/arm64/kernel/module.c                             |    4 
 arch/arm64/mm/fault.c                                  |    6 
 arch/hexagon/mm/vm_fault.c                             |    8 
 arch/ia64/kernel/module.c                              |    6 
 arch/ia64/kernel/setup.c                               |    5 
 arch/ia64/kernel/syscalls/syscall.tbl                  |    1 
 arch/ia64/kernel/topology.c                            |    3 
 arch/ia64/kernel/uncached.c                            |    2 
 arch/ia64/mm/fault.c                                   |   16 
 arch/m68k/kernel/syscalls/syscall.tbl                  |    1 
 arch/m68k/mm/fault.c                                   |   18 
 arch/microblaze/kernel/syscalls/syscall.tbl            |    1 
 arch/microblaze/mm/fault.c                             |   18 
 arch/mips/kernel/syscalls/syscall_n32.tbl              |    1 
 arch/mips/kernel/syscalls/syscall_n64.tbl              |    1 
 arch/mips/kernel/syscalls/syscall_o32.tbl              |    1 
 arch/mips/mm/fault.c                                   |   19 
 arch/nds32/mm/fault.c                                  |   16 
 arch/nios2/mm/fault.c                                  |   18 
 arch/openrisc/mm/fault.c                               |   18 
 arch/parisc/kernel/syscalls/syscall.tbl                |    1 
 arch/parisc/mm/fault.c                                 |   18 
 arch/powerpc/kernel/syscalls/syscall.tbl               |    1 
 arch/powerpc/mm/fault.c                                |    6 
 arch/riscv/mm/fault.c                                  |    2 
 arch/s390/kernel/module.c                              |    5 
 arch/s390/kernel/syscalls/syscall.tbl                  |    1 
 arch/s390/mm/fault.c                                   |   28 
 arch/sh/kernel/syscalls/syscall.tbl                    |    1 
 arch/sh/mm/fault.c                                     |   18 
 arch/sparc/kernel/syscalls/syscall.tbl                 |    1 
 arch/sparc/mm/fault_32.c                               |   16 
 arch/sparc/mm/fault_64.c                               |   16 
 arch/um/kernel/trap.c                                  |    8 
 arch/x86/Kconfig                                       |    1 
 arch/x86/entry/syscalls/syscall_32.tbl                 |    1 
 arch/x86/entry/syscalls/syscall_64.tbl                 |    1 
 arch/x86/include/asm/pgtable.h                         |   31 -
 arch/x86/kernel/module.c                               |    7 
 arch/x86/mm/fault.c                                    |    3 
 arch/xtensa/kernel/syscalls/syscall.tbl                |    1 
 arch/xtensa/mm/fault.c                                 |   17 
 drivers/block/zram/zram_drv.c                          |   11 
 drivers/dax/bus.c                                      |   32 +
 drivers/dax/bus.h                                      |    1 
 drivers/dax/device.c                                   |  140 ++--
 drivers/infiniband/sw/siw/siw_main.c                   |    7 
 drivers/of/fdt.c                                       |    6 
 fs/ext4/extents.c                                      |    8 
 fs/ext4/inline.c                                       |    5 
 fs/ext4/page-io.c                                      |    9 
 fs/f2fs/data.c                                         |    4 
 fs/f2fs/gc.c                                           |    5 
 fs/f2fs/inode.c                                        |    4 
 fs/f2fs/node.c                                         |    4 
 fs/f2fs/recovery.c                                     |    6 
 fs/f2fs/segment.c                                      |    9 
 fs/f2fs/super.c                                        |    5 
 fs/hugetlbfs/inode.c                                   |    7 
 fs/inode.c                                             |   49 +
 fs/ioctl.c                                             |    2 
 fs/ntfs/attrib.c                                       |    2 
 fs/ocfs2/alloc.c                                       |    2 
 fs/ocfs2/aops.c                                        |   26 
 fs/ocfs2/cluster/masklog.c                             |   11 
 fs/ocfs2/dir.c                                         |    2 
 fs/ocfs2/filecheck.c                                   |    3 
 fs/ocfs2/journal.c                                     |    6 
 fs/proc/task_mmu.c                                     |   13 
 fs/squashfs/super.c                                    |   33 +
 fs/userfaultfd.c                                       |    8 
 fs/xfs/kmem.c                                          |    3 
 fs/xfs/xfs_buf.c                                       |    2 
 include/linux/ceph/libceph.h                           |    1 
 include/linux/damon.h                                  |   93 +--
 include/linux/fs.h                                     |    1 
 include/linux/gfp.h                                    |   12 
 include/linux/hugetlb.h                                |    4 
 include/linux/hugetlb_cgroup.h                         |    7 
 include/linux/kasan.h                                  |    4 
 include/linux/kthread.h                                |   25 
 include/linux/memcontrol.h                             |   22 
 include/linux/mempolicy.h                              |    1 
 include/linux/memremap.h                               |   11 
 include/linux/mm.h                                     |   76 --
 include/linux/mm_inline.h                              |  136 ++++
 include/linux/mm_types.h                               |  252 +++-----
 include/linux/mmzone.h                                 |    9 
 include/linux/page-flags.h                             |    6 
 include/linux/page_idle.h                              |    1 
 include/linux/page_table_check.h                       |  147 ++++
 include/linux/pgtable.h                                |    8 
 include/linux/sched/mm.h                               |   26 
 include/linux/swap.h                                   |    8 
 include/linux/syscalls.h                               |    3 
 include/linux/vm_event_item.h                          |    3 
 include/linux/vmalloc.h                                |    7 
 include/ras/ras_event.h                                |    2 
 include/trace/events/compaction.h                      |   24 
 include/trace/events/damon.h                           |   15 
 include/trace/events/thp.h                             |   35 -
 include/uapi/asm-generic/unistd.h                      |    5 
 include/uapi/linux/prctl.h                             |    3 
 kernel/dma/pool.c                                      |    4 
 kernel/fork.c                                          |    3 
 kernel/kthread.c                                       |    1 
 kernel/rcu/rcutorture.c                                |    7 
 kernel/sys.c                                           |   63 ++
 kernel/sys_ni.c                                        |    1 
 kernel/sysctl.c                                        |    3 
 kernel/trace/ring_buffer.c                             |    7 
 kernel/trace/trace_hwlat.c                             |    6 
 kernel/trace/trace_osnoise.c                           |    3 
 lib/test_hmm.c                                         |   24 
 lib/test_kasan.c                                       |   30 
 mm/Kconfig                                             |   14 
 mm/Kconfig.debug                                       |   24 
 mm/Makefile                                            |    1 
 mm/compaction.c                                        |    7 
 mm/damon/core.c                                        |   45 -
 mm/damon/dbgfs.c                                       |   20 
 mm/damon/paddr.c                                       |   24 
 mm/damon/prmtv-common.h                                |    4 
 mm/damon/reclaim.c                                     |   46 +
 mm/damon/vaddr.c                                       |  186 ++++--
 mm/debug.c                                             |   52 -
 mm/debug_vm_pgtable.c                                  |    6 
 mm/dmapool.c                                           |    2 
 mm/frontswap.c                                         |    4 
 mm/gup.c                                               |   31 -
 mm/hmm.c                                               |    5 
 mm/huge_memory.c                                       |   32 -
 mm/hugetlb.c                                           |    6 
 mm/hugetlb_cgroup.c                                    |  133 +++-
 mm/internal.h                                          |    7 
 mm/kasan/quarantine.c                                  |   11 
 mm/kasan/shadow.c                                      |    9 
 mm/khugepaged.c                                        |   23 
 mm/kmemleak.c                                          |   21 
 mm/ksm.c                                               |    5 
 mm/madvise.c                                           |  510 ++++++++++------
 mm/mapping_dirty_helpers.c                             |    1 
 mm/memcontrol.c                                        |   44 -
 mm/memory-failure.c                                    |  189 +++---
 mm/memory.c                                            |   12 
 mm/mempolicy.c                                         |   95 ++-
 mm/memremap.c                                          |   18 
 mm/migrate.c                                           |  527 ++++++++++-------
 mm/mlock.c                                             |    2 
 mm/mmap.c                                              |   55 +
 mm/mmu_gather.c                                        |    1 
 mm/mprotect.c                                          |    2 
 mm/oom_kill.c                                          |   30 
 mm/page_alloc.c                                        |  198 ++++--
 mm/page_counter.c                                      |    1 
 mm/page_ext.c                                          |    8 
 mm/page_isolation.c                                    |    2 
 mm/page_owner.c                                        |    4 
 mm/page_table_check.c                                  |  270 ++++++++
 mm/percpu-internal.h                                   |   18 
 mm/percpu.c                                            |   10 
 mm/pgtable-generic.c                                   |    1 
 mm/rmap.c                                              |   43 +
 mm/shmem.c                                             |   91 ++
 mm/slab.h                                              |    5 
 mm/slab_common.c                                       |   34 -
 mm/swap.c                                              |    2 
 mm/swapfile.c                                          |   46 -
 mm/truncate.c                                          |    5 
 mm/userfaultfd.c                                       |    5 
 mm/util.c                                              |   15 
 mm/vmalloc.c                                           |   75 +-
 mm/vmscan.c                                            |    2 
 mm/vmstat.c                                            |    3 
 mm/zpool.c                                             |   12 
 net/ceph/buffer.c                                      |    4 
 net/ceph/ceph_common.c                                 |   27 
 net/ceph/crypto.c                                      |    2 
 net/ceph/messenger.c                                   |    2 
 net/ceph/messenger_v2.c                                |    2 
 net/ceph/osdmap.c                                      |   12 
 net/sunrpc/svc_xprt.c                                  |    3 
 scripts/spelling.txt                                   |    1 
 tools/testing/selftests/vm/charge_reserved_hugetlb.sh  |   34 -
 tools/testing/selftests/vm/hmm-tests.c                 |   42 +
 tools/testing/selftests/vm/hugepage-mremap.c           |   46 -
 tools/testing/selftests/vm/hugetlb_reparenting_test.sh |   21 
 tools/testing/selftests/vm/run_vmtests.sh              |    2 
 tools/testing/selftests/vm/userfaultfd.c               |   33 -
 tools/testing/selftests/vm/write_hugetlb_memory.sh     |    2 
 211 files changed, 3980 insertions(+), 1759 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-12-31  4:12 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-12-31  4:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

2 patches, based on 4f3d93c6eaff6b84e43b63e0d7a119c5920e1020.

Subsystems affected by this patch series:

  mm/userfaultfd
  mm/damon

Subsystem: mm/userfaultfd

    Mike Kravetz <mike.kravetz@oracle.com>:
      userfaultfd/selftests: fix hugetlb area allocations

Subsystem: mm/damon

    SeongJae Park <sj@kernel.org>:
      mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'

 mm/damon/dbgfs.c                         |    9 +++++++--
 tools/testing/selftests/vm/userfaultfd.c |   16 ++++++++++------
 2 files changed, 17 insertions(+), 8 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-12-25  5:11 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-12-25  5:11 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

9 patches, based on bc491fb12513e79702c6f936c838f792b5389129.

Subsystems affected by this patch series:

  mm/kfence
  mm/mempolicy
  core-kernel
  MAINTAINERS
  mm/memory-failure
  mm/pagemap
  mm/pagealloc
  mm/damon
  mm/memory-failure

Subsystem: mm/kfence

    Baokun Li <libaokun1@huawei.com>:
      kfence: fix memory leak when cat kfence objects

Subsystem: mm/mempolicy

    Andrey Ryabinin <arbn@yandex-team.com>:
      mm: mempolicy: fix THP allocations escaping mempolicy restrictions

Subsystem: core-kernel

    Philipp Rudo <prudo@redhat.com>:
      kernel/crash_core: suppress unknown crashkernel parameter warning

Subsystem: MAINTAINERS

    Randy Dunlap <rdunlap@infradead.org>:
      MAINTAINERS: mark more list instances as moderated

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm, hwpoison: fix condition in free hugetlb page path

Subsystem: mm/pagemap

    Hugh Dickins <hughd@google.com>:
      mm: delete unsafe BUG from page_cache_add_speculative()

Subsystem: mm/pagealloc

    Thibaut Sautereau <thibaut.sautereau@ssi.gouv.fr>:
      mm/page_alloc: fix __alloc_size attribute for alloc_pages_exact_nid

Subsystem: mm/damon

    SeongJae Park <sj@kernel.org>:
      mm/damon/dbgfs: protect targets destructions with kdamond_lock

Subsystem: mm/memory-failure

    Liu Shixin <liushixin2@huawei.com>:
      mm/hwpoison: clear MF_COUNT_INCREASED before retrying get_any_page()

 MAINTAINERS             |    4 ++--
 include/linux/gfp.h     |    2 +-
 include/linux/pagemap.h |    1 -
 kernel/crash_core.c     |   11 +++++++++++
 mm/damon/dbgfs.c        |    2 ++
 mm/kfence/core.c        |    1 +
 mm/memory-failure.c     |   14 +++++---------
 mm/mempolicy.c          |    3 +--
 8 files changed, 23 insertions(+), 15 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-12-10 22:45 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-12-10 22:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

21 patches, based on c741e49150dbb0c0aebe234389f4aa8b47958fa8.

Subsystems affected by this patch series:

  mm/mlock
  MAINTAINERS
  mailmap
  mm/pagecache
  mm/damon
  mm/slub
  mm/memcg
  mm/hugetlb
  mm/pagecache

Subsystem: mm/mlock

    Drew DeVault <sir@cmpwn.com>:
      Increase default MLOCK_LIMIT to 8 MiB

Subsystem: MAINTAINERS

    Dave Young <dyoung@redhat.com>:
      MAINTAINERS: update kdump maintainers

Subsystem: mailmap

    Guo Ren <guoren@linux.alibaba.com>:
      mailmap: update email address for Guo Ren

Subsystem: mm/pagecache

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      filemap: remove PageHWPoison check from next_uptodate_page()

Subsystem: mm/damon

    SeongJae Park <sj@kernel.org>:
    Patch series "mm/damon: Fix fake /proc/loadavg reports", v3:
      timers: implement usleep_idle_range()
      mm/damon/core: fix fake load reports due to uninterruptible sleeps
    Patch series "mm/damon: Trivial fixups and improvements":
      mm/damon/core: use better timer mechanisms selection threshold
      mm/damon/dbgfs: remove an unnecessary error message
      mm/damon/core: remove unnecessary error messages
      mm/damon/vaddr: remove an unnecessary warning message
      mm/damon/vaddr-test: split a test function having >1024 bytes frame size
      mm/damon/vaddr-test: remove unnecessary variables
      selftests/damon: skip test if DAMON is running
      selftests/damon: test DAMON enabling with empty target_ids case
      selftests/damon: test wrong DAMOS condition ranges input
      selftests/damon: test debugfs file reads/writes with huge count
      selftests/damon: split test cases

Subsystem: mm/slub

    Gerald Schaefer <gerald.schaefer@linux.ibm.com>:
      mm/slub: fix endianness bug for alloc/free_traces attributes

Subsystem: mm/memcg

    Waiman Long <longman@redhat.com>:
      mm/memcg: relocate mod_objcg_mlstate(), get_obj_stock() and put_obj_stock()

Subsystem: mm/hugetlb

    Zhenguo Yao <yaozhenguo1@gmail.com>:
      hugetlbfs: fix issue of preallocation of gigantic pages can't work

Subsystem: mm/pagecache

    Manjong Lee <mj0123.lee@samsung.com>:
      mm: bdi: initialize bdi_min_ratio when bdi is unregistered

 .mailmap                                                       |    2 
 MAINTAINERS                                                    |    2 
 include/linux/delay.h                                          |   14 
 include/uapi/linux/resource.h                                  |   13 
 kernel/time/timer.c                                            |   16 -
 mm/backing-dev.c                                               |    7 
 mm/damon/core.c                                                |   20 -
 mm/damon/dbgfs.c                                               |    4 
 mm/damon/vaddr-test.h                                          |   85 ++---
 mm/damon/vaddr.c                                               |    1 
 mm/filemap.c                                                   |    2 
 mm/hugetlb.c                                                   |    2 
 mm/memcontrol.c                                                |  106 +++----
 mm/slub.c                                                      |   15 -
 tools/testing/selftests/damon/.gitignore                       |    2 
 tools/testing/selftests/damon/Makefile                         |    7 
 tools/testing/selftests/damon/_debugfs_common.sh               |   52 +++
 tools/testing/selftests/damon/debugfs_attrs.sh                 |  149 ++--------
 tools/testing/selftests/damon/debugfs_empty_targets.sh         |   13 
 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh |   22 +
 tools/testing/selftests/damon/debugfs_schemes.sh               |   19 +
 tools/testing/selftests/damon/debugfs_target_ids.sh            |   19 +
 tools/testing/selftests/damon/huge_count_read_write.c          |   39 ++
 23 files changed, 363 insertions(+), 248 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-11-20  0:42 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-11-20  0:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

15 patches, based on a90af8f15bdc9449ee2d24e1d73fa3f7e8633f81.

Subsystems affected by this patch series:

  mm/swap
  ipc
  mm/slab-generic
  hexagon
  mm/kmemleak
  mm/hugetlb
  mm/kasan
  mm/damon
  mm/highmem
  proc

Subsystem: mm/swap

    Matthew Wilcox <willy@infradead.org>:
      mm/swap.c:put_pages_list(): reinitialise the page list

Subsystem: ipc

    Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>:
    Patch series "shm: shm_rmid_forced feature fixes":
      ipc: WARN if trying to remove ipc object which is absent
      shm: extend forced shm destroy to support objects from several IPC nses

Subsystem: mm/slab-generic

    Yunfeng Ye <yeyunfeng@huawei.com>:
      mm: emit the "free" trace report before freeing memory in kmem_cache_free()

Subsystem: hexagon

    Nathan Chancellor <nathan@kernel.org>:
    Patch series "Fixes for ARCH=hexagon allmodconfig", v2:
      hexagon: export raw I/O routines for modules
      hexagon: clean up timer-regs.h
      hexagon: ignore vmlinux.lds

Subsystem: mm/kmemleak

    Rustam Kovhaev <rkovhaev@gmail.com>:
      mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag

Subsystem: mm/hugetlb

    Bui Quang Minh <minhquangbui99@gmail.com>:
      hugetlb: fix hugetlb cgroup refcounting during mremap

    Mina Almasry <almasrymina@google.com>:
      hugetlb, userfaultfd: fix reservation restore on userfaultfd error

Subsystem: mm/kasan

    Kees Cook <keescook@chromium.org>:
      kasan: test: silence intentional read overflow warnings

Subsystem: mm/damon

    SeongJae Park <sj@kernel.org>:
    Patch series "DAMON fixes":
      mm/damon/dbgfs: use '__GFP_NOWARN' for user-specified size buffer allocation
      mm/damon/dbgfs: fix missed use of damon_dbgfs_lock

Subsystem: mm/highmem

    Ard Biesheuvel <ardb@kernel.org>:
      kmap_local: don't assume kmap PTEs are linear arrays in memory

Subsystem: proc

    David Hildenbrand <david@redhat.com>:
      proc/vmcore: fix clearing user buffer by properly using clear_user()

 arch/arm/Kconfig                      |    1 
 arch/hexagon/include/asm/timer-regs.h |   26 ----
 arch/hexagon/include/asm/timex.h      |    3 
 arch/hexagon/kernel/.gitignore        |    1 
 arch/hexagon/kernel/time.c            |   12 +-
 arch/hexagon/lib/io.c                 |    4 
 fs/proc/vmcore.c                      |   20 ++-
 include/linux/hugetlb_cgroup.h        |   12 ++
 include/linux/ipc_namespace.h         |   15 ++
 include/linux/sched/task.h            |    2 
 ipc/shm.c                             |  189 +++++++++++++++++++++++++---------
 ipc/util.c                            |    6 -
 lib/test_kasan.c                      |    2 
 mm/Kconfig                            |    3 
 mm/damon/dbgfs.c                      |   20 ++-
 mm/highmem.c                          |   32 +++--
 mm/hugetlb.c                          |   11 +
 mm/slab.c                             |    3 
 mm/slab.h                             |    2 
 mm/slob.c                             |    3 
 mm/slub.c                             |    2 
 mm/swap.c                             |    1 
 22 files changed, 254 insertions(+), 116 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-11-11  4:32 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-11-11  4:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

The post-linux-next material.

7 patches, based on debe436e77c72fcee804fb867f275e6d31aa999c.

Subsystems affected by this patch series:

  mm/debug
  mm/slab-generic
  mm/migration
  mm/memcg
  mm/kasan

Subsystem: mm/debug

    Yixuan Cao <caoyixuan2019@email.szu.edu.cn>:
      mm/page_owner.c: modify the type of argument "order" in some functions

Subsystem: mm/slab-generic

    Ingo Molnar <mingo@kernel.org>:
      mm: allow only SLUB on PREEMPT_RT

Subsystem: mm/migration

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm: migrate: simplify the file-backed pages validation when migrating its mapping

    Alistair Popple <apopple@nvidia.com>:
      mm/migrate.c: remove MIGRATE_PFN_LOCKED

Subsystem: mm/memcg

    Christoph Hellwig <hch@lst.de>:
    Patch series "unexport memcg locking helpers":
      mm: unexport folio_memcg_{,un}lock
      mm: unexport {,un}lock_page_memcg

Subsystem: mm/kasan

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
      kasan: add kasan mode messages when kasan init

 Documentation/vm/hmm.rst                 |    2 
 arch/arm64/mm/kasan_init.c               |    2 
 arch/powerpc/kvm/book3s_hv_uvmem.c       |    4 
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c |    2 
 drivers/gpu/drm/nouveau/nouveau_dmem.c   |    4 
 include/linux/migrate.h                  |    1 
 include/linux/page_owner.h               |   12 +-
 init/Kconfig                             |    2 
 lib/test_hmm.c                           |    5 -
 mm/kasan/hw_tags.c                       |   14 ++
 mm/kasan/sw_tags.c                       |    2 
 mm/memcontrol.c                          |    4 
 mm/migrate.c                             |  151 +++++--------------------------
 mm/page_owner.c                          |    6 -
 14 files changed, 61 insertions(+), 150 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-11-09  2:30 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-11-09  2:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

87 patches, based on 8bb7eca972ad531c9b149c0a51ab43a417385813, plus
previously sent material.

Subsystems affected by this patch series:

  mm/pagecache
  mm/hugetlb
  procfs
  misc
  MAINTAINERS
  lib
  checkpatch
  binfmt
  kallsyms
  ramfs
  init
  codafs
  nilfs2
  hfs
  crash_dump
  signals
  seq_file
  fork
  sysvfs
  kcov
  gdb
  resource
  selftests
  ipc

Subsystem: mm/pagecache

    Johannes Weiner <hannes@cmpxchg.org>:
      vfs: keep inodes with page cache off the inode shrinker LRU

Subsystem: mm/hugetlb

    zhangyiru <zhangyiru3@huawei.com>:
      mm,hugetlb: remove mlock ulimit for SHM_HUGETLB

Subsystem: procfs

    Florian Weimer <fweimer@redhat.com>:
      procfs: do not list TID 0 in /proc/<pid>/task

    David Hildenbrand <david@redhat.com>:
      x86/xen: update xen_oldmem_pfn_is_ram() documentation
      x86/xen: simplify xen_oldmem_pfn_is_ram()
      x86/xen: print a warning when HVMOP_get_mem_type fails
      proc/vmcore: let pfn_is_ram() return a bool
      proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks
      virtio-mem: factor out hotplug specifics from virtio_mem_init() into virtio_mem_init_hotplug()
      virtio-mem: factor out hotplug specifics from virtio_mem_probe() into virtio_mem_init_hotplug()
      virtio-mem: factor out hotplug specifics from virtio_mem_remove() into virtio_mem_deinit_hotplug()
      virtio-mem: kdump mode to sanitize /proc/vmcore access

    Stephen Brennan <stephen.s.brennan@oracle.com>:
      proc: allow pid_revalidate() during LOOKUP_RCU

Subsystem: misc

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
    Patch series "kernel.h further split", v5:
      kernel.h: drop unneeded <linux/kernel.h> inclusion from other headers
      kernel.h: split out container_of() and typeof_member() macros
      include/kunit/test.h: replace kernel.h with the necessary inclusions
      include/linux/list.h: replace kernel.h with the necessary inclusions
      include/linux/llist.h: replace kernel.h with the necessary inclusions
      include/linux/plist.h: replace kernel.h with the necessary inclusions
      include/media/media-entity.h: replace kernel.h with the necessary inclusions
      include/linux/delay.h: replace kernel.h with the necessary inclusions
      include/linux/sbitmap.h: replace kernel.h with the necessary inclusions
      include/linux/radix-tree.h: replace kernel.h with the necessary inclusions
      include/linux/generic-radix-tree.h: replace kernel.h with the necessary inclusions

    Stephen Rothwell <sfr@canb.auug.org.au>:
      kernel.h: split out instruction pointer accessors

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      linux/container_of.h: switch to static_assert

    Colin Ian King <colin.i.king@googlemail.com>:
      mailmap: update email address for Colin King

Subsystem: MAINTAINERS

    Kees Cook <keescook@chromium.org>:
      MAINTAINERS: add "exec & binfmt" section with myself and Eric

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
    Patch series "Rectify file references for dt-bindings in MAINTAINERS", v5:
      MAINTAINERS: rectify entry for ARM/TOSHIBA VISCONTI ARCHITECTURE
      MAINTAINERS: rectify entry for HIKEY960 ONBOARD USB GPIO HUB DRIVER
      MAINTAINERS: rectify entry for INTEL KEEM BAY DRM DRIVER
      MAINTAINERS: rectify entry for ALLWINNER HARDWARE SPINLOCK SUPPORT

Subsystem: lib

    Imran Khan <imran.f.khan@oracle.com>:
    Patch series "lib, stackdepot: check stackdepot handle before accessing slabs", v2:
      lib, stackdepot: check stackdepot handle before accessing slabs
      lib, stackdepot: add helper to print stack entries
      lib, stackdepot: add helper to print stack entries into buffer

    Lucas De Marchi <lucas.demarchi@intel.com>:
      include/linux/string_helpers.h: add linux/string.h for strlen()

    Alexey Dobriyan <adobriyan@gmail.com>:
      lib: uninline simple_strntoull() as well

    Thomas Gleixner <tglx@linutronix.de>:
      mm/scatterlist: replace the !preemptible warning in sg_miter_stop()

Subsystem: checkpatch

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      const_structs.checkpatch: add a few sound ops structs

    Joe Perches <joe@perches.com>:
      checkpatch: improve EXPORT_SYMBOL test for EXPORT_SYMBOL_NS uses

    Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
      checkpatch: get default codespell dictionary path from package location

Subsystem: binfmt

    Kees Cook <keescook@chromium.org>:
      binfmt_elf: reintroduce using MAP_FIXED_NOREPLACE

    Alexey Dobriyan <adobriyan@gmail.com>:
      ELF: simplify STACK_ALLOC macro

Subsystem: kallsyms

    Kefeng Wang <wangkefeng.wang@huawei.com>:
    Patch series "sections: Unify kernel sections range check and use", v4:
      kallsyms: remove arch specific text and data check
      kallsyms: fix address-checks for kernel related range
      sections: move and rename core_kernel_data() to is_kernel_core_data()
      sections: move is_kernel_inittext() into sections.h
      x86: mm: rename __is_kernel_text() to is_x86_32_kernel_text()
      sections: provide internal __is_kernel() and __is_kernel_text() helper
      mm: kasan: use is_kernel() helper
      extable: use is_kernel_text() helper
      powerpc/mm: use core_kernel_text() helper
      microblaze: use is_kernel_text() helper
      alpha: use is_kernel_text() helper

Subsystem: ramfs

    yangerkun <yangerkun@huawei.com>:
      ramfs: fix mount source show for ramfs

Subsystem: init

    Andrew Halaney <ahalaney@redhat.com>:
      init: make unknown command line param message clearer

Subsystem: codafs

    Jan Harkes <jaharkes@cs.cmu.edu>:
    Patch series "Coda updates for -next":
      coda: avoid NULL pointer dereference from a bad inode
      coda: check for async upcall request using local state

    Alex Shi <alex.shi@linux.alibaba.com>:
      coda: remove err which no one care

    Jan Harkes <jaharkes@cs.cmu.edu>:
      coda: avoid flagging NULL inodes
      coda: avoid hidden code duplication in rename
      coda: avoid doing bad things on inode type changes during revalidation

    Xiyu Yang <xiyuyang19@fudan.edu.cn>:
      coda: convert from atomic_t to refcount_t on coda_vm_ops->refcnt

    Jing Yangyang <jing.yangyang@zte.com.cn>:
      coda: use vmemdup_user to replace the open code

    Jan Harkes <jaharkes@cs.cmu.edu>:
      coda: bump module version to 7.2

Subsystem: nilfs2

    Qing Wang <wangqing@vivo.com>:
    Patch series "nilfs2 updates":
      nilfs2: replace snprintf in show functions with sysfs_emit

    Ryusuke Konishi <konishi.ryusuke@gmail.com>:
      nilfs2: remove filenames from file comments

Subsystem: hfs

    Arnd Bergmann <arnd@arndb.de>:
      hfs/hfsplus: use WARN_ON for sanity check

Subsystem: crash_dump

    Changcheng Deng <deng.changcheng@zte.com.cn>:
      crash_dump: fix boolreturn.cocci warning

    Ye Guojin <ye.guojin@zte.com.cn>:
      crash_dump: remove duplicate include in crash_dump.h

Subsystem: signals

    Ye Guojin <ye.guojin@zte.com.cn>:
      signal: remove duplicate include in signal.h

Subsystem: seq_file

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      seq_file: move seq_escape() to a header

    Muchun Song <songmuchun@bytedance.com>:
      seq_file: fix passing wrong private data

Subsystem: fork

    Ran Xiaokai <ran.xiaokai@zte.com.cn>:
      kernel/fork.c: unshare(): use swap() to make code cleaner

Subsystem: sysvfs

    Pavel Skripkin <paskripkin@gmail.com>:
      sysv: use BUILD_BUG_ON instead of runtime check

Subsystem: kcov

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
    Patch series "kcov: PREEMPT_RT fixup + misc", v2:
      Documentation/kcov: include types.h in the example
      Documentation/kcov: define `ip' in the example
      kcov: allocate per-CPU memory on the relevant node
      kcov: avoid enable+disable interrupts if !in_task()
      kcov: replace local_irq_save() with a local_lock_t

Subsystem: gdb

    Douglas Anderson <dianders@chromium.org>:
      scripts/gdb: handle split debug for vmlinux

Subsystem: resource

    David Hildenbrand <david@redhat.com>:
    Patch series "virtio-mem: disallow mapping virtio-mem memory via /dev/mem", v5:
      kernel/resource: clean up and optimize iomem_is_exclusive()
      kernel/resource: disallow access to exclusive system RAM regions
      virtio-mem: disallow mapping virtio-mem memory via /dev/mem

Subsystem: selftests

    SeongJae Park <sjpark@amazon.de>:
      selftests/kselftest/runner/run_one(): allow running non-executable files

Subsystem: ipc

    Michal Clapinski <mclapinski@google.com>:
      ipc: check checkpoint_restore_ns_capable() to modify C/R proc files

    Manfred Spraul <manfred@colorfullife.com>:
      ipc/ipc_sysctl.c: remove fallback for !CONFIG_PROC_SYSCTL

 .mailmap                                             |    2 
 Documentation/dev-tools/kcov.rst                     |    5 
 MAINTAINERS                                          |   21 +
 arch/alpha/kernel/traps.c                            |    4 
 arch/microblaze/mm/pgtable.c                         |    3 
 arch/powerpc/mm/pgtable_32.c                         |    7 
 arch/riscv/lib/delay.c                               |    4 
 arch/s390/include/asm/facility.h                     |    4 
 arch/x86/kernel/aperture_64.c                        |   13 
 arch/x86/kernel/unwind_orc.c                         |    2 
 arch/x86/mm/init_32.c                                |   14 
 arch/x86/xen/mmu_hvm.c                               |   39 --
 drivers/gpu/drm/drm_dp_mst_topology.c                |    5 
 drivers/gpu/drm/drm_mm.c                             |    5 
 drivers/gpu/drm/i915/i915_vma.c                      |    5 
 drivers/gpu/drm/i915/intel_runtime_pm.c              |   20 -
 drivers/media/dvb-frontends/cxd2880/cxd2880_common.h |    1 
 drivers/virtio/Kconfig                               |    1 
 drivers/virtio/virtio_mem.c                          |  321 +++++++++++++------
 fs/binfmt_elf.c                                      |   33 +
 fs/coda/cnode.c                                      |   13 
 fs/coda/coda_linux.c                                 |   39 +-
 fs/coda/coda_linux.h                                 |    6 
 fs/coda/dir.c                                        |   20 -
 fs/coda/file.c                                       |   12 
 fs/coda/psdev.c                                      |   14 
 fs/coda/upcall.c                                     |    3 
 fs/hfs/inode.c                                       |    6 
 fs/hfsplus/inode.c                                   |   12 
 fs/hugetlbfs/inode.c                                 |   23 -
 fs/inode.c                                           |   46 +-
 fs/internal.h                                        |    1 
 fs/nilfs2/alloc.c                                    |    2 
 fs/nilfs2/alloc.h                                    |    2 
 fs/nilfs2/bmap.c                                     |    2 
 fs/nilfs2/bmap.h                                     |    2 
 fs/nilfs2/btnode.c                                   |    2 
 fs/nilfs2/btnode.h                                   |    2 
 fs/nilfs2/btree.c                                    |    2 
 fs/nilfs2/btree.h                                    |    2 
 fs/nilfs2/cpfile.c                                   |    2 
 fs/nilfs2/cpfile.h                                   |    2 
 fs/nilfs2/dat.c                                      |    2 
 fs/nilfs2/dat.h                                      |    2 
 fs/nilfs2/dir.c                                      |    2 
 fs/nilfs2/direct.c                                   |    2 
 fs/nilfs2/direct.h                                   |    2 
 fs/nilfs2/file.c                                     |    2 
 fs/nilfs2/gcinode.c                                  |    2 
 fs/nilfs2/ifile.c                                    |    2 
 fs/nilfs2/ifile.h                                    |    2 
 fs/nilfs2/inode.c                                    |    2 
 fs/nilfs2/ioctl.c                                    |    2 
 fs/nilfs2/mdt.c                                      |    2 
 fs/nilfs2/mdt.h                                      |    2 
 fs/nilfs2/namei.c                                    |    2 
 fs/nilfs2/nilfs.h                                    |    2 
 fs/nilfs2/page.c                                     |    2 
 fs/nilfs2/page.h                                     |    2 
 fs/nilfs2/recovery.c                                 |    2 
 fs/nilfs2/segbuf.c                                   |    2 
 fs/nilfs2/segbuf.h                                   |    2 
 fs/nilfs2/segment.c                                  |    2 
 fs/nilfs2/segment.h                                  |    2 
 fs/nilfs2/sufile.c                                   |    2 
 fs/nilfs2/sufile.h                                   |    2 
 fs/nilfs2/super.c                                    |    2 
 fs/nilfs2/sysfs.c                                    |   78 ++--
 fs/nilfs2/sysfs.h                                    |    2 
 fs/nilfs2/the_nilfs.c                                |    2 
 fs/nilfs2/the_nilfs.h                                |    2 
 fs/proc/base.c                                       |   21 -
 fs/proc/vmcore.c                                     |  109 ++++--
 fs/ramfs/inode.c                                     |   11 
 fs/seq_file.c                                        |   16 
 fs/sysv/super.c                                      |    6 
 include/asm-generic/sections.h                       |   75 +++-
 include/kunit/test.h                                 |   13 
 include/linux/bottom_half.h                          |    3 
 include/linux/container_of.h                         |   52 ++-
 include/linux/crash_dump.h                           |   30 +
 include/linux/delay.h                                |    2 
 include/linux/fs.h                                   |    1 
 include/linux/fwnode.h                               |    1 
 include/linux/generic-radix-tree.h                   |    3 
 include/linux/hugetlb.h                              |    6 
 include/linux/instruction_pointer.h                  |    8 
 include/linux/kallsyms.h                             |   21 -
 include/linux/kernel.h                               |   39 --
 include/linux/list.h                                 |    4 
 include/linux/llist.h                                |    4 
 include/linux/pagemap.h                              |   50 ++
 include/linux/plist.h                                |    5 
 include/linux/radix-tree.h                           |    4 
 include/linux/rwsem.h                                |    1 
 include/linux/sbitmap.h                              |   11 
 include/linux/seq_file.h                             |   19 +
 include/linux/signal.h                               |    1 
 include/linux/smp.h                                  |    1 
 include/linux/spinlock.h                             |    1 
 include/linux/stackdepot.h                           |    5 
 include/linux/string_helpers.h                       |    1 
 include/media/media-entity.h                         |    3 
 init/main.c                                          |    4 
 ipc/ipc_sysctl.c                                     |   42 +-
 ipc/shm.c                                            |    8 
 kernel/extable.c                                     |   33 -
 kernel/fork.c                                        |    9 
 kernel/kcov.c                                        |   40 +-
 kernel/locking/lockdep.c                             |    3 
 kernel/resource.c                                    |   54 ++-
 kernel/trace/ftrace.c                                |    2 
 lib/scatterlist.c                                    |   11 
 lib/stackdepot.c                                     |   46 ++
 lib/vsprintf.c                                       |    3 
 mm/Kconfig                                           |    7 
 mm/filemap.c                                         |    8 
 mm/kasan/report.c                                    |   17 -
 mm/memfd.c                                           |    4 
 mm/mmap.c                                            |    3 
 mm/page_owner.c                                      |   18 -
 mm/truncate.c                                        |   19 +
 mm/vmscan.c                                          |    7 
 mm/workingset.c                                      |   10 
 net/sysctl_net.c                                     |    2 
 scripts/checkpatch.pl                                |   33 +
 scripts/const_structs.checkpatch                     |    4 
 scripts/gdb/linux/symbols.py                         |    3 
 tools/testing/selftests/kselftest/runner.sh          |   28 +
 tools/testing/selftests/proc/.gitignore              |    1 
 tools/testing/selftests/proc/Makefile                |    2 
 tools/testing/selftests/proc/proc-tid0.c             |   81 ++++
 132 files changed, 1206 insertions(+), 681 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-11-05 20:34 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-11-05 20:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

262 patches, based on 8bb7eca972ad531c9b149c0a51ab43a417385813

Subsystems affected by this patch series:

  scripts
  ocfs2
  vfs
  mm/slab-generic
  mm/slab
  mm/slub
  mm/kconfig
  mm/dax
  mm/kasan
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/mprotect
  mm/mremap
  mm/iomap
  mm/tracing
  mm/vmalloc
  mm/pagealloc
  mm/memory-failure
  mm/hugetlb
  mm/userfaultfd
  mm/vmscan
  mm/tools
  mm/memblock
  mm/oom-kill
  mm/hugetlbfs
  mm/migration
  mm/thp
  mm/readahead
  mm/nommu
  mm/ksm
  mm/vmstat
  mm/madvise
  mm/memory-hotplug
  mm/rmap
  mm/zsmalloc
  mm/highmem
  mm/zram
  mm/cleanups
  mm/kfence
  mm/damon

Subsystem: scripts

    Colin Ian King <colin.king@canonical.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

    Sven Eckelmann <sven@narfation.org>:
      scripts/spelling.txt: fix "mistake" version of "synchronization"

    weidonghui <weidonghui@allwinnertech.com>:
      scripts/decodecode: fix faulting instruction no print when opps.file is DOS format

Subsystem: ocfs2

    Chenyuan Mi <cymi20@fudan.edu.cn>:
      ocfs2: fix handle refcount leak in two exception handling paths

    Valentin Vidic <vvidic@valentin-vidic.from.hr>:
      ocfs2: cleanup journal init and shutdown

    Colin Ian King <colin.king@canonical.com>:
      ocfs2/dlm: remove redundant assignment of variable ret

    Jan Kara <jack@suse.cz>:
    Patch series "ocfs2: Truncate data corruption fix":
      ocfs2: fix data corruption on truncate
      ocfs2: do not zero pages beyond i_size

Subsystem: vfs

    Arnd Bergmann <arnd@arndb.de>:
      fs/posix_acl.c: avoid -Wempty-body warning

    Jia He <justin.he@arm.com>:
      d_path: fix Kernel doc validator complaining

Subsystem: mm/slab-generic

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: move kvmalloc-related functions to slab.h

Subsystem: mm/slab

    Shi Lei <shi_lei@massclouds.com>:
      mm/slab.c: remove useless lines in enable_cpucache()

Subsystem: mm/slub

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      slub: add back check for free nonslab objects

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: change percpu partial accounting from objects to pages
      mm/slub: increase default cpu partial list sizes

    Hyeonggon Yoo <42.hyeyoo@gmail.com>:
      mm, slub: use prefetchw instead of prefetch

Subsystem: mm/kconfig

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm: disable NUMA_BALANCING_DEFAULT_ENABLED and TRANSPARENT_HUGEPAGE on PREEMPT_RT

Subsystem: mm/dax

    Christoph Hellwig <hch@lst.de>:
      mm: don't include <linux/dax.h> in <linux/mempolicy.h>

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
    Patch series "stackdepot, kasan, workqueue: Avoid expanding stackdepot slabs when holding raw_spin_lock", v2:
      lib/stackdepot: include gfp.h
      lib/stackdepot: remove unused function argument
      lib/stackdepot: introduce __stack_depot_save()
      kasan: common: provide can_alloc in kasan_save_stack()
      kasan: generic: introduce kasan_record_aux_stack_noalloc()
      workqueue, kasan: avoid alloc_pages() when recording stack

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      kasan: fix tag for large allocations when using CONFIG_SLAB

    Peter Collingbourne <pcc@google.com>:
      kasan: test: add memcpy test that avoids out-of-bounds write

Subsystem: mm/debug

    Peter Xu <peterx@redhat.com>:
    Patch series "mm/smaps: Fixes and optimizations on shmem swap handling":
      mm/smaps: fix shmem pte hole swap calculation
      mm/smaps: use vma->vm_pgoff directly when counting partial swap
      mm/smaps: simplify shmem handling of pte holes

    Guo Ren <guoren@linux.alibaba.com>:
      mm: debug_vm_pgtable: don't use __P000 directly

    Kees Cook <keescook@chromium.org>:
      kasan: test: bypass __alloc_size checks
    Patch series "Add __alloc_size()", v3:
      rapidio: avoid bogus __alloc_size warning
      Compiler Attributes: add __alloc_size() for better bounds checking
      slab: clean up function prototypes
      slab: add __alloc_size attributes for better bounds checking
      mm/kvmalloc: add __alloc_size attributes for better bounds checking
      mm/vmalloc: add __alloc_size attributes for better bounds checking
      mm/page_alloc: add __alloc_size attributes for better bounds checking
      percpu: add __alloc_size attributes for better bounds checking

    Yinan Zhang <zhangyinan2019@email.szu.edu.cn>:
      mm/page_ext.c: fix a comment

Subsystem: mm/pagecache

    David Howells <dhowells@redhat.com>:
      mm: stop filemap_read() from grabbing a superfluous page

    Christoph Hellwig <hch@lst.de>:
    Patch series "simplify bdi unregistation":
      mm: export bdi_unregister
      mtd: call bdi_unregister explicitly
      fs: explicitly unregister per-superblock BDIs
      mm: don't automatically unregister bdis
      mm: simplify bdi refcounting

    Jens Axboe <axboe@kernel.dk>:
      mm: don't read i_size of inode unless we need it

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/filemap.c: remove bogus VM_BUG_ON

    Jens Axboe <axboe@kernel.dk>:
      mm: move more expensive part of XA setup out of mapping check

Subsystem: mm/gup

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup: further simplify __gup_device_huge()

Subsystem: mm/swap

    Xu Wang <vulab@iscas.ac.cn>:
      mm/swapfile: remove needless request_queue NULL pointer check

    Rafael Aquini <aquini@redhat.com>:
      mm/swapfile: fix an integer overflow in swap_show()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: optimise put_pages_list()

Subsystem: mm/memcg

    Peter Xu <peterx@redhat.com>:
      mm/memcg: drop swp_entry_t* in mc_handle_file_pte()

    Shakeel Butt <shakeelb@google.com>:
      memcg: flush stats only if updated
      memcg: unify memcg stat flushing

    Waiman Long <longman@redhat.com>:
      mm/memcg: remove obsolete memcg_free_kmem()

    Len Baker <len.baker@gmx.com>:
      mm/list_lru.c: prefer struct_size over open coded arithmetic

    Shakeel Butt <shakeelb@google.com>:
      memcg, kmem: further deprecate kmem.limit_in_bytes

    Muchun Song <songmuchun@bytedance.com>:
      mm: list_lru: remove holding lru lock
      mm: list_lru: fix the return value of list_lru_count_one()
      mm: memcontrol: remove kmemcg_id reparenting
      mm: memcontrol: remove the kmem states
      mm: list_lru: only add memcg-aware lrus to the global lru list

    Vasily Averin <vvs@virtuozzo.com>:
    Patch series "memcg: prohibit unconditional exceeding the limit of dying tasks", v3:
      mm, oom: pagefault_out_of_memory: don't force global OOM for dying tasks

    Michal Hocko <mhocko@suse.com>:
      mm, oom: do not trigger out_of_memory from the #PF

    Vasily Averin <vvs@virtuozzo.com>:
      memcg: prohibit unconditional exceeding the limit of dying tasks

Subsystem: mm/pagemap

    Peng Liu <liupeng256@huawei.com>:
      mm/mmap.c: fix a data race of mm->total_vm

    Rolf Eike Beer <eb@emlix.com>:
      mm: use __pfn_to_section() instead of open coding it

    Amit Daniel Kachhap <amit.kachhap@arm.com>:
      mm/memory.c: avoid unnecessary kernel/user pointer conversion

    Nadav Amit <namit@vmware.com>:
      mm/memory.c: use correct VMA flags when freeing page-tables

    Peter Xu <peterx@redhat.com>:
    Patch series "mm: A few cleanup patches around zap, shmem and uffd", v4:
      mm/shmem: unconditionally set pte dirty in mfill_atomic_install_pte
      mm: clear vmf->pte after pte_unmap_same() returns
      mm: drop first_index/last_index in zap_details
      mm: add zap_skip_check_mapping() helper

    Qi Zheng <zhengqi.arch@bytedance.com>:
    Patch series "Do some code cleanups related to mm", v3:
      mm: introduce pmd_install() helper
      mm: remove redundant smp_wmb()

    Tiberiu A Georgescu <tiberiu.georgescu@nutanix.com>:
      Documentation: update pagemap with shmem exceptions

    Nicholas Piggin <npiggin@gmail.com>:
    Patch series "shoot lazy tlbs", v4:
      lazy tlb: introduce lazy mm refcount helper functions
      lazy tlb: allow lazy tlb mm refcounting to be configurable
      lazy tlb: shoot lazies, a non-refcounting lazy tlb option
      powerpc/64s: enable MMU_LAZY_TLB_SHOOTDOWN

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      memory: remove unused CONFIG_MEM_BLOCK_SIZE

Subsystem: mm/mprotect

    Liu Song <liu.song11@zte.com.cn>:
      mm/mprotect.c: avoid repeated assignment in do_mprotect_pkey()

Subsystem: mm/mremap

    Dmitry Safonov <dima@arista.com>:
      mm/mremap: don't account pages in vma_to_resize()

Subsystem: mm/iomap

    Lucas De Marchi <lucas.demarchi@intel.com>:
      include/linux/io-mapping.h: remove fallback for writecombine

Subsystem: mm/tracing

    Gang Li <ligang.bdlg@bytedance.com>:
      mm: mmap_lock: remove redundant newline  in TP_printk
      mm: mmap_lock: use DECLARE_EVENT_CLASS and DEFINE_EVENT_FN

Subsystem: mm/vmalloc

    Vasily Averin <vvs@virtuozzo.com>:
      mm/vmalloc: repair warn_alloc()s in __vmalloc_area_node()

    Peter Zijlstra <peterz@infradead.org>:
      mm/vmalloc: don't allow VM_NO_GUARD on vmap()

    Eric Dumazet <edumazet@google.com>:
      mm/vmalloc: make show_numa_info() aware of hugepage mappings
      mm/vmalloc: make sure to dump unpurged areas in /proc/vmallocinfo

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: do not adjust the search size for alignment overhead
      mm/vmalloc: check various alignments when debugging

    Vasily Averin <vvs@virtuozzo.com>:
      vmalloc: back off when the current task is OOM-killed

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      vmalloc: choose a better start address in vm_area_register_early()
      arm64: support page mapping percpu first chunk allocator
      kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC

    Michal Hocko <mhocko@suse.com>:
      mm/vmalloc: be more explicit about supported gfp flags

    Chen Wandun <chenwandun@huawei.com>:
      mm/vmalloc: introduce alloc_pages_bulk_array_mempolicy to accelerate memory allocation

    Changcheng Deng <deng.changcheng@zte.com.cn>:
      lib/test_vmalloc.c: use swap() to make code cleaner

Subsystem: mm/pagealloc

    Eric Dumazet <edumazet@google.com>:
      mm/large system hash: avoid possible NULL deref in alloc_large_system_hash

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanups and fixup for page_alloc", v2:
      mm/page_alloc.c: remove meaningless VM_BUG_ON() in pindex_to_order()
      mm/page_alloc.c: simplify the code by using macro K()
      mm/page_alloc.c: fix obsolete comment in free_pcppages_bulk()
      mm/page_alloc.c: use helper function zone_spans_pfn()
      mm/page_alloc.c: avoid allocating highmem pages via alloc_pages_exact[_nid]

    Bharata B Rao <bharata@amd.com>:
    Patch series "Fix NUMA nodes fallback list ordering":
      mm/page_alloc: print node fallback order

    Krupa Ramakrishnan <krupa.ramakrishnan@amd.com>:
      mm/page_alloc: use accumulated load when building node fallback list

    Geert Uytterhoeven <geert+renesas@glider.be>:
    Patch series "Fix NUMA without SMP":
      mm: move node_reclaim_distance to fix NUMA without SMP
      mm: move fold_vm_numa_events() to fix NUMA without SMP

    Eric Dumazet <edumazet@google.com>:
      mm/page_alloc.c: do not acquire zone lock in is_free_buddy_page()

    Feng Tang <feng.tang@intel.com>:
      mm/page_alloc: detect allocation forbidden by cpuset and bail out early

    Liangcai Fan <liangcaifan19@gmail.com>:
      mm/page_alloc.c: show watermark_boost of zone in zoneinfo

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm: create a new system state and fix core_kernel_text()
      mm: make generic arch_is_kernel_initmem_freed() do what it says
      powerpc: use generic version of arch_is_kernel_initmem_freed()
      s390: use generic version of arch_is_kernel_initmem_freed()

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm: page_alloc: use migrate_disable() in drain_local_pages_wq()

    Wang ShaoBo <bobo.shaobowang@huawei.com>:
      mm/page_alloc: use clamp() to simplify code

Subsystem: mm/memory-failure

    Marco Elver <elver@google.com>:
      mm: fix data race in PagePoisoned()

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      mm/memory_failure: constify static mm_walk_ops

    Yang Shi <shy828301@gmail.com>:
    Patch series "Solve silent data loss caused by poisoned page cache (shmem/tmpfs)", v5:
      mm: filemap: coding style cleanup for filemap_map_pmd()
      mm: hwpoison: refactor refcount check handling
      mm: shmem: don't truncate page if memory failure happens
      mm: hwpoison: handle non-anonymous THP correctly

Subsystem: mm/hugetlb

    Peter Xu <peterx@redhat.com>:
      mm/hugetlb: drop __unmap_hugepage_range definition from hugetlb.h

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "hugetlb: add demote/split page functionality", v4:
      hugetlb: add demote hugetlb page sysfs interfaces
      mm/cma: add cma_pages_valid to determine if pages are in CMA
      hugetlb: be sure to free demoted CMA pages to CMA
      hugetlb: add demote bool to gigantic page routines
      hugetlb: add hugetlb demote page support

    Liangcai Fan <liangcaifan19@gmail.com>:
      mm: khugepaged: recalculate min_free_kbytes after stopping khugepaged

    Mina Almasry <almasrymina@google.com>:
      mm, hugepages: add mremap() support for hugepage backed vma
      mm, hugepages: add hugetlb vma mremap() test

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      hugetlb: support node specified when using cma for gigantic hugepages

    Ran Jianping <ran.jianping@zte.com.cn>:
      mm: remove duplicate include in hugepage-mremap.c

    Baolin Wang <baolin.wang@linux.alibaba.com>:
    Patch series "Some cleanups and improvements for hugetlb":
      hugetlb_cgroup: remove unused hugetlb_cgroup_from_counter macro
      hugetlb: replace the obsolete hugetlb_instantiation_mutex in the comments
      hugetlb: remove redundant validation in has_same_uncharge_info()
      hugetlb: remove redundant VM_BUG_ON() in add_reservation_in_range()

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: remove unnecessary set_page_count in prep_compound_gigantic_page

Subsystem: mm/userfaultfd

    Axel Rasmussen <axelrasmussen@google.com>:
    Patch series "Small userfaultfd selftest fixups", v2:
      userfaultfd/selftests: don't rely on GNU extensions for random numbers
      userfaultfd/selftests: fix feature support detection
      userfaultfd/selftests: fix calculation of expected ioctls

Subsystem: mm/vmscan

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/page_isolation: fix potential missing call to unset_migratetype_isolate()
      mm/page_isolation: guard against possible putback unisolated page

    Kai Song <songkai01@inspur.com>:
      mm/vmscan.c: fix -Wunused-but-set-variable warning

    Mel Gorman <mgorman@techsingularity.net>:
    Patch series "Remove dependency on congestion_wait in mm/", v5. Patch series:
      mm/vmscan: throttle reclaim until some writeback completes if congested
      mm/vmscan: throttle reclaim and compaction when too may pages are isolated
      mm/vmscan: throttle reclaim when no progress is being made
      mm/writeback: throttle based on page writeback instead of congestion
      mm/page_alloc: remove the throttling logic from the page allocator
      mm/vmscan: centralise timeout values for reclaim_throttle
      mm/vmscan: increase the timeout if page reclaim is not making progress
      mm/vmscan: delay waking of tasks throttled on NOPROGRESS

    Yuanzheng Song <songyuanzheng@huawei.com>:
      mm/vmpressure: fix data-race with memcg->socket_pressure

Subsystem: mm/tools

    Zhenliang Wei <weizhenliang@huawei.com>:
      tools/vm/page_owner_sort.c: count and sort by mem

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
    Patch series "tools/vm/page-types.c: a few improvements":
      tools/vm/page-types.c: make walk_file() aware of address range option
      tools/vm/page-types.c: move show_file() to summary output
      tools/vm/page-types.c: print file offset in hexadecimal

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "memblock: cleanup memblock_free interface", v2:
      arch_numa: simplify numa_distance allocation
      xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer
      memblock: drop memblock_free_early_nid() and memblock_free_early()
      memblock: stop aliasing __memblock_free_late with memblock_free_late
      memblock: rename memblock_free to memblock_phys_free
      memblock: use memblock_free for freeing virtual pointers

Subsystem: mm/oom-kill

    Sultan Alsawaf <sultan@kerneltoast.com>:
      mm: mark the OOM reaper thread as freezable

Subsystem: mm/hugetlbfs

    Zhenguo Yao <yaozhenguo1@gmail.com>:
      hugetlbfs: extend the definition of hugepages parameter to support node allocation

Subsystem: mm/migration

    John Hubbard <jhubbard@nvidia.com>:
      mm/migrate: de-duplicate migrate_reason strings

    Yang Shi <shy828301@gmail.com>:
      mm: migrate: make demotion knob depend on migration

Subsystem: mm/thp

    "George G. Davis" <davis.george@siemens.com>:
      selftests/vm/transhuge-stress: fix ram size thinko

    Rongwei Wang <rongwei.wang@linux.alibaba.com>:
    Patch series "fix two bugs for file THP":
      mm, thp: lock filemap when truncating page cache
      mm, thp: fix incorrect unmap behavior for private pages

Subsystem: mm/readahead

    Lin Feng <linf@wangsu.com>:
      mm/readahead.c: fix incorrect comments for get_init_ra_size

Subsystem: mm/nommu

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm: nommu: kill arch_get_unmapped_area()

Subsystem: mm/ksm

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      selftest/vm: fix ksm selftest to run with different NUMA topologies

    Pedro Demarchi Gomes <pedrodemargomes@gmail.com>:
      selftests: vm: add KSM huge pages merging time test

Subsystem: mm/vmstat

    Liu Shixin <liushixin2@huawei.com>:
      mm/vmstat: annotate data race for zone->free_area[order].nr_free

    Lin Feng <linf@wangsu.com>:
      mm: vmstat.c: make extfrag_index show more pretty

Subsystem: mm/madvise

    David Hildenbrand <david@redhat.com>:
      selftests/vm: make MADV_POPULATE_(READ|WRITE) use in-tree headers

Subsystem: mm/memory-hotplug

    Tang Yizhou <tangyizhou@huawei.com>:
      mm/memory_hotplug: add static qualifier for online_policy_to_str()

    David Hildenbrand <david@redhat.com>:
    Patch series "memory-hotplug.rst: document the "auto-movable" online policy":
      memory-hotplug.rst: fix two instances of "movablecore" that should be "movable_node"
      memory-hotplug.rst: fix wrong /sys/module/memory_hotplug/parameters/ path
      memory-hotplug.rst: document the "auto-movable" online policy
    Patch series "mm/memory_hotplug: Kconfig and 32 bit cleanups":
      mm/memory_hotplug: remove CONFIG_X86_64_ACPI_NUMA dependency from CONFIG_MEMORY_HOTPLUG
      mm/memory_hotplug: remove CONFIG_MEMORY_HOTPLUG_SPARSE
      mm/memory_hotplug: restrict CONFIG_MEMORY_HOTPLUG to 64 bit
      mm/memory_hotplug: remove HIGHMEM leftovers
      mm/memory_hotplug: remove stale function declarations
      x86: remove memory hotplug support on X86_32
    Patch series "mm/memory_hotplug: full support for add_memory_driver_managed() with CONFIG_ARCH_KEEP_MEMBLOCK", v2:
      mm/memory_hotplug: handle memblock_add_node() failures in add_memory_resource()
      memblock: improve MEMBLOCK_HOTPLUG documentation
      memblock: allow to specify flags with memblock_add_node()
      memblock: add MEMBLOCK_DRIVER_MANAGED to mimic IORESOURCE_SYSRAM_DRIVER_MANAGED
      mm/memory_hotplug: indicate MEMBLOCK_DRIVER_MANAGED with IORESOURCE_SYSRAM_DRIVER_MANAGED

Subsystem: mm/rmap

    Alistair Popple <apopple@nvidia.com>:
      mm/rmap.c: avoid double faults migrating device private pages

Subsystem: mm/zsmalloc

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/zsmalloc.c: close race window between zs_pool_dec_isolated() and zs_unregister_migration()

Subsystem: mm/highmem

    Ira Weiny <ira.weiny@intel.com>:
      mm/highmem: remove deprecated kmap_atomic

Subsystem: mm/zram

    Jaewon Kim <jaewon31.kim@samsung.com>:
      zram_drv: allow reclaim on bio_alloc

    Dan Carpenter <dan.carpenter@oracle.com>:
      zram: off by one in read_block_state()

    Brian Geffon <bgeffon@google.com>:
      zram: introduce an aged idle interface

Subsystem: mm/cleanups

    Stephen Kitt <steve@sk2.org>:
      mm: remove HARDENED_USERCOPY_FALLBACK

    Mianhan Liu <liumh1@shanghaitech.edu.cn>:
      include/linux/mm.h: move nr_free_buffer_pages from swap.h to mm.h

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      stacktrace: move filter_irq_stacks() to kernel/stacktrace.c
      kfence: count unexpectedly skipped allocations
      kfence: move saving stack trace of allocations into __kfence_alloc()
      kfence: limit currently covered allocations when pool nearly full
      kfence: add note to documentation about skipping covered allocations
      kfence: test: use kunit_skip() to skip tests
      kfence: shorten critical sections of alloc/free
      kfence: always use static branches to guard kfence_alloc()
      kfence: default to dynamic branch instead of static keys mode

Subsystem: mm/damon

    Geert Uytterhoeven <geert@linux-m68k.org>:
      mm/damon: grammar s/works/work/

    SeongJae Park <sjpark@amazon.de>:
      Documentation/vm: move user guides to admin-guide/mm/

    SeongJae Park <sj@kernel.org>:
      MAINTAINERS: update SeongJae's email address

    SeongJae Park <sjpark@amazon.de>:
      docs/vm/damon: remove broken reference
      include/linux/damon.h: fix kernel-doc comments for 'damon_callback'

    SeongJae Park <sj@kernel.org>:
      mm/damon/core: print kdamond start log in debug mode only

    Changbin Du <changbin.du@gmail.com>:
      mm/damon: remove unnecessary do_exit() from kdamond
      mm/damon: needn't hold kdamond_lock to print pid of kdamond

    Colin Ian King <colin.king@canonical.com>:
      mm/damon/core: nullify pointer ctx->kdamond with a NULL

    SeongJae Park <sj@kernel.org>:
    Patch series "Implement Data Access Monitoring-based Memory Operation Schemes":
      mm/damon/core: account age of target regions
      mm/damon/core: implement DAMON-based Operation Schemes (DAMOS)
      mm/damon/vaddr: support DAMON-based Operation Schemes
      mm/damon/dbgfs: support DAMON-based Operation Schemes
      mm/damon/schemes: implement statistics feature
      selftests/damon: add 'schemes' debugfs tests
      Docs/admin-guide/mm/damon: document DAMON-based Operation Schemes
    Patch series "DAMON: Support Physical Memory Address Space Monitoring::
      mm/damon/dbgfs: allow users to set initial monitoring target regions
      mm/damon/dbgfs-test: add a unit test case for 'init_regions'
      Docs/admin-guide/mm/damon: document 'init_regions' feature
      mm/damon/vaddr: separate commonly usable functions
      mm/damon: implement primitives for physical address space monitoring
      mm/damon/dbgfs: support physical memory monitoring
      Docs/DAMON: document physical memory monitoring support

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      mm/damon/vaddr: constify static mm_walk_ops

    Rongwei Wang <rongwei.wang@linux.alibaba.com>:
      mm/damon/dbgfs: remove unnecessary variables

    SeongJae Park <sj@kernel.org>:
      mm/damon/paddr: support the pageout scheme
      mm/damon/schemes: implement size quota for schemes application speed control
      mm/damon/schemes: skip already charged targets and regions
      mm/damon/schemes: implement time quota
      mm/damon/dbgfs: support quotas of schemes
      mm/damon/selftests: support schemes quotas
      mm/damon/schemes: prioritize regions within the quotas
      mm/damon/vaddr,paddr: support pageout prioritization
      mm/damon/dbgfs: support prioritization weights
      tools/selftests/damon: update for regions prioritization of schemes
      mm/damon/schemes: activate schemes based on a watermarks mechanism
      mm/damon/dbgfs: support watermarks
      selftests/damon: support watermarks
      mm/damon: introduce DAMON-based Reclamation (DAMON_RECLAIM)
      Documentation/admin-guide/mm/damon: add a document for DAMON_RECLAIM

    Xin Hao <xhao@linux.alibaba.com>:
    Patch series "mm/damon: Fix some small bugs", v4:
      mm/damon: remove unnecessary variable initialization
      mm/damon/dbgfs: add adaptive_targets list check before enable monitor_on

    SeongJae Park <sj@kernel.org>:
    Patch series "Fix trivial nits in Documentation/admin-guide/mm":
      Docs/admin-guide/mm/damon/start: fix wrong example commands
      Docs/admin-guide/mm/damon/start: fix a wrong link
      Docs/admin-guide/mm/damon/start: simplify the content
      Docs/admin-guide/mm/pagemap: wordsmith page flags descriptions

    Changbin Du <changbin.du@gmail.com>:
      mm/damon: simplify stop mechanism

    Colin Ian King <colin.i.king@googlemail.com>:
      mm/damon: fix a few spelling mistakes in comments and a pr_debug message

    Changbin Du <changbin.du@gmail.com>:
      mm/damon: remove return value from before_terminate callback

 a/Documentation/admin-guide/blockdev/zram.rst                  |    8 
 a/Documentation/admin-guide/cgroup-v1/memory.rst               |   11 
 a/Documentation/admin-guide/kernel-parameters.txt              |   14 
 a/Documentation/admin-guide/mm/damon/index.rst                 |    1 
 a/Documentation/admin-guide/mm/damon/reclaim.rst               |  235 +++
 a/Documentation/admin-guide/mm/damon/start.rst                 |  140 +
 a/Documentation/admin-guide/mm/damon/usage.rst                 |  117 +
 a/Documentation/admin-guide/mm/hugetlbpage.rst                 |   42 
 a/Documentation/admin-guide/mm/memory-hotplug.rst              |  147 +-
 a/Documentation/admin-guide/mm/pagemap.rst                     |   75 -
 a/Documentation/core-api/memory-hotplug.rst                    |    3 
 a/Documentation/dev-tools/kfence.rst                           |   23 
 a/Documentation/translations/zh_CN/core-api/memory-hotplug.rst |    4 
 a/Documentation/vm/damon/design.rst                            |   29 
 a/Documentation/vm/damon/faq.rst                               |    5 
 a/Documentation/vm/damon/index.rst                             |    1 
 a/Documentation/vm/page_owner.rst                              |   23 
 a/MAINTAINERS                                                  |    2 
 a/Makefile                                                     |   15 
 a/arch/Kconfig                                                 |   28 
 a/arch/alpha/kernel/core_irongate.c                            |    6 
 a/arch/arc/mm/init.c                                           |    6 
 a/arch/arm/mach-hisi/platmcpm.c                                |    2 
 a/arch/arm/mach-rpc/ecard.c                                    |    2 
 a/arch/arm/mm/init.c                                           |    2 
 a/arch/arm64/Kconfig                                           |    4 
 a/arch/arm64/mm/kasan_init.c                                   |   16 
 a/arch/arm64/mm/mmu.c                                          |    4 
 a/arch/ia64/mm/contig.c                                        |    2 
 a/arch/ia64/mm/init.c                                          |    2 
 a/arch/m68k/mm/mcfmmu.c                                        |    3 
 a/arch/m68k/mm/motorola.c                                      |    6 
 a/arch/mips/loongson64/init.c                                  |    4 
 a/arch/mips/mm/init.c                                          |    6 
 a/arch/mips/sgi-ip27/ip27-memory.c                             |    3 
 a/arch/mips/sgi-ip30/ip30-setup.c                              |    6 
 a/arch/powerpc/Kconfig                                         |    1 
 a/arch/powerpc/configs/skiroot_defconfig                       |    1 
 a/arch/powerpc/include/asm/machdep.h                           |    2 
 a/arch/powerpc/include/asm/sections.h                          |   13 
 a/arch/powerpc/kernel/dt_cpu_ftrs.c                            |    8 
 a/arch/powerpc/kernel/paca.c                                   |    8 
 a/arch/powerpc/kernel/setup-common.c                           |    4 
 a/arch/powerpc/kernel/setup_64.c                               |    6 
 a/arch/powerpc/kernel/smp.c                                    |    2 
 a/arch/powerpc/mm/book3s64/radix_tlb.c                         |    4 
 a/arch/powerpc/mm/hugetlbpage.c                                |    9 
 a/arch/powerpc/platforms/powernv/pci-ioda.c                    |    4 
 a/arch/powerpc/platforms/powernv/setup.c                       |    4 
 a/arch/powerpc/platforms/pseries/setup.c                       |    2 
 a/arch/powerpc/platforms/pseries/svm.c                         |    9 
 a/arch/riscv/kernel/setup.c                                    |   10 
 a/arch/s390/include/asm/sections.h                             |   12 
 a/arch/s390/kernel/setup.c                                     |   11 
 a/arch/s390/kernel/smp.c                                       |    6 
 a/arch/s390/kernel/uv.c                                        |    2 
 a/arch/s390/mm/init.c                                          |    3 
 a/arch/s390/mm/kasan_init.c                                    |    2 
 a/arch/sh/boards/mach-ap325rxa/setup.c                         |    2 
 a/arch/sh/boards/mach-ecovec24/setup.c                         |    4 
 a/arch/sh/boards/mach-kfr2r09/setup.c                          |    2 
 a/arch/sh/boards/mach-migor/setup.c                            |    2 
 a/arch/sh/boards/mach-se/7724/setup.c                          |    4 
 a/arch/sparc/kernel/smp_64.c                                   |    4 
 a/arch/um/kernel/mem.c                                         |    4 
 a/arch/x86/Kconfig                                             |    6 
 a/arch/x86/kernel/setup.c                                      |    4 
 a/arch/x86/kernel/setup_percpu.c                               |    2 
 a/arch/x86/mm/init.c                                           |    2 
 a/arch/x86/mm/init_32.c                                        |   31 
 a/arch/x86/mm/kasan_init_64.c                                  |    4 
 a/arch/x86/mm/numa.c                                           |    2 
 a/arch/x86/mm/numa_emulation.c                                 |    2 
 a/arch/x86/xen/mmu_pv.c                                        |    8 
 a/arch/x86/xen/p2m.c                                           |    4 
 a/arch/x86/xen/setup.c                                         |    6 
 a/drivers/base/Makefile                                        |    2 
 a/drivers/base/arch_numa.c                                     |   96 +
 a/drivers/base/node.c                                          |    9 
 a/drivers/block/zram/zram_drv.c                                |   66 
 a/drivers/firmware/efi/memmap.c                                |    2 
 a/drivers/hwmon/occ/p9_sbe.c                                   |    1 
 a/drivers/macintosh/smu.c                                      |    2 
 a/drivers/mmc/core/mmc_test.c                                  |    1 
 a/drivers/mtd/mtdcore.c                                        |    1 
 a/drivers/of/kexec.c                                           |    4 
 a/drivers/of/of_reserved_mem.c                                 |    5 
 a/drivers/rapidio/devices/rio_mport_cdev.c                     |    9 
 a/drivers/s390/char/sclp_early.c                               |    4 
 a/drivers/usb/early/xhci-dbc.c                                 |   10 
 a/drivers/virtio/Kconfig                                       |    2 
 a/drivers/xen/swiotlb-xen.c                                    |    4 
 a/fs/d_path.c                                                  |    8 
 a/fs/exec.c                                                    |    4 
 a/fs/ocfs2/alloc.c                                             |   21 
 a/fs/ocfs2/dlm/dlmrecovery.c                                   |    1 
 a/fs/ocfs2/file.c                                              |    8 
 a/fs/ocfs2/inode.c                                             |    4 
 a/fs/ocfs2/journal.c                                           |   28 
 a/fs/ocfs2/journal.h                                           |    3 
 a/fs/ocfs2/super.c                                             |   40 
 a/fs/open.c                                                    |   16 
 a/fs/posix_acl.c                                               |    3 
 a/fs/proc/task_mmu.c                                           |   28 
 a/fs/super.c                                                   |    3 
 a/include/asm-generic/sections.h                               |   14 
 a/include/linux/backing-dev-defs.h                             |    3 
 a/include/linux/backing-dev.h                                  |    1 
 a/include/linux/cma.h                                          |    1 
 a/include/linux/compiler-gcc.h                                 |    8 
 a/include/linux/compiler_attributes.h                          |   10 
 a/include/linux/compiler_types.h                               |   12 
 a/include/linux/cpuset.h                                       |   17 
 a/include/linux/damon.h                                        |  258 +++
 a/include/linux/fs.h                                           |    1 
 a/include/linux/gfp.h                                          |    8 
 a/include/linux/highmem.h                                      |   28 
 a/include/linux/hugetlb.h                                      |   36 
 a/include/linux/io-mapping.h                                   |    6 
 a/include/linux/kasan.h                                        |    8 
 a/include/linux/kernel.h                                       |    1 
 a/include/linux/kfence.h                                       |   21 
 a/include/linux/memblock.h                                     |   48 
 a/include/linux/memcontrol.h                                   |    9 
 a/include/linux/memory.h                                       |   26 
 a/include/linux/memory_hotplug.h                               |    3 
 a/include/linux/mempolicy.h                                    |    5 
 a/include/linux/migrate.h                                      |   23 
 a/include/linux/migrate_mode.h                                 |   13 
 a/include/linux/mm.h                                           |   57 
 a/include/linux/mm_types.h                                     |    2 
 a/include/linux/mmzone.h                                       |   41 
 a/include/linux/node.h                                         |    4 
 a/include/linux/page-flags.h                                   |    2 
 a/include/linux/percpu.h                                       |    6 
 a/include/linux/sched/mm.h                                     |   25 
 a/include/linux/slab.h                                         |  181 +-
 a/include/linux/slub_def.h                                     |   13 
 a/include/linux/stackdepot.h                                   |    8 
 a/include/linux/stacktrace.h                                   |    1 
 a/include/linux/swap.h                                         |    1 
 a/include/linux/vmalloc.h                                      |   24 
 a/include/trace/events/mmap_lock.h                             |   50 
 a/include/trace/events/vmscan.h                                |   42 
 a/include/trace/events/writeback.h                             |    7 
 a/init/Kconfig                                                 |    2 
 a/init/initramfs.c                                             |    4 
 a/init/main.c                                                  |    6 
 a/kernel/cgroup/cpuset.c                                       |   23 
 a/kernel/cpu.c                                                 |    2 
 a/kernel/dma/swiotlb.c                                         |    6 
 a/kernel/exit.c                                                |    2 
 a/kernel/extable.c                                             |    2 
 a/kernel/fork.c                                                |   51 
 a/kernel/kexec_file.c                                          |    5 
 a/kernel/kthread.c                                             |   21 
 a/kernel/locking/lockdep.c                                     |   15 
 a/kernel/printk/printk.c                                       |    4 
 a/kernel/sched/core.c                                          |   37 
 a/kernel/sched/sched.h                                         |    4 
 a/kernel/sched/topology.c                                      |    1 
 a/kernel/stacktrace.c                                          |   30 
 a/kernel/tsacct.c                                              |    2 
 a/kernel/workqueue.c                                           |    2 
 a/lib/Kconfig.debug                                            |    2 
 a/lib/Kconfig.kfence                                           |   26 
 a/lib/bootconfig.c                                             |    2 
 a/lib/cpumask.c                                                |    6 
 a/lib/stackdepot.c                                             |   76 -
 a/lib/test_kasan.c                                             |   26 
 a/lib/test_kasan_module.c                                      |    2 
 a/lib/test_vmalloc.c                                           |    6 
 a/mm/Kconfig                                                   |   10 
 a/mm/backing-dev.c                                             |   65 
 a/mm/cma.c                                                     |   26 
 a/mm/compaction.c                                              |   12 
 a/mm/damon/Kconfig                                             |   24 
 a/mm/damon/Makefile                                            |    4 
 a/mm/damon/core.c                                              |  500 ++++++-
 a/mm/damon/dbgfs-test.h                                        |   56 
 a/mm/damon/dbgfs.c                                             |  486 +++++-
 a/mm/damon/paddr.c                                             |  275 +++
 a/mm/damon/prmtv-common.c                                      |  133 +
 a/mm/damon/prmtv-common.h                                      |   20 
 a/mm/damon/reclaim.c                                           |  356 ++++
 a/mm/damon/vaddr-test.h                                        |    2 
 a/mm/damon/vaddr.c                                             |  167 +-
 a/mm/debug.c                                                   |   20 
 a/mm/debug_vm_pgtable.c                                        |    7 
 a/mm/filemap.c                                                 |   78 -
 a/mm/gup.c                                                     |    5 
 a/mm/highmem.c                                                 |    6 
 a/mm/hugetlb.c                                                 |  713 +++++++++-
 a/mm/hugetlb_cgroup.c                                          |    3 
 a/mm/internal.h                                                |   26 
 a/mm/kasan/common.c                                            |    8 
 a/mm/kasan/generic.c                                           |   16 
 a/mm/kasan/kasan.h                                             |    2 
 a/mm/kasan/shadow.c                                            |    5 
 a/mm/kfence/core.c                                             |  214 ++-
 a/mm/kfence/kfence.h                                           |    2 
 a/mm/kfence/kfence_test.c                                      |   14 
 a/mm/khugepaged.c                                              |   10 
 a/mm/list_lru.c                                                |   58 
 a/mm/memblock.c                                                |   35 
 a/mm/memcontrol.c                                              |  217 +--
 a/mm/memory-failure.c                                          |  117 +
 a/mm/memory.c                                                  |  166 +-
 a/mm/memory_hotplug.c                                          |   57 
 a/mm/mempolicy.c                                               |  143 +-
 a/mm/migrate.c                                                 |   61 
 a/mm/mmap.c                                                    |    2 
 a/mm/mprotect.c                                                |    5 
 a/mm/mremap.c                                                  |   86 -
 a/mm/nommu.c                                                   |    6 
 a/mm/oom_kill.c                                                |   27 
 a/mm/page-writeback.c                                          |   13 
 a/mm/page_alloc.c                                              |  119 -
 a/mm/page_ext.c                                                |    2 
 a/mm/page_isolation.c                                          |   29 
 a/mm/percpu.c                                                  |   24 
 a/mm/readahead.c                                               |    2 
 a/mm/rmap.c                                                    |    8 
 a/mm/shmem.c                                                   |   44 
 a/mm/slab.c                                                    |   16 
 a/mm/slab_common.c                                             |    8 
 a/mm/slub.c                                                    |  117 -
 a/mm/sparse-vmemmap.c                                          |    2 
 a/mm/sparse.c                                                  |    6 
 a/mm/swap.c                                                    |   23 
 a/mm/swapfile.c                                                |    6 
 a/mm/userfaultfd.c                                             |    8 
 a/mm/vmalloc.c                                                 |  107 +
 a/mm/vmpressure.c                                              |    2 
 a/mm/vmscan.c                                                  |  194 ++
 a/mm/vmstat.c                                                  |   76 -
 a/mm/zsmalloc.c                                                |    7 
 a/net/ipv4/tcp.c                                               |    1 
 a/net/ipv4/udp.c                                               |    1 
 a/net/netfilter/ipvs/ip_vs_ctl.c                               |    1 
 a/net/openvswitch/meter.c                                      |    1 
 a/net/sctp/protocol.c                                          |    1 
 a/scripts/checkpatch.pl                                        |    3 
 a/scripts/decodecode                                           |    2 
 a/scripts/spelling.txt                                         |   18 
 a/security/Kconfig                                             |   14 
 a/tools/testing/selftests/damon/debugfs_attrs.sh               |   25 
 a/tools/testing/selftests/memory-hotplug/config                |    1 
 a/tools/testing/selftests/vm/.gitignore                        |    1 
 a/tools/testing/selftests/vm/Makefile                          |    1 
 a/tools/testing/selftests/vm/hugepage-mremap.c                 |  161 ++
 a/tools/testing/selftests/vm/ksm_tests.c                       |  154 ++
 a/tools/testing/selftests/vm/madv_populate.c                   |   15 
 a/tools/testing/selftests/vm/run_vmtests.sh                    |   11 
 a/tools/testing/selftests/vm/transhuge-stress.c                |    2 
 a/tools/testing/selftests/vm/userfaultfd.c                     |  157 +-
 a/tools/vm/page-types.c                                        |   38 
 a/tools/vm/page_owner_sort.c                                   |   94 +
 b/Documentation/admin-guide/mm/index.rst                       |    2 
 b/Documentation/vm/index.rst                                   |   26 
 260 files changed, 6448 insertions(+), 2327 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-10-28 21:35 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-10-28 21:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

11 patches, based on 411a44c24a561e449b592ff631b7ae321f1eb559.

Subsystems affected by this patch series:

  mm/memcg
  mm/memory-failure
  mm/oom-kill
  ocfs2
  mm/secretmem
  mm/vmalloc
  mm/hugetlb
  mm/damon
  mm/tools

Subsystem: mm/memcg

    Shakeel Butt <shakeelb@google.com>:
      memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT

Subsystem: mm/memory-failure

    Yang Shi <shy828301@gmail.com>:
      mm: hwpoison: remove the unnecessary THP check
      mm: filemap: check if THP has hwpoisoned subpage for PMD page fault

Subsystem: mm/oom-kill

    Suren Baghdasaryan <surenb@google.com>:
      mm/oom_kill.c: prevent a race between process_mrelease and exit_mmap

Subsystem: ocfs2

    Gautham Ananthakrishna <gautham.ananthakrishna@oracle.com>:
      ocfs2: fix race between searching chunks and release journal_head from buffer_head

Subsystem: mm/secretmem

    Kees Cook <keescook@chromium.org>:
      mm/secretmem: avoid letting secretmem_users drop to zero

Subsystem: mm/vmalloc

    Chen Wandun <chenwandun@huawei.com>:
      mm/vmalloc: fix numa spreading for large hash tables

Subsystem: mm/hugetlb

    Rongwei Wang <rongwei.wang@linux.alibaba.com>:
      mm, thp: bail out early in collapse_file for writeback page

    Yang Shi <shy828301@gmail.com>:
      mm: khugepaged: skip huge page collapse for special files

Subsystem: mm/damon

    SeongJae Park <sj@kernel.org>:
      mm/damon/core-test: fix wrong expectations for 'damon_split_regions_of()'

Subsystem: mm/tools

    David Yang <davidcomponentone@gmail.com>:
      tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer

 fs/ocfs2/suballoc.c                               |   22 ++++++++++-------
 include/linux/page-flags.h                        |   23 ++++++++++++++++++
 mm/damon/core-test.h                              |    4 +--
 mm/huge_memory.c                                  |    2 +
 mm/khugepaged.c                                   |   26 +++++++++++++-------
 mm/memory-failure.c                               |   28 +++++++++++-----------
 mm/memory.c                                       |    9 +++++++
 mm/oom_kill.c                                     |   23 +++++++++---------
 mm/page_alloc.c                                   |    8 +++++-
 mm/secretmem.c                                    |    2 -
 mm/vmalloc.c                                      |   15 +++++++----
 tools/testing/selftests/vm/split_huge_page_test.c |    2 -
 12 files changed, 110 insertions(+), 54 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-10-18 22:14 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-10-18 22:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


19 patches, based on 519d81956ee277b4419c723adfb154603c2565ba.

Subsystems affected by this patch series:

  mm/userfaultfd
  mm/migration
  ocfs2
  mm/memblock
  mm/mempolicy
  mm/slub
  binfmt
  vfs
  mm/secretmem
  mm/thp
  misc

Subsystem: mm/userfaultfd

    Peter Xu <peterx@redhat.com>:
      mm/userfaultfd: selftests: fix memory corruption with thp enabled

    Nadav Amit <namit@vmware.com>:
      userfaultfd: fix a race between writeprotect and exit_mmap()

Subsystem: mm/migration

    Dave Hansen <dave.hansen@linux.intel.com>:
    Patch series "mm/migrate: 5.15 fixes for automatic demotion", v2:
      mm/migrate: optimize hotplug-time demotion order updates
      mm/migrate: add CPU hotplug to demotion #ifdef

    Huang Ying <ying.huang@intel.com>:
      mm/migrate: fix CPUHP state to update node demotion order

Subsystem: ocfs2

    Jan Kara <jack@suse.cz>:
      ocfs2: fix data corruption after conversion from inline format

    Valentin Vidic <vvidic@valentin-vidic.from.hr>:
      ocfs2: mount fails with buffer overflow in strlen

Subsystem: mm/memblock

    Peng Fan <peng.fan@nxp.com>:
      memblock: check memory total_size

Subsystem: mm/mempolicy

    Eric Dumazet <edumazet@google.com>:
      mm/mempolicy: do not allow illegal MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind()

Subsystem: mm/slub

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Fixups for slub":
      mm, slub: fix two bugs in slab_debug_trace_open()
      mm, slub: fix mismatch between reconstructed freelist depth and cnt
      mm, slub: fix potential memoryleak in kmem_cache_open()
      mm, slub: fix potential use-after-free in slab_debugfs_fops
      mm, slub: fix incorrect memcg slab count for bulk free

Subsystem: binfmt

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      elfcore: correct reference to CONFIG_UML

Subsystem: vfs

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      vfs: check fd has read access in kernel_read_file_from_fd()

Subsystem: mm/secretmem

    Sean Christopherson <seanjc@google.com>:
      mm/secretmem: fix NULL page->mapping dereference in page_is_secretmem()

Subsystem: mm/thp

    Marek Szyprowski <m.szyprowski@samsung.com>:
      mm/thp: decrease nr_thps in file's mapping on THP split

Subsystem: misc

    Andrej Shadura <andrew.shadura@collabora.co.uk>:
      mailmap: add Andrej Shadura

 .mailmap                                 |    2 +
 fs/kernel_read_file.c                    |    2 -
 fs/ocfs2/alloc.c                         |   46 ++++++-----------------
 fs/ocfs2/super.c                         |   14 +++++--
 fs/userfaultfd.c                         |   12 ++++--
 include/linux/cpuhotplug.h               |    4 ++
 include/linux/elfcore.h                  |    2 -
 include/linux/memory.h                   |    5 ++
 include/linux/secretmem.h                |    2 -
 mm/huge_memory.c                         |    6 ++-
 mm/memblock.c                            |    2 -
 mm/mempolicy.c                           |   16 ++------
 mm/migrate.c                             |   62 ++++++++++++++++++-------------
 mm/page_ext.c                            |    4 --
 mm/slab.c                                |    4 +-
 mm/slub.c                                |   31 ++++++++++++---
 tools/testing/selftests/vm/userfaultfd.c |   23 ++++++++++-
 17 files changed, 138 insertions(+), 99 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-09-24 22:42 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-09-24 22:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

16 patches, based on 7d42e98182586f57f376406d033f05fe135edb75.

Subsystems affected by this patch series:

  mm/memory-failure
  mm/kasan
  mm/damon
  xtensa
  mm/shmem
  ocfs2
  scripts
  mm/tools
  lib
  mm/pagecache
  mm/debug
  sh
  mm/kasan
  mm/memory-failure
  mm/pagemap

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable()

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
      kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS

Subsystem: mm/damon

    Adam Borowski <kilobyte@angband.pl>:
      mm/damon: don't use strnlen() with known-bogus source length

Subsystem: xtensa

    Guenter Roeck <linux@roeck-us.net>:
      xtensa: increase size of gcc stack frame check

Subsystem: mm/shmem

    Liu Yuntao <liuyuntao10@huawei.com>:
      mm/shmem.c: fix judgment error in shmem_is_huge()

Subsystem: ocfs2

    Wengang Wang <wen.gang.wang@oracle.com>:
      ocfs2: drop acl cache for directories too

Subsystem: scripts

    Miles Chen <miles.chen@mediatek.com>:
      scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error

Subsystem: mm/tools

    Changbin Du <changbin.du@gmail.com>:
      tools/vm/page-types: remove dependency on opt_file for idle page tracking

Subsystem: lib

    Paul Menzel <pmenzel@molgen.mpg.de>:
      lib/zlib_inflate/inffast: check config in C to avoid unused function warning

Subsystem: mm/pagecache

    Minchan Kim <minchan@kernel.org>:
      mm: fs: invalidate bh_lrus for only cold path

Subsystem: mm/debug

    Weizhao Ouyang <o451686892@gmail.com>:
      mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN
      mm/debug: sync up latest migrate_reason to migrate_reason_names

Subsystem: sh

    Geert Uytterhoeven <geert+renesas@glider.be>:
      sh: pgtable-3level: fix cast to pointer from integer of different size

Subsystem: mm/kasan

    Nathan Chancellor <nathan@kernel.org>:
      kasan: always respect CONFIG_KASAN_STACK

Subsystem: mm/memory-failure

    Qi Zheng <zhengqi.arch@bytedance.com>:
      mm/memory_failure: fix the missing pte_unmap() call

Subsystem: mm/pagemap

    Chen Jun <chenjun102@huawei.com>:
      mm: fix uninitialized use in overcommit_policy_handler

 arch/sh/include/asm/pgtable-3level.h |    2 +-
 fs/buffer.c                          |    8 ++++++--
 fs/ocfs2/dlmglue.c                   |    3 ++-
 include/linux/buffer_head.h          |    4 ++--
 include/linux/migrate.h              |    6 +++++-
 lib/Kconfig.debug                    |    2 +-
 lib/Kconfig.kasan                    |    2 ++
 lib/zlib_inflate/inffast.c           |   13 ++++++-------
 mm/damon/dbgfs-test.h                |   16 ++++++++--------
 mm/debug.c                           |    4 +++-
 mm/memory-failure.c                  |   12 ++++++------
 mm/shmem.c                           |    4 ++--
 mm/swap.c                            |   19 ++++++++++++++++---
 mm/util.c                            |    4 ++--
 scripts/Makefile.kasan               |    3 ++-
 scripts/sorttable.c                  |    4 ++++
 tools/vm/page-types.c                |    2 +-
 17 files changed, 69 insertions(+), 39 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-09-10 17:11 ` incoming Kees Cook
@ 2021-09-10 20:13   ` Kees Cook
  0 siblings, 0 replies; 307+ messages in thread
From: Kees Cook @ 2021-09-10 20:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Andrew Morton, linux-mm, mm-commits

On Fri, Sep 10, 2021 at 10:11:53AM -0700, Kees Cook wrote:
> On Thu, Sep 09, 2021 at 08:09:48PM -0700, Andrew Morton wrote:
> > 
> > More post linux-next material.
> > 
> > 9 patches, based on f154c806676ad7153c6e161f30c53a44855329d6.
> > 
> > Subsystems affected by this patch series:
> > 
> >   mm/slab-generic
> >   rapidio
> >   mm/debug
> > 
> > Subsystem: mm/slab-generic
> > 
> >     "Matthew Wilcox (Oracle)" <willy@infradead.org>:
> >       mm: move kvmalloc-related functions to slab.h
> > 
> > Subsystem: rapidio
> > 
> >     Kees Cook <keescook@chromium.org>:
> >       rapidio: avoid bogus __alloc_size warning
> > 
> > Subsystem: mm/debug
> > 
> >     Kees Cook <keescook@chromium.org>:
> >     Patch series "Add __alloc_size() for better bounds checking", v2:
> >       Compiler Attributes: add __alloc_size() for better bounds checking
> >       checkpatch: add __alloc_size() to known $Attribute
> >       slab: clean up function declarations
> >       slab: add __alloc_size attributes for better bounds checking
> >       mm/page_alloc: add __alloc_size attributes for better bounds checking
> >       percpu: add __alloc_size attributes for better bounds checking
> >       mm/vmalloc: add __alloc_size attributes for better bounds checking
> 
> Hi,
> 
> FYI, in overnight build testing I found yet another corner case in
> GCC's handling of the __alloc_size attribute. It's the gift that keeps
> on giving. The fix is here:
> 
> https://lore.kernel.org/lkml/20210910165851.3296624-1-keescook@chromium.org/

I'm so glad it's Friday. Here's the v2 fix... *sigh*

https://lore.kernel.org/lkml/20210910201132.3809437-1-keescook@chromium.org/

-Kees

> 
> > 
> >  Makefile                                 |   15 +++
> >  drivers/of/kexec.c                       |    1 
> >  drivers/rapidio/devices/rio_mport_cdev.c |    9 +-
> >  include/linux/compiler_attributes.h      |    6 +
> >  include/linux/gfp.h                      |    2 
> >  include/linux/mm.h                       |   34 --------
> >  include/linux/percpu.h                   |    3 
> >  include/linux/slab.h                     |  122 ++++++++++++++++++++++---------
> >  include/linux/vmalloc.h                  |   11 ++
> >  scripts/checkpatch.pl                    |    3 
> >  10 files changed, 132 insertions(+), 74 deletions(-)
> > 
> 
> -- 
> Kees Cook

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-09-10  3:09 incoming Andrew Morton
@ 2021-09-10 17:11 ` Kees Cook
  2021-09-10 20:13   ` incoming Kees Cook
  0 siblings, 1 reply; 307+ messages in thread
From: Kees Cook @ 2021-09-10 17:11 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-mm, mm-commits

On Thu, Sep 09, 2021 at 08:09:48PM -0700, Andrew Morton wrote:
> 
> More post linux-next material.
> 
> 9 patches, based on f154c806676ad7153c6e161f30c53a44855329d6.
> 
> Subsystems affected by this patch series:
> 
>   mm/slab-generic
>   rapidio
>   mm/debug
> 
> Subsystem: mm/slab-generic
> 
>     "Matthew Wilcox (Oracle)" <willy@infradead.org>:
>       mm: move kvmalloc-related functions to slab.h
> 
> Subsystem: rapidio
> 
>     Kees Cook <keescook@chromium.org>:
>       rapidio: avoid bogus __alloc_size warning
> 
> Subsystem: mm/debug
> 
>     Kees Cook <keescook@chromium.org>:
>     Patch series "Add __alloc_size() for better bounds checking", v2:
>       Compiler Attributes: add __alloc_size() for better bounds checking
>       checkpatch: add __alloc_size() to known $Attribute
>       slab: clean up function declarations
>       slab: add __alloc_size attributes for better bounds checking
>       mm/page_alloc: add __alloc_size attributes for better bounds checking
>       percpu: add __alloc_size attributes for better bounds checking
>       mm/vmalloc: add __alloc_size attributes for better bounds checking

Hi,

FYI, in overnight build testing I found yet another corner case in
GCC's handling of the __alloc_size attribute. It's the gift that keeps
on giving. The fix is here:

https://lore.kernel.org/lkml/20210910165851.3296624-1-keescook@chromium.org/

> 
>  Makefile                                 |   15 +++
>  drivers/of/kexec.c                       |    1 
>  drivers/rapidio/devices/rio_mport_cdev.c |    9 +-
>  include/linux/compiler_attributes.h      |    6 +
>  include/linux/gfp.h                      |    2 
>  include/linux/mm.h                       |   34 --------
>  include/linux/percpu.h                   |    3 
>  include/linux/slab.h                     |  122 ++++++++++++++++++++++---------
>  include/linux/vmalloc.h                  |   11 ++
>  scripts/checkpatch.pl                    |    3 
>  10 files changed, 132 insertions(+), 74 deletions(-)
> 

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-09-10  3:09 Andrew Morton
  2021-09-10 17:11 ` incoming Kees Cook
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-09-10  3:09 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


More post linux-next material.

9 patches, based on f154c806676ad7153c6e161f30c53a44855329d6.

Subsystems affected by this patch series:

  mm/slab-generic
  rapidio
  mm/debug

Subsystem: mm/slab-generic

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: move kvmalloc-related functions to slab.h

Subsystem: rapidio

    Kees Cook <keescook@chromium.org>:
      rapidio: avoid bogus __alloc_size warning

Subsystem: mm/debug

    Kees Cook <keescook@chromium.org>:
    Patch series "Add __alloc_size() for better bounds checking", v2:
      Compiler Attributes: add __alloc_size() for better bounds checking
      checkpatch: add __alloc_size() to known $Attribute
      slab: clean up function declarations
      slab: add __alloc_size attributes for better bounds checking
      mm/page_alloc: add __alloc_size attributes for better bounds checking
      percpu: add __alloc_size attributes for better bounds checking
      mm/vmalloc: add __alloc_size attributes for better bounds checking

 Makefile                                 |   15 +++
 drivers/of/kexec.c                       |    1 
 drivers/rapidio/devices/rio_mport_cdev.c |    9 +-
 include/linux/compiler_attributes.h      |    6 +
 include/linux/gfp.h                      |    2 
 include/linux/mm.h                       |   34 --------
 include/linux/percpu.h                   |    3 
 include/linux/slab.h                     |  122 ++++++++++++++++++++++---------
 include/linux/vmalloc.h                  |   11 ++
 scripts/checkpatch.pl                    |    3 
 10 files changed, 132 insertions(+), 74 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-09-09  1:08 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-09-09  1:08 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


A bunch of hotfixes, mostly cc:stable.


8 patches, based on 2d338201d5311bcd79d42f66df4cecbcbc5f4f2c.

Subsystems affected by this patch series:

  mm/hmm
  mm/hugetlb
  mm/vmscan
  mm/pagealloc
  mm/pagemap
  mm/kmemleak
  mm/mempolicy
  mm/memblock

Subsystem: mm/hmm

    Li Zhijian <lizhijian@cn.fujitsu.com>:
      mm/hmm: bypass devmap pte when all pfn requested flags are fulfilled

Subsystem: mm/hugetlb

    Liu Zixian <liuzixian4@huawei.com>:
      mm/hugetlb: initialize hugetlb_usage in mm_init

Subsystem: mm/vmscan

    Rik van Riel <riel@surriel.com>:
      mm,vmscan: fix divide by zero in get_scan_count

Subsystem: mm/pagealloc

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/page_alloc.c: avoid accessing uninitialized pcp page migratetype

Subsystem: mm/pagemap

    Liam Howlett <liam.howlett@oracle.com>:
      mmap_lock: change trace and locking order

Subsystem: mm/kmemleak

    Naohiro Aota <naohiro.aota@wdc.com>:
      mm/kmemleak: allow __GFP_NOLOCKDEP passed to kmemleak's gfp

Subsystem: mm/mempolicy

    yanghui <yanghui.def@bytedance.com>:
      mm/mempolicy: fix a race between offset_il_node and mpol_rebind_task

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
      nds32/setup: remove unused memblock_region variable in setup_memory()

 arch/nds32/kernel/setup.c |    1 -
 include/linux/hugetlb.h   |    9 +++++++++
 include/linux/mmap_lock.h |    8 ++++----
 kernel/fork.c             |    1 +
 mm/hmm.c                  |    5 ++++-
 mm/kmemleak.c             |    3 ++-
 mm/mempolicy.c            |   17 +++++++++++++----
 mm/page_alloc.c           |    4 +++-
 mm/vmscan.c               |    2 +-
 9 files changed, 37 insertions(+), 13 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-09-08 22:17 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-09-08 22:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


This is the post-linux-next material, so it is based upon latest
upstream to catch the now-merged dependencies.

10 patches, based on 2d338201d5311bcd79d42f66df4cecbcbc5f4f2c.

Subsystems affected by this patch series:

  mm/vmstat
  mm/migration
  compat

Subsystem: mm/vmstat

    Ingo Molnar <mingo@elte.hu>:
      mm/vmstat: protect per cpu variables with preempt disable on RT

Subsystem: mm/migration

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm: migrate: introduce a local variable to get the number of pages
      mm: migrate: fix the incorrect function name in comments
      mm: migrate: change to use bool type for 'page_was_mapped'

Subsystem: compat

    Arnd Bergmann <arnd@arndb.de>:
    Patch series "compat: remove compat_alloc_user_space", v5:
      kexec: move locking into do_kexec_load
      kexec: avoid compat_alloc_user_space
      mm: simplify compat_sys_move_pages
      mm: simplify compat numa syscalls
      compat: remove some compat entry points
      arch: remove compat_alloc_user_space

 arch/arm64/include/asm/compat.h           |    5 
 arch/arm64/include/asm/uaccess.h          |   11 -
 arch/arm64/include/asm/unistd32.h         |   10 -
 arch/arm64/lib/Makefile                   |    2 
 arch/arm64/lib/copy_in_user.S             |   77 ----------
 arch/mips/cavium-octeon/octeon-memcpy.S   |    2 
 arch/mips/include/asm/compat.h            |    8 -
 arch/mips/include/asm/uaccess.h           |   26 ---
 arch/mips/kernel/syscalls/syscall_n32.tbl |   10 -
 arch/mips/kernel/syscalls/syscall_o32.tbl |   10 -
 arch/mips/lib/memcpy.S                    |   11 -
 arch/parisc/include/asm/compat.h          |    6 
 arch/parisc/include/asm/uaccess.h         |    2 
 arch/parisc/kernel/syscalls/syscall.tbl   |    8 -
 arch/parisc/lib/memcpy.c                  |    9 -
 arch/powerpc/include/asm/compat.h         |   16 --
 arch/powerpc/kernel/syscalls/syscall.tbl  |   10 -
 arch/s390/include/asm/compat.h            |   10 -
 arch/s390/include/asm/uaccess.h           |    3 
 arch/s390/kernel/syscalls/syscall.tbl     |   10 -
 arch/s390/lib/uaccess.c                   |   63 --------
 arch/sparc/include/asm/compat.h           |   19 --
 arch/sparc/kernel/process_64.c            |    2 
 arch/sparc/kernel/signal32.c              |   12 -
 arch/sparc/kernel/signal_64.c             |    8 -
 arch/sparc/kernel/syscalls/syscall.tbl    |   10 -
 arch/x86/entry/syscalls/syscall_32.tbl    |    4 
 arch/x86/entry/syscalls/syscall_64.tbl    |    2 
 arch/x86/include/asm/compat.h             |   13 -
 arch/x86/include/asm/uaccess_64.h         |    7 
 include/linux/compat.h                    |   39 +----
 include/linux/uaccess.h                   |   10 -
 include/uapi/asm-generic/unistd.h         |   10 -
 kernel/compat.c                           |   21 --
 kernel/kexec.c                            |  105 +++++---------
 kernel/sys_ni.c                           |    5 
 mm/mempolicy.c                            |  213 +++++++-----------------------
 mm/migrate.c                              |   69 +++++----
 mm/vmstat.c                               |   48 ++++++
 39 files changed, 243 insertions(+), 663 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-09-08  2:52 incoming Andrew Morton
@ 2021-09-08  8:57 ` Vlastimil Babka
  0 siblings, 0 replies; 307+ messages in thread
From: Vlastimil Babka @ 2021-09-08  8:57 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds
  Cc: linux-mm, mm-commits, Mike Galbraith, Mel Gorman

On 9/8/21 04:52, Andrew Morton wrote:
> Subsystem: mm/slub
> 
>     Vlastimil Babka <vbabka@suse.cz>:
>     Patch series "SLUB: reduce irq disabled scope and make it RT compatible", v6:
>       mm, slub: don't call flush_all() from slab_debug_trace_open()
>       mm, slub: allocate private object map for debugfs listings
>       mm, slub: allocate private object map for validate_slab_cache()
>       mm, slub: don't disable irq for debug_check_no_locks_freed()
>       mm, slub: remove redundant unfreeze_partials() from put_cpu_partial()
>       mm, slub: extract get_partial() from new_slab_objects()
>       mm, slub: dissolve new_slab_objects() into ___slab_alloc()
>       mm, slub: return slab page from get_partial() and set c->page afterwards
>       mm, slub: restructure new page checks in ___slab_alloc()
>       mm, slub: simplify kmem_cache_cpu and tid setup
>       mm, slub: move disabling/enabling irqs to ___slab_alloc()
>       mm, slub: do initial checks in ___slab_alloc() with irqs enabled
>       mm, slub: move disabling irqs closer to get_partial() in ___slab_alloc()
>       mm, slub: restore irqs around calling new_slab()
>       mm, slub: validate slab from partial list or page allocator before making it cpu slab
>       mm, slub: check new pages with restored irqs
>       mm, slub: stop disabling irqs around get_partial()
>       mm, slub: move reset of c->page and freelist out of deactivate_slab()
>       mm, slub: make locking in deactivate_slab() irq-safe
>       mm, slub: call deactivate_slab() without disabling irqs
>       mm, slub: move irq control into unfreeze_partials()
>       mm, slub: discard slabs in unfreeze_partials() without irqs disabled
>       mm, slub: detach whole partial list at once in unfreeze_partials()
>       mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing
>       mm, slub: only disable irq with spin_lock in __unfreeze_partials()
>       mm, slub: don't disable irqs in slub_cpu_dead()
>       mm, slab: split out the cpu offline variant of flush_slab()
> 
>     Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
>       mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context
>       mm: slub: make object_map_lock a raw_spinlock_t
> 
>     Vlastimil Babka <vbabka@suse.cz>:
>       mm, slub: make slab_lock() disable irqs with PREEMPT_RT
>       mm, slub: protect put_cpu_partial() with disabled irqs instead of cmpxchg
>       mm, slub: use migrate_disable() on PREEMPT_RT
>       mm, slub: convert kmem_cpu_slab protection to local_lock

For my own piece of mind, I've checked that this part (patches 1 to 33)
are identical to the v6 posting [1] and git version [2] that Mel and
Mike tested (replies to [1]).

[1] https://lore.kernel.org/all/20210904105003.11688-1-vbabka@suse.cz/
[2] git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git
tags/mm-slub-5.15-rc1


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-09-08  2:52 Andrew Morton
  2021-09-08  8:57 ` incoming Vlastimil Babka
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-09-08  2:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

147 patches, based on 7d2a07b769330c34b4deabeed939325c77a7ec2f.

Subsystems affected by this patch series:

  mm/slub
  mm/memory-hotplug
  mm/rmap
  mm/ioremap
  mm/highmem
  mm/cleanups
  mm/secretmem
  mm/kfence
  mm/damon
  alpha
  percpu
  procfs
  misc
  core-kernel
  MAINTAINERS
  lib
  bitops
  checkpatch
  epoll
  init
  nilfs2
  coredump
  fork
  pids
  criu
  kconfig
  selftests
  ipc
  mm/vmscan
  scripts

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "SLUB: reduce irq disabled scope and make it RT compatible", v6:
      mm, slub: don't call flush_all() from slab_debug_trace_open()
      mm, slub: allocate private object map for debugfs listings
      mm, slub: allocate private object map for validate_slab_cache()
      mm, slub: don't disable irq for debug_check_no_locks_freed()
      mm, slub: remove redundant unfreeze_partials() from put_cpu_partial()
      mm, slub: extract get_partial() from new_slab_objects()
      mm, slub: dissolve new_slab_objects() into ___slab_alloc()
      mm, slub: return slab page from get_partial() and set c->page afterwards
      mm, slub: restructure new page checks in ___slab_alloc()
      mm, slub: simplify kmem_cache_cpu and tid setup
      mm, slub: move disabling/enabling irqs to ___slab_alloc()
      mm, slub: do initial checks in ___slab_alloc() with irqs enabled
      mm, slub: move disabling irqs closer to get_partial() in ___slab_alloc()
      mm, slub: restore irqs around calling new_slab()
      mm, slub: validate slab from partial list or page allocator before making it cpu slab
      mm, slub: check new pages with restored irqs
      mm, slub: stop disabling irqs around get_partial()
      mm, slub: move reset of c->page and freelist out of deactivate_slab()
      mm, slub: make locking in deactivate_slab() irq-safe
      mm, slub: call deactivate_slab() without disabling irqs
      mm, slub: move irq control into unfreeze_partials()
      mm, slub: discard slabs in unfreeze_partials() without irqs disabled
      mm, slub: detach whole partial list at once in unfreeze_partials()
      mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing
      mm, slub: only disable irq with spin_lock in __unfreeze_partials()
      mm, slub: don't disable irqs in slub_cpu_dead()
      mm, slab: split out the cpu offline variant of flush_slab()

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context
      mm: slub: make object_map_lock a raw_spinlock_t

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: make slab_lock() disable irqs with PREEMPT_RT
      mm, slub: protect put_cpu_partial() with disabled irqs instead of cmpxchg
      mm, slub: use migrate_disable() on PREEMPT_RT
      mm, slub: convert kmem_cpu_slab protection to local_lock

Subsystem: mm/memory-hotplug

    David Hildenbrand <david@redhat.com>:
    Patch series "memory-hotplug.rst: complete admin-guide overhaul", v3:
      memory-hotplug.rst: remove locking details from admin-guide
      memory-hotplug.rst: complete admin-guide overhaul

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE":
      mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE
      mm: memory_hotplug: cleanup after removal of pfn_valid_within()

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/memory_hotplug: preparatory patches for new online policy and memory":
      mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()
      mm/memory_hotplug: remove nid parameter from arch_remove_memory()
      mm/memory_hotplug: remove nid parameter from remove_memory() and friends
      ACPI: memhotplug: memory resources cannot be enabled yet
    Patch series "mm/memory_hotplug: "auto-movable" online policy and memory groups", v3:
      mm: track present early pages per zone
      mm/memory_hotplug: introduce "auto-movable" online policy
      drivers/base/memory: introduce "memory groups" to logically group memory blocks
      mm/memory_hotplug: track present pages in memory groups
      ACPI: memhotplug: use a single static memory group for a single memory device
      dax/kmem: use a single static memory group for a single probed unit
      virtio-mem: use a single dynamic memory group for a single virtio-mem device
      mm/memory_hotplug: memory group aware "auto-movable" online policy
      mm/memory_hotplug: improved dynamic memory group aware "auto-movable" online policy

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixups for memory hotplug":
      mm/memory_hotplug: use helper zone_is_zone_device() to simplify the code

Subsystem: mm/rmap

    Muchun Song <songmuchun@bytedance.com>:
      mm: remove redundant compound_head() calling

Subsystem: mm/ioremap

    Christoph Hellwig <hch@lst.de>:
      riscv: only select GENERIC_IOREMAP if MMU support is enabled
    Patch series "small ioremap cleanups":
      mm: move ioremap_page_range to vmalloc.c
      mm: don't allow executable ioremap mappings

    Weizhao Ouyang <o451686892@gmail.com>:
      mm/early_ioremap.c: remove redundant early_ioremap_shutdown()

Subsystem: mm/highmem

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      highmem: don't disable preemption on RT in kmap_atomic()

Subsystem: mm/cleanups

    Changbin Du <changbin.du@gmail.com>:
      mm: in_irq() cleanup

    Muchun Song <songmuchun@bytedance.com>:
      mm: introduce PAGEFLAGS_MASK to replace ((1UL << NR_PAGEFLAGS) - 1)

Subsystem: mm/secretmem

    Jordy Zomer <jordy@jordyzomer.github.io>:
      mm/secretmem: use refcount_t instead of atomic_t

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: show cpu and timestamp in alloc/free info
      kfence: test: fail fast if disabled at boot

Subsystem: mm/damon

    SeongJae Park <sjpark@amazon.de>:
    Patch series "Introduce Data Access MONitor (DAMON)", v34:
      mm: introduce Data Access MONitor (DAMON)
      mm/damon/core: implement region-based sampling
      mm/damon: adaptively adjust regions
      mm/idle_page_tracking: make PG_idle reusable
      mm/damon: implement primitives for the virtual memory address spaces
      mm/damon: add a tracepoint
      mm/damon: implement a debugfs-based user space interface
      mm/damon/dbgfs: export kdamond pid to the user space
      mm/damon/dbgfs: support multiple contexts
      Documentation: add documents for DAMON
      mm/damon: add kunit tests
      mm/damon: add user space selftests
      MAINTAINERS: update for DAMON

Subsystem: alpha

    Randy Dunlap <rdunlap@infradead.org>:
      alpha: agp: make empty macros use do-while-0 style
      alpha: pci-sysfs: fix all kernel-doc warnings

Subsystem: percpu

    Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
      percpu: remove export of pcpu_base_addr

Subsystem: procfs

    Feng Zhou <zhoufeng.zf@bytedance.com>:
      fs/proc/kcore.c: add mmap interface

    Christoph Hellwig <hch@lst.de>:
      proc: stop using seq_get_buf in proc_task_name

    Ohhoon Kwon <ohoono.kwon@samsung.com>:
      connector: send event on write to /proc/[pid]/comm

Subsystem: misc

    Colin Ian King <colin.king@canonical.com>:
      arch: Kconfig: fix spelling mistake "seperate" -> "separate"

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      include/linux/once.h: fix trivia typo Not -> Note

    Daniel Lezcano <daniel.lezcano@linaro.org>:
    Patch series "Add Hz macros", v3:
      units: change from 'L' to 'UL'
      units: add the HZ macros
      thermal/drivers/devfreq_cooling: use HZ macros
      devfreq: use HZ macros
      iio/drivers/as73211: use HZ macros
      hwmon/drivers/mr75203: use HZ macros
      iio/drivers/hid-sensor: use HZ macros
      i2c/drivers/ov02q10: use HZ macros
      mtd/drivers/nand: use HZ macros
      phy/drivers/stm32: use HZ macros

Subsystem: core-kernel

    Yang Yang <yang.yang29@zte.com.cn>:
      kernel/acct.c: use dedicated helper to access rlimit values

    Pavel Skripkin <paskripkin@gmail.com>:
      profiling: fix shift-out-of-bounds bugs

Subsystem: MAINTAINERS

    Nathan Chancellor <nathan@kernel.org>:
      MAINTAINERS: update ClangBuiltLinux mailing list
      Documentation/llvm: update mailing list
      Documentation/llvm: update IRC location

Subsystem: lib

    Geert Uytterhoeven <geert@linux-m68k.org>:
    Patch series "math: RATIONAL and RATIONAL_KUNIT_TEST improvements":
      math: make RATIONAL tristate
      math: RATIONAL_KUNIT_TEST should depend on RATIONAL instead of selecting it

    Matteo Croce <mcroce@microsoft.com>:
    Patch series "lib/string: optimized mem* functions", v2:
      lib/string: optimized memcpy
      lib/string: optimized memmove
      lib/string: optimized memset

    Daniel Latypov <dlatypov@google.com>:
      lib/test: convert test_sort.c to use KUnit

    Randy Dunlap <rdunlap@infradead.org>:
      lib/dump_stack: correct kernel-doc notation
      lib/iov_iter.c: fix kernel-doc warnings

Subsystem: bitops

    Yury Norov <yury.norov@gmail.com>:
    Patch series "Resend bitmap patches":
      bitops: protect find_first_{,zero}_bit properly
      bitops: move find_bit_*_le functions from le.h to find.h
      include: move find.h from asm_generic to linux
      arch: remove GENERIC_FIND_FIRST_BIT entirely
      lib: add find_first_and_bit()
      cpumask: use find_first_and_bit()
      all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
      tools: sync tools/bitmap with mother linux
      cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
      include/linux: move for_each_bit() macros from bitops.h to find.h
      find: micro-optimize for_each_{set,clear}_bit()
      bitops: replace for_each_*_bit_from() with for_each_*_bit() where appropriate

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      tools: rename bitmap_alloc() to bitmap_zalloc()

    Yury Norov <yury.norov@gmail.com>:
      mm/percpu: micro-optimize pcpu_is_populated()
      bitmap: unify find_bit operations
      lib: bitmap: add performance test for bitmap_print_to_pagebuf
      vsprintf: rework bitmap_list_string

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: support wide strings

    Mimi Zohar <zohar@linux.ibm.com>:
      checkpatch: make email address check case insensitive

    Joe Perches <joe@perches.com>:
      checkpatch: improve GIT_COMMIT_ID test

Subsystem: epoll

    Nicholas Piggin <npiggin@gmail.com>:
      fs/epoll: use a per-cpu counter for user's watches count

Subsystem: init

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      init: move usermodehelper_enable() to populate_rootfs()

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      trap: cleanup trap_init()

Subsystem: nilfs2

    Nanyong Sun <sunnanyong@huawei.com>:
    Patch series "nilfs2: fix incorrect usage of kobject":
      nilfs2: fix memory leak in nilfs_sysfs_create_device_group
      nilfs2: fix NULL pointer in nilfs_##name##_attr_release
      nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group
      nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group
      nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group
      nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group

    Zhen Lei <thunder.leizhen@huawei.com>:
      nilfs2: use refcount_dec_and_lock() to fix potential UAF

Subsystem: coredump

    David Oberhollenzer <david.oberhollenzer@sigma-star.at>:
      fs/coredump.c: log if a core dump is aborted due to changed file permissions

    QiuXi <qiuxi1@huawei.com>:
      coredump: fix memleak in dump_vma_snapshot()

Subsystem: fork

    Christoph Hellwig <hch@lst.de>:
      kernel/fork.c: unexport get_{mm,task}_exe_file

Subsystem: pids

    Takahiro Itazuri <itazur@amazon.com>:
      pid: cleanup the stale comment mentioning pidmap_init().

Subsystem: criu

    Cyrill Gorcunov <gorcunov@gmail.com>:
      prctl: allow to setup brk for et_dyn executables

Subsystem: kconfig

    Zenghui Yu <yuzenghui@huawei.com>:
      configs: remove the obsolete CONFIG_INPUT_POLLDEV

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      Kconfig.debug: drop selecting non-existing HARDLOCKUP_DETECTOR_ARCH

Subsystem: selftests

    Greg Thelen <gthelen@google.com>:
      selftests/memfd: remove unused variable

Subsystem: ipc

    Rafael Aquini <aquini@redhat.com>:
      ipc: replace costly bailout check in sysvipc_find_ipc()

Subsystem: mm/vmscan

    Randy Dunlap <rdunlap@infradead.org>:
      mm/workingset: correct kernel-doc notations

Subsystem: scripts

    Randy Dunlap <rdunlap@infradead.org>:
      scripts: check_extable: fix typo in user error message

 a/Documentation/admin-guide/mm/damon/index.rst            |   15 
 a/Documentation/admin-guide/mm/damon/start.rst            |  114 +
 a/Documentation/admin-guide/mm/damon/usage.rst            |  112 +
 a/Documentation/admin-guide/mm/index.rst                  |    1 
 a/Documentation/admin-guide/mm/memory-hotplug.rst         |  842 ++++++-----
 a/Documentation/dev-tools/kfence.rst                      |   98 -
 a/Documentation/kbuild/llvm.rst                           |    5 
 a/Documentation/vm/damon/api.rst                          |   20 
 a/Documentation/vm/damon/design.rst                       |  166 ++
 a/Documentation/vm/damon/faq.rst                          |   51 
 a/Documentation/vm/damon/index.rst                        |   30 
 a/Documentation/vm/index.rst                              |    1 
 a/MAINTAINERS                                             |   17 
 a/arch/Kconfig                                            |    2 
 a/arch/alpha/include/asm/agp.h                            |    4 
 a/arch/alpha/include/asm/bitops.h                         |    2 
 a/arch/alpha/kernel/pci-sysfs.c                           |   12 
 a/arch/arc/Kconfig                                        |    1 
 a/arch/arc/include/asm/bitops.h                           |    1 
 a/arch/arc/kernel/traps.c                                 |    5 
 a/arch/arm/configs/dove_defconfig                         |    1 
 a/arch/arm/configs/pxa_defconfig                          |    1 
 a/arch/arm/include/asm/bitops.h                           |    1 
 a/arch/arm/kernel/traps.c                                 |    5 
 a/arch/arm64/Kconfig                                      |    1 
 a/arch/arm64/include/asm/bitops.h                         |    1 
 a/arch/arm64/mm/mmu.c                                     |    3 
 a/arch/csky/include/asm/bitops.h                          |    1 
 a/arch/h8300/include/asm/bitops.h                         |    1 
 a/arch/h8300/kernel/traps.c                               |    4 
 a/arch/hexagon/include/asm/bitops.h                       |    1 
 a/arch/hexagon/kernel/traps.c                             |    4 
 a/arch/ia64/include/asm/bitops.h                          |    2 
 a/arch/ia64/mm/init.c                                     |    3 
 a/arch/m68k/include/asm/bitops.h                          |    2 
 a/arch/mips/Kconfig                                       |    1 
 a/arch/mips/configs/lemote2f_defconfig                    |    1 
 a/arch/mips/configs/pic32mzda_defconfig                   |    1 
 a/arch/mips/configs/rt305x_defconfig                      |    1 
 a/arch/mips/configs/xway_defconfig                        |    1 
 a/arch/mips/include/asm/bitops.h                          |    1 
 a/arch/nds32/kernel/traps.c                               |    5 
 a/arch/nios2/kernel/traps.c                               |    5 
 a/arch/openrisc/include/asm/bitops.h                      |    1 
 a/arch/openrisc/kernel/traps.c                            |    5 
 a/arch/parisc/configs/generic-32bit_defconfig             |    1 
 a/arch/parisc/include/asm/bitops.h                        |    2 
 a/arch/parisc/kernel/traps.c                              |    4 
 a/arch/powerpc/include/asm/bitops.h                       |    2 
 a/arch/powerpc/include/asm/cputhreads.h                   |    2 
 a/arch/powerpc/kernel/traps.c                             |    5 
 a/arch/powerpc/mm/mem.c                                   |    3 
 a/arch/powerpc/platforms/pasemi/dma_lib.c                 |    4 
 a/arch/powerpc/platforms/pseries/hotplug-memory.c         |    9 
 a/arch/riscv/Kconfig                                      |    2 
 a/arch/riscv/include/asm/bitops.h                         |    1 
 a/arch/riscv/kernel/traps.c                               |    5 
 a/arch/s390/Kconfig                                       |    1 
 a/arch/s390/include/asm/bitops.h                          |    1 
 a/arch/s390/kvm/kvm-s390.c                                |    2 
 a/arch/s390/mm/init.c                                     |    3 
 a/arch/sh/include/asm/bitops.h                            |    1 
 a/arch/sh/mm/init.c                                       |    3 
 a/arch/sparc/include/asm/bitops_32.h                      |    1 
 a/arch/sparc/include/asm/bitops_64.h                      |    2 
 a/arch/um/kernel/trap.c                                   |    4 
 a/arch/x86/Kconfig                                        |    1 
 a/arch/x86/configs/i386_defconfig                         |    1 
 a/arch/x86/configs/x86_64_defconfig                       |    1 
 a/arch/x86/include/asm/bitops.h                           |    2 
 a/arch/x86/kernel/apic/vector.c                           |    4 
 a/arch/x86/mm/init_32.c                                   |    3 
 a/arch/x86/mm/init_64.c                                   |    3 
 a/arch/x86/um/Kconfig                                     |    1 
 a/arch/xtensa/include/asm/bitops.h                        |    1 
 a/block/blk-mq.c                                          |    2 
 a/drivers/acpi/acpi_memhotplug.c                          |   46 
 a/drivers/base/memory.c                                   |  231 ++-
 a/drivers/base/node.c                                     |    2 
 a/drivers/block/rnbd/rnbd-clt.c                           |    2 
 a/drivers/dax/kmem.c                                      |   43 
 a/drivers/devfreq/devfreq.c                               |    2 
 a/drivers/dma/ti/edma.c                                   |    2 
 a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c                   |    4 
 a/drivers/hwmon/ltc2992.c                                 |    3 
 a/drivers/hwmon/mr75203.c                                 |    2 
 a/drivers/iio/adc/ad7124.c                                |    2 
 a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c  |    3 
 a/drivers/iio/light/as73211.c                             |    3 
 a/drivers/infiniband/hw/irdma/hw.c                        |   16 
 a/drivers/media/cec/core/cec-core.c                       |    2 
 a/drivers/media/i2c/ov02a10.c                             |    2 
 a/drivers/media/mc/mc-devnode.c                           |    2 
 a/drivers/mmc/host/renesas_sdhi_core.c                    |    2 
 a/drivers/mtd/nand/raw/intel-nand-controller.c            |    2 
 a/drivers/net/virtio_net.c                                |    2 
 a/drivers/pci/controller/dwc/pci-dra7xx.c                 |    2 
 a/drivers/phy/st/phy-stm32-usbphyc.c                      |    2 
 a/drivers/scsi/lpfc/lpfc_sli.c                            |   10 
 a/drivers/soc/fsl/qbman/bman_portal.c                     |    2 
 a/drivers/soc/fsl/qbman/qman_portal.c                     |    2 
 a/drivers/soc/ti/k3-ringacc.c                             |    4 
 a/drivers/thermal/devfreq_cooling.c                       |    2 
 a/drivers/tty/n_tty.c                                     |    2 
 a/drivers/virt/acrn/ioreq.c                               |    3 
 a/drivers/virtio/virtio_mem.c                             |   26 
 a/fs/coredump.c                                           |   15 
 a/fs/eventpoll.c                                          |   18 
 a/fs/f2fs/segment.c                                       |    8 
 a/fs/nilfs2/sysfs.c                                       |   26 
 a/fs/nilfs2/the_nilfs.c                                   |    9 
 a/fs/ocfs2/cluster/heartbeat.c                            |    2 
 a/fs/ocfs2/dlm/dlmdomain.c                                |    4 
 a/fs/ocfs2/dlm/dlmmaster.c                                |   18 
 a/fs/ocfs2/dlm/dlmrecovery.c                              |    2 
 a/fs/ocfs2/dlm/dlmthread.c                                |    2 
 a/fs/proc/array.c                                         |   18 
 a/fs/proc/base.c                                          |    5 
 a/fs/proc/kcore.c                                         |   73 
 a/include/asm-generic/bitops.h                            |    1 
 a/include/asm-generic/bitops/find.h                       |  198 --
 a/include/asm-generic/bitops/le.h                         |   64 
 a/include/asm-generic/early_ioremap.h                     |    6 
 a/include/linux/bitmap.h                                  |   34 
 a/include/linux/bitops.h                                  |   34 
 a/include/linux/cpumask.h                                 |   46 
 a/include/linux/damon.h                                   |  290 +++
 a/include/linux/find.h                                    |  134 +
 a/include/linux/highmem-internal.h                        |   27 
 a/include/linux/memory.h                                  |   55 
 a/include/linux/memory_hotplug.h                          |   40 
 a/include/linux/mmzone.h                                  |   19 
 a/include/linux/once.h                                    |    2 
 a/include/linux/page-flags.h                              |   17 
 a/include/linux/page_ext.h                                |    2 
 a/include/linux/page_idle.h                               |    6 
 a/include/linux/pagemap.h                                 |    7 
 a/include/linux/sched/user.h                              |    3 
 a/include/linux/slub_def.h                                |    6 
 a/include/linux/threads.h                                 |    2 
 a/include/linux/units.h                                   |   10 
 a/include/linux/vmalloc.h                                 |    3 
 a/include/trace/events/damon.h                            |   43 
 a/include/trace/events/mmflags.h                          |    2 
 a/include/trace/events/page_ref.h                         |    4 
 a/init/initramfs.c                                        |    2 
 a/init/main.c                                             |    3 
 a/init/noinitramfs.c                                      |    2 
 a/ipc/util.c                                              |   16 
 a/kernel/acct.c                                           |    2 
 a/kernel/fork.c                                           |    2 
 a/kernel/profile.c                                        |   21 
 a/kernel/sys.c                                            |    7 
 a/kernel/time/clocksource.c                               |    4 
 a/kernel/user.c                                           |   25 
 a/lib/Kconfig                                             |    3 
 a/lib/Kconfig.debug                                       |    9 
 a/lib/dump_stack.c                                        |    3 
 a/lib/find_bit.c                                          |   21 
 a/lib/find_bit_benchmark.c                                |   21 
 a/lib/genalloc.c                                          |    2 
 a/lib/iov_iter.c                                          |    8 
 a/lib/math/Kconfig                                        |    2 
 a/lib/math/rational.c                                     |    3 
 a/lib/string.c                                            |  130 +
 a/lib/test_bitmap.c                                       |   37 
 a/lib/test_printf.c                                       |    2 
 a/lib/test_sort.c                                         |   40 
 a/lib/vsprintf.c                                          |   26 
 a/mm/Kconfig                                              |   15 
 a/mm/Makefile                                             |    4 
 a/mm/compaction.c                                         |   20 
 a/mm/damon/Kconfig                                        |   68 
 a/mm/damon/Makefile                                       |    5 
 a/mm/damon/core-test.h                                    |  253 +++
 a/mm/damon/core.c                                         |  748 ++++++++++
 a/mm/damon/dbgfs-test.h                                   |  126 +
 a/mm/damon/dbgfs.c                                        |  631 ++++++++
 a/mm/damon/vaddr-test.h                                   |  329 ++++
 a/mm/damon/vaddr.c                                        |  672 +++++++++
 a/mm/early_ioremap.c                                      |    5 
 a/mm/highmem.c                                            |    2 
 a/mm/ioremap.c                                            |   25 
 a/mm/kfence/core.c                                        |    3 
 a/mm/kfence/kfence.h                                      |    2 
 a/mm/kfence/kfence_test.c                                 |    3 
 a/mm/kfence/report.c                                      |   19 
 a/mm/kmemleak.c                                           |    2 
 a/mm/memory_hotplug.c                                     |  396 ++++-
 a/mm/memremap.c                                           |    5 
 a/mm/page_alloc.c                                         |   27 
 a/mm/page_ext.c                                           |   12 
 a/mm/page_idle.c                                          |   10 
 a/mm/page_isolation.c                                     |    7 
 a/mm/page_owner.c                                         |   14 
 a/mm/percpu.c                                             |   36 
 a/mm/rmap.c                                               |    6 
 a/mm/secretmem.c                                          |    9 
 a/mm/slab_common.c                                        |    2 
 a/mm/slub.c                                               | 1023 +++++++++-----
 a/mm/vmalloc.c                                            |   24 
 a/mm/workingset.c                                         |    2 
 a/net/ncsi/ncsi-manage.c                                  |    4 
 a/scripts/check_extable.sh                                |    2 
 a/scripts/checkpatch.pl                                   |   93 -
 a/tools/include/linux/bitmap.h                            |    4 
 a/tools/perf/bench/find-bit-bench.c                       |    2 
 a/tools/perf/builtin-c2c.c                                |    6 
 a/tools/perf/builtin-record.c                             |    2 
 a/tools/perf/tests/bitmap.c                               |    2 
 a/tools/perf/tests/mem2node.c                             |    2 
 a/tools/perf/util/affinity.c                              |    4 
 a/tools/perf/util/header.c                                |    4 
 a/tools/perf/util/metricgroup.c                           |    2 
 a/tools/perf/util/mmap.c                                  |    4 
 a/tools/testing/selftests/damon/Makefile                  |    7 
 a/tools/testing/selftests/damon/_chk_dependency.sh        |   28 
 a/tools/testing/selftests/damon/debugfs_attrs.sh          |   75 +
 a/tools/testing/selftests/kvm/dirty_log_perf_test.c       |    2 
 a/tools/testing/selftests/kvm/dirty_log_test.c            |    4 
 a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c |    2 
 a/tools/testing/selftests/memfd/memfd_test.c              |    2 
 b/MAINTAINERS                                             |    2 
 b/tools/include/asm-generic/bitops.h                      |    1 
 b/tools/include/linux/bitmap.h                            |    7 
 b/tools/include/linux/find.h                              |   81 +
 b/tools/lib/find_bit.c                                    |   20 
 227 files changed, 6695 insertions(+), 1875 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-09-02 21:48 incoming Andrew Morton
@ 2021-09-02 21:49 ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-09-02 21:49 UTC (permalink / raw)
  To: Linus Torvalds, linux-mm, mm-commits

On Thu, 2 Sep 2021 14:48:20 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

> 212 patches, based on 4a3bb4200a5958d76cc26ebe4db4257efa56812b.

Make that "based on 7d2a07b769330c34b4deabeed939325c77a7ec2f".


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-09-02 21:48 Andrew Morton
  2021-09-02 21:49 ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-09-02 21:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

212 patches, based on 4a3bb4200a5958d76cc26ebe4db4257efa56812b.

Subsystems affected by this patch series:

  ia64
  ocfs2
  block
  mm/slub
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/shmem
  mm/memcg
  mm/selftests
  mm/pagemap
  mm/mremap
  mm/bootmem
  mm/sparsemem
  mm/vmalloc
  mm/kasan
  mm/pagealloc
  mm/memory-failure
  mm/hugetlb
  mm/userfaultfd
  mm/vmscan
  mm/compaction
  mm/mempolicy
  mm/memblock
  mm/oom-kill
  mm/migration
  mm/ksm
  mm/percpu
  mm/vmstat
  mm/madvise

Subsystem: ia64

    Jason Wang <wangborong@cdjrlc.com>:
      ia64: fix typo in a comment

    Geert Uytterhoeven <geert+renesas@glider.be>:
    Patch series "ia64: Miscellaneous fixes and cleanups":
      ia64: fix #endif comment for reserve_elfcorehdr()
      ia64: make reserve_elfcorehdr() static
      ia64: make num_rsvd_regions static

Subsystem: ocfs2

    Dan Carpenter <dan.carpenter@oracle.com>:
      ocfs2: remove an unnecessary condition

    Tuo Li <islituo@gmail.com>:
      ocfs2: quota_local: fix possible uninitialized-variable access in ocfs2_local_read_info()

    Gang He <ghe@suse.com>:
      ocfs2: ocfs2_downconvert_lock failure results in deadlock

Subsystem: block

    kernel test robot <lkp@intel.com>:
      arch/csky/kernel/probes/kprobes.c: fix bugon.cocci warnings

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "SLUB: reduce irq disabled scope and make it RT compatible", v4:
      mm, slub: don't call flush_all() from slab_debug_trace_open()
      mm, slub: allocate private object map for debugfs listings
      mm, slub: allocate private object map for validate_slab_cache()
      mm, slub: don't disable irq for debug_check_no_locks_freed()
      mm, slub: remove redundant unfreeze_partials() from put_cpu_partial()
      mm, slub: unify cmpxchg_double_slab() and __cmpxchg_double_slab()
      mm, slub: extract get_partial() from new_slab_objects()
      mm, slub: dissolve new_slab_objects() into ___slab_alloc()
      mm, slub: return slab page from get_partial() and set c->page afterwards
      mm, slub: restructure new page checks in ___slab_alloc()
      mm, slub: simplify kmem_cache_cpu and tid setup
      mm, slub: move disabling/enabling irqs to ___slab_alloc()
      mm, slub: do initial checks in ___slab_alloc() with irqs enabled
      mm, slub: move disabling irqs closer to get_partial() in ___slab_alloc()
      mm, slub: restore irqs around calling new_slab()
      mm, slub: validate slab from partial list or page allocator before making it cpu slab
      mm, slub: check new pages with restored irqs
      mm, slub: stop disabling irqs around get_partial()
      mm, slub: move reset of c->page and freelist out of deactivate_slab()
      mm, slub: make locking in deactivate_slab() irq-safe
      mm, slub: call deactivate_slab() without disabling irqs
      mm, slub: move irq control into unfreeze_partials()
      mm, slub: discard slabs in unfreeze_partials() without irqs disabled
      mm, slub: detach whole partial list at once in unfreeze_partials()
      mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing
      mm, slub: only disable irq with spin_lock in __unfreeze_partials()
      mm, slub: don't disable irqs in slub_cpu_dead()
      mm, slab: make flush_slab() possible to call with irqs enabled

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context
      mm: slub: make object_map_lock a raw_spinlock_t

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: optionally save/restore irqs in slab_[un]lock()/
      mm, slub: make slab_lock() disable irqs with PREEMPT_RT
      mm, slub: protect put_cpu_partial() with disabled irqs instead of cmpxchg
      mm, slub: use migrate_disable() on PREEMPT_RT
      mm, slub: convert kmem_cpu_slab protection to local_lock

Subsystem: mm/debug

    Gavin Shan <gshan@redhat.com>:
    Patch series "mm/debug_vm_pgtable: Enhancements", v6:
      mm/debug_vm_pgtable: introduce struct pgtable_debug_args
      mm/debug_vm_pgtable: use struct pgtable_debug_args in basic tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in leaf and savewrite tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in protnone and devmap tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in soft_dirty and swap tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in migration and thp tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in PTE modifying tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in PMD modifying tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in PUD modifying tests
      mm/debug_vm_pgtable: use struct pgtable_debug_args in PGD and P4D modifying tests
      mm/debug_vm_pgtable: remove unused code
      mm/debug_vm_pgtable: fix corrupted page flag

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: report a more useful address for reclaim acquisition

    liuhailong <liuhailong@oppo.com>:
      mm: add kernel_misc_reclaimable in show_free_areas

Subsystem: mm/pagecache

    Jan Kara <jack@suse.cz>:
    Patch series "writeback: Fix bandwidth estimates", v4:
      writeback: track number of inodes under writeback
      writeback: reliably update bandwidth estimation
      writeback: fix bandwidth estimate for spiky workload
      writeback: rename domain_update_bandwidth()
      writeback: use READ_ONCE for unlocked reads of writeback stats

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: remove irqsave/restore locking from contexts with irqs enabled
      fs: drop_caches: fix skipping over shadow cache inodes
      fs: inode: count invalidated shadow pages in pginodesteal

    Shakeel Butt <shakeelb@google.com>:
      writeback: memcg: simplify cgroup_writeback_by_id

    Jing Yangyang <jing.yangyang@zte.com.cn>:
      include/linux/buffer_head.h: fix boolreturn.cocci warnings

Subsystem: mm/gup

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanups and fixup for gup":
      mm: gup: remove set but unused local variable major
      mm: gup: remove unneed local variable orig_refs
      mm: gup: remove useless BUG_ON in __get_user_pages()
      mm: gup: fix potential pgmap refcnt leak in __gup_device_huge()
      mm: gup: use helper PAGE_ALIGNED in populate_vma_page_range()

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "A few gup refactorings and documentation updates", v3:
      mm/gup: documentation corrections for gup/pup
      mm/gup: small refactoring: simplify try_grab_page()
      mm/gup: remove try_get_page(), call try_get_compound_head() directly

Subsystem: mm/swap

    Hugh Dickins <hughd@google.com>:
      fs, mm: fix race in unlinking swapfile

    John Hubbard <jhubbard@nvidia.com>:
      mm: delete unused get_kernel_page()

Subsystem: mm/shmem

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      shmem: use raw_spinlock_t for ->stat_lock

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanups for shmem":
      shmem: remove unneeded variable ret
      shmem: remove unneeded header file
      shmem: remove unneeded function forward declaration
      shmem: include header file to declare swap_info

    Hugh Dickins <hughd@google.com>:
    Patch series "huge tmpfs: shmem_is_huge() fixes and cleanups":
      huge tmpfs: fix fallocate(vanilla) advance over huge pages
      huge tmpfs: fix split_huge_page() after FALLOC_FL_KEEP_SIZE
      huge tmpfs: remove shrinklist addition from shmem_setattr()
      huge tmpfs: revert shmem's use of transhuge_vma_enabled()
      huge tmpfs: move shmem_huge_enabled() upwards
      huge tmpfs: SGP_NOALLOC to stop collapse_file() on race
      huge tmpfs: shmem_is_huge(vma, inode, index)
      huge tmpfs: decide stat.st_blksize by shmem_is_huge()
      shmem: shmem_writepage() split unlikely i915 THP

Subsystem: mm/memcg

    Suren Baghdasaryan <surenb@google.com>:
      mm, memcg: add mem_cgroup_disabled checks in vmpressure and swap-related functions
      mm, memcg: inline mem_cgroup_{charge/uncharge} to improve disabled memcg config
      mm, memcg: inline swap-related functions to improve disabled memcg config

    Vasily Averin <vvs@virtuozzo.com>:
      memcg: enable accounting for pids in nested pid namespaces

    Shakeel Butt <shakeelb@google.com>:
      memcg: switch lruvec stats to rstat
      memcg: infrastructure to flush memcg stats

    Yutian Yang <nglaive@gmail.com>:
      memcg: charge fs_context and legacy_fs_context

    Vasily Averin <vvs@virtuozzo.com>:
    Patch series "memcg accounting from OpenVZ", v7:
      memcg: enable accounting for mnt_cache entries
      memcg: enable accounting for pollfd and select bits arrays
      memcg: enable accounting for file lock caches
      memcg: enable accounting for fasync_cache
      memcg: enable accounting for new namesapces and struct nsproxy
      memcg: enable accounting of ipc resources
      memcg: enable accounting for signals
      memcg: enable accounting for posix_timers_cache slab
      memcg: enable accounting for ldt_struct objects

    Shakeel Butt <shakeelb@google.com>:
      memcg: cleanup racy sum avoidance code

    Vasily Averin <vvs@virtuozzo.com>:
      memcg: replace in_interrupt() by !in_task() in active_memcg()

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm: memcontrol: set the correct memcg swappiness restriction

    Miaohe Lin <linmiaohe@huawei.com>:
      mm, memcg: remove unused functions
      mm, memcg: save some atomic ops when flush is already true

    Michal Hocko <mhocko@suse.com>:
      memcg: fix up drain_local_stock comment

    Shakeel Butt <shakeelb@google.com>:
      memcg: make memcg->event_list_lock irqsafe

Subsystem: mm/selftests

    Po-Hsu Lin <po-hsu.lin@canonical.com>:
      selftests/vm: use kselftest skip code for skipped tests

    Colin Ian King <colin.king@canonical.com>:
      selftests: Fix spelling mistake "cann't" -> "cannot"

Subsystem: mm/pagemap

    Nicholas Piggin <npiggin@gmail.com>:
    Patch series "shoot lazy tlbs", v4:
      lazy tlb: introduce lazy mm refcount helper functions
      lazy tlb: allow lazy tlb mm refcounting to be configurable
      lazy tlb: shoot lazies, a non-refcounting lazy tlb option
      powerpc/64s: enable MMU_LAZY_TLB_SHOOTDOWN

    Christoph Hellwig <hch@lst.de>:
    Patch series "_kernel_dcache_page fixes and removal":
      mmc: JZ4740: remove the flush_kernel_dcache_page call in jz4740_mmc_read_data
      mmc: mmc_spi: replace flush_kernel_dcache_page with flush_dcache_page
      scatterlist: replace flush_kernel_dcache_page with flush_dcache_page
      mm: remove flush_kernel_dcache_page

    Huang Ying <ying.huang@intel.com>:
      mm,do_huge_pmd_numa_page: remove unnecessary TLB flushing code

    Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
      mm: change fault_in_pages_* to have an unsigned size parameter

    Luigi Rizzo <lrizzo@google.com>:
      mm/pagemap: add mmap_assert_locked() annotations to find_vma*()

    "Liam R. Howlett" <Liam.Howlett@Oracle.com>:
      remap_file_pages: Use vma_lookup() instead of find_vma()

Subsystem: mm/mremap

    Chen Wandun <chenwandun@huawei.com>:
      mm/mremap: fix memory account on do_munmap() failure

Subsystem: mm/bootmem

    Muchun Song <songmuchun@bytedance.com>:
      mm/bootmem_info.c: mark __init on register_page_bootmem_info_section

Subsystem: mm/sparsemem

    Ohhoon Kwon <ohoono.kwon@samsung.com>:
    Patch series "mm: sparse: remove __section_nr() function", v4:
      mm: sparse: pass section_nr to section_mark_present
      mm: sparse: pass section_nr to find_memory_block
      mm: sparse: remove __section_nr() function

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm/sparse: set SECTION_NID_SHIFT to 6

    Matthew Wilcox <willy@infradead.org>:
      include/linux/mmzone.h: avoid a warning in sparse memory support

    Miles Chen <miles.chen@mediatek.com>:
      mm/sparse: clarify pgdat_to_phys

Subsystem: mm/vmalloc

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: use batched page requests in bulk-allocator
      mm/vmalloc: remove gfpflags_allow_blocking() check
      lib/test_vmalloc.c: add a new 'nr_pages' parameter

    Chen Wandun <chenwandun@huawei.com>:
      mm/vmalloc: fix wrong behavior in vread

Subsystem: mm/kasan

    Woody Lin <woodylin@google.com>:
      mm/kasan: move kasan.fault to mm/kasan/report.c

    Andrey Konovalov <andreyknvl@gmail.com>:
    Patch series "kasan: test: avoid crashing the kernel with HW_TAGS", v2:
      kasan: test: rework kmalloc_oob_right
      kasan: test: avoid writing invalid memory
      kasan: test: avoid corrupting memory via memset
      kasan: test: disable kmalloc_memmove_invalid_size for HW_TAGS
      kasan: test: only do kmalloc_uaf_memset for generic mode
      kasan: test: clean up ksize_uaf
      kasan: test: avoid corrupting memory in copy_user_test
      kasan: test: avoid corrupting memory in kasan_rcu_uaf

Subsystem: mm/pagealloc

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: ensure consistency of memory map poisoning":
      mm/page_alloc: always initialize memory map for the holes
      microblaze: simplify pte_alloc_one_kernel()
      mm: introduce memmap_alloc() to unify memory map allocation
      memblock: stop poisoning raw allocations

    Nico Pache <npache@redhat.com>:
      mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/page_alloc: make alloc_node_mem_map() __init rather than __ref

    Vasily Averin <vvs@virtuozzo.com>:
      mm/page_alloc.c: use in_task()

    "George G. Davis" <davis.george@siemens.com>:
      mm/page_isolation: tracing: trace all test_pages_isolated failures

Subsystem: mm/memory-failure

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanups and fixup for hwpoison":
      mm/hwpoison: remove unneeded variable unmap_success
      mm/hwpoison: fix potential pte_unmap_unlock pte error
      mm/hwpoison: change argument struct page **hpagep to *hpage
      mm/hwpoison: fix some obsolete comments

    Yang Shi <shy828301@gmail.com>:
      mm: hwpoison: don't drop slab caches for offlining non-LRU page
      doc: hwpoison: correct the support for hugepage
      mm: hwpoison: dump page for unhandlable page

    Michael Wang <yun.wang@linux.alibaba.com>:
      mm: fix panic caused by __page_handle_poison()

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: simplify prep_compound_gigantic_page ref count racing code
      hugetlb: drop ref count earlier after page allocation
      hugetlb: before freeing hugetlb page set dtor to appropriate value
      hugetlb: fix hugetlb cgroup refcounting during vma split

Subsystem: mm/userfaultfd

    Nadav Amit <namit@vmware.com>:
    Patch series "userfaultfd: minor bug fixes":
      userfaultfd: change mmap_changing to atomic
      userfaultfd: prevent concurrent API initialization
      selftests/vm/userfaultfd: wake after copy failure

Subsystem: mm/vmscan

    Dave Hansen <dave.hansen@linux.intel.com>:
    Patch series "Migrate Pages in lieu of discard", v11:
      mm/numa: automatically generate node migration order
      mm/migrate: update node demotion order on hotplug events

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/migrate: enable returning precise migrate_pages() success count

    Dave Hansen <dave.hansen@linux.intel.com>:
      mm/migrate: demote pages during reclaim

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/vmscan: add page demotion counter

    Dave Hansen <dave.hansen@linux.intel.com>:
      mm/vmscan: add helper for querying ability to age anonymous pages

    Keith Busch <kbusch@kernel.org>:
      mm/vmscan: Consider anonymous pages without swap

    Dave Hansen <dave.hansen@linux.intel.com>:
      mm/vmscan: never demote for memcg reclaim

    Huang Ying <ying.huang@intel.com>:
      mm/migrate: add sysfs interface to enable reclaim migration

    Hui Su <suhui@zeku.com>:
      mm/vmpressure: replace vmpressure_to_css() with vmpressure_to_memcg()

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanups for vmscan", v2:
      mm/vmscan: remove the PageDirty check after MADV_FREE pages are page_ref_freezed
      mm/vmscan: remove misleading setting to sc->priority
      mm/vmscan: remove unneeded return value of kswapd_run()
      mm/vmscan: add 'else' to remove check_pending label

    Vlastimil Babka <vbabka@suse.cz>:
      mm, vmscan: guarantee drop_slab_node() termination

Subsystem: mm/compaction

    Charan Teja Reddy <charante@codeaurora.org>:
      mm: compaction: optimize proactive compaction deferrals
      mm: compaction: support triggering of proactive compaction by user

Subsystem: mm/mempolicy

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm/mempolicy: use readable NUMA_NO_NODE macro instead of magic number

    Dave Hansen <dave.hansen@linux.intel.com>:
    Patch series "Introduce multi-preference mempolicy", v7:
      mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes

    Feng Tang <feng.tang@intel.com>:
      mm/memplicy: add page allocation function for MPOL_PREFERRED_MANY policy

    Ben Widawsky <ben.widawsky@intel.com>:
      mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY
      mm/mempolicy: advertise new MPOL_PREFERRED_MANY

    Feng Tang <feng.tang@intel.com>:
      mm/mempolicy: unify the create() func for bind/interleave/prefer-many policies

    Vasily Averin <vvs@virtuozzo.com>:
      mm/mempolicy.c: use in_task() in mempolicy_slab_node()

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
      memblock: make memblock_find_in_range method private

Subsystem: mm/oom-kill

    Suren Baghdasaryan <surenb@google.com>:
      mm: introduce process_mrelease system call
      mm: wire up syscall process_mrelease

Subsystem: mm/migration

    Randy Dunlap <rdunlap@infradead.org>:
      mm/migrate: correct kernel-doc notation

Subsystem: mm/ksm

    Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>:
    Patch series "add KSM selftests":
      selftests: vm: add KSM merge test
      selftests: vm: add KSM unmerge test
      selftests: vm: add KSM zero page merging test
      selftests: vm: add KSM merging across nodes test
      mm: KSM: fix data type
    Patch series "add KSM performance tests", v3:
      selftests: vm: add KSM merging time test
      selftests: vm: add COW time test for KSM pages

Subsystem: mm/percpu

    Jing Xiangfeng <jingxiangfeng@huawei.com>:
      mm/percpu,c: remove obsolete comments of pcpu_chunk_populated()

Subsystem: mm/vmstat

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup for vmstat":
      mm/vmstat: correct some wrong comments
      mm/vmstat: simplify the array size calculation
      mm/vmstat: remove unneeded return value

Subsystem: mm/madvise

    zhangkui <zhangkui@oppo.com>:
      mm/madvise: add MADV_WILLNEED to process_madvise()

 Documentation/ABI/testing/sysfs-kernel-mm-numa         |   24 
 Documentation/admin-guide/mm/numa_memory_policy.rst    |   15 
 Documentation/admin-guide/sysctl/vm.rst                |    3 
 Documentation/core-api/cachetlb.rst                    |   86 -
 Documentation/dev-tools/kasan.rst                      |   13 
 Documentation/translations/zh_CN/core-api/cachetlb.rst |    9 
 Documentation/vm/hwpoison.rst                          |    1 
 arch/Kconfig                                           |   28 
 arch/alpha/kernel/syscalls/syscall.tbl                 |    2 
 arch/arm/include/asm/cacheflush.h                      |    4 
 arch/arm/kernel/setup.c                                |   20 
 arch/arm/mach-rpc/ecard.c                              |    2 
 arch/arm/mm/flush.c                                    |   33 
 arch/arm/mm/nommu.c                                    |    6 
 arch/arm/tools/syscall.tbl                             |    2 
 arch/arm64/include/asm/unistd.h                        |    2 
 arch/arm64/include/asm/unistd32.h                      |    2 
 arch/arm64/kvm/hyp/reserved_mem.c                      |    9 
 arch/arm64/mm/init.c                                   |   38 
 arch/csky/abiv1/cacheflush.c                           |   11 
 arch/csky/abiv1/inc/abi/cacheflush.h                   |    4 
 arch/csky/kernel/probes/kprobes.c                      |    3 
 arch/ia64/include/asm/meminit.h                        |    2 
 arch/ia64/kernel/acpi.c                                |    2 
 arch/ia64/kernel/setup.c                               |   55 
 arch/ia64/kernel/syscalls/syscall.tbl                  |    2 
 arch/m68k/kernel/syscalls/syscall.tbl                  |    2 
 arch/microblaze/include/asm/page.h                     |    3 
 arch/microblaze/include/asm/pgtable.h                  |    2 
 arch/microblaze/kernel/syscalls/syscall.tbl            |    2 
 arch/microblaze/mm/init.c                              |   12 
 arch/microblaze/mm/pgtable.c                           |   17 
 arch/mips/include/asm/cacheflush.h                     |    8 
 arch/mips/kernel/setup.c                               |   14 
 arch/mips/kernel/syscalls/syscall_n32.tbl              |    2 
 arch/mips/kernel/syscalls/syscall_n64.tbl              |    2 
 arch/mips/kernel/syscalls/syscall_o32.tbl              |    2 
 arch/nds32/include/asm/cacheflush.h                    |    3 
 arch/nds32/mm/cacheflush.c                             |    9 
 arch/parisc/include/asm/cacheflush.h                   |    8 
 arch/parisc/kernel/cache.c                             |    3 
 arch/parisc/kernel/syscalls/syscall.tbl                |    2 
 arch/powerpc/Kconfig                                   |    1 
 arch/powerpc/kernel/smp.c                              |    2 
 arch/powerpc/kernel/syscalls/syscall.tbl               |    2 
 arch/powerpc/mm/book3s64/radix_tlb.c                   |    4 
 arch/powerpc/platforms/pseries/hotplug-memory.c        |    4 
 arch/riscv/mm/init.c                                   |   44 
 arch/s390/kernel/setup.c                               |    9 
 arch/s390/kernel/syscalls/syscall.tbl                  |    2 
 arch/s390/mm/fault.c                                   |    2 
 arch/sh/include/asm/cacheflush.h                       |    8 
 arch/sh/kernel/syscalls/syscall.tbl                    |    2 
 arch/sparc/kernel/syscalls/syscall.tbl                 |    2 
 arch/x86/entry/syscalls/syscall_32.tbl                 |    1 
 arch/x86/entry/syscalls/syscall_64.tbl                 |    1 
 arch/x86/kernel/aperture_64.c                          |    5 
 arch/x86/kernel/ldt.c                                  |    6 
 arch/x86/mm/init.c                                     |   23 
 arch/x86/mm/numa.c                                     |    5 
 arch/x86/mm/numa_emulation.c                           |    5 
 arch/x86/realmode/init.c                               |    2 
 arch/xtensa/kernel/syscalls/syscall.tbl                |    2 
 block/blk-map.c                                        |    2 
 drivers/acpi/tables.c                                  |    5 
 drivers/base/arch_numa.c                               |    5 
 drivers/base/memory.c                                  |    4 
 drivers/mmc/host/jz4740_mmc.c                          |    4 
 drivers/mmc/host/mmc_spi.c                             |    2 
 drivers/of/of_reserved_mem.c                           |   12 
 fs/drop_caches.c                                       |    3 
 fs/exec.c                                              |   12 
 fs/fcntl.c                                             |    3 
 fs/fs-writeback.c                                      |   28 
 fs/fs_context.c                                        |    4 
 fs/inode.c                                             |    2 
 fs/locks.c                                             |    6 
 fs/namei.c                                             |    8 
 fs/namespace.c                                         |    7 
 fs/ocfs2/dlmglue.c                                     |   14 
 fs/ocfs2/quota_global.c                                |    1 
 fs/ocfs2/quota_local.c                                 |    2 
 fs/pipe.c                                              |    2 
 fs/select.c                                            |    4 
 fs/userfaultfd.c                                       |  116 -
 include/linux/backing-dev-defs.h                       |    2 
 include/linux/backing-dev.h                            |   19 
 include/linux/buffer_head.h                            |    2 
 include/linux/compaction.h                             |    2 
 include/linux/highmem.h                                |    5 
 include/linux/hugetlb_cgroup.h                         |   12 
 include/linux/memblock.h                               |    2 
 include/linux/memcontrol.h                             |  118 +
 include/linux/memory.h                                 |    2 
 include/linux/mempolicy.h                              |   16 
 include/linux/migrate.h                                |   14 
 include/linux/mm.h                                     |   17 
 include/linux/mmzone.h                                 |    4 
 include/linux/page-flags.h                             |    9 
 include/linux/pagemap.h                                |    4 
 include/linux/sched/mm.h                               |   35 
 include/linux/shmem_fs.h                               |   25 
 include/linux/slub_def.h                               |    6 
 include/linux/swap.h                                   |   28 
 include/linux/syscalls.h                               |    1 
 include/linux/userfaultfd_k.h                          |    8 
 include/linux/vm_event_item.h                          |    2 
 include/linux/vmpressure.h                             |    2 
 include/linux/writeback.h                              |    4 
 include/trace/events/migrate.h                         |    3 
 include/uapi/asm-generic/unistd.h                      |    4 
 include/uapi/linux/mempolicy.h                         |    1 
 ipc/msg.c                                              |    2 
 ipc/namespace.c                                        |    2 
 ipc/sem.c                                              |    9 
 ipc/shm.c                                              |    2 
 kernel/cgroup/namespace.c                              |    2 
 kernel/cpu.c                                           |    2 
 kernel/exit.c                                          |    2 
 kernel/fork.c                                          |   51 
 kernel/kthread.c                                       |   21 
 kernel/nsproxy.c                                       |    2 
 kernel/pid_namespace.c                                 |    5 
 kernel/sched/core.c                                    |   37 
 kernel/sched/sched.h                                   |    4 
 kernel/signal.c                                        |    2 
 kernel/sys_ni.c                                        |    1 
 kernel/sysctl.c                                        |    2 
 kernel/time/namespace.c                                |    4 
 kernel/time/posix-timers.c                             |    4 
 kernel/user_namespace.c                                |    2 
 lib/scatterlist.c                                      |    5 
 lib/test_kasan.c                                       |   80 -
 lib/test_kasan_module.c                                |   20 
 lib/test_vmalloc.c                                     |    5 
 mm/backing-dev.c                                       |   11 
 mm/bootmem_info.c                                      |    4 
 mm/compaction.c                                        |   69 -
 mm/debug_vm_pgtable.c                                  |  982 +++++++++------
 mm/filemap.c                                           |   15 
 mm/gup.c                                               |  109 -
 mm/huge_memory.c                                       |   32 
 mm/hugetlb.c                                           |  173 ++
 mm/hwpoison-inject.c                                   |    2 
 mm/internal.h                                          |    9 
 mm/kasan/hw_tags.c                                     |   43 
 mm/kasan/kasan.h                                       |    1 
 mm/kasan/report.c                                      |   29 
 mm/khugepaged.c                                        |    2 
 mm/ksm.c                                               |    8 
 mm/madvise.c                                           |    1 
 mm/memblock.c                                          |   22 
 mm/memcontrol.c                                        |  234 +--
 mm/memory-failure.c                                    |   53 
 mm/memory_hotplug.c                                    |    2 
 mm/mempolicy.c                                         |  207 ++-
 mm/migrate.c                                           |  319 ++++
 mm/mmap.c                                              |    7 
 mm/mremap.c                                            |    2 
 mm/oom_kill.c                                          |   70 +
 mm/page-writeback.c                                    |  133 +-
 mm/page_alloc.c                                        |   62 
 mm/page_isolation.c                                    |   13 
 mm/percpu.c                                            |    3 
 mm/shmem.c                                             |  309 ++--
 mm/slab_common.c                                       |    2 
 mm/slub.c                                              | 1085 ++++++++++-------
 mm/sparse.c                                            |   46 
 mm/swap.c                                              |   22 
 mm/swapfile.c                                          |   14 
 mm/truncate.c                                          |   28 
 mm/userfaultfd.c                                       |   15 
 mm/vmalloc.c                                           |   79 -
 mm/vmpressure.c                                        |   10 
 mm/vmscan.c                                            |  220 ++-
 mm/vmstat.c                                            |   25 
 security/tomoyo/domain.c                               |   13 
 tools/testing/scatterlist/linux/mm.h                   |    1 
 tools/testing/selftests/vm/.gitignore                  |    1 
 tools/testing/selftests/vm/Makefile                    |    3 
 tools/testing/selftests/vm/charge_reserved_hugetlb.sh  |    5 
 tools/testing/selftests/vm/hugetlb_reparenting_test.sh |    5 
 tools/testing/selftests/vm/ksm_tests.c                 |  696 ++++++++++
 tools/testing/selftests/vm/mlock-random-test.c         |    2 
 tools/testing/selftests/vm/run_vmtests.sh              |   98 +
 tools/testing/selftests/vm/userfaultfd.c               |   13 
 186 files changed, 4488 insertions(+), 2281 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-08-25 19:17 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-08-25 19:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

2 patches, based on 6e764bcd1cf72a2846c0e53d3975a09b242c04c9.

Subsystems affected by this patch series:

  mm/memory-hotplug
  MAINTAINERS

Subsystem: mm/memory-hotplug

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/memory_hotplug: fix potential permanent lru cache disable

Subsystem: MAINTAINERS

    Namjae Jeon <namjae.jeon@samsung.com>:
      MAINTAINERS: exfat: update my email address

 MAINTAINERS         |    2 +-
 mm/memory_hotplug.c |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-08-20  2:03 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-08-20  2:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

10 patches, based on 614cb2751d3150850d459bee596c397f344a7936.

Subsystems affected by this patch series:

  mm/shmem
  mm/pagealloc
  mm/tracing
  MAINTAINERS
  mm/memcg
  mm/memory-failure
  mm/vmscan
  mm/kfence
  mm/hugetlb

Subsystem: mm/shmem

    Yang Shi <shy828301@gmail.com>:
      Revert "mm/shmem: fix shmem_swapin() race with swapoff"
      Revert "mm: swap: check if swap backing device is congested or not"

Subsystem: mm/pagealloc

    Doug Berger <opendmb@gmail.com>:
      mm/page_alloc: don't corrupt pcppage_migratetype

Subsystem: mm/tracing

    Mike Rapoport <rppt@linux.ibm.com>:
      mmflags.h: add missing __GFP_ZEROTAGS and __GFP_SKIP_KASAN_POISON names

Subsystem: MAINTAINERS

    Nathan Chancellor <nathan@kernel.org>:
      MAINTAINERS: update ClangBuiltLinux IRC chat

Subsystem: mm/memcg

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm/hwpoison: retry with shake_page() for unhandlable pages

Subsystem: mm/vmscan

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: vmscan: fix missing psi annotation for node_reclaim()

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: don't pass page cache pages to restore_reserve_on_error

 MAINTAINERS                    |    2 +-
 include/linux/kfence.h         |    7 ++++---
 include/linux/memcontrol.h     |   29 +++++++++++++++--------------
 include/trace/events/mmflags.h |    4 +++-
 mm/hugetlb.c                   |   19 ++++++++++++++-----
 mm/memory-failure.c            |   12 +++++++++---
 mm/page_alloc.c                |   25 ++++++++++++-------------
 mm/shmem.c                     |   14 +-------------
 mm/swap_state.c                |    7 -------
 mm/vmscan.c                    |   30 ++++++++++++++++++++++--------
 10 files changed, 81 insertions(+), 68 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-08-13 23:53 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-08-13 23:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

7 patches, based on f8e6dfc64f6135d1b6c5215c14cd30b9b60a0008.

Subsystems affected by this patch series:

  mm/kasan
  mm/slub
  mm/madvise
  mm/memcg
  lib

Subsystem: mm/kasan

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
    Patch series "kasan, slub: reset tag when printing address", v3:
      kasan, kmemleak: reset tags when scanning block
      kasan, slub: reset tag when printing address

Subsystem: mm/slub

    Shakeel Butt <shakeelb@google.com>:
      slub: fix kmalloc_pagealloc_invalid_free unit test

    Vlastimil Babka <vbabka@suse.cz>:
      mm: slub: fix slub_debug disabling for list of slabs

Subsystem: mm/madvise

    David Hildenbrand <david@redhat.com>:
      mm/madvise: report SIGBUS as -EFAULT for MADV_POPULATE_(READ|WRITE)

Subsystem: mm/memcg

    Waiman Long <longman@redhat.com>:
      mm/memcg: fix incorrect flushing of lruvec data in obj_stock

Subsystem: lib

    Liang Wang <wangliang101@huawei.com>:
      lib: use PFN_PHYS() in devmem_is_allowed()

 lib/devmem_is_allowed.c |    2 +-
 mm/gup.c                |    7 +++++--
 mm/kmemleak.c           |    6 +++---
 mm/madvise.c            |    4 +++-
 mm/memcontrol.c         |    6 ++++--
 mm/slub.c               |   25 ++++++++++++++-----------
 6 files changed, 30 insertions(+), 20 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-07-29 21:52 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-07-29 21:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

7 patches, based on 7e96bf476270aecea66740a083e51b38c1371cd2.

Subsystems affected by this patch series:

  lib
  ocfs2
  mm/memcg
  mm/migration
  mm/slub
  mm/memcg

Subsystem: lib

    Matteo Croce <mcroce@microsoft.com>:
      lib/test_string.c: move string selftest in the Runtime Testing menu

Subsystem: ocfs2

    Junxiao Bi <junxiao.bi@oracle.com>:
      ocfs2: fix zero out valid data
      ocfs2: issue zeroout to EOF blocks

Subsystem: mm/memcg

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: fix blocking rstat function called from atomic cgroup1 thresholding code

Subsystem: mm/migration

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm/migrate: fix NR_ISOLATED corruption on 64-bit

Subsystem: mm/slub

    Shakeel Butt <shakeelb@google.com>:
      slub: fix unreclaimable slab stat for bulk free

Subsystem: mm/memcg

    Wang Hai <wanghai38@huawei.com>:
      mm/memcg: fix NULL pointer dereference in memcg_slab_free_hook()

 fs/ocfs2/file.c   |  103 ++++++++++++++++++++++++++++++++----------------------
 lib/Kconfig       |    3 -
 lib/Kconfig.debug |    3 +
 mm/memcontrol.c   |    3 +
 mm/migrate.c      |    2 -
 mm/slab.h         |    2 -
 mm/slub.c         |   22 ++++++-----
 7 files changed, 81 insertions(+), 57 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-07-23 22:49 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-07-23 22:49 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

15 patches, based on 704f4cba43d4ed31ef4beb422313f1263d87bc55.

Subsystems affected by this patch series:

  mm/userfaultfd
  mm/kfence
  mm/highmem
  mm/pagealloc
  mm/memblock
  mm/pagecache
  mm/secretmem
  mm/pagemap
  mm/hugetlbfs

Subsystem: mm/userfaultfd

    Peter Collingbourne <pcc@google.com>:
    Patch series "userfaultfd: do not untag user pointers", v5:
      userfaultfd: do not untag user pointers
      selftest: use mmap instead of posix_memalign to allocate memory

Subsystem: mm/kfence

    Weizhao Ouyang <o451686892@gmail.com>:
      kfence: defer kfence_test_init to ensure that kunit debugfs is created

    Alexander Potapenko <glider@google.com>:
      kfence: move the size check to the beginning of __kfence_alloc()
      kfence: skip all GFP_ZONEMASK allocations

Subsystem: mm/highmem

    Christoph Hellwig <hch@lst.de>:
      mm: call flush_dcache_page() in memcpy_to_page() and memzero_page()
      mm: use kmap_local_page in memzero_page

Subsystem: mm/pagealloc

    Sergei Trofimovich <slyfox@gentoo.org>:
      mm: page_alloc: fix page_poison=1 / INIT_ON_ALLOC_DEFAULT_ON interaction

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
      memblock: make for_each_mem_range() traverse MEMBLOCK_HOTPLUG regions

Subsystem: mm/pagecache

    Roman Gushchin <guro@fb.com>:
      writeback, cgroup: remove wb from offline list before releasing refcnt
      writeback, cgroup: do not reparent dax inodes

Subsystem: mm/secretmem

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/secretmem: wire up ->set_page_dirty

Subsystem: mm/pagemap

    Muchun Song <songmuchun@bytedance.com>:
      mm: mmap_lock: fix disabling preemption directly

    Qi Zheng <zhengqi.arch@bytedance.com>:
      mm: fix the deadlock in finish_fault()

Subsystem: mm/hugetlbfs

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlbfs: fix mount mode command line processing

 Documentation/arm64/tagged-address-abi.rst |   26 ++++++++++++++++++--------
 fs/fs-writeback.c                          |    3 +++
 fs/hugetlbfs/inode.c                       |    2 +-
 fs/userfaultfd.c                           |   26 ++++++++++++--------------
 include/linux/highmem.h                    |    6 ++++--
 include/linux/memblock.h                   |    4 ++--
 mm/backing-dev.c                           |    2 +-
 mm/kfence/core.c                           |   19 ++++++++++++++++---
 mm/kfence/kfence_test.c                    |    2 +-
 mm/memblock.c                              |    3 ++-
 mm/memory.c                                |   11 ++++++++++-
 mm/mmap_lock.c                             |    4 ++--
 mm/page_alloc.c                            |   29 ++++++++++++++++-------------
 mm/secretmem.c                             |    1 +
 tools/testing/selftests/vm/userfaultfd.c   |    6 ++++--
 15 files changed, 93 insertions(+), 51 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-07-15  4:26 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-07-15  4:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

13 patches, based on 40226a3d96ef8ab8980f032681c8bfd46d63874e.

Subsystems affected by this patch series:

  mm/kasan
  mm/pagealloc
  mm/rmap
  mm/hmm
  hfs
  mm/hugetlb

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
      mm: move helper to check slub_debug_enabled

    Yee Lee <yee.lee@mediatek.com>:
      kasan: add memzero init for unaligned size at DEBUG

    Marco Elver <elver@google.com>:
      kasan: fix build by including kernel.h

Subsystem: mm/pagealloc

    Matteo Croce <mcroce@microsoft.com>:
      Revert "mm/page_alloc: make should_fail_alloc_page() static"

    Mel Gorman <mgorman@techsingularity.net>:
      mm/page_alloc: avoid page allocator recursion with pagesets.lock held

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/page_alloc: correct return value when failing at preparing

    Chuck Lever <chuck.lever@oracle.com>:
      mm/page_alloc: further fix __alloc_pages_bulk() return value

Subsystem: mm/rmap

    Christoph Hellwig <hch@lst.de>:
      mm: fix the try_to_unmap prototype for !CONFIG_MMU

Subsystem: mm/hmm

    Alistair Popple <apopple@nvidia.com>:
      lib/test_hmm: remove set but unused page variable

Subsystem: hfs

    Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>:
    Patch series "hfs: fix various errors", v2:
      hfs: add missing clean-up in hfs_fill_super
      hfs: fix high memory mapping in hfs_bnode_read
      hfs: add lock nesting notation to hfs_find_init

Subsystem: mm/hugetlb

    Joao Martins <joao.m.martins@oracle.com>:
      mm/hugetlb: fix refs calculation from unaligned @vaddr

 fs/hfs/bfind.c        |   14 +++++++++++++-
 fs/hfs/bnode.c        |   25 ++++++++++++++++++++-----
 fs/hfs/btree.h        |    7 +++++++
 fs/hfs/super.c        |   10 +++++-----
 include/linux/kasan.h |    1 +
 include/linux/rmap.h  |    4 +++-
 lib/test_hmm.c        |    2 --
 mm/hugetlb.c          |    5 +++--
 mm/kasan/kasan.h      |   12 ++++++++++++
 mm/page_alloc.c       |   30 ++++++++++++++++++++++--------
 mm/slab.h             |   15 +++++++++++----
 mm/slub.c             |   14 --------------
 12 files changed, 97 insertions(+), 42 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-07-08  0:59 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-07-08  0:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

54 patches, based on a931dd33d370896a683236bba67c0d6f3d01144d.

Subsystems affected by this patch series:

  lib
  mm/slub
  mm/secretmem
  mm/cleanups
  mm/init
  debug
  mm/pagemap
  mm/mremap

Subsystem: lib

    Zhen Lei <thunder.leizhen@huawei.com>:
      lib/test: fix spelling mistakes
      lib: fix spelling mistakes
      lib: fix spelling mistakes in header files

Subsystem: mm/slub

    Nathan Chancellor <nathan@kernel.org>:
    Patch series "hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN":
      hexagon: handle {,SOFT}IRQENTRY_TEXT in linker script
      hexagon: use common DISCARDS macro
      hexagon: select ARCH_WANT_LD_ORPHAN_WARN

    Oliver Glitta <glittao@gmail.com>:
      mm/slub: use stackdepot to save stack trace in objects

Subsystem: mm/secretmem

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: introduce memfd_secret system call to create "secret" memory areas", v20:
      mmap: make mlock_future_check() global
      riscv/Kconfig: make direct map manipulation options depend on MMU
      set_memory: allow querying whether set_direct_map_*() is actually enabled
      mm: introduce memfd_secret system call to create "secret" memory areas
      PM: hibernate: disable when there are active secretmem users
      arch, mm: wire up memfd_secret system call where relevant
      secretmem: test: add basic selftest for memfd_secret(2)

Subsystem: mm/cleanups

    Zhen Lei <thunder.leizhen@huawei.com>:
      mm: fix spelling mistakes in header files

Subsystem: mm/init

    Kefeng Wang <wangkefeng.wang@huawei.com>:
    Patch series "init_mm: cleanup ARCH's text/data/brk setup code", v3:
      mm: add setup_initial_init_mm() helper
      arc: convert to setup_initial_init_mm()
      arm: convert to setup_initial_init_mm()
      arm64: convert to setup_initial_init_mm()
      csky: convert to setup_initial_init_mm()
      h8300: convert to setup_initial_init_mm()
      m68k: convert to setup_initial_init_mm()
      nds32: convert to setup_initial_init_mm()
      nios2: convert to setup_initial_init_mm()
      openrisc: convert to setup_initial_init_mm()
      powerpc: convert to setup_initial_init_mm()
      riscv: convert to setup_initial_init_mm()
      s390: convert to setup_initial_init_mm()
      sh: convert to setup_initial_init_mm()
      x86: convert to setup_initial_init_mm()

Subsystem: debug

    Stephen Boyd <swboyd@chromium.org>:
    Patch series "Add build ID to stacktraces", v6:
      buildid: only consider GNU notes for build ID parsing
      buildid: add API to parse build ID out of buffer
      buildid: stash away kernels build ID on init
      dump_stack: add vmlinux build ID to stack traces
      module: add printk formats to add module build ID to stacktraces
      arm64: stacktrace: use %pSb for backtrace printing
      x86/dumpstack: use %pSb/%pBb for backtrace printing
      scripts/decode_stacktrace.sh: support debuginfod
      scripts/decode_stacktrace.sh: silence stderr messages from addr2line/nm
      scripts/decode_stacktrace.sh: indicate 'auto' can be used for base path
      buildid: mark some arguments const
      buildid: fix kernel-doc notation
      kdump: use vmlinux_build_id to simplify

Subsystem: mm/pagemap

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *
      mm: rename p4d_page_vaddr to p4d_pgtable and make it return pud_t *

Subsystem: mm/mremap

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
    Patch series "mrermap fixes", v2:
      selftest/mremap_test: update the test to handle pagesize other than 4K
      selftest/mremap_test: avoid crash with static build
      mm/mremap: convert huge PUD move to separate helper
      mm/mremap: don't enable optimized PUD move if page table levels is 2
      mm/mremap: use pmd/pud_poplulate to update page table entries
      mm/mremap: hold the rmap lock in write mode when moving page table entries.
    Patch series "Speedup mremap on ppc64", v8:
      mm/mremap: allow arch runtime override
      powerpc/book3s64/mm: update flush_tlb_range to flush page walk cache
      powerpc/mm: enable HAVE_MOVE_PMD support

 Documentation/core-api/printk-formats.rst           |   11 
 arch/alpha/include/asm/pgtable.h                    |    8 
 arch/arc/mm/init.c                                  |    5 
 arch/arm/include/asm/pgtable-3level.h               |    2 
 arch/arm/kernel/setup.c                             |    5 
 arch/arm64/include/asm/Kbuild                       |    1 
 arch/arm64/include/asm/cacheflush.h                 |    6 
 arch/arm64/include/asm/kfence.h                     |    2 
 arch/arm64/include/asm/pgtable.h                    |    8 
 arch/arm64/include/asm/set_memory.h                 |   17 +
 arch/arm64/include/uapi/asm/unistd.h                |    1 
 arch/arm64/kernel/machine_kexec.c                   |    1 
 arch/arm64/kernel/setup.c                           |    5 
 arch/arm64/kernel/stacktrace.c                      |    2 
 arch/arm64/mm/mmu.c                                 |    7 
 arch/arm64/mm/pageattr.c                            |   13 
 arch/csky/kernel/setup.c                            |    5 
 arch/h8300/kernel/setup.c                           |    5 
 arch/hexagon/Kconfig                                |    1 
 arch/hexagon/kernel/vmlinux.lds.S                   |    9 
 arch/ia64/include/asm/pgtable.h                     |    4 
 arch/m68k/include/asm/motorola_pgtable.h            |    2 
 arch/m68k/kernel/setup_mm.c                         |    5 
 arch/m68k/kernel/setup_no.c                         |    5 
 arch/mips/include/asm/pgtable-64.h                  |    8 
 arch/nds32/kernel/setup.c                           |    5 
 arch/nios2/kernel/setup.c                           |    5 
 arch/openrisc/kernel/setup.c                        |    5 
 arch/parisc/include/asm/pgtable.h                   |    4 
 arch/powerpc/include/asm/book3s/64/pgtable.h        |   11 
 arch/powerpc/include/asm/book3s/64/tlbflush-radix.h |    2 
 arch/powerpc/include/asm/nohash/64/pgtable-4k.h     |    6 
 arch/powerpc/include/asm/nohash/64/pgtable.h        |    6 
 arch/powerpc/include/asm/tlb.h                      |    6 
 arch/powerpc/kernel/setup-common.c                  |    5 
 arch/powerpc/mm/book3s64/radix_hugetlbpage.c        |    8 
 arch/powerpc/mm/book3s64/radix_pgtable.c            |    6 
 arch/powerpc/mm/book3s64/radix_tlb.c                |   44 +-
 arch/powerpc/mm/pgtable_64.c                        |    4 
 arch/powerpc/platforms/Kconfig.cputype              |    2 
 arch/riscv/Kconfig                                  |    4 
 arch/riscv/include/asm/pgtable-64.h                 |    4 
 arch/riscv/include/asm/unistd.h                     |    1 
 arch/riscv/kernel/setup.c                           |    5 
 arch/s390/kernel/setup.c                            |    5 
 arch/sh/include/asm/pgtable-3level.h                |    4 
 arch/sh/kernel/setup.c                              |    5 
 arch/sparc/include/asm/pgtable_32.h                 |    6 
 arch/sparc/include/asm/pgtable_64.h                 |   10 
 arch/um/include/asm/pgtable-3level.h                |    2 
 arch/x86/entry/syscalls/syscall_32.tbl              |    1 
 arch/x86/entry/syscalls/syscall_64.tbl              |    1 
 arch/x86/include/asm/pgtable.h                      |    8 
 arch/x86/kernel/dumpstack.c                         |    2 
 arch/x86/kernel/setup.c                             |    5 
 arch/x86/mm/init_64.c                               |    4 
 arch/x86/mm/pat/set_memory.c                        |    4 
 arch/x86/mm/pgtable.c                               |    2 
 include/asm-generic/pgtable-nop4d.h                 |    2 
 include/asm-generic/pgtable-nopmd.h                 |    2 
 include/asm-generic/pgtable-nopud.h                 |    4 
 include/linux/bootconfig.h                          |    4 
 include/linux/buildid.h                             |   10 
 include/linux/compaction.h                          |    4 
 include/linux/cpumask.h                             |    2 
 include/linux/crash_core.h                          |   12 
 include/linux/debugobjects.h                        |    2 
 include/linux/hmm.h                                 |    2 
 include/linux/hugetlb.h                             |    6 
 include/linux/kallsyms.h                            |   21 +
 include/linux/list_lru.h                            |    4 
 include/linux/lru_cache.h                           |    8 
 include/linux/mm.h                                  |    3 
 include/linux/mmu_notifier.h                        |    8 
 include/linux/module.h                              |    9 
 include/linux/nodemask.h                            |    6 
 include/linux/percpu-defs.h                         |    2 
 include/linux/percpu-refcount.h                     |    2 
 include/linux/pgtable.h                             |    4 
 include/linux/scatterlist.h                         |    2 
 include/linux/secretmem.h                           |   54 +++
 include/linux/set_memory.h                          |   12 
 include/linux/shrinker.h                            |    2 
 include/linux/syscalls.h                            |    1 
 include/linux/vmalloc.h                             |    4 
 include/uapi/asm-generic/unistd.h                   |    7 
 include/uapi/linux/magic.h                          |    1 
 init/Kconfig                                        |    1 
 init/main.c                                         |    2 
 kernel/crash_core.c                                 |   50 ---
 kernel/kallsyms.c                                   |  104 +++++--
 kernel/module.c                                     |   42 ++
 kernel/power/hibernate.c                            |    5 
 kernel/sys_ni.c                                     |    2 
 lib/Kconfig.debug                                   |   17 -
 lib/asn1_encoder.c                                  |    2 
 lib/buildid.c                                       |   80 ++++-
 lib/devres.c                                        |    2 
 lib/dump_stack.c                                    |   13 
 lib/dynamic_debug.c                                 |    2 
 lib/fonts/font_pearl_8x8.c                          |    2 
 lib/kfifo.c                                         |    2 
 lib/list_sort.c                                     |    2 
 lib/nlattr.c                                        |    4 
 lib/oid_registry.c                                  |    2 
 lib/pldmfw/pldmfw.c                                 |    2 
 lib/reed_solomon/test_rslib.c                       |    2 
 lib/refcount.c                                      |    2 
 lib/rhashtable.c                                    |    2 
 lib/sbitmap.c                                       |    2 
 lib/scatterlist.c                                   |    4 
 lib/seq_buf.c                                       |    2 
 lib/sort.c                                          |    2 
 lib/stackdepot.c                                    |    2 
 lib/test_bitops.c                                   |    2 
 lib/test_bpf.c                                      |    2 
 lib/test_kasan.c                                    |    2 
 lib/test_kmod.c                                     |    6 
 lib/test_scanf.c                                    |    2 
 lib/vsprintf.c                                      |   10 
 mm/Kconfig                                          |    4 
 mm/Makefile                                         |    1 
 mm/gup.c                                            |   12 
 mm/init-mm.c                                        |    9 
 mm/internal.h                                       |    3 
 mm/mlock.c                                          |    3 
 mm/mmap.c                                           |    5 
 mm/mremap.c                                         |  108 ++++++-
 mm/secretmem.c                                      |  254 +++++++++++++++++
 mm/slub.c                                           |   79 +++--
 scripts/checksyscalls.sh                            |    4 
 scripts/decode_stacktrace.sh                        |   89 +++++-
 tools/testing/selftests/vm/.gitignore               |    1 
 tools/testing/selftests/vm/Makefile                 |    3 
 tools/testing/selftests/vm/memfd_secret.c           |  296 ++++++++++++++++++++
 tools/testing/selftests/vm/mremap_test.c            |  116 ++++---
 tools/testing/selftests/vm/run_vmtests.sh           |   17 +
 137 files changed, 1470 insertions(+), 442 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-07-03  0:28 ` incoming Linus Torvalds
@ 2021-07-03  1:06   ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2021-07-03  1:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Fri, Jul 2, 2021 at 5:28 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Commit e058a84bfddc42ba356a2316f2cf1141974625c9 is good, and looking
> at the pulls and merges I've done since, this -mm series looks like
> the obvious culprit.

No, unless my bisection is wrong, the -mm branch is innocent, and was
discarded from the suspects on the very first bisection trial.

So never mind.

             Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-07-01  1:46 incoming Andrew Morton
@ 2021-07-03  0:28 ` Linus Torvalds
  2021-07-03  1:06   ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2021-07-03  0:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Wed, Jun 30, 2021 at 6:46 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> This is the rest of the -mm tree, less 66 patches which are dependent on
> things which are (or were recently) in linux-next.  I'll trickle that
> material over next week.

I haven't bisected this yet, but with the current -git I'm getting

   watchdog: BUG: soft lockup - CPU#41 stuck for 49s!

and the common call chain seems to be in flush_tlb_mm_range ->
on_each_cpu_cond_mask.

Commit e058a84bfddc42ba356a2316f2cf1141974625c9 is good, and looking
at the pulls and merges I've done since, this -mm series looks like
the obvious culprit.

I'll go start bisection, but I thought I'd give a heads-up in case
somebody else has seen TLB-flush-related lockups and already figured
out the guilty party..

                 Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-07-01  1:46 Andrew Morton
  2021-07-03  0:28 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-07-01  1:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


This is the rest of the -mm tree, less 66 patches which are dependent on
things which are (or were recently) in linux-next.  I'll trickle that
material over next week.


192 patches, based on 7cf3dead1ad70c72edb03e2d98e1f3dcd332cdb2 plus the
June 28 sendings.

Subsystems affected by this patch series:

  mm/hugetlb
  mm/userfaultfd
  mm/vmscan
  mm/kconfig
  mm/proc
  mm/z3fold
  mm/zbud
  mm/ras
  mm/mempolicy
  mm/memblock
  mm/migration
  mm/thp
  mm/nommu
  mm/kconfig
  mm/madvise
  mm/memory-hotplug
  mm/zswap
  mm/zsmalloc
  mm/zram
  mm/cleanups
  mm/kfence
  mm/hmm
  procfs
  sysctl
  misc
  core-kernel
  lib
  lz4
  checkpatch
  init
  kprobes
  nilfs2
  hfs
  signals
  exec
  kcov
  selftests
  compress/decompress
  ipc

Subsystem: mm/hugetlb

    Muchun Song <songmuchun@bytedance.com>:
    Patch series "Free some vmemmap pages of HugeTLB page", v23:
      mm: memory_hotplug: factor out bootmem core functions to bootmem_info.c
      mm: hugetlb: introduce a new config HUGETLB_PAGE_FREE_VMEMMAP
      mm: hugetlb: gather discrete indexes of tail page
      mm: hugetlb: free the vmemmap pages associated with each HugeTLB page
      mm: hugetlb: defer freeing of HugeTLB pages
      mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page
      mm: hugetlb: add a kernel parameter hugetlb_free_vmemmap
      mm: memory_hotplug: disable memmap_on_memory when hugetlb_free_vmemmap enabled
      mm: hugetlb: introduce nr_free_vmemmap_pages in the struct hstate

    Shixin Liu <liushixin2@huawei.com>:
      mm/debug_vm_pgtable: move {pmd/pud}_huge_tests out of CONFIG_TRANSPARENT_HUGEPAGE
      mm/debug_vm_pgtable: remove redundant pfn_{pmd/pte}() and fix one comment mistake

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixup for huge_memory:, v3:
      mm/huge_memory.c: remove dedicated macro HPAGE_CACHE_INDEX_MASK
      mm/huge_memory.c: use page->deferred_list
      mm/huge_memory.c: add missing read-only THP checking in transparent_hugepage_enabled()
      mm/huge_memory.c: remove unnecessary tlb_remove_page_size() for huge zero pmd
      mm/huge_memory.c: don't discard hugepage if other processes are mapping it

    Christophe Leroy <christophe.leroy@csgroup.eu>:
    Patch series "Subject: [PATCH v2 0/5] Implement huge VMAP and VMALLOC on powerpc 8xx", v2:
      mm/hugetlb: change parameters of arch_make_huge_pte()
      mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge
      mm/vmalloc: enable mapping of huge pages at pte level in vmap
      mm/vmalloc: enable mapping of huge pages at pte level in vmalloc
      powerpc/8xx: add support for huge pages on VMAP and VMALLOC

    Nanyong Sun <sunnanyong@huawei.com>:
      khugepaged: selftests: remove debug_cow

    Mina Almasry <almasrymina@google.com>:
      mm, hugetlb: fix racy resv_huge_pages underflow on UFFDIO_COPY

    Muchun Song <songmuchun@bytedance.com>:
    Patch series "Split huge PMD mapping of vmemmap pages", v4:
      mm: sparsemem: split the huge PMD mapping of vmemmap pages
      mm: sparsemem: use huge PMD mapping for vmemmap pages
      mm: hugetlb: introduce CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "Fix prep_compound_gigantic_page ref count adjustment":
      hugetlb: remove prep_compound_huge_page cleanup
      hugetlb: address ref count racing in prep_compound_gigantic_page

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm/hwpoison: disable pcp for page_handle_poison()

Subsystem: mm/userfaultfd

    Peter Xu <peterx@redhat.com>:
    Patch series "userfaultfd/selftests: A few cleanups", v2:
      userfaultfd/selftests: use user mode only
      userfaultfd/selftests: remove the time() check on delayed uffd
      userfaultfd/selftests: dropping VERIFY check in locking_thread
      userfaultfd/selftests: only dump counts if mode enabled
      userfaultfd/selftests: unify error handling
    Patch series "mm/uffd: Misc fix for uffd-wp and one more test":
      mm/thp: simplify copying of huge zero page pmd when fork
      mm/userfaultfd: fix uffd-wp special cases for fork()
      mm/userfaultfd: fail uffd-wp registration if not supported
      mm/pagemap: export uffd-wp protection information
      userfaultfd/selftests: add pagemap uffd-wp test

    Axel Rasmussen <axelrasmussen@google.com>:
    Patch series "userfaultfd: add minor fault handling for shmem", v6:
      userfaultfd/shmem: combine shmem_{mcopy_atomic,mfill_zeropage}_pte
      userfaultfd/shmem: support minor fault registration for shmem
      userfaultfd/shmem: support UFFDIO_CONTINUE for shmem
      userfaultfd/shmem: advertise shmem minor fault support
      userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte()
      userfaultfd/selftests: use memfd_create for shmem test type
      userfaultfd/selftests: create alias mappings in the shmem test
      userfaultfd/selftests: reinitialize test context in each test
      userfaultfd/selftests: exercise minor fault handling shmem support

Subsystem: mm/vmscan

    Yu Zhao <yuzhao@google.com>:
      mm/vmscan.c: fix potential deadlock in reclaim_pages()
      include/trace/events/vmscan.h: remove mm_vmscan_inactive_list_is_low

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: workingset: define macro WORKINGSET_SHIFT

Subsystem: mm/kconfig

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm/kconfig: move HOLES_IN_ZONE into mm

Subsystem: mm/proc

    Mike Rapoport <rppt@linux.ibm.com>:
      docs: proc.rst: meminfo: briefly describe gaps in memory accounting

    David Hildenbrand <david@redhat.com>:
    Patch series "fs/proc/kcore: don't read offline sections, logically offline pages and hwpoisoned pages", v3:
      fs/proc/kcore: drop KCORE_REMAP and KCORE_OTHER
      fs/proc/kcore: pfn_is_ram check only applies to KCORE_RAM
      fs/proc/kcore: don't read offline sections, logically offline pages and hwpoisoned pages
      mm: introduce page_offline_(begin|end|freeze|thaw) to synchronize setting PageOffline()
      virtio-mem: use page_offline_(start|end) when setting PageOffline()
      fs/proc/kcore: use page_offline_(freeze|thaw)

Subsystem: mm/z3fold

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixup for z3fold":
      mm/z3fold: define macro NCHUNKS as TOTAL_CHUNKS - ZHDR_CHUNKS
      mm/z3fold: avoid possible underflow in z3fold_alloc()
      mm/z3fold: remove magic number in z3fold_create_pool()
      mm/z3fold: remove unused function handle_to_z3fold_header()
      mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
      mm/z3fold: use release_z3fold_page_locked() to release locked z3fold page

Subsystem: mm/zbud

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanups for zbud", v2:
      mm/zbud: reuse unbuddied[0] as buddied in zbud_pool
      mm/zbud: don't export any zbud API

Subsystem: mm/ras

    YueHaibing <yuehaibing@huawei.com>:
      mm/compaction: use DEVICE_ATTR_WO macro

    Liu Xiang <liu.xiang@zlingsmart.com>:
      mm: compaction: remove duplicate !list_empty(&sublist) check

    Wonhyuk Yang <vvghjk1234@gmail.com>:
      mm/compaction: fix 'limit' in fast_isolate_freepages

Subsystem: mm/mempolicy

    Feng Tang <feng.tang@intel.com>:
    Patch series "mm/mempolicy: some fix and semantics cleanup", v4:
      mm/mempolicy: cleanup nodemask intersection check for oom
      mm/mempolicy: don't handle MPOL_LOCAL like a fake MPOL_PREFERRED policy
      mm/mempolicy: unify the parameter sanity check for mbind and set_mempolicy

    Yang Shi <shy828301@gmail.com>:
      mm: mempolicy: don't have to split pmd for huge zero page

    Ben Widawsky <ben.widawsky@intel.com>:
      mm/mempolicy: use unified 'nodes' for bind/interleave/prefer policies

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "arm64: drop pfn_valid_within() and simplify pfn_valid()", v4:
      include/linux/mmzone.h: add documentation for pfn_valid()
      memblock: update initialization of reserved pages
      arm64: decouple check whether pfn is in linear map from pfn_valid()
      arm64: drop pfn_valid_within() and simplify pfn_valid()

    Anshuman Khandual <anshuman.khandual@arm.com>:
      arm64/mm: drop HAVE_ARCH_PFN_VALID

Subsystem: mm/migration

    Muchun Song <songmuchun@bytedance.com>:
      mm: migrate: fix missing update page_private to hugetlb_page_subpool

Subsystem: mm/thp

    Collin Fijalkovich <cfijalkovich@google.com>:
      mm, thp: relax the VM_DENYWRITE constraint on file-backed THPs

    Yang Shi <shy828301@gmail.com>:
      mm: memory: add orig_pmd to struct vm_fault
      mm: memory: make numa_migrate_prep() non-static
      mm: thp: refactor NUMA fault handling
      mm: migrate: account THP NUMA migration counters correctly
      mm: migrate: don't split THP for misplaced NUMA page
      mm: migrate: check mapcount for THP instead of refcount
      mm: thp: skip make PMD PROT_NONE if THP migration is not supported

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/thp: make ARCH_ENABLE_SPLIT_PMD_PTLOCK dependent on PGTABLE_LEVELS > 2

    Yang Shi <shy828301@gmail.com>:
      mm: rmap: make try_to_unmap() void function

    Hugh Dickins <hughd@google.com>:
      mm/thp: remap_page() is only needed on anonymous THP
      mm: hwpoison_user_mappings() try_to_unmap() with TTU_SYNC

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/thp: fix strncpy warning

Subsystem: mm/nommu

    Chen Li <chenli@uniontech.com>:
      nommu: remove __GFP_HIGHMEM in vmalloc/vzalloc

    Liam Howlett <liam.howlett@oracle.com>:
      mm/nommu: unexport do_munmap()

Subsystem: mm/kconfig

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm: generalize ZONE_[DMA|DMA32]

Subsystem: mm/madvise

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tables", v2:
      mm: make variable names for populate_vma_page_range() consistent
      mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tables
      MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT
      selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore
      selftests/vm: add test for MADV_POPULATE_(READ|WRITE)

Subsystem: mm/memory-hotplug

    Liam Mark <lmark@codeaurora.org>:
      mm/memory_hotplug: rate limit page migration warnings

    Oscar Salvador <osalvador@suse.de>:
      mm,memory_hotplug: drop unneeded locking

Subsystem: mm/zswap

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixup for zswap":
      mm/zswap.c: remove unused function zswap_debugfs_exit()
      mm/zswap.c: avoid unnecessary copy-in at map time
      mm/zswap.c: fix two bugs in zswap_writeback_entry()

Subsystem: mm/zsmalloc

    Zhaoyang Huang <zhaoyang.huang@unisoc.com>:
      mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup for zsmalloc":
      mm/zsmalloc.c: remove confusing code in obj_free()
      mm/zsmalloc.c: improve readability for async_free_zspage()

Subsystem: mm/zram

    Yue Hu <huyue2@yulong.com>:
      zram: move backing_dev under macro CONFIG_ZRAM_WRITEBACK

Subsystem: mm/cleanups

    Hyeonggon Yoo <42.hyeyoo@gmail.com>:
      mm: fix typos and grammar error in comments

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm: define default value for FIRST_USER_ADDRESS

    Zhen Lei <thunder.leizhen@huawei.com>:
      mm: fix spelling mistakes

    Mel Gorman <mgorman@techsingularity.net>:
    Patch series "Clean W=1 build warnings for mm/":
      mm/vmscan: remove kerneldoc-like comment from isolate_lru_pages
      mm/vmalloc: include header for prototype of set_iounmap_nonlazy
      mm/page_alloc: make should_fail_alloc_page() static
      mm/mapping_dirty_helpers: remove double Note in kerneldoc
      mm/memcontrol.c: fix kerneldoc comment for mem_cgroup_calculate_protection
      mm/memory_hotplug: fix kerneldoc comment for __try_online_node
      mm/memory_hotplug: fix kerneldoc comment for __remove_memory
      mm/zbud: add kerneldoc fields for zbud_pool
      mm/z3fold: add kerneldoc fields for z3fold_pool
      mm/swap: make swap_address_space an inline function
      mm/mmap_lock: remove dead code for !CONFIG_TRACING configurations
      mm/page_alloc: move prototype for find_suitable_fallback
      mm/swap: make NODE_DATA an inline function on CONFIG_FLATMEM

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/thp: define default pmd_pgtable()

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: unconditionally use unbound work queue

Subsystem: mm/hmm

    Alistair Popple <apopple@nvidia.com>:
    Patch series "Add support for SVM atomics in Nouveau", v11:
      mm: remove special swap entry functions
      mm/swapops: rework swap entry manipulation code
      mm/rmap: split try_to_munlock from try_to_unmap
      mm/rmap: split migration into its own function
      mm: rename migrate_pgmap_owner
      mm/memory.c: allow different return codes for copy_nonpresent_pte()
      mm: device exclusive memory access
      mm: selftests for exclusive device memory
      nouveau/svm: refactor nouveau_range_fault
      nouveau/svm: implement atomic SVM access

Subsystem: procfs

    Marcelo Henrique Cerri <marcelo.cerri@canonical.com>:
      proc: Avoid mixing integer types in mem_rw()

    ZHOUFENG <zhoufeng.zf@bytedance.com>:
      fs/proc/kcore.c: add mmap interface

    Kalesh Singh <kaleshsingh@google.com>:
      procfs: allow reading fdinfo with PTRACE_MODE_READ
      procfs/dmabuf: add inode number to /proc/*/fdinfo

Subsystem: sysctl

    Jiapeng Chong <jiapeng.chong@linux.alibaba.com>:
      sysctl: remove redundant assignment to first

Subsystem: misc

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      drm: include only needed headers in ascii85.h

Subsystem: core-kernel

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kernel.h: split out panic and oops helpers

Subsystem: lib

    Zhen Lei <thunder.leizhen@huawei.com>:
      lib: decompress_bunzip2: remove an unneeded semicolon

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
    Patch series "lib/string_helpers: get rid of ugly *_escape_mem_ascii()", v3:
      lib/string_helpers: switch to use BIT() macro
      lib/string_helpers: move ESCAPE_NP check inside 'else' branch in a loop
      lib/string_helpers: drop indentation level in string_escape_mem()
      lib/string_helpers: introduce ESCAPE_NA for escaping non-ASCII
      lib/string_helpers: introduce ESCAPE_NAP to escape non-ASCII and non-printable
      lib/string_helpers: allow to append additional characters to be escaped
      lib/test-string_helpers: print flags in hexadecimal format
      lib/test-string_helpers: get rid of trailing comma in terminators
      lib/test-string_helpers: add test cases for new features
      MAINTAINERS: add myself as designated reviewer for generic string library
      seq_file: introduce seq_escape_mem()
      seq_file: add seq_escape_str() as replica of string_escape_str()
      seq_file: convert seq_escape() to use seq_escape_str()
      nfsd: avoid non-flexible API in seq_quote_mem()
      seq_file: drop unused *_escape_mem_ascii()

    Trent Piepho <tpiepho@gmail.com>:
      lib/math/rational.c: fix divide by zero
      lib/math/rational: add Kunit test cases

    Zhen Lei <thunder.leizhen@huawei.com>:
      lib/decompressors: fix spelling mistakes
      lib/mpi: fix spelling mistakes

    Alexey Dobriyan <adobriyan@gmail.com>:
      lib: memscan() fixlet
      lib: uninline simple_strtoull()

    Matteo Croce <mcroce@microsoft.com>:
      lib/test_string.c: allow module removal

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kernel.h: split out kstrtox() and simple_strtox() to a separate header

Subsystem: lz4

    Rajat Asthana <thisisrast7@gmail.com>:
      lz4_decompress: declare LZ4_decompress_safe_withPrefix64k static

    Dimitri John Ledkov <dimitri.ledkov@canonical.com>:
      lib/decompress_unlz4.c: correctly handle zero-padding around initrds.

Subsystem: checkpatch

    Guenter Roeck <linux@roeck-us.net>:
      checkpatch: scripts/spdxcheck.py now requires python3

    Joe Perches <joe@perches.com>:
      checkpatch: improve the indented label test

    Guenter Roeck <linux@roeck-us.net>:
      checkpatch: do not complain about positive return values starting with EPOLL

Subsystem: init

    Andrew Halaney <ahalaney@redhat.com>:
      init: print out unknown kernel parameters

Subsystem: kprobes

    Barry Song <song.bao.hua@hisilicon.com>:
      kprobes: remove duplicated strong free_insn_page in x86 and s390

Subsystem: nilfs2

    Colin Ian King <colin.king@canonical.com>:
      nilfs2: remove redundant continue statement in a while-loop

Subsystem: hfs

    Zhen Lei <thunder.leizhen@huawei.com>:
      hfsplus: remove unnecessary oom message

    Chung-Chiang Cheng <shepjeng@gmail.com>:
      hfsplus: report create_date to kstat.btime

Subsystem: signals

    Al Viro <viro@zeniv.linux.org.uk>:
      x86: signal: don't do sas_ss_reset() until we are certain that sigframe won't be abandoned

Subsystem: exec

    Alexey Dobriyan <adobriyan@gmail.com>:
      exec: remove checks in __register_bimfmt()

Subsystem: kcov

    Marco Elver <elver@google.com>:
      kcov: add __no_sanitize_coverage to fix noinstr for all architectures

Subsystem: selftests

    Dave Hansen <dave.hansen@linux.intel.com>:
    Patch series "selftests/vm/pkeys: Bug fixes and a new test":
      selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random
      selftests/vm/pkeys: handle negative sys_pkey_alloc() return code
      selftests/vm/pkeys: refill shadow register after implicit kernel write
      selftests/vm/pkeys: exercise x86 XSAVE init state

Subsystem: compress/decompress

    Yu Kuai <yukuai3@huawei.com>:
      lib/decompressors: remove set but not used variabled 'level'

Subsystem: ipc

    Vasily Averin <vvs@virtuozzo.com>:
    Patch series "ipc: allocations cleanup", v2:
      ipc sem: use kvmalloc for sem_undo allocation
      ipc: use kmalloc for msg_queue and shmid_kernel

    Manfred Spraul <manfred@colorfullife.com>:
      ipc/sem.c: use READ_ONCE()/WRITE_ONCE() for use_global_lock
      ipc/util.c: use binary search for max_idx

 Documentation/admin-guide/kernel-parameters.txt    |   35 
 Documentation/admin-guide/mm/hugetlbpage.rst       |   11 
 Documentation/admin-guide/mm/memory-hotplug.rst    |   13 
 Documentation/admin-guide/mm/pagemap.rst           |    2 
 Documentation/admin-guide/mm/userfaultfd.rst       |    3 
 Documentation/core-api/kernel-api.rst              |    7 
 Documentation/filesystems/proc.rst                 |   48 
 Documentation/vm/hmm.rst                           |   19 
 Documentation/vm/unevictable-lru.rst               |   33 
 MAINTAINERS                                        |   10 
 arch/alpha/Kconfig                                 |    5 
 arch/alpha/include/asm/pgalloc.h                   |    1 
 arch/alpha/include/asm/pgtable.h                   |    1 
 arch/alpha/include/uapi/asm/mman.h                 |    3 
 arch/alpha/kernel/setup.c                          |    2 
 arch/arc/include/asm/pgalloc.h                     |    2 
 arch/arc/include/asm/pgtable.h                     |    8 
 arch/arm/Kconfig                                   |    3 
 arch/arm/include/asm/pgalloc.h                     |    1 
 arch/arm64/Kconfig                                 |   15 
 arch/arm64/include/asm/hugetlb.h                   |    3 
 arch/arm64/include/asm/memory.h                    |    2 
 arch/arm64/include/asm/page.h                      |    4 
 arch/arm64/include/asm/pgalloc.h                   |    1 
 arch/arm64/include/asm/pgtable.h                   |    2 
 arch/arm64/kernel/setup.c                          |    1 
 arch/arm64/kvm/mmu.c                               |    2 
 arch/arm64/mm/hugetlbpage.c                        |    5 
 arch/arm64/mm/init.c                               |   51 
 arch/arm64/mm/ioremap.c                            |    4 
 arch/arm64/mm/mmu.c                                |   22 
 arch/csky/include/asm/pgalloc.h                    |    2 
 arch/csky/include/asm/pgtable.h                    |    1 
 arch/hexagon/include/asm/pgtable.h                 |    4 
 arch/ia64/Kconfig                                  |    7 
 arch/ia64/include/asm/pal.h                        |    1 
 arch/ia64/include/asm/pgalloc.h                    |    1 
 arch/ia64/include/asm/pgtable.h                    |    1 
 arch/m68k/Kconfig                                  |    5 
 arch/m68k/include/asm/mcf_pgalloc.h                |    2 
 arch/m68k/include/asm/mcf_pgtable.h                |    2 
 arch/m68k/include/asm/motorola_pgalloc.h           |    1 
 arch/m68k/include/asm/motorola_pgtable.h           |    2 
 arch/m68k/include/asm/pgtable_mm.h                 |    1 
 arch/m68k/include/asm/sun3_pgalloc.h               |    1 
 arch/microblaze/Kconfig                            |    4 
 arch/microblaze/include/asm/pgalloc.h              |    2 
 arch/microblaze/include/asm/pgtable.h              |    2 
 arch/mips/Kconfig                                  |   10 
 arch/mips/include/asm/pgalloc.h                    |    1 
 arch/mips/include/asm/pgtable-32.h                 |    1 
 arch/mips/include/asm/pgtable-64.h                 |    1 
 arch/mips/include/uapi/asm/mman.h                  |    3 
 arch/mips/kernel/relocate.c                        |    1 
 arch/mips/sgi-ip22/ip22-reset.c                    |    1 
 arch/mips/sgi-ip32/ip32-reset.c                    |    1 
 arch/nds32/include/asm/pgalloc.h                   |    5 
 arch/nios2/include/asm/pgalloc.h                   |    1 
 arch/nios2/include/asm/pgtable.h                   |    2 
 arch/openrisc/include/asm/pgalloc.h                |    2 
 arch/openrisc/include/asm/pgtable.h                |    1 
 arch/parisc/include/asm/pgalloc.h                  |    1 
 arch/parisc/include/asm/pgtable.h                  |    2 
 arch/parisc/include/uapi/asm/mman.h                |    3 
 arch/parisc/kernel/pdc_chassis.c                   |    1 
 arch/powerpc/Kconfig                               |    6 
 arch/powerpc/include/asm/book3s/pgtable.h          |    1 
 arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h   |    5 
 arch/powerpc/include/asm/nohash/32/mmu-8xx.h       |   43 
 arch/powerpc/include/asm/nohash/32/pgtable.h       |    1 
 arch/powerpc/include/asm/nohash/64/pgtable.h       |    2 
 arch/powerpc/include/asm/pgalloc.h                 |    5 
 arch/powerpc/include/asm/pgtable.h                 |    6 
 arch/powerpc/kernel/setup-common.c                 |    1 
 arch/powerpc/platforms/Kconfig.cputype             |    1 
 arch/riscv/Kconfig                                 |    5 
 arch/riscv/include/asm/pgalloc.h                   |    2 
 arch/riscv/include/asm/pgtable.h                   |    2 
 arch/s390/Kconfig                                  |    6 
 arch/s390/include/asm/pgalloc.h                    |    3 
 arch/s390/include/asm/pgtable.h                    |    5 
 arch/s390/kernel/ipl.c                             |    1 
 arch/s390/kernel/kprobes.c                         |    5 
 arch/s390/mm/pgtable.c                             |    2 
 arch/sh/include/asm/pgalloc.h                      |    1 
 arch/sh/include/asm/pgtable.h                      |    2 
 arch/sparc/Kconfig                                 |    5 
 arch/sparc/include/asm/pgalloc_32.h                |    1 
 arch/sparc/include/asm/pgalloc_64.h                |    1 
 arch/sparc/include/asm/pgtable_32.h                |    3 
 arch/sparc/include/asm/pgtable_64.h                |    8 
 arch/sparc/kernel/sstate.c                         |    1 
 arch/sparc/mm/hugetlbpage.c                        |    6 
 arch/sparc/mm/init_64.c                            |    1 
 arch/um/drivers/mconsole_kern.c                    |    1 
 arch/um/include/asm/pgalloc.h                      |    1 
 arch/um/include/asm/pgtable-2level.h               |    1 
 arch/um/include/asm/pgtable-3level.h               |    1 
 arch/um/kernel/um_arch.c                           |    1 
 arch/x86/Kconfig                                   |   17 
 arch/x86/include/asm/desc.h                        |    1 
 arch/x86/include/asm/pgalloc.h                     |    2 
 arch/x86/include/asm/pgtable_types.h               |    2 
 arch/x86/kernel/cpu/mshyperv.c                     |    1 
 arch/x86/kernel/kprobes/core.c                     |    6 
 arch/x86/kernel/setup.c                            |    1 
 arch/x86/mm/init_64.c                              |   21 
 arch/x86/mm/pgtable.c                              |   34 
 arch/x86/purgatory/purgatory.c                     |    2 
 arch/x86/xen/enlighten.c                           |    1 
 arch/xtensa/include/asm/pgalloc.h                  |    2 
 arch/xtensa/include/asm/pgtable.h                  |    1 
 arch/xtensa/include/uapi/asm/mman.h                |    3 
 arch/xtensa/platforms/iss/setup.c                  |    1 
 drivers/block/zram/zram_drv.h                      |    2 
 drivers/bus/brcmstb_gisb.c                         |    1 
 drivers/char/ipmi/ipmi_msghandler.c                |    1 
 drivers/clk/analogbits/wrpll-cln28hpc.c            |    4 
 drivers/edac/altera_edac.c                         |    1 
 drivers/firmware/google/gsmi.c                     |    1 
 drivers/gpu/drm/nouveau/include/nvif/if000c.h      |    1 
 drivers/gpu/drm/nouveau/nouveau_svm.c              |  162 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h      |    1 
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp100.c |    6 
 drivers/hv/vmbus_drv.c                             |    1 
 drivers/hwtracing/coresight/coresight-cpu-debug.c  |    1 
 drivers/leds/trigger/ledtrig-activity.c            |    1 
 drivers/leds/trigger/ledtrig-heartbeat.c           |    1 
 drivers/leds/trigger/ledtrig-panic.c               |    1 
 drivers/misc/bcm-vk/bcm_vk_dev.c                   |    1 
 drivers/misc/ibmasm/heartbeat.c                    |    1 
 drivers/misc/pvpanic/pvpanic.c                     |    1 
 drivers/net/ipa/ipa_smp2p.c                        |    1 
 drivers/parisc/power.c                             |    1 
 drivers/power/reset/ltc2952-poweroff.c             |    1 
 drivers/remoteproc/remoteproc_core.c               |    1 
 drivers/s390/char/con3215.c                        |    1 
 drivers/s390/char/con3270.c                        |    1 
 drivers/s390/char/sclp.c                           |    1 
 drivers/s390/char/sclp_con.c                       |    1 
 drivers/s390/char/sclp_vt220.c                     |    1 
 drivers/s390/char/zcore.c                          |    1 
 drivers/soc/bcm/brcmstb/pm/pm-arm.c                |    1 
 drivers/staging/olpc_dcon/olpc_dcon.c              |    1 
 drivers/video/fbdev/hyperv_fb.c                    |    1 
 drivers/virtio/virtio_mem.c                        |    2 
 fs/Kconfig                                         |   15 
 fs/exec.c                                          |    3 
 fs/hfsplus/inode.c                                 |    5 
 fs/hfsplus/xattr.c                                 |    1 
 fs/nfsd/nfs4state.c                                |    2 
 fs/nilfs2/btree.c                                  |    1 
 fs/open.c                                          |   13 
 fs/proc/base.c                                     |    6 
 fs/proc/fd.c                                       |   20 
 fs/proc/kcore.c                                    |  136 ++
 fs/proc/task_mmu.c                                 |   34 
 fs/seq_file.c                                      |   43 
 fs/userfaultfd.c                                   |   15 
 include/asm-generic/bug.h                          |    3 
 include/linux/ascii85.h                            |    3 
 include/linux/bootmem_info.h                       |   68 +
 include/linux/compat.h                             |    2 
 include/linux/compiler-clang.h                     |   17 
 include/linux/compiler-gcc.h                       |    6 
 include/linux/compiler_types.h                     |    2 
 include/linux/huge_mm.h                            |   74 -
 include/linux/hugetlb.h                            |   80 +
 include/linux/hugetlb_cgroup.h                     |   19 
 include/linux/kcore.h                              |    3 
 include/linux/kernel.h                             |  227 ----
 include/linux/kprobes.h                            |    1 
 include/linux/kstrtox.h                            |  155 ++
 include/linux/memblock.h                           |    4 
 include/linux/memory_hotplug.h                     |   27 
 include/linux/mempolicy.h                          |    9 
 include/linux/memremap.h                           |    2 
 include/linux/migrate.h                            |   27 
 include/linux/mm.h                                 |   18 
 include/linux/mm_types.h                           |    2 
 include/linux/mmu_notifier.h                       |   26 
 include/linux/mmzone.h                             |   27 
 include/linux/mpi.h                                |    4 
 include/linux/page-flags.h                         |   22 
 include/linux/panic.h                              |   98 +
 include/linux/panic_notifier.h                     |   12 
 include/linux/pgtable.h                            |   44 
 include/linux/rmap.h                               |   13 
 include/linux/seq_file.h                           |   10 
 include/linux/shmem_fs.h                           |   19 
 include/linux/signal.h                             |    2 
 include/linux/string.h                             |    7 
 include/linux/string_helpers.h                     |   31 
 include/linux/sunrpc/cache.h                       |    1 
 include/linux/swap.h                               |   19 
 include/linux/swapops.h                            |  171 +--
 include/linux/thread_info.h                        |    1 
 include/linux/userfaultfd_k.h                      |    5 
 include/linux/vmalloc.h                            |   15 
 include/linux/zbud.h                               |   23 
 include/trace/events/vmscan.h                      |   41 
 include/uapi/asm-generic/mman-common.h             |    3 
 include/uapi/linux/mempolicy.h                     |    1 
 include/uapi/linux/userfaultfd.h                   |    7 
 init/main.c                                        |   42 
 ipc/msg.c                                          |    6 
 ipc/sem.c                                          |   25 
 ipc/shm.c                                          |    6 
 ipc/util.c                                         |   44 
 ipc/util.h                                         |    3 
 kernel/hung_task.c                                 |    1 
 kernel/kexec_core.c                                |    1 
 kernel/kprobes.c                                   |    2 
 kernel/panic.c                                     |    1 
 kernel/rcu/tree.c                                  |    2 
 kernel/signal.c                                    |   14 
 kernel/sysctl.c                                    |    4 
 kernel/trace/trace.c                               |    1 
 lib/Kconfig.debug                                  |   12 
 lib/decompress_bunzip2.c                           |    6 
 lib/decompress_unlz4.c                             |    8 
 lib/decompress_unlzo.c                             |    3 
 lib/decompress_unxz.c                              |    2 
 lib/decompress_unzstd.c                            |    4 
 lib/kstrtox.c                                      |    5 
 lib/lz4/lz4_decompress.c                           |    2 
 lib/math/Makefile                                  |    1 
 lib/math/rational-test.c                           |   56 +
 lib/math/rational.c                                |   16 
 lib/mpi/longlong.h                                 |    4 
 lib/mpi/mpicoder.c                                 |    6 
 lib/mpi/mpiutil.c                                  |    2 
 lib/parser.c                                       |    1 
 lib/string.c                                       |    2 
 lib/string_helpers.c                               |  142 +-
 lib/test-string_helpers.c                          |  157 ++-
 lib/test_hmm.c                                     |  127 ++
 lib/test_hmm_uapi.h                                |    2 
 lib/test_string.c                                  |    5 
 lib/vsprintf.c                                     |    1 
 lib/xz/xz_dec_bcj.c                                |    2 
 lib/xz/xz_dec_lzma2.c                              |    8 
 lib/zlib_inflate/inffast.c                         |    2 
 lib/zstd/huf.h                                     |    2 
 mm/Kconfig                                         |   16 
 mm/Makefile                                        |    2 
 mm/bootmem_info.c                                  |  127 ++
 mm/compaction.c                                    |   20 
 mm/debug_vm_pgtable.c                              |  109 --
 mm/gup.c                                           |   58 +
 mm/hmm.c                                           |   12 
 mm/huge_memory.c                                   |  269 ++---
 mm/hugetlb.c                                       |  369 +++++--
 mm/hugetlb_vmemmap.c                               |  332 ++++++
 mm/hugetlb_vmemmap.h                               |   53 -
 mm/internal.h                                      |   29 
 mm/kfence/core.c                                   |    4 
 mm/khugepaged.c                                    |   20 
 mm/madvise.c                                       |   66 +
 mm/mapping_dirty_helpers.c                         |    2 
 mm/memblock.c                                      |   28 
 mm/memcontrol.c                                    |    4 
 mm/memory-failure.c                                |   38 
 mm/memory.c                                        |  239 +++-
 mm/memory_hotplug.c                                |  161 ---
 mm/mempolicy.c                                     |  323 ++----
 mm/migrate.c                                       |  268 +----
 mm/mlock.c                                         |   12 
 mm/mmap_lock.c                                     |   59 -
 mm/mprotect.c                                      |   18 
 mm/nommu.c                                         |    5 
 mm/oom_kill.c                                      |    2 
 mm/page_alloc.c                                    |    5 
 mm/page_vma_mapped.c                               |   15 
 mm/rmap.c                                          |  644 +++++++++---
 mm/shmem.c                                         |  125 --
 mm/sparse-vmemmap.c                                |  432 +++++++-
 mm/sparse.c                                        |    1 
 mm/swap.c                                          |    2 
 mm/swapfile.c                                      |    2 
 mm/userfaultfd.c                                   |  249 ++--
 mm/util.c                                          |   40 
 mm/vmalloc.c                                       |   37 
 mm/vmscan.c                                        |   20 
 mm/workingset.c                                    |   10 
 mm/z3fold.c                                        |   39 
 mm/zbud.c                                          |  235 ++--
 mm/zsmalloc.c                                      |    5 
 mm/zswap.c                                         |   26 
 scripts/checkpatch.pl                              |   16 
 tools/testing/selftests/vm/.gitignore              |    3 
 tools/testing/selftests/vm/Makefile                |    5 
 tools/testing/selftests/vm/hmm-tests.c             |  158 +++
 tools/testing/selftests/vm/khugepaged.c            |    4 
 tools/testing/selftests/vm/madv_populate.c         |  342 ++++++
 tools/testing/selftests/vm/pkey-x86.h              |    1 
 tools/testing/selftests/vm/protection_keys.c       |   85 +
 tools/testing/selftests/vm/run_vmtests.sh          |   16 
 tools/testing/selftests/vm/userfaultfd.c           | 1094 ++++++++++-----------
 299 files changed, 6277 insertions(+), 3183 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-06-29  2:32 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-06-29  2:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

192 patches, based on 7cf3dead1ad70c72edb03e2d98e1f3dcd332cdb2.

Subsystems affected by this patch series:

  mm/gup
  mm/pagealloc
  kthread
  ia64
  scripts
  ntfs
  squashfs
  ocfs2
  z
  kernel/watchdog
  mm/slab
  mm/slub
  mm/kmemleak
  mm/dax
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/mprotect
  mm/bootmem
  mm/dma
  mm/tracing
  mm/vmalloc
  mm/kasan
  mm/initialization
  mm/pagealloc
  mm/memory-failure

Subsystem: mm/gup

    Jann Horn <jannh@google.com>:
      mm/gup: fix try_grab_compound_head() race with split_huge_page()

Subsystem: mm/pagealloc

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/page_alloc: fix memory map initialization for descending nodes

    Mel Gorman <mgorman@techsingularity.net>:
      mm/page_alloc: correct return value of populated elements if bulk array is populated

Subsystem: kthread

    Jonathan Neuschäfer <j.neuschaefer@gmx.net>:
      kthread: switch to new kerneldoc syntax for named variable macro argument

    Petr Mladek <pmladek@suse.com>:
      kthread_worker: fix return value when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync()

Subsystem: ia64

    Randy Dunlap <rdunlap@infradead.org>:
      ia64: headers: drop duplicated words

    Arnd Bergmann <arnd@arndb.de>:
      ia64: mca_drv: fix incorrect array size calculation

Subsystem: scripts

    "Steven Rostedt (VMware)" <rostedt@goodmis.org>:
    Patch series "streamline_config.pl: Fix Perl spacing":
      streamline_config.pl: make spacing consistent
      streamline_config.pl: add softtabstop=4 for vim users

    Colin Ian King <colin.king@canonical.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

Subsystem: ntfs

    Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>:
      ntfs: fix validity check for file name attribute

Subsystem: squashfs

    Vincent Whitchurch <vincent.whitchurch@axis.com>:
      squashfs: add option to panic on errors

Subsystem: ocfs2

    Yang Yingliang <yangyingliang@huawei.com>:
      ocfs2: remove unnecessary INIT_LIST_HEAD()

Subsystem: z

    Dan Carpenter <dan.carpenter@oracle.com>:
      ocfs2: fix snprintf() checking

    Colin Ian King <colin.king@canonical.com>:
      ocfs2: remove redundant assignment to pointer queue

    Wan Jiabing <wanjiabing@vivo.com>:
      ocfs2: remove repeated uptodate check for buffer

    Chen Huang <chenhuang5@huawei.com>:
      ocfs2: replace simple_strtoull() with kstrtoull()

    Colin Ian King <colin.king@canonical.com>:
      ocfs2: remove redundant initialization of variable ret

Subsystem: kernel/watchdog

    Wang Qing <wangqing@vivo.com>:
      kernel: watchdog: modify the explanation related to watchdog thread
      doc: watchdog: modify the explanation related to watchdog thread
      doc: watchdog: modify the doc related to "watchdog/%u"

Subsystem: mm/slab

    gumingtao <gumingtao1225@gmail.com>:
      slab: use __func__ to trace function name

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
      kunit: make test->lock irq safe

    Oliver Glitta <glittao@gmail.com>:
      mm/slub, kunit: add a KUnit test for SLUB debugging functionality
      slub: remove resiliency_test() function

    Hyeonggon Yoo <42.hyeyoo@gmail.com>:
      mm, slub: change run-time assertion in kmalloc_index() to compile-time

    Stephen Boyd <swboyd@chromium.org>:
      slub: restore slub_debug=- behavior
      slub: actually use 'message' in restore_bytes()

    Joe Perches <joe@perches.com>:
      slub: indicate slab_fix() uses printf formats

    Stephen Boyd <swboyd@chromium.org>:
      slub: force on no_hash_pointers when slub_debug is enabled

    Faiyaz Mohammed <faiyazm@codeaurora.org>:
      mm: slub: move sysfs slab alloc/free interfaces to debugfs

    Georgi Djakov <quic_c_gdjako@quicinc.com>:
      mm/slub: add taint after the errors are printed

Subsystem: mm/kmemleak

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/kmemleak: fix possible wrong memory scanning period

Subsystem: mm/dax

    Jan Kara <jack@suse.cz>:
      dax: fix ENOMEM handling in grab_mapping_entry()

Subsystem: mm/debug

    Tang Bin <tangbin@cmss.chinamobile.com>:
      tools/vm/page_owner_sort.c: check malloc() return

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/debug_vm_pgtable: ensure THP availability via has_transparent_hugepage()

    Nicolas Saenz Julienne <nsaenzju@redhat.com>:
      mm: mmap_lock: use local locks instead of disabling preemption

    Gavin Shan <gshan@redhat.com>:
    Patch series "mm/page_reporting: Make page reporting work on arm64 with 64KB page size", v4:
      mm/page_reporting: fix code style in __page_reporting_request()
      mm/page_reporting: export reporting order as module parameter
      mm/page_reporting: allow driver to specify reporting order
      virtio_balloon: specify page reporting order if needed

Subsystem: mm/pagecache

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm: page-writeback: kill get_writeback_state() comments

    Chi Wu <wuchi.zero@gmail.com>:
      mm/page-writeback: Fix performance when BDI's share of ratio is 0.
      mm/page-writeback: update the comment of Dirty position control
      mm/page-writeback: use __this_cpu_inc() in account_page_dirtied()

    Roman Gushchin <guro@fb.com>:
    Patch series "cgroup, blkcg: prevent dirty inodes to pin dying memory cgroups", v9:
      writeback, cgroup: do not switch inodes with I_WILL_FREE flag
      writeback, cgroup: add smp_mb() to cgroup_writeback_umount()
      writeback, cgroup: increment isw_nr_in_flight before grabbing an inode
      writeback, cgroup: switch to rcu_work API in inode_switch_wbs()
      writeback, cgroup: keep list of inodes attached to bdi_writeback
      writeback, cgroup: split out the functional part of inode_switch_wbs_work_fn()
      writeback, cgroup: support switching multiple inodes at once
      writeback, cgroup: release dying cgwbs by switching attached inodes

    Christoph Hellwig <hch@lst.de>:
    Patch series "remove the implicit .set_page_dirty default":
      fs: unexport __set_page_dirty
      fs: move ramfs_aops to libfs
      mm: require ->set_page_dirty to be explicitly wired up

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Further set_page_dirty cleanups":
      mm/writeback: move __set_page_dirty() to core mm
      mm/writeback: use __set_page_dirty in __set_page_dirty_nobuffers
      iomap: use __set_page_dirty_nobuffers
      fs: remove anon_set_page_dirty()
      fs: remove noop_set_page_dirty()
      mm: move page dirtying prototypes from mm.h

Subsystem: mm/gup

    Peter Xu <peterx@redhat.com>:
    Patch series "mm/gup: Fix pin page write cache bouncing on has_pinned", v2:
      mm/gup_benchmark: support threading

    Andrea Arcangeli <aarcange@redhat.com>:
      mm: gup: allow FOLL_PIN to scale in SMP
      mm: gup: pack has_pinned in MMF_HAS_PINNED

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm: pagewalk: fix walk for hugepage tables

Subsystem: mm/swap

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "close various race windows for swap", v6:
      mm/swapfile: use percpu_ref to serialize against concurrent swapoff
      swap: fix do_swap_page() race with swapoff
      mm/swap: remove confusing checking for non_swap_entry() in swap_ra_info()
      mm/shmem: fix shmem_swapin() race with swapoff
    Patch series "Cleanups for swap", v2:
      mm/swapfile: move get_swap_page_of_type() under CONFIG_HIBERNATION
      mm/swap: remove unused local variable nr_shadows
      mm/swap_slots.c: delete meaningless forward declarations

    Huang Ying <ying.huang@intel.com>:
      mm, swap: remove unnecessary smp_rmb() in swap_type_to_swap_info()
      mm: free idle swap cache page after COW
      swap: check mapping_empty() for swap cache before being freed

Subsystem: mm/memcg

    Waiman Long <longman@redhat.com>:
    Patch series "mm/memcg: Reduce kmemcache memory accounting overhead", v6:
      mm/memcg: move mod_objcg_state() to memcontrol.c
      mm/memcg: cache vmstat data in percpu memcg_stock_pcp
      mm/memcg: improve refill_obj_stock() performance
      mm/memcg: optimize user context object stock access
    Patch series "mm: memcg/slab: Fix objcg pointer array handling problem", v4:
      mm: memcg/slab: properly set up gfp flags for objcg pointer array
      mm: memcg/slab: create a new set of kmalloc-cg-<n> caches
      mm: memcg/slab: disable cache merging for KMALLOC_NORMAL caches

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: fix root_mem_cgroup charging
    Patch series "memcontrol code cleanup and simplification", v3:
      mm: memcontrol: fix page charging in page replacement
      mm: memcontrol: bail out early when !mm in get_mem_cgroup_from_mm
      mm: memcontrol: remove the pgdata parameter of mem_cgroup_page_lruvec
      mm: memcontrol: simplify lruvec_holds_page_lru_lock
      mm: memcontrol: rename lruvec_holds_page_lru_lock to page_matches_lruvec
      mm: memcontrol: simplify the logic of objcg pinning memcg
      mm: memcontrol: move obj_cgroup_uncharge_pages() out of css_set_lock
      mm: vmscan: remove noinline_for_stack

    wenhuizhang <wenhui@gwmail.gwu.edu>:
      memcontrol: use flexible-array member

    Dan Schatzberg <schatzberg.dan@gmail.com>:
    Patch series "Charge loop device i/o to issuing cgroup", v14:
      loop: use worker per cgroup instead of kworker
      mm: charge active memcg when no mm is set
      loop: charge i/o to mem and blk cg

    Huilong Deng <denghuilong@cdjrlc.com>:
      mm: memcontrol: remove trailing semicolon in macros

Subsystem: mm/pagemap

    David Hildenbrand <david@redhat.com>:
    Patch series "perf/binfmt/mm: remove in-tree usage of MAP_EXECUTABLE":
      perf: MAP_EXECUTABLE does not indicate VM_MAYEXEC
      binfmt: remove in-tree usage of MAP_EXECUTABLE
      mm: ignore MAP_EXECUTABLE in ksys_mmap_pgoff()

    Gonzalo Matias Juarez Tello <gmjuareztello@gmail.com>:
      mm/mmap.c: logic of find_vma_intersection repeated in __do_munmap

    Liam Howlett <liam.howlett@oracle.com>:
      mm/mmap: introduce unlock_range() for code cleanup
      mm/mmap: use find_vma_intersection() in do_mmap() for overlap

    Liu Xiang <liu.xiang@zlingsmart.com>:
      mm/memory.c: fix comment of finish_mkwrite_fault()

    Liam Howlett <liam.howlett@oracle.com>:
    Patch series "mm: Add vma_lookup()", v2:
      mm: add vma_lookup(), update find_vma_intersection() comments
      drm/i915/selftests: use vma_lookup() in __igt_mmap()
      arch/arc/kernel/troubleshoot: use vma_lookup() instead of find_vma()
      arch/arm64/kvm: use vma_lookup() instead of find_vma_intersection()
      arch/powerpc/kvm/book3s_hv_uvmem: use vma_lookup() instead of find_vma_intersection()
      arch/powerpc/kvm/book3s: use vma_lookup() in kvmppc_hv_setup_htab_rma()
      arch/mips/kernel/traps: use vma_lookup() instead of find_vma()
      arch/m68k/kernel/sys_m68k: use vma_lookup() in sys_cacheflush()
      x86/sgx: use vma_lookup() in sgx_encl_find()
      virt/kvm: use vma_lookup() instead of find_vma_intersection()
      vfio: use vma_lookup() instead of find_vma_intersection()
      net/ipv5/tcp: use vma_lookup() in tcp_zerocopy_receive()
      drm/amdgpu: use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
      media: videobuf2: use vma_lookup() in get_vaddr_frames()
      misc/sgi-gru/grufault: use vma_lookup() in gru_find_vma()
      kernel/events/uprobes: use vma_lookup() in find_active_uprobe()
      lib/test_hmm: use vma_lookup() in dmirror_migrate()
      mm/ksm: use vma_lookup() in find_mergeable_vma()
      mm/migrate: use vma_lookup() in do_pages_stat_array()
      mm/mremap: use vma_lookup() in vma_to_resize()
      mm/memory.c: use vma_lookup() in __access_remote_vm()
      mm/mempolicy: use vma_lookup() in __access_remote_vm()

    Chen Li <chenli@uniontech.com>:
      mm: update legacy flush_tlb_* to use vma

Subsystem: mm/mprotect

    Peter Collingbourne <pcc@google.com>:
      mm: improve mprotect(R|W) efficiency on pages referenced once

Subsystem: mm/bootmem

    Souptick Joarder <jrdr.linux@gmail.com>:
      h8300: remove unused variable

Subsystem: mm/dma

    YueHaibing <yuehaibing@huawei.com>:
      mm/dmapool: use DEVICE_ATTR_RO macro

Subsystem: mm/tracing

    Vincent Whitchurch <vincent.whitchurch@axis.com>:
      mm, tracing: unify PFN format strings

Subsystem: mm/vmalloc

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
    Patch series "vmalloc() vs bulk allocator", v2:
      mm/page_alloc: add an alloc_pages_bulk_array_node() helper
      mm/vmalloc: switch to bulk allocator in __vmalloc_area_node()
      mm/vmalloc: print a warning message first on failure
      mm/vmalloc: remove quoted strings split across lines

    Uladzislau Rezki <urezki@gmail.com>:
      mm/vmalloc: fallback to a single page allocator

    Rafael Aquini <aquini@redhat.com>:
      mm: vmalloc: add cond_resched() in __vunmap()

Subsystem: mm/kasan

    Alexander Potapenko <glider@google.com>:
      printk: introduce dump_stack_lvl()
      kasan: use dump_stack_lvl(KERN_ERR) to print stacks

    David Gow <davidgow@google.com>:
      kasan: test: improve failure message in KUNIT_EXPECT_KASAN_FAIL()

    Daniel Axtens <dja@axtens.net>:
    Patch series "KASAN core changes for ppc64 radix KASAN", v16:
      kasan: allow an architecture to disable inline instrumentation
      kasan: allow architectures to provide an outline readiness check
      mm: define default MAX_PTRS_PER_* in include/pgtable.h
      kasan: use MAX_PTRS_PER_* for early shadow tables

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
    Patch series "kasan: add memory corruption identification support for hw tag-based kasan", v4:
      kasan: rename CONFIG_KASAN_SW_TAGS_IDENTIFY to CONFIG_KASAN_TAGS_IDENTIFY
      kasan: integrate the common part of two KASAN tag-based modes
      kasan: add memory corruption identification support for hardware tag-based mode

Subsystem: mm/initialization

    Jungseung Lee <js07.lee@samsung.com>:
      mm: report which part of mem is being freed on initmem case

Subsystem: mm/pagealloc

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/mmzone.h: simplify is_highmem_idx()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Constify struct page arguments":
      mm: make __dump_page static

    Aaron Tomlin <atomlin@redhat.com>:
      mm/page_alloc: bail out on fatal signal during reclaim/compaction retry attempt

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/debug: factor PagePoisoned out of __dump_page
      mm/page_owner: constify dump_page_owner
      mm: make compound_head const-preserving
      mm: constify get_pfnblock_flags_mask and get_pfnblock_migratetype
      mm: constify page_count and page_ref_count
      mm: optimise nth_page for contiguous memmap

    Heiner Kallweit <hkallweit1@gmail.com>:
      mm/page_alloc: switch to pr_debug

    Andrii Nakryiko <andrii@kernel.org>:
      kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21

    Mel Gorman <mgorman@techsingularity.net>:
      mm/page_alloc: split per cpu page lists and zone stats
      mm/page_alloc: convert per-cpu list protection to local_lock
      mm/vmstat: convert NUMA statistics to basic NUMA counters
      mm/vmstat: inline NUMA event counter updates
      mm/page_alloc: batch the accounting updates in the bulk allocator
      mm/page_alloc: reduce duration that IRQs are disabled for VM counters
      mm/page_alloc: explicitly acquire the zone lock in __free_pages_ok
      mm/page_alloc: avoid conflating IRQs disabled with zone->lock
      mm/page_alloc: update PGFREE outside the zone lock in __free_pages_ok

    Minchan Kim <minchan@kernel.org>:
      mm: page_alloc: dump migrate-failed pages only at -EBUSY

    Mel Gorman <mgorman@techsingularity.net>:
    Patch series "Calculate pcp->high based on zone sizes and active CPUs", v2:
      mm/page_alloc: delete vm.percpu_pagelist_fraction
      mm/page_alloc: disassociate the pcp->high from pcp->batch
      mm/page_alloc: adjust pcp->high after CPU hotplug events
      mm/page_alloc: scale the number of pages that are batch freed
      mm/page_alloc: limit the number of pages on PCP lists when reclaim is active
      mm/page_alloc: introduce vm.percpu_pagelist_high_fraction

    Dong Aisheng <aisheng.dong@nxp.com>:
      mm: drop SECTION_SHIFT in code comments
      mm/page_alloc: improve memmap_pages dbg msg

    Liu Shixin <liushixin2@huawei.com>:
      mm/page_alloc: fix counting of managed_pages

    Mel Gorman <mgorman@techsingularity.net>:
    Patch series "Allow high order pages to be stored on PCP", v2:
      mm/page_alloc: move free_the_page

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "Remove DISCONTIGMEM memory model", v3:
      alpha: remove DISCONTIGMEM and NUMA
      arc: update comment about HIGHMEM implementation
      arc: remove support for DISCONTIGMEM
      m68k: remove support for DISCONTIGMEM
      mm: remove CONFIG_DISCONTIGMEM
      arch, mm: remove stale mentions of DISCONIGMEM
      docs: remove description of DISCONTIGMEM
      mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
      mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM

    Mel Gorman <mgorman@techsingularity.net>:
      mm/page_alloc: allow high-order pages to be stored on the per-cpu lists
      mm/page_alloc: split pcp->high across all online CPUs for cpuless nodes

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm,hwpoison: send SIGBUS with error virutal address
      mm,hwpoison: make get_hwpoison_page() call get_any_page()

 Documentation/admin-guide/kernel-parameters.txt    |    6 
 Documentation/admin-guide/lockup-watchdogs.rst     |    4 
 Documentation/admin-guide/sysctl/kernel.rst        |   10 
 Documentation/admin-guide/sysctl/vm.rst            |   52 -
 Documentation/dev-tools/kasan.rst                  |    9 
 Documentation/vm/memory-model.rst                  |   45 
 arch/alpha/Kconfig                                 |   22 
 arch/alpha/include/asm/machvec.h                   |    6 
 arch/alpha/include/asm/mmzone.h                    |  100 --
 arch/alpha/include/asm/pgtable.h                   |    4 
 arch/alpha/include/asm/topology.h                  |   39 
 arch/alpha/kernel/core_marvel.c                    |   53 -
 arch/alpha/kernel/core_wildfire.c                  |   29 
 arch/alpha/kernel/pci_iommu.c                      |   29 
 arch/alpha/kernel/proto.h                          |    8 
 arch/alpha/kernel/setup.c                          |   16 
 arch/alpha/kernel/sys_marvel.c                     |    5 
 arch/alpha/kernel/sys_wildfire.c                   |    5 
 arch/alpha/mm/Makefile                             |    2 
 arch/alpha/mm/init.c                               |    3 
 arch/alpha/mm/numa.c                               |  223 ----
 arch/arc/Kconfig                                   |   13 
 arch/arc/include/asm/mmzone.h                      |   40 
 arch/arc/kernel/troubleshoot.c                     |    8 
 arch/arc/mm/init.c                                 |   21 
 arch/arm/include/asm/tlbflush.h                    |   13 
 arch/arm/mm/tlb-v6.S                               |    2 
 arch/arm/mm/tlb-v7.S                               |    2 
 arch/arm64/Kconfig                                 |    2 
 arch/arm64/kvm/mmu.c                               |    2 
 arch/h8300/kernel/setup.c                          |    2 
 arch/ia64/Kconfig                                  |    2 
 arch/ia64/include/asm/pal.h                        |    2 
 arch/ia64/include/asm/spinlock.h                   |    2 
 arch/ia64/include/asm/uv/uv_hub.h                  |    2 
 arch/ia64/kernel/efi_stub.S                        |    2 
 arch/ia64/kernel/mca_drv.c                         |    2 
 arch/ia64/kernel/topology.c                        |    5 
 arch/ia64/mm/numa.c                                |    5 
 arch/m68k/Kconfig.cpu                              |   10 
 arch/m68k/include/asm/mmzone.h                     |   10 
 arch/m68k/include/asm/page.h                       |    2 
 arch/m68k/include/asm/page_mm.h                    |   35 
 arch/m68k/include/asm/tlbflush.h                   |    2 
 arch/m68k/kernel/sys_m68k.c                        |    4 
 arch/m68k/mm/init.c                                |   20 
 arch/mips/Kconfig                                  |    2 
 arch/mips/include/asm/mmzone.h                     |    8 
 arch/mips/include/asm/page.h                       |    2 
 arch/mips/kernel/traps.c                           |    4 
 arch/mips/mm/init.c                                |    7 
 arch/nds32/include/asm/memory.h                    |    6 
 arch/openrisc/include/asm/tlbflush.h               |    2 
 arch/powerpc/Kconfig                               |    2 
 arch/powerpc/include/asm/mmzone.h                  |    4 
 arch/powerpc/kernel/setup_64.c                     |    2 
 arch/powerpc/kernel/smp.c                          |    2 
 arch/powerpc/kexec/core.c                          |    4 
 arch/powerpc/kvm/book3s_hv.c                       |    4 
 arch/powerpc/kvm/book3s_hv_uvmem.c                 |    2 
 arch/powerpc/mm/Makefile                           |    2 
 arch/powerpc/mm/mem.c                              |    4 
 arch/riscv/Kconfig                                 |    2 
 arch/s390/Kconfig                                  |    2 
 arch/s390/include/asm/pgtable.h                    |    2 
 arch/sh/include/asm/mmzone.h                       |    4 
 arch/sh/kernel/topology.c                          |    2 
 arch/sh/mm/Kconfig                                 |    2 
 arch/sh/mm/init.c                                  |    2 
 arch/sparc/Kconfig                                 |    2 
 arch/sparc/include/asm/mmzone.h                    |    4 
 arch/sparc/kernel/smp_64.c                         |    2 
 arch/sparc/mm/init_64.c                            |   12 
 arch/x86/Kconfig                                   |    2 
 arch/x86/ia32/ia32_aout.c                          |    4 
 arch/x86/kernel/cpu/mce/core.c                     |   13 
 arch/x86/kernel/cpu/sgx/encl.h                     |    4 
 arch/x86/kernel/setup_percpu.c                     |    6 
 arch/x86/mm/init_32.c                              |    4 
 arch/xtensa/include/asm/page.h                     |    4 
 arch/xtensa/include/asm/tlbflush.h                 |    4 
 drivers/base/node.c                                |   18 
 drivers/block/loop.c                               |  270 ++++-
 drivers/block/loop.h                               |   15 
 drivers/dax/device.c                               |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c            |    4 
 drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c |    2 
 drivers/media/common/videobuf2/frame_vector.c      |    2 
 drivers/misc/sgi-gru/grufault.c                    |    4 
 drivers/vfio/vfio_iommu_type1.c                    |    2 
 drivers/virtio/virtio_balloon.c                    |   17 
 fs/adfs/inode.c                                    |    1 
 fs/affs/file.c                                     |    2 
 fs/bfs/file.c                                      |    1 
 fs/binfmt_aout.c                                   |    4 
 fs/binfmt_elf.c                                    |    2 
 fs/binfmt_elf_fdpic.c                              |   11 
 fs/binfmt_flat.c                                   |    2 
 fs/block_dev.c                                     |    1 
 fs/buffer.c                                        |   25 
 fs/configfs/inode.c                                |    8 
 fs/dax.c                                           |    3 
 fs/ecryptfs/mmap.c                                 |   13 
 fs/exfat/inode.c                                   |    1 
 fs/ext2/inode.c                                    |    4 
 fs/ext4/inode.c                                    |    2 
 fs/fat/inode.c                                     |    1 
 fs/fs-writeback.c                                  |  366 +++++---
 fs/fuse/dax.c                                      |    3 
 fs/gfs2/aops.c                                     |    2 
 fs/gfs2/meta_io.c                                  |    2 
 fs/hfs/inode.c                                     |    2 
 fs/hfsplus/inode.c                                 |    2 
 fs/hpfs/file.c                                     |    1 
 fs/iomap/buffered-io.c                             |   27 
 fs/jfs/inode.c                                     |    1 
 fs/kernfs/inode.c                                  |    8 
 fs/libfs.c                                         |   44 
 fs/minix/inode.c                                   |    1 
 fs/nilfs2/mdt.c                                    |    1 
 fs/ntfs/inode.c                                    |    2 
 fs/ocfs2/aops.c                                    |    4 
 fs/ocfs2/cluster/heartbeat.c                       |    7 
 fs/ocfs2/cluster/nodemanager.c                     |    2 
 fs/ocfs2/dlm/dlmmaster.c                           |    2 
 fs/ocfs2/filecheck.c                               |    6 
 fs/ocfs2/stackglue.c                               |    8 
 fs/omfs/file.c                                     |    1 
 fs/proc/task_mmu.c                                 |    2 
 fs/ramfs/inode.c                                   |    9 
 fs/squashfs/block.c                                |    5 
 fs/squashfs/squashfs_fs_sb.h                       |    1 
 fs/squashfs/super.c                                |   86 +
 fs/sysv/itree.c                                    |    1 
 fs/udf/file.c                                      |    1 
 fs/udf/inode.c                                     |    1 
 fs/ufs/inode.c                                     |    1 
 fs/xfs/xfs_aops.c                                  |    4 
 fs/zonefs/super.c                                  |    4 
 include/asm-generic/memory_model.h                 |   37 
 include/asm-generic/pgtable-nop4d.h                |    1 
 include/asm-generic/topology.h                     |    2 
 include/kunit/test.h                               |    5 
 include/linux/backing-dev-defs.h                   |   20 
 include/linux/cpuhotplug.h                         |    2 
 include/linux/fs.h                                 |    6 
 include/linux/gfp.h                                |   13 
 include/linux/iomap.h                              |    1 
 include/linux/kasan.h                              |    7 
 include/linux/kernel.h                             |    2 
 include/linux/kthread.h                            |    2 
 include/linux/memblock.h                           |    6 
 include/linux/memcontrol.h                         |   60 -
 include/linux/mm.h                                 |   53 -
 include/linux/mm_types.h                           |   10 
 include/linux/mman.h                               |    2 
 include/linux/mmdebug.h                            |    3 
 include/linux/mmzone.h                             |   96 +-
 include/linux/page-flags.h                         |   10 
 include/linux/page_owner.h                         |    6 
 include/linux/page_ref.h                           |    4 
 include/linux/page_reporting.h                     |    3 
 include/linux/pageblock-flags.h                    |    2 
 include/linux/pagemap.h                            |    4 
 include/linux/pgtable.h                            |   22 
 include/linux/printk.h                             |    5 
 include/linux/sched/coredump.h                     |    8 
 include/linux/slab.h                               |   59 +
 include/linux/swap.h                               |   19 
 include/linux/swapops.h                            |    5 
 include/linux/vmstat.h                             |   69 -
 include/linux/writeback.h                          |    1 
 include/trace/events/cma.h                         |    4 
 include/trace/events/filemap.h                     |    2 
 include/trace/events/kmem.h                        |   12 
 include/trace/events/page_pool.h                   |    4 
 include/trace/events/pagemap.h                     |    4 
 include/trace/events/vmscan.h                      |    2 
 kernel/cgroup/cgroup.c                             |    1 
 kernel/crash_core.c                                |    4 
 kernel/events/core.c                               |    2 
 kernel/events/uprobes.c                            |    4 
 kernel/fork.c                                      |    1 
 kernel/kthread.c                                   |   19 
 kernel/sysctl.c                                    |   16 
 kernel/watchdog.c                                  |   12 
 lib/Kconfig.debug                                  |   15 
 lib/Kconfig.kasan                                  |   16 
 lib/Makefile                                       |    1 
 lib/dump_stack.c                                   |   20 
 lib/kunit/test.c                                   |   18 
 lib/slub_kunit.c                                   |  152 +++
 lib/test_hmm.c                                     |    5 
 lib/test_kasan.c                                   |   11 
 lib/vsprintf.c                                     |    2 
 mm/Kconfig                                         |   38 
 mm/backing-dev.c                                   |   66 +
 mm/compaction.c                                    |    2 
 mm/debug.c                                         |   27 
 mm/debug_vm_pgtable.c                              |   63 +
 mm/dmapool.c                                       |    5 
 mm/filemap.c                                       |    2 
 mm/gup.c                                           |   81 +
 mm/hugetlb.c                                       |    2 
 mm/internal.h                                      |    9 
 mm/kasan/Makefile                                  |    4 
 mm/kasan/common.c                                  |    6 
 mm/kasan/generic.c                                 |    3 
 mm/kasan/hw_tags.c                                 |   22 
 mm/kasan/init.c                                    |    6 
 mm/kasan/kasan.h                                   |   12 
 mm/kasan/report.c                                  |    6 
 mm/kasan/report_hw_tags.c                          |    5 
 mm/kasan/report_sw_tags.c                          |   45 
 mm/kasan/report_tags.c                             |   51 +
 mm/kasan/shadow.c                                  |    6 
 mm/kasan/sw_tags.c                                 |   45 
 mm/kasan/tags.c                                    |   59 +
 mm/kfence/kfence_test.c                            |    5 
 mm/kmemleak.c                                      |   18 
 mm/ksm.c                                           |    6 
 mm/memblock.c                                      |    8 
 mm/memcontrol.c                                    |  385 ++++++--
 mm/memory-failure.c                                |  344 +++++--
 mm/memory.c                                        |   22 
 mm/memory_hotplug.c                                |    6 
 mm/mempolicy.c                                     |    4 
 mm/migrate.c                                       |    4 
 mm/mmap.c                                          |   54 -
 mm/mmap_lock.c                                     |   33 
 mm/mprotect.c                                      |   52 +
 mm/mremap.c                                        |    5 
 mm/nommu.c                                         |    2 
 mm/page-writeback.c                                |   89 +
 mm/page_alloc.c                                    |  950 +++++++++++++--------
 mm/page_ext.c                                      |    2 
 mm/page_owner.c                                    |    2 
 mm/page_reporting.c                                |   19 
 mm/page_reporting.h                                |    5 
 mm/pagewalk.c                                      |   58 +
 mm/shmem.c                                         |   18 
 mm/slab.h                                          |   24 
 mm/slab_common.c                                   |   60 -
 mm/slub.c                                          |  420 +++++----
 mm/sparse.c                                        |    2 
 mm/swap.c                                          |    4 
 mm/swap_slots.c                                    |    2 
 mm/swap_state.c                                    |   20 
 mm/swapfile.c                                      |  177 +--
 mm/vmalloc.c                                       |  181 ++--
 mm/vmscan.c                                        |   43 
 mm/vmstat.c                                        |  282 ++----
 mm/workingset.c                                    |    2 
 net/ipv4/tcp.c                                     |    4 
 scripts/kconfig/streamline_config.pl               |   76 -
 scripts/link-vmlinux.sh                            |    4 
 scripts/spelling.txt                               |   16 
 tools/testing/selftests/vm/gup_test.c              |   96 +-
 tools/vm/page_owner_sort.c                         |    4 
 virt/kvm/kvm_main.c                                |    2 
 260 files changed, 3989 insertions(+), 2996 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-06-25  1:38 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-06-25  1:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

24 patches, based on 4a09d388f2ab382f217a764e6a152b3f614246f6.

Subsystems affected by this patch series:

  mm/thp
  nilfs2
  mm/vmalloc
  kthread
  mm/hugetlb
  mm/memory-failure
  mm/pagealloc
  MAINTAINERS
  mailmap

Subsystem: mm/thp

    Hugh Dickins <hughd@google.com>:
    Patch series "mm: page_vma_mapped_walk() cleanup and THP fixes":
      mm: page_vma_mapped_walk(): use page for pvmw->page
      mm: page_vma_mapped_walk(): settle PageHuge on entry
      mm: page_vma_mapped_walk(): use pmde for *pvmw->pmd
      mm: page_vma_mapped_walk(): prettify PVMW_MIGRATION block
      mm: page_vma_mapped_walk(): crossing page table boundary
      mm: page_vma_mapped_walk(): add a level of indentation
      mm: page_vma_mapped_walk(): use goto instead of while (1)
      mm: page_vma_mapped_walk(): get vma_address_end() earlier
      mm/thp: fix page_vma_mapped_walk() if THP mapped by ptes
      mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk()

Subsystem: nilfs2

    Pavel Skripkin <paskripkin@gmail.com>:
      nilfs2: fix memory leak in nilfs_sysfs_delete_device_group

Subsystem: mm/vmalloc

    Claudio Imbrenda <imbrenda@linux.ibm.com>:
    Patch series "mm: add vmalloc_no_huge and use it", v4:
      mm/vmalloc: add vmalloc_no_huge
      KVM: s390: prepare for hugepage vmalloc

    Daniel Axtens <dja@axtens.net>:
      mm/vmalloc: unbreak kasan vmalloc support

Subsystem: kthread

    Petr Mladek <pmladek@suse.com>:
    Patch series "kthread_worker: Fix race between kthread_mod_delayed_work():
      kthread_worker: split code for canceling the delayed work timer
      kthread: prevent deadlock when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync()

Subsystem: mm/hugetlb

    Hugh Dickins <hughd@google.com>:
      mm, futex: fix shared futex pgoff on shmem huge page

Subsystem: mm/memory-failure

    Tony Luck <tony.luck@intel.com>:
    Patch series "mm,hwpoison: fix sending SIGBUS for Action Required MCE", v5:
      mm/memory-failure: use a mutex to avoid memory_failure() races

    Aili Yao <yaoaili@kingsoft.com>:
      mm,hwpoison: return -EHWPOISON to denote that the page has already been poisoned

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm/hwpoison: do not lock page again when me_huge_page() successfully recovers

Subsystem: mm/pagealloc

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      mm/page_alloc: __alloc_pages_bulk(): do bounds check before accessing array

    Mel Gorman <mgorman@techsingularity.net>:
      mm/page_alloc: do bulk array bounds check after checking populated elements

Subsystem: MAINTAINERS

    Marek Behún <kabel@kernel.org>:
      MAINTAINERS: fix Marek's identity again

Subsystem: mailmap

    Marek Behún <kabel@kernel.org>:
      mailmap: add Marek's other e-mail address and identity without diacritics

 .mailmap                |    2 
 MAINTAINERS             |    4 
 arch/s390/kvm/pv.c      |    7 +
 fs/nilfs2/sysfs.c       |    1 
 include/linux/hugetlb.h |   16 ---
 include/linux/pagemap.h |   13 +-
 include/linux/vmalloc.h |    1 
 kernel/futex.c          |    3 
 kernel/kthread.c        |   81 ++++++++++------
 mm/hugetlb.c            |    5 -
 mm/memory-failure.c     |   83 +++++++++++------
 mm/page_alloc.c         |    6 +
 mm/page_vma_mapped.c    |  233 +++++++++++++++++++++++++++---------------------
 mm/vmalloc.c            |   41 ++++++--
 14 files changed, 297 insertions(+), 199 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-06-16  1:22 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-06-16  1:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


18 patches, based on 94f0b2d4a1d0c52035aef425da5e022bd2cb1c71.

Subsystems affected by this patch series:

  mm/memory-failure
  mm/swap
  mm/slub
  mm/hugetlb
  mm/memory-failure
  coredump
  mm/slub
  mm/thp
  mm/sparsemem

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm,hwpoison: fix race with hugetlb page allocation

Subsystem: mm/swap

    Peter Xu <peterx@redhat.com>:
      mm/swap: fix pte_same_as_swp() not removing uffd-wp bit when compare

Subsystem: mm/slub

    Kees Cook <keescook@chromium.org>:
    Patch series "Actually fix freelist pointer vs redzoning", v4:
      mm/slub: clarify verification reporting
      mm/slub: fix redzoning for small allocations
      mm/slub: actually fix freelist pointer vs redzoning

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      mm/hugetlb: expand restore_reserve_on_error functionality

Subsystem: mm/memory-failure

    yangerkun <yangerkun@huawei.com>:
      mm/memory-failure: make sure wait for page writeback in memory_failure

Subsystem: coredump

    Pingfan Liu <kernelfans@gmail.com>:
      crash_core, vmcoreinfo: append 'SECTION_SIZE_BITS' to vmcoreinfo

Subsystem: mm/slub

    Andrew Morton <akpm@linux-foundation.org>:
      mm/slub.c: include swab.h

Subsystem: mm/thp

    Xu Yu <xuyu@linux.alibaba.com>:
      mm, thp: use head page in __migration_entry_wait()

    Hugh Dickins <hughd@google.com>:
    Patch series "mm/thp: fix THP splitting unmap BUGs and related", v10:
      mm/thp: fix __split_huge_pmd_locked() on shmem migration entry
      mm/thp: make is_huge_zero_pmd() safe and quicker
      mm/thp: try_to_unmap() use TTU_SYNC for safe splitting
      mm/thp: fix vma_address() if virtual address below file offset

    Jue Wang <juew@google.com>:
      mm/thp: fix page_address_in_vma() on file THP tails

    Hugh Dickins <hughd@google.com>:
      mm/thp: unmap_mapping_page() to fix THP truncate_cleanup_page()

    Yang Shi <shy828301@gmail.com>:
      mm: thp: replace DEBUG_VM BUG with VM_WARN when unmap fails for split

Subsystem: mm/sparsemem

    Miles Chen <miles.chen@mediatek.com>:
      mm/sparse: fix check_usemap_section_nr warnings

 Documentation/vm/slub.rst |   10 +--
 fs/hugetlbfs/inode.c      |    1 
 include/linux/huge_mm.h   |    8 ++
 include/linux/hugetlb.h   |    8 ++
 include/linux/mm.h        |    3 +
 include/linux/rmap.h      |    1 
 include/linux/swapops.h   |   15 +++--
 kernel/crash_core.c       |    1 
 mm/huge_memory.c          |   58 ++++++++++---------
 mm/hugetlb.c              |  137 +++++++++++++++++++++++++++++++++++++---------
 mm/internal.h             |   51 ++++++++++++-----
 mm/memory-failure.c       |   36 +++++++++++-
 mm/memory.c               |   41 +++++++++++++
 mm/migrate.c              |    1 
 mm/page_vma_mapped.c      |   27 +++++----
 mm/pgtable-generic.c      |    5 -
 mm/rmap.c                 |   41 +++++++++----
 mm/slab_common.c          |    3 -
 mm/slub.c                 |   37 +++++-------
 mm/sparse.c               |   13 +++-
 mm/swapfile.c             |    2 
 mm/truncate.c             |   43 ++++++--------
 22 files changed, 388 insertions(+), 154 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-06-05  3:00 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-06-05  3:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

13 patches, based on 16f0596fc1d78a1f3ae4628cff962bb297dc908c.

Subsystems affected by this patch series:

  mips
  mm/kfence
  init
  mm/debug
  mm/pagealloc
  mm/memory-hotplug
  mm/hugetlb
  proc
  mm/kasan
  mm/hugetlb
  lib
  ocfs2
  mailmap

Subsystem: mips

    Thomas Bogendoerfer <tsbogend@alpha.franken.de>:
      Revert "MIPS: make userspace mapping young by default"

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: use TASK_IDLE when awaiting allocation

Subsystem: init

    Mark Rutland <mark.rutland@arm.com>:
      pid: take a reference when initializing `cad_pid`

Subsystem: mm/debug

    Gerald Schaefer <gerald.schaefer@linux.ibm.com>:
      mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests()

Subsystem: mm/pagealloc

    Ding Hui <dinghui@sangfor.com.cn>:
      mm/page_alloc: fix counting of free pages after take off from buddy

Subsystem: mm/memory-hotplug

    David Hildenbrand <david@redhat.com>:
      drivers/base/memory: fix trying offlining memory blocks with memory holes on aarch64

Subsystem: mm/hugetlb

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      hugetlb: pass head page to remove_hugetlb_page()

Subsystem: proc

    David Matlack <dmatlack@google.com>:
      proc: add .gitignore for proc-subset-pid selftest

Subsystem: mm/kasan

    Yu Kuai <yukuai3@huawei.com>:
      mm/kasan/init.c: fix doc warning

Subsystem: mm/hugetlb

    Mina Almasry <almasrymina@google.com>:
      mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY

Subsystem: lib

    YueHaibing <yuehaibing@huawei.com>:
      lib: crc64: fix kernel-doc warning

Subsystem: ocfs2

    Junxiao Bi <junxiao.bi@oracle.com>:
      ocfs2: fix data corruption by fallocate

Subsystem: mailmap

    Michel Lespinasse <michel@lespinasse.org>:
      mailmap: use private address for Michel Lespinasse

 .mailmap                                |    3 +
 arch/mips/mm/cache.c                    |   30 ++++++++---------
 drivers/base/memory.c                   |    6 +--
 fs/ocfs2/file.c                         |   55 +++++++++++++++++++++++++++++---
 include/linux/pgtable.h                 |    8 ++++
 init/main.c                             |    2 -
 lib/crc64.c                             |    2 -
 mm/debug_vm_pgtable.c                   |    4 +-
 mm/hugetlb.c                            |   16 +++++++--
 mm/kasan/init.c                         |    4 +-
 mm/kfence/core.c                        |    6 +--
 mm/memory.c                             |    4 ++
 mm/page_alloc.c                         |    2 +
 tools/testing/selftests/proc/.gitignore |    1 
 14 files changed, 107 insertions(+), 36 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-05-23  0:41 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-05-23  0:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

10 patches, based on 4ff2473bdb4cf2bb7d208ccf4418d3d7e6b1652c.

Subsystems affected by this patch series:

  mm/pagealloc
  mm/gup
  ipc
  selftests
  mm/kasan
  kernel/watchdog
  bitmap
  procfs
  lib
  mm/userfaultfd

Subsystem: mm/pagealloc

    Arnd Bergmann <arnd@arndb.de>:
      mm/shuffle: fix section mismatch warning

Subsystem: mm/gup

    Michal Hocko <mhocko@suse.com>:
      Revert "mm/gup: check page posion status for coredump."

Subsystem: ipc

    Varad Gautam <varad.gautam@suse.com>:
      ipc/mqueue, msg, sem: avoid relying on a stack reference past its expiry

Subsystem: selftests

    Yang Yingliang <yangyingliang@huawei.com>:
      tools/testing/selftests/exec: fix link error

Subsystem: mm/kasan

    Alexander Potapenko <glider@google.com>:
      kasan: slab: always reset the tag in get_freepointer_safe()

Subsystem: kernel/watchdog

    Petr Mladek <pmladek@suse.com>:
      watchdog: reliable handling of timestamps

Subsystem: bitmap

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      linux/bits.h: fix compilation error with GENMASK

Subsystem: procfs

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: remove Alexey from MAINTAINERS

Subsystem: lib

    Zhen Lei <thunder.leizhen@huawei.com>:
      lib: kunit: suppress a compilation warning of frame size

Subsystem: mm/userfaultfd

    Mike Kravetz <mike.kravetz@oracle.com>:
      userfaultfd: hugetlbfs: fix new flag usage in error path

 MAINTAINERS                           |    1 -
 fs/hugetlbfs/inode.c                  |    2 +-
 include/linux/bits.h                  |    2 +-
 include/linux/const.h                 |    8 ++++++++
 include/linux/minmax.h                |   10 ++--------
 ipc/mqueue.c                          |    6 ++++--
 ipc/msg.c                             |    6 ++++--
 ipc/sem.c                             |    6 ++++--
 kernel/watchdog.c                     |   34 ++++++++++++++++++++--------------
 lib/Makefile                          |    1 +
 mm/gup.c                              |    4 ----
 mm/internal.h                         |   20 --------------------
 mm/shuffle.h                          |    4 ++--
 mm/slub.c                             |    1 +
 mm/userfaultfd.c                      |   28 ++++++++++++++--------------
 tools/include/linux/bits.h            |    2 +-
 tools/include/linux/const.h           |    8 ++++++++
 tools/testing/selftests/exec/Makefile |    6 +++---
 18 files changed, 74 insertions(+), 75 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-05-15  0:26 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-05-15  0:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

13 patches, based on bd3c9cdb21a2674dd0db70199df884828e37abd4.

Subsystems affected by this patch series:

  mm/hugetlb
  mm/slub
  resource
  squashfs
  mm/userfaultfd
  mm/ksm
  mm/pagealloc
  mm/kasan
  mm/pagemap
  hfsplus
  modprobe
  mm/ioremap

Subsystem: mm/hugetlb

    Peter Xu <peterx@redhat.com>:
    Patch series "mm/hugetlb: Fix issues on file sealing and fork", v2:
      mm/hugetlb: fix F_SEAL_FUTURE_WRITE
      mm/hugetlb: fix cow where page writtable in child

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: move slub_debug static key enabling outside slab_mutex

Subsystem: resource

    Alistair Popple <apopple@nvidia.com>:
      kernel/resource: fix return code check in __request_free_mem_region

Subsystem: squashfs

    Phillip Lougher <phillip@squashfs.org.uk>:
      squashfs: fix divide error in calculate_skip()

Subsystem: mm/userfaultfd

    Axel Rasmussen <axelrasmussen@google.com>:
      userfaultfd: release page in error path to avoid BUG_ON

Subsystem: mm/ksm

    Hugh Dickins <hughd@google.com>:
      ksm: revert "use GET_KSM_PAGE_NOLOCK to get ksm page in remove_rmap_item_from_tree()"

Subsystem: mm/pagealloc

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: fix struct page layout on 32-bit systems

Subsystem: mm/kasan

    Peter Collingbourne <pcc@google.com>:
      kasan: fix unit tests with CONFIG_UBSAN_LOCAL_BOUNDS enabled

Subsystem: mm/pagemap

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/filemap: fix readahead return types

Subsystem: hfsplus

    Jouni Roivas <jouni.roivas@tuxera.com>:
      hfsplus: prevent corruption in shrinking truncate

Subsystem: modprobe

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      docs: admin-guide: update description for kernel.modprobe sysctl

Subsystem: mm/ioremap

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm/ioremap: fix iomap_max_page_shift

 Documentation/admin-guide/sysctl/kernel.rst |    9 ++++---
 fs/hfsplus/extents.c                        |    7 +++--
 fs/hugetlbfs/inode.c                        |    5 ++++
 fs/iomap/buffered-io.c                      |    4 +--
 fs/squashfs/file.c                          |    6 ++--
 include/linux/mm.h                          |   32 ++++++++++++++++++++++++++
 include/linux/mm_types.h                    |    4 +--
 include/linux/pagemap.h                     |    6 ++--
 include/net/page_pool.h                     |   12 +++++++++
 kernel/resource.c                           |    2 -
 lib/test_kasan.c                            |   29 ++++++++++++++++++-----
 mm/hugetlb.c                                |    1 
 mm/ioremap.c                                |    6 ++--
 mm/ksm.c                                    |    3 +-
 mm/shmem.c                                  |   34 ++++++++++++----------------
 mm/slab_common.c                            |   10 ++++++++
 mm/slub.c                                   |    9 -------
 net/core/page_pool.c                        |   12 +++++----
 18 files changed, 129 insertions(+), 62 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-05-07  1:01 incoming Andrew Morton
@ 2021-05-07  7:12 ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2021-05-07  7:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Thu, May 6, 2021 at 6:01 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> I've been wobbly about the secretmem patches due to doubts about
> whether the feature is sufficiently useful to justify inclusion, but
> developers are now weighing in with helpful information and I've asked Mike
> for an extensively updated [0/n] changelog.  This will take a few days
> to play out so it is possible that I will prevail upon you for a post-rc1
> merge.

Oh, much too late for this release by now.

> If that's a problem, there's always 5.13-rc1.

5.13-rc1 is two days from now, it would be for 5.14-rc1.. How time -
and version numbers - fly.

             Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-05-07  1:01 Andrew Morton
  2021-05-07  7:12 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-05-07  1:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


This is everything else from -mm for this merge window, with the
possible exception of Mike Rapoport's "secretmem" syscall patch series
(https://lkml.kernel.org/r/20210303162209.8609-1-rppt@kernel.org).

I've been wobbly about the secretmem patches due to doubts about
whether the feature is sufficiently useful to justify inclusion, but
developers are now weighing in with helpful information and I've asked Mike
for an extensively updated [0/n] changelog.  This will take a few days
to play out so it is possible that I will prevail upon you for a post-rc1
merge.  If that's a problem, there's always 5.13-rc1.

91 patches, based on 8ca5297e7e38f2dc8c753d33a5092e7be181fff0, plus
previously sent patches.

Thanks.



Subsystems affected by this patch series:

  alpha
  procfs
  sysctl
  misc
  core-kernel
  bitmap
  lib
  compat
  checkpatch
  epoll
  isofs
  nilfs2
  hpfs
  exit
  fork
  kexec
  gcov
  panic
  delayacct
  gdb
  resource
  selftests
  async
  initramfs
  ipc
  mm/cleanups
  drivers/char
  mm/slub
  spelling

Subsystem: alpha

    Randy Dunlap <rdunlap@infradead.org>:
      alpha: eliminate old-style function definitions
      alpha: csum_partial_copy.c: add function prototypes from <net/checksum.h>

Subsystem: procfs

    Colin Ian King <colin.king@canonical.com>:
      fs/proc/generic.c: fix incorrect pde_is_permanent check

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: save LOC in __xlate_proc_name()
      proc: mandate ->proc_lseek in "struct proc_ops"
      proc: delete redundant subset=pid check
      selftests: proc: test subset=pid

Subsystem: sysctl

    zhouchuangao <zhouchuangao@vivo.com>:
      proc/sysctl: fix function name error in comments

Subsystem: misc

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      include: remove pagemap.h from blkdev.h

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kernel.h: drop inclusion in bitmap.h

    Wan Jiabing <wanjiabing@vivo.com>:
      linux/profile.h: remove unnecessary declaration

Subsystem: core-kernel

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      kernel/async.c: fix pr_debug statement
      kernel/cred.c: make init_groups static

Subsystem: bitmap

    Yury Norov <yury.norov@gmail.com>:
    Patch series "lib/find_bit: fast path for small bitmaps", v6:
      tools: disable -Wno-type-limits
      tools: bitmap: sync function declarations with the kernel
      tools: sync BITMAP_LAST_WORD_MASK() macro with the kernel
      arch: rearrange headers inclusion order in asm/bitops for m68k, sh and h8300
      lib: extend the scope of small_const_nbits() macro
      tools: sync small_const_nbits() macro with the kernel
      lib: inline _find_next_bit() wrappers
      tools: sync find_next_bit implementation
      lib: add fast path for find_next_*_bit()
      lib: add fast path for find_first_*_bit() and find_last_bit()
      tools: sync lib/find_bit implementation
      MAINTAINERS: add entry for the bitmap API

Subsystem: lib

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      lib/bch.c: fix a typo in the file bch.c

    Wang Qing <wangqing@vivo.com>:
      lib: fix inconsistent indenting in process_bit1()

    ToastC <mrtoastcheng@gmail.com>:
      lib/list_sort.c: fix typo in function description

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      lib/genalloc.c: Fix a typo

    Richard Fitzgerald <rf@opensource.cirrus.com>:
      lib: crc8: pointer to data block should be const

    Zqiang <qiang.zhang@windriver.com>:
      lib: stackdepot: turn depot_lock spinlock to raw_spinlock

    Alex Shi <alexs@kernel.org>:
      lib/percpu_counter: tame kernel-doc compile warning
      lib/genalloc: add parameter description to fix doc compile warning

    Randy Dunlap <rdunlap@infradead.org>:
      lib: parser: clean up kernel-doc

Subsystem: compat

    Masahiro Yamada <masahiroy@kernel.org>:
      include/linux/compat.h: remove unneeded declaration from COMPAT_SYSCALL_DEFINEx()

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: warn when missing newline in return sysfs_emit() formats

    Vincent Mailhol <mailhol.vincent@wanadoo.fr>:
      checkpatch: exclude four preprocessor sub-expressions from MACRO_ARG_REUSE

    Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
      checkpatch: improve ALLOC_ARRAY_ARGS test

Subsystem: epoll

    Davidlohr Bueso <dave@stgolabs.net>:
    Patch series "fs/epoll: restore user-visible behavior upon event ready":
      kselftest: introduce new epoll test case
      fs/epoll: restore waking from ep_done_scan()

Subsystem: isofs

    "Gustavo A. R. Silva" <gustavoars@kernel.org>:
      isofs: fix fall-through warnings for Clang

Subsystem: nilfs2

    Liu xuzhi <liu.xuzhi@zte.com.cn>:
      fs/nilfs2: fix misspellings using codespell tool

    Lu Jialin <lujialin4@huawei.com>:
      nilfs2: fix typos in comments

Subsystem: hpfs

    "Gustavo A. R. Silva" <gustavoars@kernel.org>:
      hpfs: replace one-element array with flexible-array member

Subsystem: exit

    Jim Newsome <jnewsome@torproject.org>:
      do_wait: make PIDTYPE_PID case O(1) instead of O(n)

Subsystem: fork

    Rolf Eike Beer <eb@emlix.com>:
      kernel/fork.c: simplify copy_mm()

    Xiaofeng Cao <cxfcosmos@gmail.com>:
      kernel/fork.c: fix typos

Subsystem: kexec

    Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>:
      kernel/crash_core: add crashkernel=auto for vmcore creation

    Joe LeVeque <jolevequ@microsoft.com>:
      kexec: Add kexec reboot string

    Jia-Ju Bai <baijiaju1990@gmail.com>:
      kernel: kexec_file: fix error return code of kexec_calculate_store_digests()

    Pavel Tatashin <pasha.tatashin@soleen.com>:
      kexec: dump kmessage before machine_kexec

Subsystem: gcov

    Johannes Berg <johannes.berg@intel.com>:
      gcov: combine common code
      gcov: simplify buffer allocation
      gcov: use kvmalloc()

    Nick Desaulniers <ndesaulniers@google.com>:
      gcov: clang: drop support for clang-10 and older

Subsystem: panic

    He Ying <heying24@huawei.com>:
      smp: kernel/panic.c - silence warnings

Subsystem: delayacct

    Yafang Shao <laoar.shao@gmail.com>:
      delayacct: clear right task's flag after blkio completes

Subsystem: gdb

    Johannes Berg <johannes.berg@intel.com>:
      gdb: lx-symbols: store the abspath()

    Barry Song <song.bao.hua@hisilicon.com>:
    Patch series "scripts/gdb: clarify the platforms supporting lx_current and add arm64 support", v2:
      scripts/gdb: document lx_current is only supported by x86
      scripts/gdb: add lx_current support for arm64

Subsystem: resource

    David Hildenbrand <david@redhat.com>:
    Patch series "kernel/resource: make walk_system_ram_res() and walk_mem_res() search the whole tree", v2:
      kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources
      kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM resources
      kernel/resource: remove first_lvl / siblings_only logic

    Alistair Popple <apopple@nvidia.com>:
      kernel/resource: allow region_intersects users to hold resource_lock
      kernel/resource: refactor __request_region to allow external locking
      kernel/resource: fix locking in request_free_mem_region

Subsystem: selftests

    Zhang Yunkai <zhang.yunkai@zte.com.cn>:
      selftests: remove duplicate include

Subsystem: async

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
      kernel/async.c: stop guarding pr_debug() statements
      kernel/async.c: remove async_unregister_domain()

Subsystem: initramfs

    Rasmus Villemoes <linux@rasmusvillemoes.dk>:
    Patch series "background initramfs unpacking, and CONFIG_MODPROBE_PATH", v3:
      init/initramfs.c: do unpacking asynchronously
      modules: add CONFIG_MODPROBE_PATH

Subsystem: ipc

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      ipc/sem.c: mundane typo fixes

Subsystem: mm/cleanups

    Shijie Luo <luoshijie1@huawei.com>:
      mm: fix some typos and code style problems

Subsystem: drivers/char

    David Hildenbrand <david@redhat.com>:
    Patch series "drivers/char: remove /dev/kmem for good":
      drivers/char: remove /dev/kmem for good
      mm: remove xlate_dev_kmem_ptr()
      mm/vmalloc: remove vwrite()

Subsystem: mm/slub

    Maninder Singh <maninder1.s@samsung.com>:
      arm: print alloc free paths for address in registers

Subsystem: spelling

    Drew Fustini <drew@beagleboard.org>:
      scripts/spelling.txt: add "overlfow"

    zuoqilin <zuoqilin@yulong.com>:
      scripts/spelling.txt: Add "diabled" typo

    Drew Fustini <drew@beagleboard.org>:
      scripts/spelling.txt: add "overflw"

    Colin Ian King <colin.king@canonical.com>:
      mm/slab.c: fix spelling mistake "disired" -> "desired"

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      include/linux/pgtable.h: few spelling fixes

    zhouchuangao <zhouchuangao@vivo.com>:
      kernel/umh.c: fix some spelling mistakes

    Xiaofeng Cao <cxfcosmos@gmail.com>:
      kernel/user_namespace.c: fix typos

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      kernel/up.c: fix typo

    Xiaofeng Cao <caoxiaofeng@yulong.com>:
      kernel/sys.c: fix typo

    dingsenjie <dingsenjie@yulong.com>:
      fs: fat: fix spelling typo of values

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      ipc/sem.c: spelling fix

    Masahiro Yamada <masahiroy@kernel.org>:
      treewide: remove editor modelines and cruft

    Ingo Molnar <mingo@kernel.org>:
      mm: fix typos in comments

    Lu Jialin <lujialin4@huawei.com>:
      mm: fix typos in comments

 Documentation/admin-guide/devices.txt                         |    2 
 Documentation/admin-guide/kdump/kdump.rst                     |    3 
 Documentation/admin-guide/kernel-parameters.txt               |   18 
 Documentation/dev-tools/gdb-kernel-debugging.rst              |    4 
 MAINTAINERS                                                   |   16 
 arch/Kconfig                                                  |   20 
 arch/alpha/include/asm/io.h                                   |    5 
 arch/alpha/kernel/pc873xx.c                                   |    4 
 arch/alpha/lib/csum_partial_copy.c                            |    1 
 arch/arm/configs/dove_defconfig                               |    1 
 arch/arm/configs/magician_defconfig                           |    1 
 arch/arm/configs/moxart_defconfig                             |    1 
 arch/arm/configs/mps2_defconfig                               |    1 
 arch/arm/configs/mvebu_v5_defconfig                           |    1 
 arch/arm/configs/xcep_defconfig                               |    1 
 arch/arm/include/asm/bug.h                                    |    1 
 arch/arm/include/asm/io.h                                     |    5 
 arch/arm/kernel/process.c                                     |   11 
 arch/arm/kernel/traps.c                                       |    1 
 arch/h8300/include/asm/bitops.h                               |    8 
 arch/hexagon/configs/comet_defconfig                          |    1 
 arch/hexagon/include/asm/io.h                                 |    1 
 arch/ia64/include/asm/io.h                                    |    1 
 arch/ia64/include/asm/uaccess.h                               |   18 
 arch/m68k/atari/time.c                                        |    7 
 arch/m68k/configs/amcore_defconfig                            |    1 
 arch/m68k/include/asm/bitops.h                                |    6 
 arch/m68k/include/asm/io_mm.h                                 |    5 
 arch/mips/include/asm/io.h                                    |    5 
 arch/openrisc/configs/or1ksim_defconfig                       |    1 
 arch/parisc/include/asm/io.h                                  |    5 
 arch/parisc/include/asm/pdc_chassis.h                         |    1 
 arch/powerpc/include/asm/io.h                                 |    5 
 arch/s390/include/asm/io.h                                    |    5 
 arch/sh/configs/edosk7705_defconfig                           |    1 
 arch/sh/configs/se7206_defconfig                              |    1 
 arch/sh/configs/sh2007_defconfig                              |    1 
 arch/sh/configs/sh7724_generic_defconfig                      |    1 
 arch/sh/configs/sh7770_generic_defconfig                      |    1 
 arch/sh/configs/sh7785lcr_32bit_defconfig                     |    1 
 arch/sh/include/asm/bitops.h                                  |    5 
 arch/sh/include/asm/io.h                                      |    5 
 arch/sparc/configs/sparc64_defconfig                          |    1 
 arch/sparc/include/asm/io_64.h                                |    5 
 arch/um/drivers/cow.h                                         |    7 
 arch/xtensa/configs/xip_kc705_defconfig                       |    1 
 block/blk-settings.c                                          |    1 
 drivers/auxdisplay/panel.c                                    |    7 
 drivers/base/firmware_loader/main.c                           |    2 
 drivers/block/brd.c                                           |    1 
 drivers/block/loop.c                                          |    1 
 drivers/char/Kconfig                                          |   10 
 drivers/char/mem.c                                            |  231 --------
 drivers/gpu/drm/qxl/qxl_drv.c                                 |    1 
 drivers/isdn/capi/kcapi_proc.c                                |    1 
 drivers/md/bcache/super.c                                     |    1 
 drivers/media/usb/pwc/pwc-uncompress.c                        |    3 
 drivers/net/ethernet/adaptec/starfire.c                       |    8 
 drivers/net/ethernet/amd/atarilance.c                         |    8 
 drivers/net/ethernet/amd/pcnet32.c                            |    7 
 drivers/net/wireless/intersil/hostap/hostap_proc.c            |    1 
 drivers/net/wireless/intersil/orinoco/orinoco_nortel.c        |    8 
 drivers/net/wireless/intersil/orinoco/orinoco_pci.c           |    8 
 drivers/net/wireless/intersil/orinoco/orinoco_plx.c           |    8 
 drivers/net/wireless/intersil/orinoco/orinoco_tmd.c           |    8 
 drivers/nvdimm/btt.c                                          |    1 
 drivers/nvdimm/pmem.c                                         |    1 
 drivers/parport/parport_ip32.c                                |   12 
 drivers/platform/x86/dell/dell_rbu.c                          |    3 
 drivers/scsi/53c700.c                                         |    1 
 drivers/scsi/53c700.h                                         |    1 
 drivers/scsi/ch.c                                             |    6 
 drivers/scsi/esas2r/esas2r_main.c                             |    1 
 drivers/scsi/ips.c                                            |   20 
 drivers/scsi/ips.h                                            |   20 
 drivers/scsi/lasi700.c                                        |    1 
 drivers/scsi/megaraid/mbox_defs.h                             |    2 
 drivers/scsi/megaraid/mega_common.h                           |    2 
 drivers/scsi/megaraid/megaraid_mbox.c                         |    2 
 drivers/scsi/megaraid/megaraid_mbox.h                         |    2 
 drivers/scsi/qla1280.c                                        |   12 
 drivers/scsi/scsicam.c                                        |    1 
 drivers/scsi/sni_53c710.c                                     |    1 
 drivers/video/fbdev/matrox/matroxfb_base.c                    |    9 
 drivers/video/fbdev/vga16fb.c                                 |   10 
 fs/configfs/configfs_internal.h                               |    4 
 fs/configfs/dir.c                                             |    4 
 fs/configfs/file.c                                            |    4 
 fs/configfs/inode.c                                           |    4 
 fs/configfs/item.c                                            |    4 
 fs/configfs/mount.c                                           |    4 
 fs/configfs/symlink.c                                         |    4 
 fs/eventpoll.c                                                |    6 
 fs/fat/fatent.c                                               |    2 
 fs/hpfs/hpfs.h                                                |    3 
 fs/isofs/rock.c                                               |    1 
 fs/nfs/dir.c                                                  |    7 
 fs/nfs/nfs4proc.c                                             |    6 
 fs/nfs/nfs4renewd.c                                           |    6 
 fs/nfs/nfs4state.c                                            |    6 
 fs/nfs/nfs4xdr.c                                              |    6 
 fs/nfsd/nfs4proc.c                                            |    6 
 fs/nfsd/nfs4xdr.c                                             |    6 
 fs/nfsd/xdr4.h                                                |    6 
 fs/nilfs2/cpfile.c                                            |    2 
 fs/nilfs2/ioctl.c                                             |    4 
 fs/nilfs2/segment.c                                           |    4 
 fs/nilfs2/the_nilfs.c                                         |    2 
 fs/ocfs2/acl.c                                                |    4 
 fs/ocfs2/acl.h                                                |    4 
 fs/ocfs2/alloc.c                                              |    4 
 fs/ocfs2/alloc.h                                              |    4 
 fs/ocfs2/aops.c                                               |    4 
 fs/ocfs2/aops.h                                               |    4 
 fs/ocfs2/blockcheck.c                                         |    4 
 fs/ocfs2/blockcheck.h                                         |    4 
 fs/ocfs2/buffer_head_io.c                                     |    4 
 fs/ocfs2/buffer_head_io.h                                     |    4 
 fs/ocfs2/cluster/heartbeat.c                                  |    4 
 fs/ocfs2/cluster/heartbeat.h                                  |    4 
 fs/ocfs2/cluster/masklog.c                                    |    4 
 fs/ocfs2/cluster/masklog.h                                    |    4 
 fs/ocfs2/cluster/netdebug.c                                   |    4 
 fs/ocfs2/cluster/nodemanager.c                                |    4 
 fs/ocfs2/cluster/nodemanager.h                                |    4 
 fs/ocfs2/cluster/ocfs2_heartbeat.h                            |    4 
 fs/ocfs2/cluster/ocfs2_nodemanager.h                          |    4 
 fs/ocfs2/cluster/quorum.c                                     |    4 
 fs/ocfs2/cluster/quorum.h                                     |    4 
 fs/ocfs2/cluster/sys.c                                        |    4 
 fs/ocfs2/cluster/sys.h                                        |    4 
 fs/ocfs2/cluster/tcp.c                                        |    4 
 fs/ocfs2/cluster/tcp.h                                        |    4 
 fs/ocfs2/cluster/tcp_internal.h                               |    4 
 fs/ocfs2/dcache.c                                             |    4 
 fs/ocfs2/dcache.h                                             |    4 
 fs/ocfs2/dir.c                                                |    4 
 fs/ocfs2/dir.h                                                |    4 
 fs/ocfs2/dlm/dlmapi.h                                         |    4 
 fs/ocfs2/dlm/dlmast.c                                         |    4 
 fs/ocfs2/dlm/dlmcommon.h                                      |    4 
 fs/ocfs2/dlm/dlmconvert.c                                     |    4 
 fs/ocfs2/dlm/dlmconvert.h                                     |    4 
 fs/ocfs2/dlm/dlmdebug.c                                       |    4 
 fs/ocfs2/dlm/dlmdebug.h                                       |    4 
 fs/ocfs2/dlm/dlmdomain.c                                      |    4 
 fs/ocfs2/dlm/dlmdomain.h                                      |    4 
 fs/ocfs2/dlm/dlmlock.c                                        |    4 
 fs/ocfs2/dlm/dlmmaster.c                                      |    4 
 fs/ocfs2/dlm/dlmrecovery.c                                    |    4 
 fs/ocfs2/dlm/dlmthread.c                                      |    4 
 fs/ocfs2/dlm/dlmunlock.c                                      |    4 
 fs/ocfs2/dlmfs/dlmfs.c                                        |    4 
 fs/ocfs2/dlmfs/userdlm.c                                      |    4 
 fs/ocfs2/dlmfs/userdlm.h                                      |    4 
 fs/ocfs2/dlmglue.c                                            |    4 
 fs/ocfs2/dlmglue.h                                            |    4 
 fs/ocfs2/export.c                                             |    4 
 fs/ocfs2/export.h                                             |    4 
 fs/ocfs2/extent_map.c                                         |    4 
 fs/ocfs2/extent_map.h                                         |    4 
 fs/ocfs2/file.c                                               |    4 
 fs/ocfs2/file.h                                               |    4 
 fs/ocfs2/filecheck.c                                          |    4 
 fs/ocfs2/filecheck.h                                          |    4 
 fs/ocfs2/heartbeat.c                                          |    4 
 fs/ocfs2/heartbeat.h                                          |    4 
 fs/ocfs2/inode.c                                              |    4 
 fs/ocfs2/inode.h                                              |    4 
 fs/ocfs2/journal.c                                            |    4 
 fs/ocfs2/journal.h                                            |    4 
 fs/ocfs2/localalloc.c                                         |    4 
 fs/ocfs2/localalloc.h                                         |    4 
 fs/ocfs2/locks.c                                              |    4 
 fs/ocfs2/locks.h                                              |    4 
 fs/ocfs2/mmap.c                                               |    4 
 fs/ocfs2/move_extents.c                                       |    4 
 fs/ocfs2/move_extents.h                                       |    4 
 fs/ocfs2/namei.c                                              |    4 
 fs/ocfs2/namei.h                                              |    4 
 fs/ocfs2/ocfs1_fs_compat.h                                    |    4 
 fs/ocfs2/ocfs2.h                                              |    4 
 fs/ocfs2/ocfs2_fs.h                                           |    4 
 fs/ocfs2/ocfs2_ioctl.h                                        |    4 
 fs/ocfs2/ocfs2_lockid.h                                       |    4 
 fs/ocfs2/ocfs2_lockingver.h                                   |    4 
 fs/ocfs2/refcounttree.c                                       |    4 
 fs/ocfs2/refcounttree.h                                       |    4 
 fs/ocfs2/reservations.c                                       |    4 
 fs/ocfs2/reservations.h                                       |    4 
 fs/ocfs2/resize.c                                             |    4 
 fs/ocfs2/resize.h                                             |    4 
 fs/ocfs2/slot_map.c                                           |    4 
 fs/ocfs2/slot_map.h                                           |    4 
 fs/ocfs2/stack_o2cb.c                                         |    4 
 fs/ocfs2/stack_user.c                                         |    4 
 fs/ocfs2/stackglue.c                                          |    4 
 fs/ocfs2/stackglue.h                                          |    4 
 fs/ocfs2/suballoc.c                                           |    4 
 fs/ocfs2/suballoc.h                                           |    4 
 fs/ocfs2/super.c                                              |    4 
 fs/ocfs2/super.h                                              |    4 
 fs/ocfs2/symlink.c                                            |    4 
 fs/ocfs2/symlink.h                                            |    4 
 fs/ocfs2/sysfile.c                                            |    4 
 fs/ocfs2/sysfile.h                                            |    4 
 fs/ocfs2/uptodate.c                                           |    4 
 fs/ocfs2/uptodate.h                                           |    4 
 fs/ocfs2/xattr.c                                              |    4 
 fs/ocfs2/xattr.h                                              |    4 
 fs/proc/generic.c                                             |   13 
 fs/proc/inode.c                                               |   18 
 fs/proc/proc_sysctl.c                                         |    2 
 fs/reiserfs/procfs.c                                          |   10 
 include/asm-generic/bitops/find.h                             |  108 +++
 include/asm-generic/bitops/le.h                               |   38 +
 include/asm-generic/bitsperlong.h                             |   12 
 include/asm-generic/io.h                                      |   11 
 include/linux/align.h                                         |   15 
 include/linux/async.h                                         |    1 
 include/linux/bitmap.h                                        |   11 
 include/linux/bitops.h                                        |   12 
 include/linux/blkdev.h                                        |    1 
 include/linux/compat.h                                        |    1 
 include/linux/configfs.h                                      |    4 
 include/linux/crc8.h                                          |    2 
 include/linux/cred.h                                          |    1 
 include/linux/delayacct.h                                     |   20 
 include/linux/fs.h                                            |    2 
 include/linux/genl_magic_func.h                               |    1 
 include/linux/genl_magic_struct.h                             |    1 
 include/linux/gfp.h                                           |    2 
 include/linux/init_task.h                                     |    1 
 include/linux/initrd.h                                        |    2 
 include/linux/kernel.h                                        |    9 
 include/linux/mm.h                                            |    2 
 include/linux/mmzone.h                                        |    2 
 include/linux/pgtable.h                                       |   10 
 include/linux/proc_fs.h                                       |    1 
 include/linux/profile.h                                       |    3 
 include/linux/smp.h                                           |    8 
 include/linux/swap.h                                          |    1 
 include/linux/vmalloc.h                                       |    7 
 include/uapi/linux/if_bonding.h                               |   11 
 include/uapi/linux/nfs4.h                                     |    6 
 include/xen/interface/elfnote.h                               |   10 
 include/xen/interface/hvm/hvm_vcpu.h                          |   10 
 include/xen/interface/io/xenbus.h                             |   10 
 init/Kconfig                                                  |   12 
 init/initramfs.c                                              |   38 +
 init/main.c                                                   |    1 
 ipc/sem.c                                                     |   12 
 kernel/async.c                                                |   68 --
 kernel/configs/android-base.config                            |    1 
 kernel/crash_core.c                                           |    7 
 kernel/cred.c                                                 |    2 
 kernel/exit.c                                                 |   67 ++
 kernel/fork.c                                                 |   23 
 kernel/gcov/Kconfig                                           |    1 
 kernel/gcov/base.c                                            |   49 +
 kernel/gcov/clang.c                                           |  282 ----------
 kernel/gcov/fs.c                                              |  146 ++++-
 kernel/gcov/gcc_4_7.c                                         |  173 ------
 kernel/gcov/gcov.h                                            |   14 
 kernel/kexec_core.c                                           |    4 
 kernel/kexec_file.c                                           |    4 
 kernel/kmod.c                                                 |    2 
 kernel/resource.c                                             |  198 ++++---
 kernel/sys.c                                                  |   14 
 kernel/umh.c                                                  |    8 
 kernel/up.c                                                   |    2 
 kernel/user_namespace.c                                       |    6 
 lib/bch.c                                                     |    2 
 lib/crc8.c                                                    |    2 
 lib/decompress_unlzma.c                                       |    2 
 lib/find_bit.c                                                |   68 --
 lib/genalloc.c                                                |    7 
 lib/list_sort.c                                               |    2 
 lib/parser.c                                                  |   61 +-
 lib/percpu_counter.c                                          |    2 
 lib/stackdepot.c                                              |    6 
 mm/balloon_compaction.c                                       |    4 
 mm/compaction.c                                               |    4 
 mm/filemap.c                                                  |    2 
 mm/gup.c                                                      |    2 
 mm/highmem.c                                                  |    2 
 mm/huge_memory.c                                              |    6 
 mm/hugetlb.c                                                  |    6 
 mm/internal.h                                                 |    2 
 mm/kasan/kasan.h                                              |    8 
 mm/kasan/quarantine.c                                         |    4 
 mm/kasan/shadow.c                                             |    4 
 mm/kfence/report.c                                            |    2 
 mm/khugepaged.c                                               |    2 
 mm/ksm.c                                                      |    6 
 mm/madvise.c                                                  |    4 
 mm/memcontrol.c                                               |   18 
 mm/memory-failure.c                                           |    2 
 mm/memory.c                                                   |   18 
 mm/mempolicy.c                                                |    6 
 mm/migrate.c                                                  |    8 
 mm/mmap.c                                                     |    4 
 mm/mprotect.c                                                 |    2 
 mm/mremap.c                                                   |    2 
 mm/nommu.c                                                    |   10 
 mm/oom_kill.c                                                 |    2 
 mm/page-writeback.c                                           |    4 
 mm/page_alloc.c                                               |   16 
 mm/page_owner.c                                               |    2 
 mm/page_vma_mapped.c                                          |    2 
 mm/percpu-internal.h                                          |    2 
 mm/percpu.c                                                   |    2 
 mm/pgalloc-track.h                                            |    6 
 mm/rmap.c                                                     |    2 
 mm/slab.c                                                     |    8 
 mm/slub.c                                                     |    2 
 mm/swap.c                                                     |    4 
 mm/swap_slots.c                                               |    2 
 mm/swap_state.c                                               |    2 
 mm/vmalloc.c                                                  |  124 ----
 mm/vmstat.c                                                   |    2 
 mm/z3fold.c                                                   |    2 
 mm/zpool.c                                                    |    2 
 mm/zsmalloc.c                                                 |    6 
 samples/configfs/configfs_sample.c                            |    2 
 scripts/checkpatch.pl                                         |   15 
 scripts/gdb/linux/cpus.py                                     |   23 
 scripts/gdb/linux/symbols.py                                  |    3 
 scripts/spelling.txt                                          |    3 
 tools/include/asm-generic/bitops/find.h                       |   85 ++-
 tools/include/asm-generic/bitsperlong.h                       |    3 
 tools/include/linux/bitmap.h                                  |   18 
 tools/lib/bitmap.c                                            |    4 
 tools/lib/find_bit.c                                          |   56 -
 tools/scripts/Makefile.include                                |    1 
 tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c |   44 +
 tools/testing/selftests/kvm/lib/sparsebit.c                   |    1 
 tools/testing/selftests/mincore/mincore_selftest.c            |    1 
 tools/testing/selftests/powerpc/mm/tlbie_test.c               |    1 
 tools/testing/selftests/proc/Makefile                         |    1 
 tools/testing/selftests/proc/proc-subset-pid.c                |  121 ++++
 tools/testing/selftests/proc/read.c                           |    4 
 tools/usb/hcd-tests.sh                                        |    2 
 343 files changed, 1383 insertions(+), 2119 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-05-05 17:44       ` incoming Andrew Morton
@ 2021-05-06  3:19         ` Anshuman Khandual
  0 siblings, 0 replies; 307+ messages in thread
From: Anshuman Khandual @ 2021-05-06  3:19 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: Konstantin Ryabitsev, Linux-MM, mm-commits



On 5/5/21 11:14 PM, Andrew Morton wrote:
> On Wed, 5 May 2021 10:10:33 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
>> On Tue, May 4, 2021 at 8:16 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>>> Let me resend right now with the same in-reply-to.  Hopefully they will
>>> land in the correct place.
>> Well, you re-sent it twice, and I have three copies in my own mailbox,
>> bot they still don't show up on the mm-commits mailing list.
>>
>> So the list hates them for some odd reason.
>>
>> I've picked them up locally, but adding Konstantin to the participants
>> to see if he can see what's up.
>>
>> Konstantin: patches 103/106/107 are missing on lore out of Andrew's
>> series of 143. Odd.
> It's weird.  They don't turn up on linux-mm either, and that's running
> at kvack.org, also majordomo.  They don't get through when sent with
> either heirloom-mailx or with sylpheed.
> 
> Also, it seems that when Anshuman originally sent the patch, linux-mm
> and linux-kernel didn't send it back out.  So perhaps a spam filter
> triggered?
> 
> I'm seeing
> 
> https://lore.kernel.org/linux-arm-kernel/1615278790-18053-3-git-send-email-anshuman.khandual@arm.com/
> 
> which is via linux-arm-kernel@lists.infradead.org but the linux-kernel
> server massacred that patch series.  Searching
> https://lkml.org/lkml/2021/3/9 for "anshuman" only shows 3 of the 7
> email series.

Yeah these patches faced problem from the very beginning getting
into the MM/LKML list for some strange reason.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-05-05 17:10     ` incoming Linus Torvalds
@ 2021-05-05 17:44       ` Andrew Morton
  2021-05-06  3:19         ` incoming Anshuman Khandual
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-05-05 17:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Konstantin Ryabitsev, Linux-MM, mm-commits

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

On Wed, 5 May 2021 10:10:33 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, May 4, 2021 at 8:16 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > Let me resend right now with the same in-reply-to.  Hopefully they will
> > land in the correct place.
> 
> Well, you re-sent it twice, and I have three copies in my own mailbox,
> bot they still don't show up on the mm-commits mailing list.
> 
> So the list hates them for some odd reason.
> 
> I've picked them up locally, but adding Konstantin to the participants
> to see if he can see what's up.
> 
> Konstantin: patches 103/106/107 are missing on lore out of Andrew's
> series of 143. Odd.

It's weird.  They don't turn up on linux-mm either, and that's running
at kvack.org, also majordomo.  They don't get through when sent with
either heirloom-mailx or with sylpheed.

Also, it seems that when Anshuman originally sent the patch, linux-mm
and linux-kernel didn't send it back out.  So perhaps a spam filter
triggered?

I'm seeing

https://lore.kernel.org/linux-arm-kernel/1615278790-18053-3-git-send-email-anshuman.khandual@arm.com/

which is via linux-arm-kernel@lists.infradead.org but the linux-kernel
server massacred that patch series.  Searching
https://lkml.org/lkml/2021/3/9 for "anshuman" only shows 3 of the 7
email series.

One of the emails (as sent my me) is attached, if that helps.



[-- Attachment #2: x.txt --]
[-- Type: text/plain, Size: 21048 bytes --]

Return-Path: <akpm@linux-foundation.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on y
X-Spam-Level: (none)
X-Spam-Status: No, score=-101.5 required=2.5 tests=BAYES_00,T_DKIM_INVALID,
	USER_IN_WHITELIST autolearn=ham autolearn_force=no version=3.4.1
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.15.2/8.15.2/Debian-8ubuntu1) with ESMTP id 1453H2fk032202
	for <akpm@localhost>; Tue, 4 May 2021 20:17:03 -0700
Received: from imap.fastmail.com [66.111.4.135]
	by localhost.localdomain with IMAP (fetchmail-6.3.26)
	for <akpm@localhost> (single-drop); Tue, 04 May 2021 20:17:03 -0700 (PDT)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
	 by sloti11d1t06 (Cyrus 3.5.0-alpha0-442-g5daca166b9-fm-20210428.001-g5daca166) with LMTPA;
	 Tue, 04 May 2021 23:16:31 -0400
X-Cyrus-Session-Id: sloti11d1t06-1620184591-1699471-2-6359664467419938249
X-Sieve: CMU Sieve 3.0
X-Resolved-to: akpm@mbx.kernel.org
X-Delivered-to: akpm@mbx.kernel.org
X-Mail-from: akpm@linux-foundation.org
Received: from mx6 ([10.202.2.205])
  by compute1.internal (LMTPProxy); Tue, 04 May 2021 23:16:31 -0400
Received: from mx6.messagingengine.com (localhost [127.0.0.1])
	by mailmx.nyi.internal (Postfix) with ESMTP id 40796C800E1
	for <akpm@mbx.kernel.org>; Tue,  4 May 2021 23:16:31 -0400 (EDT)
Received: from mx6.messagingengine.com (localhost [127.0.0.1])
    by mx6.messagingengine.com (Authentication Milter) with ESMTP
    id 14870833D7F;
    Tue, 4 May 2021 23:16:31 -0400
ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=messagingengine.com; s=fm2; t=
    1620184591; b=FBo7Gf3JFN+4QYg5Byan0oNm6RESv+sIf5HcaslVNsUd9SOTGS
    yI0+IsXr1CUpGH783hE6fmgEq9SyfOwQVZjdikLaJS1+7u0JtfAYQFU3RORCtXlr
    djJWrScfjVa8nAHX4rQCtzvtPYuzx5w7cTgGgeILgoJMxgLj7EC9xcT8BIf68+9W
    Lw+ohAmcuiKhL2ez+de4SMuwdh3dh2FwAIHQOsSjEU1/NV+WGxMLwYbxWgTrqQGH
    RQIzFNdq30qslW9huK47+e80uHOX2tXwxtshwbThFEn458bdV5LL6Y8Oh4ZWMbv1
    tFgTt515DVedonZknxc07XsXtAjaJyB8bfHw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=
    messagingengine.com; h=date:from:to:subject:message-id
    :in-reply-to; s=fm2; t=1620184591; bh=LuH7mbm3+zp863vKBEqKeoZtnp
    uFxYpIb5oTVwf56Es=; b=m5E1fbz2b+an/X406oY3BuG0Zm4/W05vWAki8Lsnud
    gPCc1LfPUFSuXaMppcEDPbLKprp4hH3T52itK4pivXMQCLEOyme7kVStaLMVTiky
    Xxqh5ZdhOWvygBfda/GjfuLBSbbj2gfm8HPKpbL7CA5foelknIBhJHDzGkJyxetZ
    YagZfVvtdo2OEwnC1mmjUCpKPO5+m5kaZO0ol6rPdl+TV0MKGhjLg+/i6Ia+0nFp
    zDwV4VeACvVcGb2xY7KG5Z+BtqVxeVFn+w5JcqpWUtxEKoSBR4bWARzjwHg6eouh
    7psOOKPTt/NzDKk+3f49lso5KlPiTF2xEU/+5SIttCkQ==
ARC-Authentication-Results: i=2; mx6.messagingengine.com;
    arc=pass (as.1.google.com=pass, ams.1.google.com=pass)
    smtp.remote-ip=209.85.215.198;
    bimi=skipped (DMARC did not pass);
    dkim=pass (1024-bit rsa key sha256) header.d=linux-foundation.org
    header.i=@linux-foundation.org header.b=Gdz/3wY9 header.a=rsa-sha256
    header.s=korg x-bits=1024;
    dmarc=none policy.published-domain-policy=none
    policy.applied-disposition=none policy.evaluated-disposition=none
    (p=none,d=none,d.eval=none) policy.policy-from=p
    header.from=linux-foundation.org;
    iprev=pass smtp.remote-ip=209.85.215.198 (mail-pg1-f198.google.com);
    spf=pass smtp.mailfrom=akpm@linux-foundation.org
    smtp.helo=mail-pg1-f198.google.com;
    x-aligned-from=pass (Address match);
    x-arc-spf=pass
    (google.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender)
    smtp.mailfrom=akpm@linux-foundation.org x-arc-instance=1
    x-arc-domain=google.com (Trusted from aar.1.google.com);
    x-csa=none;
    x-google-dkim=fail (message has been altered, 2048-bit rsa key)
    header.d=1e100.net header.i=@1e100.net header.b=VZuDOxUf;
    x-me-sender=none;
    x-ptr=pass smtp.helo=mail-pg1-f198.google.com
    policy.ptr=mail-pg1-f198.google.com;
    x-return-mx=pass header.domain=linux-foundation.org policy.is_org=yes
    (MX Records found: ASPMX.L.GOOGLE.COM,ALT1.ASPMX.L.GOOGLE.COM,ALT2.ASPMX.L.GOOGLE.COM,ALT3.ASPMX.L.GOOGLE.COM,ALT4.ASPMX.L.GOOGLE.COM);
    x-return-mx=pass smtp.domain=linux-foundation.org policy.is_org=yes
    (MX Records found: ASPMX.L.GOOGLE.COM,ALT1.ASPMX.L.GOOGLE.COM,ALT2.ASPMX.L.GOOGLE.COM,ALT3.ASPMX.L.GOOGLE.COM,ALT4.ASPMX.L.GOOGLE.COM);
    x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_256_GCM_SHA384
    smtp.bits=256/256;
    x-vs=clean score=40 state=0
Authentication-Results: mx6.messagingengine.com;
    arc=pass (as.1.google.com=pass, ams.1.google.com=pass)
      smtp.remote-ip=209.85.215.198;
    bimi=skipped (DMARC did not pass);
    dkim=pass (1024-bit rsa key sha256) header.d=linux-foundation.org
      header.i=@linux-foundation.org header.b=Gdz/3wY9 header.a=rsa-sha256
      header.s=korg x-bits=1024;
    dmarc=none policy.published-domain-policy=none
      policy.applied-disposition=none policy.evaluated-disposition=none
      (p=none,d=none,d.eval=none) policy.policy-from=p
      header.from=linux-foundation.org;
    iprev=pass smtp.remote-ip=209.85.215.198 (mail-pg1-f198.google.com);
    spf=pass smtp.mailfrom=akpm@linux-foundation.org
      smtp.helo=mail-pg1-f198.google.com;
    x-aligned-from=pass (Address match);
    x-arc-spf=pass
      (google.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender)
      smtp.mailfrom=akpm@linux-foundation.org x-arc-instance=1
      x-arc-domain=google.com (Trusted from aar.1.google.com);
    x-csa=none;
    x-google-dkim=fail (message has been altered, 2048-bit rsa key)
      header.d=1e100.net header.i=@1e100.net header.b=VZuDOxUf;
    x-me-sender=none;
    x-ptr=pass smtp.helo=mail-pg1-f198.google.com
      policy.ptr=mail-pg1-f198.google.com;
    x-return-mx=pass header.domain=linux-foundation.org policy.is_org=yes
      (MX Records found: ASPMX.L.GOOGLE.COM,ALT1.ASPMX.L.GOOGLE.COM,ALT2.ASPMX.L.GOOGLE.COM,ALT3.ASPMX.L.GOOGLE.COM,ALT4.ASPMX.L.GOOGLE.COM);
    x-return-mx=pass smtp.domain=linux-foundation.org policy.is_org=yes
      (MX Records found: ASPMX.L.GOOGLE.COM,ALT1.ASPMX.L.GOOGLE.COM,ALT2.ASPMX.L.GOOGLE.COM,ALT3.ASPMX.L.GOOGLE.COM,ALT4.ASPMX.L.GOOGLE.COM);
    x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_256_GCM_SHA384
      smtp.bits=256/256;
    x-vs=clean score=40 state=0
X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefjedgieegucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu
    rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgoufhorhhtvggutfgvtg
    hiphdvucdlgedtmdenucfjughrpeffhffvuffkjggfsedttdertddtredtnecuhfhrohhm
    peetnhgurhgvficuofhorhhtohhnuceorghkphhmsehlihhnuhigqdhfohhunhgurghtih
    honhdrohhrgheqnecuggftrfgrthhtvghrnhepjeevfeduveffvddvudetkefhgeduveeu
    geevvdfhhfevhfekkedtieefgfduheeinecuffhomhgrihhnpehkvghrnhgvlhdrohhrgh
    enucfkphepvddtledrkeehrddvudehrdduleekpdduleekrddugeehrddvledrleelnecu
    uegrugftvghpuhhtkfhppeduleekrddugeehrddvledrleelnecuvehluhhsthgvrhfuih
    iivgeptdenucfrrghrrghmpehinhgvthepvddtledrkeehrddvudehrdduleekpdhhvghl
    ohepmhgrihhlqdhpghduqdhfudelkedrghhoohhglhgvrdgtohhmpdhmrghilhhfrhhomh
    epoegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorhhgqe
X-ME-VSScore: 40
X-ME-VSCategory: clean
X-ME-CSA: none
Received-SPF: pass
    (linux-foundation.org: Sender is authorized to use 'akpm@linux-foundation.org' in 'mfrom' identity (mechanism 'include:_spf.google.com' matched))
    receiver=mx6.messagingengine.com;
    identity=mailfrom;
    envelope-from="akpm@linux-foundation.org";
    helo=mail-pg1-f198.google.com;
    client-ip=209.85.215.198
Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by mx6.messagingengine.com (Postfix) with ESMTPS
	for <akpm@mbx.kernel.org>; Tue,  4 May 2021 23:16:31 -0400 (EDT)
Received: by mail-pg1-f198.google.com with SMTP id g5-20020a63f4050000b02901f6c7b9a6d0so593624pgi.5
        for <akpm@mbx.kernel.org>; Tue, 04 May 2021 20:16:30 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:dkim-signature:date:from:to:subject:message-id
         :in-reply-to:user-agent;
        bh=LuH7mbm3+zp863vKBEqKeoZtnpuFxYpIb5oTVwf56Es=;
        b=VZuDOxUfeHXJz1/CiFfcxuMVHkmW5RznvqYS+Py8Ub6nHHXprQJGE9Ze3WgH+1ylSe
         NJLEC7xgv15SR9A+e/MT4RTj3OVOwtd1Zi2vPav39a9K4tP+2uL2Ei+5d7FtT3LLZsjo
         feek/DqCGSkJ/EC5woLyU9BBkfLUuQ9/2HiDCk10BMetEfWdor69Slb39NOXES8br02X
         25Btabu9ZCWroyjQj7W5gwGr5Z6Hs2nbnnfAb+e92FalcUD/4ql77lNzRcWGi4/9TT8s
         ntqI2g46Xv+k5LURaRH5CRBpxkkKgzcrioRPYFUHkEgOEWy1hPzg9QPk8ZO35Xm9R9d2
         vl3Q==
X-Gm-Message-State: AOAM531IlYUTVWcMrsTunnxZWB7SKeeOmoZj5mZ1A5tl7N/JlZUueN8L
	tvyRKnvxHr6a5mDaGHN9Tb1N/iCzT0U5oQgRVTxTnj1qFGibRa9+leLQNKX0aGlNg9JiaMfromb
	xyOlCUpVXOlVvchuwTUSTn7rXum+Hh3PWQZm5II/EX+0AkzKqez62Z8U=
X-Received: by 2002:a17:90a:a581:: with SMTP id b1mr32203271pjq.53.1620184589161;
        Tue, 04 May 2021 20:16:29 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJxffoGdRqAjUagWoMVD5p/Lk1KTEDftEhkWh8ewatgDmZLlxh0lO1hxYIdYYwoO5dsJ/i0z
X-Received: by 2002:a17:90a:a581:: with SMTP id b1mr32203198pjq.53.1620184588109;
        Tue, 04 May 2021 20:16:28 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1620184588; cv=none;
        d=google.com; s=arc-20160816;
        b=Fr2b2AMXJr6OeNpSql45tq1korkuDOunp7t+DpARuEBnwvQnKfagyipQ93jywsRf/c
         /i/mP2eTmJwOLWNORClh1MGF/0VfBx1ULoB9W4CI3LpVgGFXGGFis8LTcvUYD5yvhlsV
         50rm2j34iS9lyo04FB/hbhGkwLtUhz2PGkLGuqHspTd+pUpUCf5SLxGJbZC5uCcUEsbO
         8WSDBWyvaCPjFzJQZK60gK70ticKW+fCG1xHtOG4qsFCbqEpFKBy8eVK83OBazo/dQDr
         DOheWNWyw2o/WMP4GpZMvZuj30dx3j8xnBahIpnMIQJaog6wLMcVX9pkQ8UJym3/PGNm
         pO/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=user-agent:in-reply-to:message-id:subject:to:from:date
         :dkim-signature;
        bh=LuH7mbm3+zp863vKBEqKeoZtnpuFxYpIb5oTVwf56Es=;
        b=vVN16NPMKjoxSJQ6b36VXFCkZqnmG7wABfilgE069txZqmHpEMyZb8lRStkHy557LM
         Kn7UfJFP3xwsP8ZTCipVDZ6tpFW/hYFU9o4th9G8asWs+MOf9xpWX2LQZ1FTmaao2Fg5
         uCHypz39cnAh0Z1EJfNsTcaTGIrkbBd6zje+mtBgs8hnfH8HcWBYTPCHCCx950Z928tb
         XOPd/Igs7yzD1ioBiGXZj/ciwPbWVTaZXBg4JOZSApxkDMfuMyfyLLOs++EVkyxJHUme
         TmgwvLkixcwEtKF7gIeqEhwvOUSVvilLuJLFVaLumwTcjJ1amVfGcJhBE7LIM9C3SMpA
         rOOg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@linux-foundation.org header.s=korg header.b="Gdz/3wY9";
       spf=pass (google.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org
Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99])
        by mx.google.com with ESMTPS id c85si20173199pfb.8.2021.05.04.20.16.27
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 04 May 2021 20:16:28 -0700 (PDT)
Received-SPF: pass (google.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@linux-foundation.org header.s=korg header.b="Gdz/3wY9";
       spf=pass (google.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org
Received: by mail.kernel.org (Postfix) with ESMTPSA id A4DB4610D2;
	Wed,  5 May 2021 03:16:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org;
	s=korg; t=1620184587;
	bh=TxN4wgKcKf2UUem+5pL09m9GL/7U592mEalo2U6vwAU=;
	h=Date:From:To:Subject:In-Reply-To:From;
	b=Gdz/3wY9ktH3hOmn2DAOkfh0JXwPdMJ8xsNQFa9eI25K39Z3iHdRGo9jX3QtMDtog
	 D4Zakt52CQCYsV91c9oCai8KnCTkkAjJq/Ez7p8UHpz97Go3yYYxqg6DDl6d8HCQvN
	 H47dTaZAgeH2sw29bjB9fRzNuTx7k4RAPlqZIpiE=
Date: Tue, 04 May 2021 20:16:26 -0700
From: Andrew Morton <akpm@linux-foundation.org>
To: akpm@linux-foundation.org, anshuman.khandual@arm.com, aou@eecs.berkeley.edu, arnd@arndb.de, benh@kernel.crashing.org, borntraeger@de.ibm.com, bp@alien8.de, catalin.marinas@arm.com, dalias@libc.org, deller@gmx.de, gor@linux.ibm.com, hca@linux.ibm.com, hpa@zytor.com, James.Bottomley@HansenPartnership.com, linux-mm@kvack.org, linux@armlinux.org.uk, mingo@redhat.com, mm-commits@vger.kernel.org, mpe@ellerman.id.au, palmerdabbelt@google.com, paul.walmsley@sifive.com, paulus@samba.org, tglx@linutronix.de, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, vgupta@synopsys.com, viro@zeniv.linux.org.uk, will@kernel.org, ysato@users.osdn.me
Subject: [patch 103/143] mm: generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS)
Message-ID: <20210505031626.c8o4WL7KE%akpm@linux-foundation.org>
In-Reply-To: <20210504183219.a3cc46aee4013d77402276c5@linux-foundation.org>
User-Agent: s-nail v14.8.16
X-Gm-Original-To: akpm@linux-foundation.org

From: Anshuman Khandual <anshuman.khandual@arm.com>
Subject: mm: generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS)

SYS_SUPPORTS_HUGETLBFS config has duplicate definitions on platforms that
subscribe it.  Instead, just make it a generic option which can be
selected on applicable platforms.  Also rename it as
ARCH_SUPPORTS_HUGETLBFS instead.  This reduces code duplication and makes
it cleaner.

Link: https://lkml.kernel.org/r/1617259448-22529-3-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>	[riscv]
Acked-by: Michael Ellerman <mpe@ellerman.id.au>		[powerpc]
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/Kconfig                       |    5 +----
 arch/arm64/Kconfig                     |    4 +---
 arch/mips/Kconfig                      |    6 +-----
 arch/parisc/Kconfig                    |    5 +----
 arch/powerpc/Kconfig                   |    3 ---
 arch/powerpc/platforms/Kconfig.cputype |    6 +++---
 arch/riscv/Kconfig                     |    5 +----
 arch/sh/Kconfig                        |    5 +----
 fs/Kconfig                             |    5 ++++-
 9 files changed, 13 insertions(+), 31 deletions(-)

--- a/arch/arm64/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/arm64/Kconfig
@@ -73,6 +73,7 @@ config ARM64
 	select ARCH_USE_QUEUED_SPINLOCKS
 	select ARCH_USE_SYM_ANNOTATIONS
 	select ARCH_SUPPORTS_DEBUG_PAGEALLOC
+	select ARCH_SUPPORTS_HUGETLBFS
 	select ARCH_SUPPORTS_MEMORY_FAILURE
 	select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK
 	select ARCH_SUPPORTS_LTO_CLANG if CPU_LITTLE_ENDIAN
@@ -1072,9 +1073,6 @@ config HW_PERF_EVENTS
 	def_bool y
 	depends on ARM_PMU
 
-config SYS_SUPPORTS_HUGETLBFS
-	def_bool y
-
 config ARCH_HAS_FILTER_PGPROT
 	def_bool y
 
--- a/arch/arm/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/arm/Kconfig
@@ -31,6 +31,7 @@ config ARM
 	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
 	select ARCH_SUPPORTS_ATOMIC_RMW
+	select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_USE_MEMTEST
@@ -1511,10 +1512,6 @@ config HW_PERF_EVENTS
 	def_bool y
 	depends on ARM_PMU
 
-config SYS_SUPPORTS_HUGETLBFS
-       def_bool y
-       depends on ARM_LPAE
-
 config HAVE_ARCH_TRANSPARENT_HUGEPAGE
        def_bool y
        depends on ARM_LPAE
--- a/arch/mips/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/mips/Kconfig
@@ -19,6 +19,7 @@ config MIPS
 	select ARCH_USE_MEMTEST
 	select ARCH_USE_QUEUED_RWLOCKS
 	select ARCH_USE_QUEUED_SPINLOCKS
+	select ARCH_SUPPORTS_HUGETLBFS if CPU_SUPPORTS_HUGEPAGES
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select ARCH_WANT_LD_ORPHAN_WARN
@@ -1287,11 +1288,6 @@ config SYS_SUPPORTS_BIG_ENDIAN
 config SYS_SUPPORTS_LITTLE_ENDIAN
 	bool
 
-config SYS_SUPPORTS_HUGETLBFS
-	bool
-	depends on CPU_SUPPORTS_HUGEPAGES
-	default y
-
 config MIPS_HUGE_TLB_SUPPORT
 	def_bool HUGETLB_PAGE || TRANSPARENT_HUGEPAGE
 
--- a/arch/parisc/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/parisc/Kconfig
@@ -12,6 +12,7 @@ config PARISC
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARCH_NO_SG_CHAIN
+	select ARCH_SUPPORTS_HUGETLBFS if PA20
 	select ARCH_SUPPORTS_MEMORY_FAILURE
 	select DMA_OPS
 	select RTC_CLASS
@@ -138,10 +139,6 @@ config PGTABLE_LEVELS
 	default 3 if 64BIT && PARISC_PAGE_SIZE_4KB
 	default 2
 
-config SYS_SUPPORTS_HUGETLBFS
-	def_bool y if PA20
-
-
 menu "Processor type and features"
 
 choice
--- a/arch/powerpc/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/powerpc/Kconfig
@@ -697,9 +697,6 @@ config ARCH_SPARSEMEM_DEFAULT
 	def_bool y
 	depends on PPC_BOOK3S_64
 
-config SYS_SUPPORTS_HUGETLBFS
-	bool
-
 config ILLEGAL_POINTER_VALUE
 	hex
 	# This is roughly half way between the top of user space and the bottom
--- a/arch/powerpc/platforms/Kconfig.cputype~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/powerpc/platforms/Kconfig.cputype
@@ -40,8 +40,8 @@ config PPC_85xx
 
 config PPC_8xx
 	bool "Freescale 8xx"
+	select ARCH_SUPPORTS_HUGETLBFS
 	select FSL_SOC
-	select SYS_SUPPORTS_HUGETLBFS
 	select PPC_HAVE_KUEP
 	select PPC_HAVE_KUAP
 	select HAVE_ARCH_VMAP_STACK
@@ -95,9 +95,9 @@ config PPC_BOOK3S_64
 	bool "Server processors"
 	select PPC_FPU
 	select PPC_HAVE_PMU_SUPPORT
-	select SYS_SUPPORTS_HUGETLBFS
 	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
 	select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
+	select ARCH_SUPPORTS_HUGETLBFS
 	select ARCH_SUPPORTS_NUMA_BALANCING
 	select IRQ_WORK
 	select PPC_MM_SLICES
@@ -278,9 +278,9 @@ config FSL_BOOKE
 # this is for common code between PPC32 & PPC64 FSL BOOKE
 config PPC_FSL_BOOK3E
 	bool
+	select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
 	select FSL_EMB_PERFMON
 	select PPC_SMP_MUXED_IPI
-	select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
 	select PPC_DOORBELL
 	default y if FSL_BOOKE
 
--- a/arch/riscv/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/riscv/Kconfig
@@ -30,6 +30,7 @@ config RISCV
 	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
 	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
+	select ARCH_SUPPORTS_HUGETLBFS if MMU
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
 	select ARCH_WANT_FRAME_POINTERS
 	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
@@ -165,10 +166,6 @@ config ARCH_WANT_GENERAL_HUGETLB
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
-config SYS_SUPPORTS_HUGETLBFS
-	depends on MMU
-	def_bool y
-
 config STACKTRACE_SUPPORT
 	def_bool y
 
--- a/arch/sh/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/arch/sh/Kconfig
@@ -101,9 +101,6 @@ config SYS_SUPPORTS_APM_EMULATION
 	bool
 	select ARCH_SUSPEND_POSSIBLE
 
-config SYS_SUPPORTS_HUGETLBFS
-	bool
-
 config SYS_SUPPORTS_SMP
 	bool
 
@@ -175,12 +172,12 @@ config CPU_SH3
 
 config CPU_SH4
 	bool
+	select ARCH_SUPPORTS_HUGETLBFS if MMU
 	select CPU_HAS_INTEVT
 	select CPU_HAS_SR_RB
 	select CPU_HAS_FPU if !CPU_SH4AL_DSP
 	select SH_INTC
 	select SYS_SUPPORTS_SH_TMU
-	select SYS_SUPPORTS_HUGETLBFS if MMU
 
 config CPU_SH4A
 	bool
--- a/fs/Kconfig~mm-generalize-sys_supports_hugetlbfs-rename-as-arch_supports_hugetlbfs
+++ a/fs/Kconfig
@@ -223,10 +223,13 @@ config TMPFS_INODE64
 
 	  If unsure, say N.
 
+config ARCH_SUPPORTS_HUGETLBFS
+	def_bool n
+
 config HUGETLBFS
 	bool "HugeTLB file system support"
 	depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
-		   SYS_SUPPORTS_HUGETLBFS || BROKEN
+		   ARCH_SUPPORTS_HUGETLBFS || BROKEN
 	help
 	  hugetlbfs is a filesystem backing for HugeTLB pages, based on
 	  ramfs. For architectures that support it, say Y here and read
_

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-05-05  3:16   ` incoming Andrew Morton
@ 2021-05-05 17:10     ` Linus Torvalds
  2021-05-05 17:44       ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2021-05-05 17:10 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: Linux-MM, mm-commits

On Tue, May 4, 2021 at 8:16 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> Let me resend right now with the same in-reply-to.  Hopefully they will
> land in the correct place.

Well, you re-sent it twice, and I have three copies in my own mailbox,
bot they still don't show up on the mm-commits mailing list.

So the list hates them for some odd reason.

I've picked them up locally, but adding Konstantin to the participants
to see if he can see what's up.

Konstantin: patches 103/106/107 are missing on lore out of Andrew's
series of 143. Odd.

             Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-05-05  1:47 ` incoming Linus Torvalds
@ 2021-05-05  3:16   ` Andrew Morton
  2021-05-05 17:10     ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-05-05  3:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-MM, mm-commits

On Tue, 4 May 2021 18:47:19 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, May 4, 2021 at 6:32 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > 143 patches
> 
> Hmm. Only 140 seem to have made it to the list, with 103, 106 and 107 missing.
> 
> Maybe just some mail delay? But at least right now
> 
>    https://lore.kernel.org/mm-commits/
> 
> doesn't show them (and thus 'b4' doesn't work).
> 
> I'll check again later.
> 

Well that's strange.  I see all three via cc:me, but not on linux-mm or
mm-commits.

Let me resend right now with the same in-reply-to.  Hopefully they will
land in the correct place.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-05-05  1:32 incoming Andrew Morton
@ 2021-05-05  1:47 ` Linus Torvalds
  2021-05-05  3:16   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2021-05-05  1:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Tue, May 4, 2021 at 6:32 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> 143 patches

Hmm. Only 140 seem to have made it to the list, with 103, 106 and 107 missing.

Maybe just some mail delay? But at least right now

   https://lore.kernel.org/mm-commits/

doesn't show them (and thus 'b4' doesn't work).

I'll check again later.

             Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-05-05  1:32 Andrew Morton
  2021-05-05  1:47 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-05-05  1:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


The remainder of the main mm/ queue.

143 patches, based on 8ca5297e7e38f2dc8c753d33a5092e7be181fff0, plus
previously sent patches.

Subsystems affected by this patch series:

  mm/pagecache
  mm/hugetlb
  mm/userfaultfd
  mm/vmscan
  mm/compaction
  mm/migration
  mm/cma
  mm/ksm
  mm/vmstat
  mm/mmap
  mm/kconfig
  mm/util
  mm/memory-hotplug
  mm/zswap
  mm/zsmalloc
  mm/highmem
  mm/cleanups
  mm/kfence

Subsystem: mm/pagecache

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Remove nrexceptional tracking", v2:
      mm: introduce and use mapping_empty()
      mm: stop accounting shadow entries
      dax: account DAX entries as nrpages
      mm: remove nrexceptional from inode

    Hugh Dickins <hughd@google.com>:
      mm: remove nrexceptional from inode: remove BUG_ON

Subsystem: mm/hugetlb

    Peter Xu <peterx@redhat.com>:
    Patch series "hugetlb: Disable huge pmd unshare for uffd-wp", v4:
      hugetlb: pass vma into huge_pte_alloc() and huge_pmd_share()
      hugetlb/userfaultfd: forbid huge pmd sharing when uffd enabled
      mm/hugetlb: move flush_hugetlb_tlb_range() into hugetlb.h
      hugetlb/userfaultfd: unshare all pmds for hugetlbfs when register wp

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hugetlb: remove redundant reservation check condition in alloc_huge_page()

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm: generalize HUGETLB_PAGE_SIZE_VARIABLE

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Some cleanups for hugetlb":
      mm/hugetlb: use some helper functions to cleanup code
      mm/hugetlb: optimize the surplus state transfer code in move_hugetlb_state()
      mm/hugetlb_cgroup: remove unnecessary VM_BUG_ON_PAGE in hugetlb_cgroup_migrate()
      mm/hugetlb: simplify the code when alloc_huge_page() failed in hugetlb_no_page()
      mm/hugetlb: avoid calculating fault_mutex_hash in truncate_op case
    Patch series "Cleanup and fixup for khugepaged", v2:
      khugepaged: remove unneeded return value of khugepaged_collapse_pte_mapped_thps()
      khugepaged: reuse the smp_wmb() inside __SetPageUptodate()
      khugepaged: use helper khugepaged_test_exit() in __khugepaged_enter()
      khugepaged: fix wrong result value for trace_mm_collapse_huge_page_isolate()
      mm/huge_memory.c: remove unnecessary local variable ret2
    Patch series "Some cleanups for huge_memory", v3:
      mm/huge_memory.c: rework the function vma_adjust_trans_huge()
      mm/huge_memory.c: make get_huge_zero_page() return bool
      mm/huge_memory.c: rework the function do_huge_pmd_numa_page() slightly
      mm/huge_memory.c: remove redundant PageCompound() check
      mm/huge_memory.c: remove unused macro TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG
      mm/huge_memory.c: use helper function migration_entry_to_page()

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/khugepaged.c: replace barrier() with READ_ONCE() for a selective variable

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup for khugepaged":
      khugepaged: use helper function range_in_vma() in collapse_pte_mapped_thp()
      khugepaged: remove unnecessary out label in collapse_huge_page()
      khugepaged: remove meaningless !pte_present() check in khugepaged_scan_pmd()

    Zi Yan <ziy@nvidia.com>:
      mm: huge_memory: a new debugfs interface for splitting THP tests
      mm: huge_memory: debugfs for file-backed THP split

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixup for hugetlb", v2:
      mm/hugeltb: remove redundant VM_BUG_ON() in region_add()
      mm/hugeltb: simplify the return code of __vma_reservation_common()
      mm/hugeltb: clarify (chg - freed) won't go negative in hugetlb_unreserve_pages()
      mm/hugeltb: handle the error case in hugetlb_fix_reserve_counts()
      mm/hugetlb: remove unused variable pseudo_vma in remove_inode_hugepages()

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "make hugetlb put_page safe for all calling contexts", v5:
      mm/cma: change cma mutex to irq safe spinlock
      hugetlb: no need to drop hugetlb_lock to call cma_release
      hugetlb: add per-hstate mutex to synchronize user adjustments
      hugetlb: create remove_hugetlb_page() to separate functionality
      hugetlb: call update_and_free_page without hugetlb_lock
      hugetlb: change free_pool_huge_page to remove_pool_huge_page
      hugetlb: make free_huge_page irq safe
      hugetlb: add lockdep_assert_held() calls for hugetlb_lock

    Oscar Salvador <osalvador@suse.de>:
    Patch series "Make alloc_contig_range handle Hugetlb pages", v10:
      mm,page_alloc: bail out earlier on -ENOMEM in alloc_contig_migrate_range
      mm,compaction: let isolate_migratepages_{range,block} return error codes
      mm,hugetlb: drop clearing of flag from prep_new_huge_page
      mm,hugetlb: split prep_new_huge_page functionality
      mm: make alloc_contig_range handle free hugetlb pages
      mm: make alloc_contig_range handle in-use hugetlb pages
      mm,page_alloc: drop unnecessary checks from pfn_range_valid_contig

Subsystem: mm/userfaultfd

    Axel Rasmussen <axelrasmussen@google.com>:
    Patch series "userfaultfd: add minor fault handling", v9:
      userfaultfd: add minor fault registration mode
      userfaultfd: disable huge PMD sharing for MINOR registered VMAs
      userfaultfd: hugetlbfs: only compile UFFD helpers if config enabled
      userfaultfd: add UFFDIO_CONTINUE ioctl
      userfaultfd: update documentation to describe minor fault handling
      userfaultfd/selftests: add test exercising minor fault handling

Subsystem: mm/vmscan

    Dave Hansen <dave.hansen@linux.intel.com>:
      mm/vmscan: move RECLAIM* bits to uapi header
      mm/vmscan: replace implicit RECLAIM_ZONE checks with explicit checks

    Yang Shi <shy828301@gmail.com>:
    Patch series "Make shrinker's nr_deferred memcg aware", v10:
      mm: vmscan: use nid from shrink_control for tracepoint
      mm: vmscan: consolidate shrinker_maps handling code
      mm: vmscan: use shrinker_rwsem to protect shrinker_maps allocation
      mm: vmscan: remove memcg_shrinker_map_size
      mm: vmscan: use kvfree_rcu instead of call_rcu
      mm: memcontrol: rename shrinker_map to shrinker_info
      mm: vmscan: add shrinker_info_protected() helper
      mm: vmscan: use a new flag to indicate shrinker is registered
      mm: vmscan: add per memcg shrinker nr_deferred
      mm: vmscan: use per memcg nr_deferred of shrinker
      mm: vmscan: don't need allocate shrinker->nr_deferred for memcg aware shrinkers
      mm: memcontrol: reparent nr_deferred when memcg offline
      mm: vmscan: shrink deferred objects proportional to priority

Subsystem: mm/compaction

    Pintu Kumar <pintu@codeaurora.org>:
      mm/compaction: remove unused variable sysctl_compact_memory

    Charan Teja Reddy <charante@codeaurora.org>:
      mm: compaction: update the COMPACT[STALL|FAIL] events properly

Subsystem: mm/migration

    Minchan Kim <minchan@kernel.org>:
      mm: disable LRU pagevec during the migration temporarily
      mm: replace migrate_[prep|finish] with lru_cache_[disable|enable]
      mm: fs: invalidate BH LRU during page migration

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixup for mm/migrate.c", v3:
      mm/migrate.c: make putback_movable_page() static
      mm/migrate.c: remove unnecessary rc != MIGRATEPAGE_SUCCESS check in 'else' case
      mm/migrate.c: fix potential indeterminate pte entry in migrate_vma_insert_page()
      mm/migrate.c: use helper migrate_vma_collect_skip() in migrate_vma_collect_hole()
      Revert "mm: migrate: skip shared exec THP for NUMA balancing"

Subsystem: mm/cma

    Minchan Kim <minchan@kernel.org>:
      mm: vmstat: add cma statistics

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm: cma: use pr_err_ratelimited for CMA warning

    Liam Mark <lmark@codeaurora.org>:
      mm: cma: add trace events for CMA alloc perf testing

    Minchan Kim <minchan@kernel.org>:
      mm: cma: support sysfs
      mm: cma: add the CMA instance name to cma trace events
      mm: use proper type for cma_[alloc|release]

Subsystem: mm/ksm

    Miaohe Lin <linmiaohe@huawei.com>:
    Patch series "Cleanup and fixup for ksm":
      ksm: remove redundant VM_BUG_ON_PAGE() on stable_tree_search()
      ksm: use GET_KSM_PAGE_NOLOCK to get ksm page in remove_rmap_item_from_tree()
      ksm: remove dedicated macro KSM_FLAG_MASK
      ksm: fix potential missing rmap_item for stable_node

    Chengyang Fan <cy.fan@huawei.com>:
      mm/ksm: remove unused parameter from remove_trailing_rmap_items()

Subsystem: mm/vmstat

    Hugh Dickins <hughd@google.com>:
      mm: restore node stat checking in /proc/sys/vm/stat_refresh
      mm: no more EINVAL from /proc/sys/vm/stat_refresh
      mm: /proc/sys/vm/stat_refresh skip checking known negative stats
      mm: /proc/sys/vm/stat_refresh stop checking monotonic numa stats

    Saravanan D <saravanand@fb.com>:
      x86/mm: track linear mapping split events

Subsystem: mm/mmap

    Liam Howlett <liam.howlett@oracle.com>:
      mm/mmap.c: don't unlock VMAs in remap_file_pages()

Subsystem: mm/kconfig

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm: some config cleanups", v2:
      mm: generalize ARCH_HAS_CACHE_LINE_SIZE
      mm: generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS)
      mm: generalize ARCH_ENABLE_MEMORY_[HOTPLUG|HOTREMOVE]
      mm: drop redundant ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION
      mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK
      mm: drop redundant HAVE_ARCH_TRANSPARENT_HUGEPAGE

Subsystem: mm/util

    Joe Perches <joe@perches.com>:
      mm/util.c: reduce mem_dump_obj() object size

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      mm/util.c: fix typo

Subsystem: mm/memory-hotplug

    Pavel Tatashin <pasha.tatashin@soleen.com>:
    Patch series "prohibit pinning pages in ZONE_MOVABLE", v11:
      mm/gup: don't pin migrated cma pages in movable zone
      mm/gup: check every subpage of a compound page during isolation
      mm/gup: return an error on migration failure
      mm/gup: check for isolation errors
      mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN
      mm: apply per-task gfp constraints in fast path
      mm: honor PF_MEMALLOC_PIN for all movable pages
      mm/gup: do not migrate zero page
      mm/gup: migrate pinned pages out of movable zone
      memory-hotplug.rst: add a note about ZONE_MOVABLE and page pinning
      mm/gup: change index type to long as it counts pages
      mm/gup: longterm pin migration cleanup
      selftests/vm: gup_test: fix test flag
      selftests/vm: gup_test: test faulting in kernel, and verify pinnable pages

    Mel Gorman <mgorman@techsingularity.net>:
      mm/memory_hotplug: remove broken locking of zone PCP structures during hot remove

    Oscar Salvador <osalvador@suse.de>:
    Patch series "Allocate memmap from hotadded memory (per device)", v10:
      drivers/base/memory: introduce memory_block_{online,offline}
      mm,memory_hotplug: relax fully spanned sections check

    David Hildenbrand <david@redhat.com>:
      mm,memory_hotplug: factor out adjusting present pages into adjust_present_page_count()

    Oscar Salvador <osalvador@suse.de>:
      mm,memory_hotplug: allocate memmap from the added memory range
      acpi,memhotplug: enable MHP_MEMMAP_ON_MEMORY when supported
      mm,memory_hotplug: add kernel boot option to enable memmap_on_memory
      x86/Kconfig: introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
      arm64/Kconfig: introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

Subsystem: mm/zswap

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/zswap.c: switch from strlcpy to strscpy

Subsystem: mm/zsmalloc

    zhouchuangao <zhouchuangao@vivo.com>:
      mm/zsmalloc: use BUG_ON instead of if condition followed by BUG.

Subsystem: mm/highmem

    Ira Weiny <ira.weiny@intel.com>:
    Patch series "btrfs: Convert kmap/memset/kunmap to memzero_user()":
      iov_iter: lift memzero_page() to highmem.h
      btrfs: use memzero_page() instead of open coded kmap pattern

    songqiang <songqiang@uniontech.com>:
      mm/highmem.c: fix coding style issue

Subsystem: mm/cleanups

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/mempool: minor coding style tweaks

    Zhang Yunkai <zhang.yunkai@zte.com.cn>:
      mm/process_vm_access.c: remove duplicate include

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: zero guard page after out-of-bounds access
    Patch series "kfence: optimize timer scheduling", v2:
      kfence: await for allocation using wait_event
      kfence: maximize allocation wait timeout duration
      kfence: use power-efficient work queue to run delayed work

 Documentation/ABI/testing/sysfs-kernel-mm-cma     |   25 
 Documentation/admin-guide/kernel-parameters.txt   |   17 
 Documentation/admin-guide/mm/memory-hotplug.rst   |    9 
 Documentation/admin-guide/mm/userfaultfd.rst      |  105 +-
 arch/arc/Kconfig                                  |    9 
 arch/arm/Kconfig                                  |   10 
 arch/arm64/Kconfig                                |   34 
 arch/arm64/mm/hugetlbpage.c                       |    7 
 arch/ia64/Kconfig                                 |   14 
 arch/ia64/mm/hugetlbpage.c                        |    3 
 arch/mips/Kconfig                                 |    6 
 arch/mips/mm/hugetlbpage.c                        |    4 
 arch/parisc/Kconfig                               |    5 
 arch/parisc/mm/hugetlbpage.c                      |    2 
 arch/powerpc/Kconfig                              |   17 
 arch/powerpc/mm/hugetlbpage.c                     |    3 
 arch/powerpc/platforms/Kconfig.cputype            |   16 
 arch/riscv/Kconfig                                |    5 
 arch/s390/Kconfig                                 |   12 
 arch/s390/mm/hugetlbpage.c                        |    2 
 arch/sh/Kconfig                                   |    7 
 arch/sh/mm/Kconfig                                |    8 
 arch/sh/mm/hugetlbpage.c                          |    2 
 arch/sparc/mm/hugetlbpage.c                       |    2 
 arch/x86/Kconfig                                  |   33 
 arch/x86/mm/pat/set_memory.c                      |    8 
 drivers/acpi/acpi_memhotplug.c                    |    5 
 drivers/base/memory.c                             |  105 ++
 fs/Kconfig                                        |    5 
 fs/block_dev.c                                    |    2 
 fs/btrfs/compression.c                            |    5 
 fs/btrfs/extent_io.c                              |   22 
 fs/btrfs/inode.c                                  |   33 
 fs/btrfs/reflink.c                                |    6 
 fs/btrfs/zlib.c                                   |    5 
 fs/btrfs/zstd.c                                   |    5 
 fs/buffer.c                                       |   36 
 fs/dax.c                                          |    8 
 fs/gfs2/glock.c                                   |    3 
 fs/hugetlbfs/inode.c                              |    9 
 fs/inode.c                                        |   11 
 fs/proc/task_mmu.c                                |    3 
 fs/userfaultfd.c                                  |  149 +++
 include/linux/buffer_head.h                       |    4 
 include/linux/cma.h                               |    4 
 include/linux/compaction.h                        |    1 
 include/linux/fs.h                                |    2 
 include/linux/gfp.h                               |    2 
 include/linux/highmem.h                           |    7 
 include/linux/huge_mm.h                           |    3 
 include/linux/hugetlb.h                           |   37 
 include/linux/memcontrol.h                        |   27 
 include/linux/memory.h                            |    8 
 include/linux/memory_hotplug.h                    |   15 
 include/linux/memremap.h                          |    2 
 include/linux/migrate.h                           |   11 
 include/linux/mm.h                                |   28 
 include/linux/mmzone.h                            |   20 
 include/linux/pagemap.h                           |    5 
 include/linux/pgtable.h                           |   12 
 include/linux/sched.h                             |    2 
 include/linux/sched/mm.h                          |   27 
 include/linux/shrinker.h                          |    7 
 include/linux/swap.h                              |   21 
 include/linux/userfaultfd_k.h                     |   55 +
 include/linux/vm_event_item.h                     |    8 
 include/trace/events/cma.h                        |   92 +-
 include/trace/events/migrate.h                    |   25 
 include/trace/events/mmflags.h                    |    7 
 include/uapi/linux/mempolicy.h                    |    7 
 include/uapi/linux/userfaultfd.h                  |   36 
 init/Kconfig                                      |    5 
 kernel/sysctl.c                                   |    2 
 lib/Kconfig.kfence                                |    1 
 lib/iov_iter.c                                    |    8 
 mm/Kconfig                                        |   28 
 mm/Makefile                                       |    6 
 mm/cma.c                                          |   70 +
 mm/cma.h                                          |   25 
 mm/cma_debug.c                                    |    8 
 mm/cma_sysfs.c                                    |  112 ++
 mm/compaction.c                                   |  113 ++
 mm/filemap.c                                      |   24 
 mm/frontswap.c                                    |   12 
 mm/gup.c                                          |  264 +++---
 mm/gup_test.c                                     |   29 
 mm/gup_test.h                                     |    3 
 mm/highmem.c                                      |   11 
 mm/huge_memory.c                                  |  326 +++++++-
 mm/hugetlb.c                                      |  843 ++++++++++++++--------
 mm/hugetlb_cgroup.c                               |    9 
 mm/internal.h                                     |   10 
 mm/kfence/core.c                                  |   61 +
 mm/khugepaged.c                                   |   63 -
 mm/ksm.c                                          |   17 
 mm/list_lru.c                                     |    6 
 mm/memcontrol.c                                   |  137 ---
 mm/memory_hotplug.c                               |  220 +++++
 mm/mempolicy.c                                    |   16 
 mm/mempool.c                                      |    2 
 mm/migrate.c                                      |  103 --
 mm/mlock.c                                        |    4 
 mm/mmap.c                                         |   18 
 mm/oom_kill.c                                     |    2 
 mm/page_alloc.c                                   |   83 +-
 mm/process_vm_access.c                            |    1 
 mm/shmem.c                                        |    2 
 mm/sparse.c                                       |    4 
 mm/swap.c                                         |   69 +
 mm/swap_state.c                                   |    4 
 mm/swapfile.c                                     |    4 
 mm/truncate.c                                     |   19 
 mm/userfaultfd.c                                  |   39 -
 mm/util.c                                         |   26 
 mm/vmalloc.c                                      |    2 
 mm/vmscan.c                                       |  543 +++++++++-----
 mm/vmstat.c                                       |   45 -
 mm/workingset.c                                   |    1 
 mm/zsmalloc.c                                     |    6 
 mm/zswap.c                                        |    2 
 tools/testing/selftests/vm/.gitignore             |    1 
 tools/testing/selftests/vm/Makefile               |    1 
 tools/testing/selftests/vm/gup_test.c             |   38 
 tools/testing/selftests/vm/split_huge_page_test.c |  400 ++++++++++
 tools/testing/selftests/vm/userfaultfd.c          |  164 ++++
 125 files changed, 3596 insertions(+), 1668 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-04-30  5:52 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-04-30  5:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


A few misc subsystems and some of MM.


178 patches, based on 8ca5297e7e38f2dc8c753d33a5092e7be181fff0.

Subsystems affected by this patch series:

  ia64
  kbuild
  scripts
  sh
  ocfs2
  kfifo
  vfs
  kernel/watchdog
  mm/slab-generic
  mm/slub
  mm/kmemleak
  mm/debug
  mm/pagecache
  mm/msync
  mm/gup
  mm/memremap
  mm/memcg
  mm/pagemap
  mm/mremap
  mm/dma
  mm/sparsemem
  mm/vmalloc
  mm/documentation
  mm/kasan
  mm/initialization
  mm/pagealloc
  mm/memory-failure

Subsystem: ia64

    Zhang Yunkai <zhang.yunkai@zte.com.cn>:
      arch/ia64/kernel/head.S: remove duplicate include

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      arch/ia64/kernel/fsys.S: fix typos
      arch/ia64/include/asm/pgtable.h: minor typo fixes

    Valentin Schneider <valentin.schneider@arm.com>:
      ia64: ensure proper NUMA distance and possible map initialization

    Sergei Trofimovich <slyfox@gentoo.org>:
      ia64: drop unused IA64_FW_EMU ifdef
      ia64: simplify code flow around swiotlb init

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      ia64: trivial spelling fixes

    Sergei Trofimovich <slyfox@gentoo.org>:
      ia64: fix EFI_DEBUG build
      ia64: mca: always make IA64_MCA_DEBUG an expression
      ia64: drop marked broken DISCONTIGMEM and VIRTUAL_MEM_MAP
      ia64: module: fix symbolizer crash on fdescr

Subsystem: kbuild

    Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
      include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()

Subsystem: scripts

    Tom Saeger <tom.saeger@oracle.com>:
      scripts/spelling.txt: add entries for recent discoveries

    Wan Jiabing <wanjiabing@vivo.com>:
      scripts: a new script for checking duplicate struct declaration

Subsystem: sh

    Zhang Yunkai <zhang.yunkai@zte.com.cn>:
      arch/sh/include/asm/tlb.h: remove duplicate include

Subsystem: ocfs2

    Yang Li <yang.lee@linux.alibaba.com>:
      ocfs2: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: map flags directly in flags_to_o2dlm()

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      ocfs2: fix a typo

    Jiapeng Chong <jiapeng.chong@linux.alibaba.com>:
      ocfs2/dlm: remove unused function

Subsystem: kfifo

    Dan Carpenter <dan.carpenter@oracle.com>:
      kfifo: fix ternary sign extension bugs

Subsystem: vfs

    Randy Dunlap <rdunlap@infradead.org>:
      vfs: fs_parser: clean up kernel-doc warnings

Subsystem: kernel/watchdog

    Petr Mladek <pmladek@suse.com>:
    Patch series "watchdog/softlockup: Report overall time and some cleanup", v2:
      watchdog: rename __touch_watchdog() to a better descriptive name
      watchdog: explicitly update timestamp when reporting softlockup
      watchdog/softlockup: report the overall time of softlockups
      watchdog/softlockup: remove logic that tried to prevent repeated reports
      watchdog: fix barriers when printing backtraces from all CPUs
      watchdog: cleanup handling of false positives

Subsystem: mm/slab-generic

    Rafael Aquini <aquini@redhat.com>:
      mm/slab_common: provide "slab_merge" option for !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT) builds

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: enable slub_debug static key when creating cache with explicit debug flags

    Oliver Glitta <glittao@gmail.com>:
      kunit: add a KUnit test for SLUB debugging functionality
      slub: remove resiliency_test() function

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      mm/slub.c: trivial typo fixes

Subsystem: mm/kmemleak

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      mm/kmemleak.c: fix a typo

Subsystem: mm/debug

    Georgi Djakov <georgi.djakov@linaro.org>:
      mm/page_owner: record the timestamp of all pages during free

    zhongjiang-ali <zhongjiang-ali@linux.alibaba.com>:
      mm, page_owner: remove unused parameter in __set_page_owner_handle

    Sergei Trofimovich <slyfox@gentoo.org>:
      mm: page_owner: fetch backtrace only for tracked pages
      mm: page_owner: use kstrtobool() to parse bool option
      mm: page_owner: detect page_owner recursion via task_struct
      mm: page_poison: print page info when corruption is caught

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/memtest: add ARCH_USE_MEMTEST

Subsystem: mm/pagecache

    Jens Axboe <axboe@kernel.dk>:
    Patch series "Improve IOCB_NOWAIT O_DIRECT reads", v3:
      mm: provide filemap_range_needs_writeback() helper
      mm: use filemap_range_needs_writeback() for O_DIRECT reads
      iomap: use filemap_range_needs_writeback() for O_DIRECT reads

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/filemap: use filemap_read_page in filemap_fault
      mm/filemap: drop check for truncated page after I/O

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: page-writeback: simplify memcg handling in test_clear_page_writeback()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: move page_mapping_file to pagemap.h

    Rui Sun <sunrui26@huawei.com>:
      mm/filemap: update stale comment

Subsystem: mm/msync

    Nikita Ermakov <sh1r4s3@mail.si-head.nl>:
      mm/msync: exit early when the flags is an MS_ASYNC and start < vm_start

Subsystem: mm/gup

    Joao Martins <joao.m.martins@oracle.com>:
    Patch series "mm/gup: page unpining improvements", v4:
      mm/gup: add compound page list iterator
      mm/gup: decrement head page once for group of subpages
      mm/gup: add a range variant of unpin_user_pages_dirty_lock()
      RDMA/umem: batch page unpin in __ib_umem_release()

    Yang Shi <shy828301@gmail.com>:
      mm: gup: remove FOLL_SPLIT

Subsystem: mm/memremap

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/memremap.c: fix improper SPDX comment style

Subsystem: mm/memcg

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: fix kernel stack account

    Shakeel Butt <shakeelb@google.com>:
      memcg: cleanup root memcg checks
      memcg: enable memcg oom-kill for __GFP_NOFAIL

    Johannes Weiner <hannes@cmpxchg.org>:
    Patch series "mm: memcontrol: switch to rstat", v3:
      mm: memcontrol: fix cpuhotplug statistics flushing
      mm: memcontrol: kill mem_cgroup_nodeinfo()
      mm: memcontrol: privatize memcg_page_state query functions
      cgroup: rstat: support cgroup1
      cgroup: rstat: punt root-level optimization to individual controllers
      mm: memcontrol: switch to rstat
      mm: memcontrol: consolidate lruvec stat flushing
      kselftests: cgroup: update kmem test for new vmstat implementation

    Shakeel Butt <shakeelb@google.com>:
      memcg: charge before adding to swapcache on swapin

    Muchun Song <songmuchun@bytedance.com>:
    Patch series "Use obj_cgroup APIs to charge kmem pages", v5:
      mm: memcontrol: slab: fix obtain a reference to a freeing memcg
      mm: memcontrol: introduce obj_cgroup_{un}charge_pages
      mm: memcontrol: directly access page->memcg_data in mm/page_alloc.c
      mm: memcontrol: change ug->dummy_page only if memcg changed
      mm: memcontrol: use obj_cgroup APIs to charge kmem pages
      mm: memcontrol: inline __memcg_kmem_{un}charge() into obj_cgroup_{un}charge_pages()
      mm: memcontrol: move PageMemcgKmem to the scope of CONFIG_MEMCG_KMEM

    Wan Jiabing <wanjiabing@vivo.com>:
      linux/memcontrol.h: remove duplicate struct declaration

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: page_counter: mitigate consequences of a page_counter underflow

Subsystem: mm/pagemap

    Wang Qing <wangqing@vivo.com>:
      mm/memory.c: do_numa_page(): delete bool "migrated"

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/interval_tree: add comments to improve code readability

    Oscar Salvador <osalvador@suse.de>:
    Patch series "Cleanup and fixups for vmemmap handling", v6:
      x86/vmemmap: drop handling of 4K unaligned vmemmap range
      x86/vmemmap: drop handling of 1GB vmemmap ranges
      x86/vmemmap: handle unpopulated sub-pmd ranges
      x86/vmemmap: optimize for consecutive sections in partial populated PMDs

    Ovidiu Panait <ovidiu.panait@windriver.com>:
      mm, tracing: improve rss_stat tracepoint message

    Christoph Hellwig <hch@lst.de>:
    Patch series "add remap_pfn_range_notrack instead of reinventing it in i915", v2:
      mm: add remap_pfn_range_notrack
      mm: add a io_mapping_map_user helper
      i915: use io_mapping_map_user
      i915: fix remap_io_sg to verify the pgprot

    Huang Ying <ying.huang@intel.com>:
      NUMA balancing: reduce TLB flush via delaying mapping on hint page fault

Subsystem: mm/mremap

    Brian Geffon <bgeffon@google.com>:
    Patch series "mm: Extend MREMAP_DONTUNMAP to non-anonymous mappings", v5:
      mm: extend MREMAP_DONTUNMAP to non-anonymous mappings
      Revert "mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio"
      selftests: add a MREMAP_DONTUNMAP selftest for shmem

Subsystem: mm/dma

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/dmapool: switch from strlcpy to strscpy

Subsystem: mm/sparsemem

    Wang Wensheng <wangwensheng4@huawei.com>:
      mm/sparse: add the missing sparse_buffer_fini() in error branch

Subsystem: mm/vmalloc

    Christoph Hellwig <hch@lst.de>:
    Patch series "remap_vmalloc_range cleanups":
      samples/vfio-mdev/mdpy: use remap_vmalloc_range
      mm: unexport remap_vmalloc_range_partial

    Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>:
      mm/vmalloc: use rb_tree instead of list for vread() lookups

    Nicholas Piggin <npiggin@gmail.com>:
    Patch series "huge vmalloc mappings", v13:
      ARM: mm: add missing pud_page define to 2-level page tables
      mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page
      mm: apply_to_pte_range warn and fail if a large pte is encountered
      mm/vmalloc: rename vmap_*_range vmap_pages_*_range
      mm/ioremap: rename ioremap_*_range to vmap_*_range
      mm: HUGE_VMAP arch support cleanup
      powerpc: inline huge vmap supported functions
      arm64: inline huge vmap supported functions
      x86: inline huge vmap supported functions
      mm/vmalloc: provide fallback arch huge vmap support functions
      mm: move vmap_range from mm/ioremap.c to mm/vmalloc.c
      mm/vmalloc: add vmap_range_noflush variant
      mm/vmalloc: hugepage vmalloc mappings
    Patch series "mm/vmalloc: cleanup after hugepage series", v2:
      mm/vmalloc: remove map_kernel_range
      kernel/dma: remove unnecessary unmap_kernel_range
      powerpc/xive: remove unnecessary unmap_kernel_range
      mm/vmalloc: remove unmap_kernel_range
      mm/vmalloc: improve allocation failure error messages

    Vijayanand Jitta <vjitta@codeaurora.org>:
      mm: vmalloc: prevent use after free in _vm_unmap_aliases

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      lib/test_vmalloc.c: remove two kvfree_rcu() tests
      lib/test_vmalloc.c: add a new 'nr_threads' parameter
      vm/test_vmalloc.sh: adapt for updated driver interface
      mm/vmalloc: refactor the preloading loagic
      mm/vmalloc: remove an empty line

Subsystem: mm/documentation

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/doc: fix fault_flag_allow_retry_first kerneldoc
      mm/doc: fix page_maybe_dma_pinned kerneldoc
      mm/doc: turn fault flags into an enum
      mm/doc: add mm.h and mm_types.h to the mm-api document

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
    Patch series "kernel-doc and MAINTAINERS clean-up":
      MAINTAINERS: assign pagewalk.h to MEMORY MANAGEMENT
      pagewalk: prefix struct kernel-doc descriptions

Subsystem: mm/kasan

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/kasan: switch from strlcpy to strscpy

    Peter Collingbourne <pcc@google.com>:
      kasan: fix kasan_byte_accessible() to be consistent with actual checks

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: initialize shadow to TAG_INVALID for SW_TAGS
      mm, kasan: don't poison boot memory with tag-based modes
    Patch series "kasan: integrate with init_on_alloc/free", v3:
      arm64: kasan: allow to init memory when setting tags
      kasan: init memory in kasan_(un)poison for HW_TAGS
      kasan, mm: integrate page_alloc init with HW_TAGS
      kasan, mm: integrate slab init_on_alloc with HW_TAGS
      kasan, mm: integrate slab init_on_free with HW_TAGS
      kasan: docs: clean up sections
      kasan: docs: update overview section
      kasan: docs: update usage section
      kasan: docs: update error reports section
      kasan: docs: update boot parameters section
      kasan: docs: update GENERIC implementation details section
      kasan: docs: update SW_TAGS implementation details section
      kasan: docs: update HW_TAGS implementation details section
      kasan: docs: update shadow memory section
      kasan: docs: update ignoring accesses section
      kasan: docs: update tests section

    Walter Wu <walter-zh.wu@mediatek.com>:
      kasan: record task_work_add() call stack

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: detect false-positives in tests

    Zqiang <qiang.zhang@windriver.com>:
      irq_work: record irq_work_queue() call stack

Subsystem: mm/initialization

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm: move mem_init_print_info() into mm_init()

Subsystem: mm/pagealloc

    David Hildenbrand <david@redhat.com>:
      mm/page_alloc: drop pr_info_ratelimited() in alloc_contig_range()

    Minchan Kim <minchan@kernel.org>:
      mm: remove lru_add_drain_all in alloc_contig_range

    Yu Zhao <yuzhao@google.com>:
      include/linux/page-flags-layout.h: correctly determine LAST_CPUPID_WIDTH
      include/linux/page-flags-layout.h: cleanups

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Rationalise __alloc_pages wrappers", v3:
      mm/page_alloc: rename alloc_mask to alloc_gfp
      mm/page_alloc: rename gfp_mask to gfp
      mm/page_alloc: combine __alloc_pages and __alloc_pages_nodemask
      mm/mempolicy: rename alloc_pages_current to alloc_pages
      mm/mempolicy: rewrite alloc_pages documentation
      mm/mempolicy: rewrite alloc_pages_vma documentation
      mm/mempolicy: fix mpol_misplaced kernel-doc

    Minchan Kim <minchan@kernel.org>:
      mm: page_alloc: dump migrate-failed pages

    Geert Uytterhoeven <geert@linux-m68k.org>:
      mm/Kconfig: remove default DISCONTIGMEM_MANUAL

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm, page_alloc: avoid page_to_pfn() in move_freepages()

    zhouchuangao <zhouchuangao@vivo.com>:
      mm/page_alloc: duplicate include linux/vmalloc.h

    Mel Gorman <mgorman@techsingularity.net>:
    Patch series "Introduce a bulk order-0 page allocator with two in-tree users", v6:
      mm/page_alloc: rename alloced to allocated
      mm/page_alloc: add a bulk page allocator
      mm/page_alloc: add an array-based interface to the bulk page allocator

    Jesper Dangaard Brouer <brouer@redhat.com>:
      mm/page_alloc: optimize code layout for __alloc_pages_bulk
      mm/page_alloc: inline __rmqueue_pcplist

    Chuck Lever <chuck.lever@oracle.com>:
    Patch series "SUNRPC consumer for the bulk page allocator":
      SUNRPC: set rq_page_end differently
      SUNRPC: refresh rq_pages using a bulk page allocator

    Jesper Dangaard Brouer <brouer@redhat.com>:
      net: page_pool: refactor dma_map into own function page_pool_dma_map
      net: page_pool: use alloc_pages_bulk in refill code path

    Sergei Trofimovich <slyfox@gentoo.org>:
      mm: page_alloc: ignore init_on_free=1 for debug_pagealloc=1

    huxiang <huxiang@uniontech.com>:
      mm/page_alloc: redundant definition variables of pfn in for loop

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/mmzone.h: fix existing kernel-doc comments and link them to core-api

Subsystem: mm/memory-failure

    Jane Chu <jane.chu@oracle.com>:
      mm/memory-failure: unnecessary amount of unmapping

 Documentation/admin-guide/kernel-parameters.txt |    7 
 Documentation/admin-guide/mm/transhuge.rst      |    2 
 Documentation/core-api/cachetlb.rst             |    4 
 Documentation/core-api/mm-api.rst               |    6 
 Documentation/dev-tools/kasan.rst               |  355 +++++-----
 Documentation/vm/page_owner.rst                 |    2 
 Documentation/vm/transhuge.rst                  |    5 
 MAINTAINERS                                     |    1 
 arch/Kconfig                                    |   11 
 arch/alpha/mm/init.c                            |    1 
 arch/arc/mm/init.c                              |    1 
 arch/arm/Kconfig                                |    1 
 arch/arm/include/asm/pgtable-3level.h           |    2 
 arch/arm/include/asm/pgtable.h                  |    3 
 arch/arm/mm/copypage-v4mc.c                     |    1 
 arch/arm/mm/copypage-v6.c                       |    1 
 arch/arm/mm/copypage-xscale.c                   |    1 
 arch/arm/mm/init.c                              |    2 
 arch/arm64/Kconfig                              |    1 
 arch/arm64/include/asm/memory.h                 |    4 
 arch/arm64/include/asm/mte-kasan.h              |   39 -
 arch/arm64/include/asm/vmalloc.h                |   38 -
 arch/arm64/mm/init.c                            |    4 
 arch/arm64/mm/mmu.c                             |   36 -
 arch/csky/abiv1/cacheflush.c                    |    1 
 arch/csky/mm/init.c                             |    1 
 arch/h8300/mm/init.c                            |    2 
 arch/hexagon/mm/init.c                          |    1 
 arch/ia64/Kconfig                               |   23 
 arch/ia64/configs/bigsur_defconfig              |    1 
 arch/ia64/include/asm/meminit.h                 |   11 
 arch/ia64/include/asm/module.h                  |    6 
 arch/ia64/include/asm/page.h                    |   25 
 arch/ia64/include/asm/pgtable.h                 |    7 
 arch/ia64/kernel/Makefile                       |    2 
 arch/ia64/kernel/acpi.c                         |    7 
 arch/ia64/kernel/efi.c                          |   11 
 arch/ia64/kernel/fsys.S                         |    4 
 arch/ia64/kernel/head.S                         |    6 
 arch/ia64/kernel/ia64_ksyms.c                   |   12 
 arch/ia64/kernel/machine_kexec.c                |    2 
 arch/ia64/kernel/mca.c                          |    4 
 arch/ia64/kernel/module.c                       |   29 
 arch/ia64/kernel/pal.S                          |    6 
 arch/ia64/mm/Makefile                           |    1 
 arch/ia64/mm/contig.c                           |    4 
 arch/ia64/mm/discontig.c                        |   21 
 arch/ia64/mm/fault.c                            |   15 
 arch/ia64/mm/init.c                             |  221 ------
 arch/m68k/mm/init.c                             |    1 
 arch/microblaze/mm/init.c                       |    1 
 arch/mips/Kconfig                               |    1 
 arch/mips/loongson64/numa.c                     |    1 
 arch/mips/mm/cache.c                            |    1 
 arch/mips/mm/init.c                             |    1 
 arch/mips/sgi-ip27/ip27-memory.c                |    1 
 arch/nds32/mm/init.c                            |    1 
 arch/nios2/mm/cacheflush.c                      |    1 
 arch/nios2/mm/init.c                            |    1 
 arch/openrisc/mm/init.c                         |    2 
 arch/parisc/mm/init.c                           |    2 
 arch/powerpc/Kconfig                            |    1 
 arch/powerpc/include/asm/vmalloc.h              |   34 -
 arch/powerpc/kernel/isa-bridge.c                |    4 
 arch/powerpc/kernel/pci_64.c                    |    2 
 arch/powerpc/mm/book3s64/radix_pgtable.c        |   29 
 arch/powerpc/mm/ioremap.c                       |    2 
 arch/powerpc/mm/mem.c                           |    1 
 arch/powerpc/sysdev/xive/common.c               |    4 
 arch/riscv/mm/init.c                            |    1 
 arch/s390/mm/init.c                             |    2 
 arch/sh/include/asm/tlb.h                       |   10 
 arch/sh/mm/cache-sh4.c                          |    1 
 arch/sh/mm/cache-sh7705.c                       |    1 
 arch/sh/mm/init.c                               |    1 
 arch/sparc/include/asm/pgtable_32.h             |    3 
 arch/sparc/mm/init_32.c                         |    2 
 arch/sparc/mm/init_64.c                         |    1 
 arch/sparc/mm/tlb.c                             |    1 
 arch/um/kernel/mem.c                            |    1 
 arch/x86/Kconfig                                |    1 
 arch/x86/include/asm/vmalloc.h                  |   42 -
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c       |    2 
 arch/x86/mm/init_32.c                           |    2 
 arch/x86/mm/init_64.c                           |  222 ++++--
 arch/x86/mm/ioremap.c                           |   33 
 arch/x86/mm/pgtable.c                           |   13 
 arch/xtensa/Kconfig                             |    1 
 arch/xtensa/mm/init.c                           |    1 
 block/blk-cgroup.c                              |   17 
 drivers/gpu/drm/i915/Kconfig                    |    1 
 drivers/gpu/drm/i915/gem/i915_gem_mman.c        |    9 
 drivers/gpu/drm/i915/i915_drv.h                 |    3 
 drivers/gpu/drm/i915/i915_mm.c                  |  117 ---
 drivers/infiniband/core/umem.c                  |   12 
 drivers/pci/pci.c                               |    2 
 fs/aio.c                                        |    5 
 fs/fs_parser.c                                  |    2 
 fs/iomap/direct-io.c                            |   24 
 fs/ocfs2/blockcheck.c                           |    2 
 fs/ocfs2/dlm/dlmrecovery.c                      |    7 
 fs/ocfs2/stack_o2cb.c                           |   36 -
 fs/ocfs2/stackglue.c                            |    2 
 include/linux/compiler-gcc.h                    |    8 
 include/linux/fs.h                              |    2 
 include/linux/gfp.h                             |   45 -
 include/linux/io-mapping.h                      |    3 
 include/linux/io.h                              |    9 
 include/linux/kasan.h                           |   51 +
 include/linux/memcontrol.h                      |  271 ++++----
 include/linux/mm.h                              |   50 -
 include/linux/mmzone.h                          |   43 -
 include/linux/page-flags-layout.h               |   64 -
 include/linux/pagemap.h                         |   10 
 include/linux/pagewalk.h                        |    4 
 include/linux/sched.h                           |    4 
 include/linux/slab.h                            |    2 
 include/linux/slub_def.h                        |    2 
 include/linux/vmalloc.h                         |   73 +-
 include/linux/vmstat.h                          |   24 
 include/net/page_pool.h                         |    2 
 include/trace/events/kmem.h                     |   24 
 init/main.c                                     |    2 
 kernel/cgroup/cgroup.c                          |   34 -
 kernel/cgroup/rstat.c                           |   61 +
 kernel/dma/remap.c                              |    1 
 kernel/fork.c                                   |   13 
 kernel/irq_work.c                               |    7 
 kernel/task_work.c                              |    3 
 kernel/watchdog.c                               |  102 +--
 lib/Kconfig.debug                               |   14 
 lib/Makefile                                    |    1 
 lib/test_kasan.c                                |   59 -
 lib/test_slub.c                                 |  124 +++
 lib/test_vmalloc.c                              |  128 +--
 mm/Kconfig                                      |    4 
 mm/Makefile                                     |    1 
 mm/debug_vm_pgtable.c                           |    4 
 mm/dmapool.c                                    |    2 
 mm/filemap.c                                    |   61 +
 mm/gup.c                                        |  145 +++-
 mm/hugetlb.c                                    |    2 
 mm/internal.h                                   |   25 
 mm/interval_tree.c                              |    2 
 mm/io-mapping.c                                 |   29 
 mm/ioremap.c                                    |  361 ++--------
 mm/kasan/common.c                               |   53 -
 mm/kasan/generic.c                              |   12 
 mm/kasan/kasan.h                                |   28 
 mm/kasan/report_generic.c                       |    2 
 mm/kasan/shadow.c                               |   10 
 mm/kasan/sw_tags.c                              |   12 
 mm/kmemleak.c                                   |    2 
 mm/memcontrol.c                                 |  798 ++++++++++++------------
 mm/memory-failure.c                             |    2 
 mm/memory.c                                     |  191 +++--
 mm/mempolicy.c                                  |   78 --
 mm/mempool.c                                    |    4 
 mm/memremap.c                                   |    2 
 mm/migrate.c                                    |    2 
 mm/mm_init.c                                    |    4 
 mm/mmap.c                                       |    6 
 mm/mremap.c                                     |    6 
 mm/msync.c                                      |    6 
 mm/page-writeback.c                             |    9 
 mm/page_alloc.c                                 |  430 +++++++++---
 mm/page_counter.c                               |    8 
 mm/page_owner.c                                 |   68 --
 mm/page_poison.c                                |    6 
 mm/percpu-vm.c                                  |    7 
 mm/slab.c                                       |   43 -
 mm/slab.h                                       |   24 
 mm/slab_common.c                                |   10 
 mm/slub.c                                       |  215 ++----
 mm/sparse.c                                     |    1 
 mm/swap_state.c                                 |   13 
 mm/util.c                                       |   10 
 mm/vmalloc.c                                    |  728 ++++++++++++++++-----
 net/core/page_pool.c                            |  127 ++-
 net/sunrpc/svc_xprt.c                           |   38 -
 samples/kfifo/bytestream-example.c              |    8 
 samples/kfifo/inttype-example.c                 |    8 
 samples/kfifo/record-example.c                  |    8 
 samples/vfio-mdev/mdpy.c                        |    4 
 scripts/checkdeclares.pl                        |   53 +
 scripts/spelling.txt                            |   26 
 tools/testing/selftests/cgroup/test_kmem.c      |   22 
 tools/testing/selftests/vm/mremap_dontunmap.c   |   52 +
 tools/testing/selftests/vm/test_vmalloc.sh      |   21 
 189 files changed, 3642 insertions(+), 3013 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-04-23 21:28 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-04-23 21:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


5 patches, based on 5bfc75d92efd494db37f5c4c173d3639d4772966.

Subsystems affected by this patch series:

  coda
  overlayfs
  mm/pagecache
  mm/memcg

Subsystem: coda

    Christian König <christian.koenig@amd.com>:
      coda: fix reference counting in coda_file_mmap error path

Subsystem: overlayfs

    Christian König <christian.koenig@amd.com>:
      ovl: fix reference counting in ovl_mmap error path

Subsystem: mm/pagecache

    Hugh Dickins <hughd@google.com>:
      mm/filemap: fix find_lock_entries hang on 32-bit THP
      mm/filemap: fix mapping_seek_hole_data on THP & 32-bit

Subsystem: mm/memcg

    Vasily Averin <vvs@virtuozzo.com>:
      tools/cgroup/slabinfo.py: updated to work on current kernel

 fs/coda/file.c                 |    6 +++---
 fs/overlayfs/file.c            |   11 +----------
 mm/filemap.c                   |   31 +++++++++++++++++++------------
 tools/cgroup/memcg_slabinfo.py |    8 ++++----
 4 files changed, 27 insertions(+), 29 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-04-16 22:45 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-04-16 22:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

12 patches, based on 06c2aac4014c38247256fe49c61b7f55890271e7.

Subsystems affected by this patch series:

  mm/documentation
  mm/kasan
  csky
  ia64
  mm/pagemap
  gcov
  lib

Subsystem: mm/documentation

    Randy Dunlap <rdunlap@infradead.org>:
      mm: eliminate "expecting prototype" kernel-doc warnings

Subsystem: mm/kasan

    Arnd Bergmann <arnd@arndb.de>:
      kasan: fix hwasan build for gcc

    Walter Wu <walter-zh.wu@mediatek.com>:
      kasan: remove redundant config option

Subsystem: csky

    Randy Dunlap <rdunlap@infradead.org>:
      csky: change a Kconfig symbol name to fix e1000 build error

Subsystem: ia64

    Randy Dunlap <rdunlap@infradead.org>:
      ia64: remove duplicate entries in generic_defconfig
      ia64: fix discontig.c section mismatches

    John Paul Adrian Glaubitz <glaubitz () physik ! fu-berlin ! de>:
      ia64: tools: remove inclusion of ia64-specific version of errno.h header

    John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>:
      ia64: tools: remove duplicate definition of ia64_mf() on ia64

Subsystem: mm/pagemap

    Zack Rusin <zackr@vmware.com>:
      mm/mapping_dirty_helpers: guard hugepage pud's usage

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm: ptdump: fix build failure

Subsystem: gcov

    Johannes Berg <johannes.berg@intel.com>:
      gcov: clang: fix clang-11+ build

Subsystem: lib

    Randy Dunlap <rdunlap@infradead.org>:
      lib: remove "expecting prototype" kernel-doc warnings

 arch/arm64/kernel/sleep.S             |    2 +-
 arch/csky/Kconfig                     |    2 +-
 arch/csky/include/asm/page.h          |    2 +-
 arch/ia64/configs/generic_defconfig   |    2 --
 arch/ia64/mm/discontig.c              |    6 +++---
 arch/x86/kernel/acpi/wakeup_64.S      |    2 +-
 include/linux/kasan.h                 |    2 +-
 kernel/gcov/clang.c                   |    2 +-
 lib/Kconfig.kasan                     |    9 ++-------
 lib/earlycpio.c                       |    4 ++--
 lib/lru_cache.c                       |    3 ++-
 lib/parman.c                          |    4 ++--
 lib/radix-tree.c                      |   11 ++++++-----
 mm/kasan/common.c                     |    2 +-
 mm/kasan/kasan.h                      |    2 +-
 mm/kasan/report_generic.c             |    2 +-
 mm/mapping_dirty_helpers.c            |    2 ++
 mm/mmu_gather.c                       |   29 +++++++++++++++++++----------
 mm/oom_kill.c                         |    2 +-
 mm/ptdump.c                           |    2 +-
 mm/shuffle.c                          |    4 ++--
 scripts/Makefile.kasan                |   22 ++++++++++++++--------
 security/Kconfig.hardening            |    4 ++--
 tools/arch/ia64/include/asm/barrier.h |    3 ---
 tools/include/uapi/asm/errno.h        |    2 --
 25 files changed, 67 insertions(+), 60 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-04-09 20:26 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-04-09 20:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

16 patches, based on 17e7124aad766b3f158943acb51467f86220afe9.

Subsystems affected by this patch series:

  MAINTAINERS
  mailmap
  mm/kasan
  mm/gup
  nds32
  gcov
  ocfs2
  ia64
  mm/pagecache
  mm/kasan
  mm/kfence
  lib

Subsystem: MAINTAINERS

    Marek Behún <kabel@kernel.org>:
      MAINTAINERS: update CZ.NIC's Turris information
      treewide: change my e-mail address, fix my name

Subsystem: mailmap

    Jordan Crouse <jordan@cosmicpenguin.net>:
      mailmap: update email address for Jordan Crouse

    Matthew Wilcox <willy@infradead.org>:
      .mailmap: fix old email addresses

Subsystem: mm/kasan

    Arnd Bergmann <arnd@arndb.de>:
      kasan: fix hwasan build for gcc

    Walter Wu <walter-zh.wu@mediatek.com>:
      kasan: remove redundant config option

Subsystem: mm/gup

    Aili Yao <yaoaili@kingsoft.com>:
      mm/gup: check page posion status for coredump.

Subsystem: nds32

    Mike Rapoport <rppt@linux.ibm.com>:
      nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff

Subsystem: gcov

    Nick Desaulniers <ndesaulniers@google.com>:
      gcov: re-fix clang-11+ support

Subsystem: ocfs2

    Wengang Wang <wen.gang.wang@oracle.com>:
      ocfs2: fix deadlock between setattr and dio_end_io_write

Subsystem: ia64

    Sergei Trofimovich <slyfox@gentoo.org>:
      ia64: fix user_stack_pointer() for ptrace()

Subsystem: mm/pagecache

    Jack Qiu <jack.qiu@huawei.com>:
      fs: direct-io: fix missing sdio->boundary

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix conflict with page poisoning

    Andrew Morton <akpm@linux-foundation.org>:
      lib/test_kasan_module.c: suppress unused var warning

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence, x86: fix preemptible warning on KPTI-enabled systems

Subsystem: lib

    Julian Braha <julianbraha@gmail.com>:
      lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS

 .mailmap                                                            |    7 ++
 Documentation/ABI/testing/debugfs-moxtet                            |    4 -
 Documentation/ABI/testing/debugfs-turris-mox-rwtm                   |    2 
 Documentation/ABI/testing/sysfs-bus-moxtet-devices                  |    6 +-
 Documentation/ABI/testing/sysfs-class-led-driver-turris-omnia       |    2 
 Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm            |   10 +--
 Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml |    2 
 MAINTAINERS                                                         |   13 +++-
 arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts              |    2 
 arch/arm64/kernel/sleep.S                                           |    2 
 arch/ia64/include/asm/ptrace.h                                      |    8 --
 arch/nds32/mm/cacheflush.c                                          |    2 
 arch/x86/include/asm/kfence.h                                       |    7 ++
 arch/x86/kernel/acpi/wakeup_64.S                                    |    2 
 drivers/bus/moxtet.c                                                |    4 -
 drivers/firmware/turris-mox-rwtm.c                                  |    4 -
 drivers/gpio/gpio-moxtet.c                                          |    4 -
 drivers/leds/leds-turris-omnia.c                                    |    4 -
 drivers/mailbox/armada-37xx-rwtm-mailbox.c                          |    4 -
 drivers/watchdog/armada_37xx_wdt.c                                  |    4 -
 fs/direct-io.c                                                      |    5 +
 fs/ocfs2/aops.c                                                     |   11 ---
 fs/ocfs2/file.c                                                     |    8 ++
 include/dt-bindings/bus/moxtet.h                                    |    2 
 include/linux/armada-37xx-rwtm-mailbox.h                            |    2 
 include/linux/kasan.h                                               |    2 
 include/linux/moxtet.h                                              |    2 
 kernel/gcov/clang.c                                                 |   29 ++++++----
 lib/Kconfig.debug                                                   |    6 +-
 lib/Kconfig.kasan                                                   |    9 ---
 lib/test_kasan_module.c                                             |    2 
 mm/gup.c                                                            |    4 +
 mm/internal.h                                                       |   20 ++++++
 mm/kasan/common.c                                                   |    2 
 mm/kasan/kasan.h                                                    |    2 
 mm/kasan/report_generic.c                                           |    2 
 mm/page_poison.c                                                    |    4 +
 scripts/Makefile.kasan                                              |   18 ++++--
 security/Kconfig.hardening                                          |    4 -
 39 files changed, 136 insertions(+), 91 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-03-25  4:36 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-03-25  4:36 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


14 patches, based on 7acac4b3196caee5e21fb5ea53f8bc124e6a16fc.

Subsystems affected by this patch series:

  mm/hugetlb
  mm/kasan
  mm/gup
  mm/selftests
  mm/z3fold
  squashfs
  ia64
  gcov
  mm/kfence
  mm/memblock
  mm/highmem
  mailmap

Subsystem: mm/hugetlb

    Miaohe Lin <linmiaohe@huawei.com>:
      hugetlb_cgroup: fix imbalanced css_get and css_put pair for shared mappings

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix per-page tags for non-page_alloc pages

Subsystem: mm/gup

    Sean Christopherson <seanjc@google.com>:
      mm/mmu_notifiers: ensure range_end() is paired with range_start()

Subsystem: mm/selftests

    Rong Chen <rong.a.chen@intel.com>:
      selftests/vm: fix out-of-tree build

Subsystem: mm/z3fold

    Thomas Hebb <tommyhebb@gmail.com>:
      z3fold: prevent reclaim/free race for headless pages

Subsystem: squashfs

    Sean Nyekjaer <sean@geanix.com>:
      squashfs: fix inode lookup sanity checks

    Phillip Lougher <phillip@squashfs.org.uk>:
      squashfs: fix xattr id and id lookup sanity checks

Subsystem: ia64

    Sergei Trofimovich <slyfox@gentoo.org>:
      ia64: mca: allocate early mca with GFP_ATOMIC
      ia64: fix format strings for err_inject

Subsystem: gcov

    Nick Desaulniers <ndesaulniers@google.com>:
      gcov: fix clang-11+ support

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: make compatible with kmemleak

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
      mm: memblock: fix section mismatch warning again

Subsystem: mm/highmem

    Ira Weiny <ira.weiny@intel.com>:
      mm/highmem: fix CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP

Subsystem: mailmap

    Andrey Konovalov <andreyknvl@google.com>:
      mailmap: update Andrey Konovalov's email address

 .mailmap                            |    1 
 arch/ia64/kernel/err_inject.c       |   22 +++++------
 arch/ia64/kernel/mca.c              |    2 -
 fs/squashfs/export.c                |    8 +++-
 fs/squashfs/id.c                    |    6 ++-
 fs/squashfs/squashfs_fs.h           |    1 
 fs/squashfs/xattr_id.c              |    6 ++-
 include/linux/hugetlb_cgroup.h      |   15 ++++++-
 include/linux/memblock.h            |    4 +-
 include/linux/mm.h                  |   18 +++++++--
 include/linux/mmu_notifier.h        |   10 ++---
 kernel/gcov/clang.c                 |   69 ++++++++++++++++++++++++++++++++++++
 mm/highmem.c                        |    4 +-
 mm/hugetlb.c                        |   41 +++++++++++++++++++--
 mm/hugetlb_cgroup.c                 |   10 ++++-
 mm/kfence/core.c                    |    9 ++++
 mm/kmemleak.c                       |    3 +
 mm/mmu_notifier.c                   |   23 ++++++++++++
 mm/z3fold.c                         |   16 +++++++-
 tools/testing/selftests/vm/Makefile |    4 +-
 20 files changed, 230 insertions(+), 42 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-03-13  5:06 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-03-13  5:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


29 patches, based on f78d76e72a4671ea52d12752d92077788b4f5d50.

Subsystems affected by this patch series:

  mm/memblock
  core-kernel
  kconfig
  mm/pagealloc
  fork
  mm/hugetlb
  mm/highmem
  binfmt
  MAINTAINERS
  kbuild
  mm/kfence
  mm/oom-kill
  mm/madvise
  mm/kasan
  mm/userfaultfd
  mm/memory-failure
  ia64
  mm/memcg
  mm/zram

Subsystem: mm/memblock

    Arnd Bergmann <arnd@arndb.de>:
      memblock: fix section mismatch warning

Subsystem: core-kernel

    Arnd Bergmann <arnd@arndb.de>:
      stop_machine: mark helpers __always_inline

Subsystem: kconfig

    Masahiro Yamada <masahiroy@kernel.org>:
      init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM

Subsystem: mm/pagealloc

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

Subsystem: fork

    Fenghua Yu <fenghua.yu@intel.com>:
      mm/fork: clear PASID for new mm

Subsystem: mm/hugetlb

    Peter Xu <peterx@redhat.com>:
    Patch series "mm/hugetlb: Early cow on fork, and a few cleanups", v5:
      hugetlb: dedup the code to add a new file_region
      hugetlb: break earlier in add_reservation_in_range() when we can
      mm: introduce page_needs_cow_for_dma() for deciding whether cow
      mm: use is_cow_mapping() across tree where proper
      hugetlb: do early cow when page pinned on src mm

Subsystem: mm/highmem

    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
      mm/highmem.c: fix zero_user_segments() with start > end

Subsystem: binfmt

    Lior Ribak <liorribak@gmail.com>:
      binfmt_misc: fix possible deadlock in bm_register_write

Subsystem: MAINTAINERS

    Vlastimil Babka <vbabka@suse.cz>:
      MAINTAINERS: exclude uapi directories in API/ABI section

Subsystem: kbuild

    Arnd Bergmann <arnd@arndb.de>:
      linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP*

Subsystem: mm/kfence

    Marco Elver <elver@google.com>:
      kfence: fix printk format for ptrdiff_t
      kfence, slab: fix cache_alloc_debugcheck_after() for bulk allocations
      kfence: fix reports if constant function prefixes exist

Subsystem: mm/oom-kill

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      include/linux/sched/mm.h: use rcu_dereference in in_vfork()

Subsystem: mm/madvise

    Suren Baghdasaryan <surenb@google.com>:
      mm/madvise: replace ptrace attach requirement for process_madvise

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC
      kasan: fix KASAN_STACK dependency for HW_TAGS

Subsystem: mm/userfaultfd

    Nadav Amit <namit@vmware.com>:
      mm/userfaultfd: fix memory corruption due to writeprotect

Subsystem: mm/memory-failure

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm, hwpoison: do not lock page again when me_huge_page() successfully recovers

Subsystem: ia64

    Sergei Trofimovich <slyfox@gentoo.org>:
      ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls
      ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign

Subsystem: mm/memcg

    Zhou Guanghui <zhouguanghui1@huawei.com>:
      mm/memcg: rename mem_cgroup_split_huge_fixup to split_page_memcg and add nr_pages argument
      mm/memcg: set memcg when splitting page

Subsystem: mm/zram

    Minchan Kim <minchan@kernel.org>:
      zram: fix return value on writeback_store
      zram: fix broken page writeback

 MAINTAINERS                                |    4 
 arch/ia64/include/asm/syscall.h            |    2 
 arch/ia64/kernel/ptrace.c                  |   24 +++-
 drivers/block/zram/zram_drv.c              |   17 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c   |    2 
 fs/binfmt_misc.c                           |   29 ++---
 fs/proc/task_mmu.c                         |    2 
 include/linux/compiler-clang.h             |    6 +
 include/linux/memblock.h                   |    4 
 include/linux/memcontrol.h                 |    6 -
 include/linux/mm.h                         |   21 +++
 include/linux/mm_types.h                   |    1 
 include/linux/sched/mm.h                   |    3 
 include/linux/stop_machine.h               |   11 +
 init/Kconfig                               |    3 
 kernel/fork.c                              |    8 +
 lib/Kconfig.kasan                          |    1 
 mm/highmem.c                               |   17 ++
 mm/huge_memory.c                           |   10 -
 mm/hugetlb.c                               |  123 +++++++++++++++------
 mm/internal.h                              |    5 
 mm/kfence/report.c                         |   30 +++--
 mm/madvise.c                               |   13 ++
 mm/memcontrol.c                            |   15 +-
 mm/memory-failure.c                        |    4 
 mm/memory.c                                |   16 +-
 mm/page_alloc.c                            |  167 ++++++++++++++---------------
 mm/slab.c                                  |    2 
 29 files changed, 334 insertions(+), 216 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-26 17:55 ` incoming Linus Torvalds
@ 2021-02-26 19:16   ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-02-26 19:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, Linux-MM

On Fri, 26 Feb 2021 09:55:27 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Thu, Feb 25, 2021 at 5:14 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > - The rest of MM.
> >
> >   Includes kfence - another runtime memory validator.  Not as
> >   thorough as KASAN, but it has unmeasurable overhead and is intended
> >   to be usable in production builds.
> >
> > - Everything else
> 
> Just to clarify: you have nothing else really pending?

Yes, that's it from me for -rc1.




^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-26  1:14 incoming Andrew Morton
@ 2021-02-26 17:55 ` Linus Torvalds
  2021-02-26 19:16   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2021-02-26 17:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Thu, Feb 25, 2021 at 5:14 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> - The rest of MM.
>
>   Includes kfence - another runtime memory validator.  Not as
>   thorough as KASAN, but it has unmeasurable overhead and is intended
>   to be usable in production builds.
>
> - Everything else

Just to clarify: you have nothing else really pending?

I'm hoping to just do -rc1 this weekend after all - despite my late
start due to loss of power for several days.

I'll allow late stragglers with good reason through, but the fewer of
those there are, the better, of course.

Thanks,
                   Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-02-26  1:14 Andrew Morton
  2021-02-26 17:55 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-02-26  1:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- The rest of MM.

  Includes kfence - another runtime memory validator.  Not as
  thorough as KASAN, but it has unmeasurable overhead and is intended
  to be usable in production builds.

- Everything else


118 patches, based on 6fbd6cf85a3be127454a1ad58525a3adcf8612ab.

Subsystems affected by this patch series:

  mm/thp
  mm/cma
  mm/vmstat
  mm/memory-hotplug
  mm/mlock
  mm/rmap
  mm/zswap
  mm/zsmalloc
  mm/cleanups
  mm/kfence
  mm/kasan2
  alpha
  procfs
  sysctl
  misc
  core-kernel
  MAINTAINERS
  lib
  bitops
  checkpatch
  init
  coredump
  seq_file
  gdb
  ubsan
  initramfs
  mm/pagemap2

Subsystem: mm/thp

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Overhaul multi-page lookups for THP", v4:
      mm: make pagecache tagged lookups return only head pages
      mm/shmem: use pagevec_lookup in shmem_unlock_mapping
      mm/swap: optimise get_shadow_from_swap_cache
      mm: add FGP_ENTRY
      mm/filemap: rename find_get_entry to mapping_get_entry
      mm/filemap: add helper for finding pages
      mm/filemap: add mapping_seek_hole_data
      iomap: use mapping_seek_hole_data
      mm: add and use find_lock_entries
      mm: add an 'end' parameter to find_get_entries
      mm: add an 'end' parameter to pagevec_lookup_entries
      mm: remove nr_entries parameter from pagevec_lookup_entries
      mm: pass pvec directly to find_get_entries
      mm: remove pagevec_lookup_entries

    Rik van Riel <riel@surriel.com>:
    Patch series "mm,thp,shm: limit shmem THP alloc gfp_mask", v6:
      mm,thp,shmem: limit shmem THP alloc gfp_mask
      mm,thp,shm: limit gfp mask to no more than specified
      mm,thp,shmem: make khugepaged obey tmpfs mount flags
      mm,shmem,thp: limit shmem THP allocations to requested zones

Subsystem: mm/cma

    Roman Gushchin <guro@fb.com>:
      mm: cma: allocate cma areas bottom-up

    David Hildenbrand <david@redhat.com>:
      mm/cma: expose all pages to the buddy if activation of an area fails
      mm/page_alloc: count CMA pages per zone and print them in /proc/zoneinfo

    Patrick Daly <pdaly@codeaurora.org>:
      mm: cma: print region name on failure

Subsystem: mm/vmstat

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: vmstat: fix NOHZ wakeups for node stat changes
      mm: vmstat: add some comments on internal storage of byte items

    Jiang Biao <benbjiang@tencent.com>:
      mm/vmstat.c: erase latency in vmstat_shepherd

Subsystem: mm/memory-hotplug

    Dan Williams <dan.j.williams@intel.com>:
    Patch series "mm: Fix pfn_to_online_page() with respect to ZONE_DEVICE", v4:
      mm: move pfn_to_online_page() out of line
      mm: teach pfn_to_online_page() to consider subsection validity
      mm: teach pfn_to_online_page() about ZONE_DEVICE section collisions
      mm: fix memory_failure() handling of dax-namespace metadata

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/memory_hotplug: rename all existing 'memhp' into 'mhp'

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: MEMHP_MERGE_RESOURCE -> MHP_MERGE_RESOURCE

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/memory_hotplug: use helper function zone_end_pfn() to get end_pfn

    David Hildenbrand <david@redhat.com>:
      drivers/base/memory: don't store phys_device in memory blocks
      Documentation: sysfs/memory: clarify some memory block device properties

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/memory_hotplug: Pre-validate the address range with platform", v5:
      mm/memory_hotplug: prevalidate the address range being added with platform
      arm64/mm: define arch_get_mappable_range()
      s390/mm: define arch_get_mappable_range()

    David Hildenbrand <david@redhat.com>:
      virtio-mem: check against mhp_get_pluggable_range() which memory we can hotplug

Subsystem: mm/mlock

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mlock: stop counting mlocked pages when none vma is found

Subsystem: mm/rmap

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/rmap: correct some obsolete comments of anon_vma
      mm/rmap: remove unneeded semicolon in page_not_mapped()
      mm/rmap: fix obsolete comment in __page_check_anon_rmap()
      mm/rmap: use page_not_mapped in try_to_unmap()
      mm/rmap: correct obsolete comment of page_get_anon_vma()
      mm/rmap: fix potential pte_unmap on an not mapped pte

Subsystem: mm/zswap

    Randy Dunlap <rdunlap@infradead.org>:
      mm: zswap: clean up confusing comment

    Tian Tao <tiantao6@hisilicon.com>:
    Patch series "Fix the compatibility of zsmalloc and zswap":
      mm/zswap: add the flag can_sleep_mapped
      mm: set the sleep_mapped to true for zbud and z3fold

Subsystem: mm/zsmalloc

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/zsmalloc.c: convert to use kmem_cache_zalloc in cache_alloc_zspage()

    Rokudo Yan <wu-yan@tcl.com>:
      zsmalloc: account the number of compacted pages correctly

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/zsmalloc.c: use page_private() to access page->private

Subsystem: mm/cleanups

    Guo Ren <guoren@linux.alibaba.com>:
      mm: page-flags.h: Typo fix (It -> If)

    Daniel Vetter <daniel.vetter@ffwll.ch>:
      mm/dmapool: use might_alloc()
      mm/backing-dev.c: use might_alloc()

    Stephen Zhang <stephenzhangzsd@gmail.com>:
      mm/early_ioremap.c: use __func__ instead of function name

Subsystem: mm/kfence

    Alexander Potapenko <glider@google.com>:
    Patch series "KFENCE: A low-overhead sampling-based memory safety error detector", v7:
      mm: add Kernel Electric-Fence infrastructure
      x86, kfence: enable KFENCE for x86

    Marco Elver <elver@google.com>:
      arm64, kfence: enable KFENCE for ARM64
      kfence: use pt_regs to generate stack trace on faults

    Alexander Potapenko <glider@google.com>:
      mm, kfence: insert KFENCE hooks for SLAB
      mm, kfence: insert KFENCE hooks for SLUB
      kfence, kasan: make KFENCE compatible with KASAN

    Marco Elver <elver@google.com>:
      kfence, Documentation: add KFENCE documentation
      kfence: add test suite
      MAINTAINERS: add entry for KFENCE
      kfence: report sensitive information based on no_hash_pointers

    Alexander Potapenko <glider@google.com>:
    Patch series "Add error_report_end tracepoint to KFENCE and KASAN", v3:
      tracing: add error_report_end trace point
      kfence: use error_report_end tracepoint
      kasan: use error_report_end tracepoint

Subsystem: mm/kasan2

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: optimizations and fixes for HW_TAGS", v4:
      kasan, mm: don't save alloc stacks twice
      kasan, mm: optimize kmalloc poisoning
      kasan: optimize large kmalloc poisoning
      kasan: clean up setting free info in kasan_slab_free
      kasan: unify large kfree checks
      kasan: rework krealloc tests
      kasan, mm: fail krealloc on freed objects
      kasan, mm: optimize krealloc poisoning
      kasan: ensure poisoning size alignment
      arm64: kasan: simplify and inline MTE functions
      kasan: inline HW_TAGS helper functions
      kasan: clarify that only first bug is reported in HW_TAGS

Subsystem: alpha

    Randy Dunlap <rdunlap@infradead.org>:
      alpha: remove CONFIG_EXPERIMENTAL from defconfigs

Subsystem: procfs

    Helge Deller <deller@gmx.de>:
      proc/wchan: use printk format instead of lookup_symbol_name()

    Josef Bacik <josef@toxicpanda.com>:
      proc: use kvzalloc for our kernel buffer

Subsystem: sysctl

    Lin Feng <linf@wangsu.com>:
      sysctl.c: fix underflow value setting risk in vm_table

Subsystem: misc

    Randy Dunlap <rdunlap@infradead.org>:
      include/linux: remove repeated words

    Miguel Ojeda <ojeda@kernel.org>:
      treewide: Miguel has moved

Subsystem: core-kernel

    Hubert Jasudowicz <hubert.jasudowicz@gmail.com>:
      groups: use flexible-array member in struct group_info
      groups: simplify struct group_info allocation

    Randy Dunlap <rdunlap@infradead.org>:
      kernel: delete repeated words in comments

Subsystem: MAINTAINERS

    Vlastimil Babka <vbabka@suse.cz>:
      MAINTAINERS: add uapi directories to API/ABI section

Subsystem: lib

    Huang Shijie <sjhuang@iluvatar.ai>:
      lib/genalloc.c: change return type to unsigned long for bitmap_set_ll

    Francis Laniel <laniel_francis@privacyrequired.com>:
      string.h: move fortified functions definitions in a dedicated header.

    Yogesh Lal <ylal@codeaurora.org>:
      lib: stackdepot: add support to configure STACK_HASH_SIZE

    Vijayanand Jitta <vjitta@codeaurora.org>:
      lib: stackdepot: add support to disable stack depot
      lib: stackdepot: fix ignoring return value warning

    Masahiro Yamada <masahiroy@kernel.org>:
      lib/cmdline: remove an unneeded local variable in next_arg()

Subsystem: bitops

    Geert Uytterhoeven <geert+renesas@glider.be>:
      include/linux/bitops.h: spelling s/synomyn/synonym/

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: improve blank line after declaration test

    Peng Wang <rocking@linux.alibaba.com>:
      checkpatch: ignore warning designated initializers using NR_CPUS

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: trivial style fixes

    Joe Perches <joe@perches.com>:
      checkpatch: prefer ftrace over function entry/exit printks
      checkpatch: improve TYPECAST_INT_CONSTANT test message

    Aditya Srivastava <yashsri421@gmail.com>:
      checkpatch: add warning for avoiding .L prefix symbols in assembly files

    Joe Perches <joe@perches.com>:
      checkpatch: add kmalloc_array_node to unnecessary OOM message check

    Chris Down <chris@chrisdown.name>:
      checkpatch: don't warn about colon termination in linker scripts

    Song Liu <songliubraving@fb.com>:
      checkpatch: do not apply "initialise globals to 0" check to BPF progs

Subsystem: init

    Masahiro Yamada <masahiroy@kernel.org>:
      init/version.c: remove Version_<LINUX_VERSION_CODE> symbol
      init: clean up early_param_on_off() macro

    Bhaskar Chowdhury <unixbhaskar@gmail.com>:
      init/Kconfig: fix a typo in CC_VERSION_TEXT help text

Subsystem: coredump

    Ira Weiny <ira.weiny@intel.com>:
      fs/coredump: use kmap_local_page()

Subsystem: seq_file

    NeilBrown <neilb@suse.de>:
    Patch series "Fix some seq_file users that were recently broken":
      seq_file: document how per-entry resources are managed.
      x86: fix seq_file iteration for pat/memtype.c

Subsystem: gdb

    George Prekas <prekageo@amazon.com>:
      scripts/gdb: fix list_for_each

    Sumit Garg <sumit.garg@linaro.org>:
      kgdb: fix to kill breakpoints on initmem after boot

Subsystem: ubsan

    Andrey Ryabinin <ryabinin.a.a@gmail.com>:
      ubsan: remove overflow checks

Subsystem: initramfs

    Florian Fainelli <f.fainelli@gmail.com>:
      initramfs: panic with memory information

Subsystem: mm/pagemap2

    Huang Pei <huangpei@loongson.cn>:
      MIPS: make userspace mapping young by default

 .mailmap                                            |    1 
 CREDITS                                             |    9 
 Documentation/ABI/testing/sysfs-devices-memory      |   58 -
 Documentation/admin-guide/auxdisplay/cfag12864b.rst |    2 
 Documentation/admin-guide/auxdisplay/ks0108.rst     |    2 
 Documentation/admin-guide/kernel-parameters.txt     |    6 
 Documentation/admin-guide/mm/memory-hotplug.rst     |   20 
 Documentation/dev-tools/index.rst                   |    1 
 Documentation/dev-tools/kasan.rst                   |    8 
 Documentation/dev-tools/kfence.rst                  |  318 +++++++
 Documentation/filesystems/seq_file.rst              |    6 
 MAINTAINERS                                         |   26 
 arch/alpha/configs/defconfig                        |    1 
 arch/arm64/Kconfig                                  |    1 
 arch/arm64/include/asm/cache.h                      |    1 
 arch/arm64/include/asm/kasan.h                      |    1 
 arch/arm64/include/asm/kfence.h                     |   26 
 arch/arm64/include/asm/mte-def.h                    |    2 
 arch/arm64/include/asm/mte-kasan.h                  |   65 +
 arch/arm64/include/asm/mte.h                        |    2 
 arch/arm64/kernel/mte.c                             |   46 -
 arch/arm64/lib/mte.S                                |   16 
 arch/arm64/mm/fault.c                               |    8 
 arch/arm64/mm/mmu.c                                 |   23 
 arch/mips/mm/cache.c                                |   30 
 arch/s390/mm/init.c                                 |    1 
 arch/s390/mm/vmem.c                                 |   14 
 arch/x86/Kconfig                                    |    1 
 arch/x86/include/asm/kfence.h                       |   76 +
 arch/x86/mm/fault.c                                 |   10 
 arch/x86/mm/pat/memtype.c                           |    4 
 drivers/auxdisplay/cfag12864b.c                     |    4 
 drivers/auxdisplay/cfag12864bfb.c                   |    4 
 drivers/auxdisplay/ks0108.c                         |    4 
 drivers/base/memory.c                               |   35 
 drivers/block/zram/zram_drv.c                       |    2 
 drivers/hv/hv_balloon.c                             |    2 
 drivers/virtio/virtio_mem.c                         |   43 
 drivers/xen/balloon.c                               |    2 
 fs/coredump.c                                       |    4 
 fs/iomap/seek.c                                     |  125 --
 fs/proc/base.c                                      |   21 
 fs/proc/proc_sysctl.c                               |    4 
 include/linux/bitops.h                              |    2 
 include/linux/cfag12864b.h                          |    2 
 include/linux/cred.h                                |    2 
 include/linux/fortify-string.h                      |  302 ++++++
 include/linux/gfp.h                                 |    2 
 include/linux/init.h                                |    4 
 include/linux/kasan.h                               |   25 
 include/linux/kfence.h                              |  230 +++++
 include/linux/kgdb.h                                |    2 
 include/linux/khugepaged.h                          |    2 
 include/linux/ks0108.h                              |    2 
 include/linux/mdev.h                                |    2 
 include/linux/memory.h                              |    3 
 include/linux/memory_hotplug.h                      |   33 
 include/linux/memremap.h                            |    6 
 include/linux/mmzone.h                              |   49 -
 include/linux/page-flags.h                          |    4 
 include/linux/pagemap.h                             |   10 
 include/linux/pagevec.h                             |   10 
 include/linux/pgtable.h                             |    8 
 include/linux/ptrace.h                              |    2 
 include/linux/rmap.h                                |    3 
 include/linux/slab_def.h                            |    3 
 include/linux/slub_def.h                            |    3 
 include/linux/stackdepot.h                          |    9 
 include/linux/string.h                              |  282 ------
 include/linux/vmstat.h                              |    6 
 include/linux/zpool.h                               |    3 
 include/linux/zsmalloc.h                            |    2 
 include/trace/events/error_report.h                 |   74 +
 include/uapi/linux/firewire-cdev.h                  |    2 
 include/uapi/linux/input.h                          |    2 
 init/Kconfig                                        |    2 
 init/initramfs.c                                    |   19 
 init/main.c                                         |    6 
 init/version.c                                      |    8 
 kernel/debug/debug_core.c                           |   11 
 kernel/events/core.c                                |    8 
 kernel/events/uprobes.c                             |    2 
 kernel/groups.c                                     |    7 
 kernel/locking/rtmutex.c                            |    4 
 kernel/locking/rwsem.c                              |    2 
 kernel/locking/semaphore.c                          |    2 
 kernel/sched/fair.c                                 |    2 
 kernel/sched/membarrier.c                           |    2 
 kernel/sysctl.c                                     |    8 
 kernel/trace/Makefile                               |    1 
 kernel/trace/error_report-traces.c                  |   12 
 lib/Kconfig                                         |    9 
 lib/Kconfig.debug                                   |    1 
 lib/Kconfig.kfence                                  |   84 +
 lib/Kconfig.ubsan                                   |   17 
 lib/cmdline.c                                       |    7 
 lib/genalloc.c                                      |    3 
 lib/stackdepot.c                                    |   41 
 lib/test_kasan.c                                    |  111 ++
 lib/test_ubsan.c                                    |   49 -
 lib/ubsan.c                                         |   68 -
 mm/Makefile                                         |    1 
 mm/backing-dev.c                                    |    3 
 mm/cma.c                                            |   64 -
 mm/dmapool.c                                        |    3 
 mm/early_ioremap.c                                  |   12 
 mm/filemap.c                                        |  361 +++++---
 mm/huge_memory.c                                    |    6 
 mm/internal.h                                       |    6 
 mm/kasan/common.c                                   |  213 +++-
 mm/kasan/generic.c                                  |    3 
 mm/kasan/hw_tags.c                                  |    2 
 mm/kasan/kasan.h                                    |   97 +-
 mm/kasan/report.c                                   |    8 
 mm/kasan/shadow.c                                   |   78 +
 mm/kfence/Makefile                                  |    6 
 mm/kfence/core.c                                    |  875 +++++++++++++++++++-
 mm/kfence/kfence.h                                  |  126 ++
 mm/kfence/kfence_test.c                             |  860 +++++++++++++++++++
 mm/kfence/report.c                                  |  350 ++++++--
 mm/khugepaged.c                                     |   22 
 mm/memory-failure.c                                 |    6 
 mm/memory.c                                         |    4 
 mm/memory_hotplug.c                                 |  178 +++-
 mm/memremap.c                                       |   23 
 mm/mlock.c                                          |    2 
 mm/page_alloc.c                                     |    1 
 mm/rmap.c                                           |   24 
 mm/shmem.c                                          |  160 +--
 mm/slab.c                                           |   38 
 mm/slab_common.c                                    |   29 
 mm/slub.c                                           |   63 +
 mm/swap.c                                           |   54 -
 mm/swap_state.c                                     |    7 
 mm/truncate.c                                       |  141 ---
 mm/vmstat.c                                         |   35 
 mm/z3fold.c                                         |    1 
 mm/zbud.c                                           |    1 
 mm/zpool.c                                          |   13 
 mm/zsmalloc.c                                       |   22 
 mm/zswap.c                                          |   57 +
 samples/auxdisplay/cfag12864b-example.c             |    2 
 scripts/Makefile.ubsan                              |    2 
 scripts/checkpatch.pl                               |  152 ++-
 scripts/gdb/linux/lists.py                          |    5 
 145 files changed, 5046 insertions(+), 1682 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-25  9:12       ` incoming Andrey Ryabinin
@ 2021-02-25 11:07         ` Walter Wu
  0 siblings, 0 replies; 307+ messages in thread
From: Walter Wu @ 2021-02-25 11:07 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: Arnd Bergmann, Linus Torvalds, Andrew Morton, Dmitry Vyukov,
	Nathan Chancellor, Arnd Bergmann, Andrey Konovalov, Linux-MM,
	mm-commits, Andrey Ryabinin, Alexander Potapenko

Hi Andrey,

On Thu, 2021-02-25 at 12:12 +0300, Andrey Ryabinin wrote:
> On Thu, Feb 25, 2021 at 11:53 AM Arnd Bergmann <arnd@kernel.org> wrote:
> >
> > On Wed, Feb 24, 2021 at 10:37 PM Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> > >
> > > On Wed, Feb 24, 2021 at 1:30 PM Linus Torvalds
> > > <torvalds@linux-foundation.org> wrote:
> > > >
> > > > Hmm. I haven't bisected things yet, but I suspect it's something with
> > > > the KASAN patches. With this all applied, I get:
> > > >
> > > >   lib/crypto/curve25519-hacl64.c: In function ‘ladder_cmult.constprop’:
> > > >   lib/crypto/curve25519-hacl64.c:601:1: warning: the frame size of
> > > > 2288 bytes is larger than 2048 bytes [-Wframe-larger-than=]
> > > >
> > > > and
> > > >
> > > >   lib/bitfield_kunit.c: In function ‘test_bitfields_constants’:
> > > >   lib/bitfield_kunit.c:93:1: warning: the frame size of 11200 bytes is
> > > > larger than 2048 bytes [-Wframe-larger-than=]
> > > >
> > > > which is obviously not really acceptable. A 11kB stack frame _will_
> > > > cause issues.
> > >
> > > A quick bisect shoes that this was introduced by "[patch 101/173]
> > > kasan: remove redundant config option".
> > >
> > > I didn't check what part of that patch screws up, but it's definitely
> > > doing something bad.
> >
> > I'm not sure why that patch surfaced the bug, but it's worth pointing
> > out that the underlying problem is asan-stack in combination
> > with the structleak plugin. This will happen for every user of kunit.
> >
> 
> The patch didn't update KASAN_STACK dependency in kconfig:
>         config GCC_PLUGIN_STRUCTLEAK_BYREF
> ....
>                depends on !(KASAN && KASAN_STACK=1)
> 
> This 'depends on'  stopped working with the patch

Thanks for pointing out this problem. I will re-send that patch.


Walter

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-25  8:53     ` incoming Arnd Bergmann
@ 2021-02-25  9:12       ` Andrey Ryabinin
  2021-02-25 11:07         ` incoming Walter Wu
  0 siblings, 1 reply; 307+ messages in thread
From: Andrey Ryabinin @ 2021-02-25  9:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Torvalds, Andrew Morton, Walter Wu, Dmitry Vyukov,
	Nathan Chancellor, Arnd Bergmann, Andrey Konovalov, Linux-MM,
	mm-commits, Andrey Ryabinin, Alexander Potapenko

On Thu, Feb 25, 2021 at 11:53 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Wed, Feb 24, 2021 at 10:37 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Wed, Feb 24, 2021 at 1:30 PM Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> > >
> > > Hmm. I haven't bisected things yet, but I suspect it's something with
> > > the KASAN patches. With this all applied, I get:
> > >
> > >   lib/crypto/curve25519-hacl64.c: In function ‘ladder_cmult.constprop’:
> > >   lib/crypto/curve25519-hacl64.c:601:1: warning: the frame size of
> > > 2288 bytes is larger than 2048 bytes [-Wframe-larger-than=]
> > >
> > > and
> > >
> > >   lib/bitfield_kunit.c: In function ‘test_bitfields_constants’:
> > >   lib/bitfield_kunit.c:93:1: warning: the frame size of 11200 bytes is
> > > larger than 2048 bytes [-Wframe-larger-than=]
> > >
> > > which is obviously not really acceptable. A 11kB stack frame _will_
> > > cause issues.
> >
> > A quick bisect shoes that this was introduced by "[patch 101/173]
> > kasan: remove redundant config option".
> >
> > I didn't check what part of that patch screws up, but it's definitely
> > doing something bad.
>
> I'm not sure why that patch surfaced the bug, but it's worth pointing
> out that the underlying problem is asan-stack in combination
> with the structleak plugin. This will happen for every user of kunit.
>

The patch didn't update KASAN_STACK dependency in kconfig:
        config GCC_PLUGIN_STRUCTLEAK_BYREF
....
               depends on !(KASAN && KASAN_STACK=1)

This 'depends on'  stopped working with the patch


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-24 21:37   ` incoming Linus Torvalds
@ 2021-02-25  8:53     ` Arnd Bergmann
  2021-02-25  9:12       ` incoming Andrey Ryabinin
  0 siblings, 1 reply; 307+ messages in thread
From: Arnd Bergmann @ 2021-02-25  8:53 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Walter Wu, Dmitry Vyukov, Nathan Chancellor,
	Arnd Bergmann, Andrey Konovalov, Linux-MM, mm-commits,
	Andrey Ryabinin, Alexander Potapenko

On Wed, Feb 24, 2021 at 10:37 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Wed, Feb 24, 2021 at 1:30 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > Hmm. I haven't bisected things yet, but I suspect it's something with
> > the KASAN patches. With this all applied, I get:
> >
> >   lib/crypto/curve25519-hacl64.c: In function ‘ladder_cmult.constprop’:
> >   lib/crypto/curve25519-hacl64.c:601:1: warning: the frame size of
> > 2288 bytes is larger than 2048 bytes [-Wframe-larger-than=]
> >
> > and
> >
> >   lib/bitfield_kunit.c: In function ‘test_bitfields_constants’:
> >   lib/bitfield_kunit.c:93:1: warning: the frame size of 11200 bytes is
> > larger than 2048 bytes [-Wframe-larger-than=]
> >
> > which is obviously not really acceptable. A 11kB stack frame _will_
> > cause issues.
>
> A quick bisect shoes that this was introduced by "[patch 101/173]
> kasan: remove redundant config option".
>
> I didn't check what part of that patch screws up, but it's definitely
> doing something bad.

I'm not sure why that patch surfaced the bug, but it's worth pointing
out that the underlying problem is asan-stack in combination
with the structleak plugin. This will happen for every user of kunit.

I sent a series[1] out earlier this year to turn off the structleak
plugin as an alternative workaround, but need to follow up on
the remaining patches. Someone suggested adding a more
generic way to turn off the plugin for a file instead of open-coding
the CLFAGS_REMOVE_*.o Makefile bit, which would help.

I am also still hoping that someone can come up with a way
to make kunit work better with the structleak plugin, as there
shouldn't be a fundamental reason why it can't work, just that
it the code pattern triggers a particularly bad case in the compiler.

      Arnd

[1] https://lore.kernel.org/lkml/20210125124533.101339-1-arnd@kernel.org/


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-24 21:30 ` incoming Linus Torvalds
@ 2021-02-24 21:37   ` Linus Torvalds
  2021-02-25  8:53     ` incoming Arnd Bergmann
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2021-02-24 21:37 UTC (permalink / raw)
  To: Andrew Morton, Walter Wu, Dmitry Vyukov, Nathan Chancellor,
	Arnd Bergmann, Andrey Konovalov
  Cc: Linux-MM, mm-commits, Andrey Ryabinin, Alexander Potapenko

On Wed, Feb 24, 2021 at 1:30 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Hmm. I haven't bisected things yet, but I suspect it's something with
> the KASAN patches. With this all applied, I get:
>
>   lib/crypto/curve25519-hacl64.c: In function ‘ladder_cmult.constprop’:
>   lib/crypto/curve25519-hacl64.c:601:1: warning: the frame size of
> 2288 bytes is larger than 2048 bytes [-Wframe-larger-than=]
>
> and
>
>   lib/bitfield_kunit.c: In function ‘test_bitfields_constants’:
>   lib/bitfield_kunit.c:93:1: warning: the frame size of 11200 bytes is
> larger than 2048 bytes [-Wframe-larger-than=]
>
> which is obviously not really acceptable. A 11kB stack frame _will_
> cause issues.

A quick bisect shoes that this was introduced by "[patch 101/173]
kasan: remove redundant config option".

I didn't check what part of that patch screws up, but it's definitely
doing something bad.

I will drop that patch.

               Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-24 19:58 incoming Andrew Morton
@ 2021-02-24 21:30 ` Linus Torvalds
  2021-02-24 21:37   ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2021-02-24 21:30 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Wed, Feb 24, 2021 at 11:58 AM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> A few small subsystems and some of MM.

Hmm. I haven't bisected things yet, but I suspect it's something with
the KASAN patches. With this all applied, I get:

  lib/crypto/curve25519-hacl64.c: In function ‘ladder_cmult.constprop’:
  lib/crypto/curve25519-hacl64.c:601:1: warning: the frame size of
2288 bytes is larger than 2048 bytes [-Wframe-larger-than=]

and

  lib/bitfield_kunit.c: In function ‘test_bitfields_constants’:
  lib/bitfield_kunit.c:93:1: warning: the frame size of 11200 bytes is
larger than 2048 bytes [-Wframe-larger-than=]

which is obviously not really acceptable. A 11kB stack frame _will_
cause issues.

              Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-02-24 19:58 Andrew Morton
  2021-02-24 21:30 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-02-24 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


A few small subsystems and some of MM.


173 patches, based on c03c21ba6f4e95e406a1a7b4c34ef334b977c194.

Subsystems affected by this patch series:

  hexagon
  scripts
  ntfs
  ocfs2
  vfs
  mm/slab-generic
  mm/slab
  mm/slub
  mm/debug
  mm/pagecache
  mm/swap
  mm/memcg
  mm/pagemap
  mm/mprotect
  mm/mremap
  mm/page-reporting
  mm/vmalloc
  mm/kasan
  mm/pagealloc
  mm/memory-failure
  mm/hugetlb
  mm/vmscan
  mm/z3fold
  mm/compaction
  mm/mempolicy
  mm/oom-kill
  mm/hugetlbfs
  mm/migration

Subsystem: hexagon

    Randy Dunlap <rdunlap@infradead.org>:
      hexagon: remove CONFIG_EXPERIMENTAL from defconfigs

Subsystem: scripts

    tangchunyou <tangchunyou@yulong.com>:
      scripts/spelling.txt: increase error-prone spell checking

    zuoqilin <zuoqilin@yulong.com>:
      scripts/spelling.txt: check for "exeeds"

    dingsenjie <dingsenjie@yulong.com>:
      scripts/spelling.txt: add "allocted" and "exeeds" typo

    Colin Ian King <colin.king@canonical.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

Subsystem: ntfs

    Randy Dunlap <rdunlap@infradead.org>:
      ntfs: layout.h: delete duplicated words

    Rustam Kovhaev <rkovhaev@gmail.com>:
      ntfs: check for valid standard information attribute

Subsystem: ocfs2

    Yi Li <yili@winhong.com>:
      ocfs2: remove redundant conditional before iput

    guozh <guozh88@chinatelecom.cn>:
      ocfs2: clean up some definitions which are not used any more

    Dan Carpenter <dan.carpenter@oracle.com>:
      ocfs2: fix a use after free on error

    Jiapeng Chong <jiapeng.chong@linux.alibaba.com>:
      ocfs2: simplify the calculation of variables

Subsystem: vfs

    Randy Dunlap <rdunlap@infradead.org>:
      fs: delete repeated words in comments

    Alexey Dobriyan <adobriyan@gmail.com>:
      ramfs: support O_TMPFILE

Subsystem: mm/slab-generic

    Jacob Wen <jian.w.wen@oracle.com>:
      mm, tracing: record slab name for kmem_cache_free()

    Nikolay Borisov <nborisov@suse.com>:
      mm/sl?b.c: remove ctor argument from kmem_cache_flags

Subsystem: mm/slab

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/slab: minor coding style tweaks

Subsystem: mm/slub

    Johannes Berg <johannes.berg@intel.com>:
      mm/slub: disable user tracing for kmemleak caches by default

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "mm, slab, slub: remove cpu and memory hotplug locks":
      mm, slub: stop freeing kmem_cache_node structures on node offline
      mm, slab, slub: stop taking memory hotplug lock
      mm, slab, slub: stop taking cpu hotplug lock
      mm, slub: splice cpu and page freelists in deactivate_slab()
      mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/slub: minor coding style tweaks

Subsystem: mm/debug

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/debug: improve memcg debugging

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/debug_vm_pgtable: Some minor updates", v3:
      mm/debug_vm_pgtable/basic: add validation for dirtiness after write protect
      mm/debug_vm_pgtable/basic: iterate over entire protection_map[]

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/page_owner: use helper function zone_end_pfn() to get end_pfn

Subsystem: mm/pagecache

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm/filemap: remove unused parameter and change to void type for replace_page_cache_page()

    Pavel Begunkov <asml.silence@gmail.com>:
      mm/filemap: don't revert iter on -EIOCBQUEUED

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Refactor generic_file_buffered_read", v5:
      mm/filemap: rename generic_file_buffered_read subfunctions
      mm/filemap: remove dynamically allocated array from filemap_read
      mm/filemap: convert filemap_get_pages to take a pagevec
      mm/filemap: use head pages in generic_file_buffered_read
      mm/filemap: pass a sleep state to put_and_wait_on_page_locked
      mm/filemap: support readpage splitting a page
      mm/filemap: inline __wait_on_page_locked_async into caller
      mm/filemap: don't call ->readpage if IOCB_WAITQ is set
      mm/filemap: change filemap_read_page calling conventions
      mm/filemap: change filemap_create_page calling conventions
      mm/filemap: convert filemap_update_page to return an errno
      mm/filemap: move the iocb checks into filemap_update_page
      mm/filemap: add filemap_range_uptodate
      mm/filemap: split filemap_readahead out of filemap_get_pages
      mm/filemap: restructure filemap_get_pages
      mm/filemap: don't relock the page after calling readpage

    Christoph Hellwig <hch@lst.de>:
      mm/filemap: rename generic_file_buffered_read to filemap_read
      mm/filemap: simplify generic_file_read_iter

    Yang Guo <guoyang2@huawei.com>:
      fs/buffer.c: add checking buffer head stat before clear

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm: backing-dev: Remove duplicated macro definition

Subsystem: mm/swap

    Yang Li <abaci-bugfix@linux.alibaba.com>:
      mm/swap_slots.c: remove redundant NULL check

    Stephen Zhang <stephenzhangzsd@gmail.com>:
      mm/swapfile.c: fix debugging information problem

    Georgi Djakov <georgi.djakov@linaro.org>:
      mm/page_io: use pr_alert_ratelimited for swap read/write errors

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      mm/swap_state: constify static struct attribute_group

    Yu Zhao <yuzhao@google.com>:
      mm/swap: don't SetPageWorkingset unconditionally during swapin

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: pre-allocate obj_cgroups for slab caches with SLAB_ACCOUNT

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: optimize per-lruvec stats counter memory usage
    Patch series "Convert all THP vmstat counters to pages", v6:
      mm: memcontrol: fix NR_ANON_THPS accounting in charge moving
      mm: memcontrol: convert NR_ANON_THPS account to pages
      mm: memcontrol: convert NR_FILE_THPS account to pages
      mm: memcontrol: convert NR_SHMEM_THPS account to pages
      mm: memcontrol: convert NR_SHMEM_PMDMAPPED account to pages
      mm: memcontrol: convert NR_FILE_PMDMAPPED account to pages
      mm: memcontrol: make the slab calculation consistent

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/memcg: revise the using condition of lock_page_lruvec function series
      mm/memcg: remove rcu locking for lock_page_lruvec function series

    Shakeel Butt <shakeelb@google.com>:
      mm: memcg: add swapcache stat for memcg v2

    Roman Gushchin <guro@fb.com>:
      mm: kmem: make __memcg_kmem_(un)charge static

    Feng Tang <feng.tang@intel.com>:
      mm: page_counter: re-layout structure to reduce false sharing

    Yang Li <abaci-bugfix@linux.alibaba.com>:
      mm/memcontrol: remove redundant NULL check

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: replace the loop with a list_for_each_entry()

    Shakeel Butt <shakeelb@google.com>:
      mm/list_lru.c: remove kvfree_rcu_local()

    Johannes Weiner <hannes@cmpxchg.org>:
      fs: buffer: use raw page_memcg() on locked page

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: fix swap undercounting in cgroup2
      mm: memcontrol: fix get_active_memcg return value
      mm: memcontrol: fix slub memory accounting

Subsystem: mm/pagemap

    Adrian Huang <ahuang12@lenovo.com>:
      mm/mmap.c: remove unnecessary local variable

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/memory.c: fix potential pte_unmap_unlock pte error
      mm/pgtable-generic.c: simplify the VM_BUG_ON condition in pmdp_huge_clear_flush()
      mm/pgtable-generic.c: optimize the VM_BUG_ON condition in pmdp_huge_clear_flush()
      mm/memory.c: fix potential pte_unmap_unlock pte error

Subsystem: mm/mprotect

    Tianjia Zhang <tianjia.zhang@linux.alibaba.com>:
      mm/mprotect.c: optimize error detection in do_mprotect_pkey()

Subsystem: mm/mremap

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm: rmap: explicitly reset vma->anon_vma in unlink_anon_vmas()
      mm: mremap: unlink anon_vmas when mremap with MREMAP_DONTUNMAP success

Subsystem: mm/page-reporting

    sh <sh_def@163.com>:
      mm/page_reporting: use list_entry_is_head() in page_reporting_cycle()

Subsystem: mm/vmalloc

    Yang Li <abaci-bugfix@linux.alibaba.com>:
      vmalloc: remove redundant NULL check

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: HW_TAGS tests support and fixes", v4:
      kasan: prefix global functions with kasan_
      kasan: clarify HW_TAGS impact on TBI
      kasan: clean up comments in tests
      kasan: add macros to simplify checking test constraints
      kasan: add match-all tag tests
      kasan, arm64: allow using KUnit tests with HW_TAGS mode
      kasan: rename CONFIG_TEST_KASAN_MODULE
      kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL
      kasan: adapt kmalloc_uaf2 test to HW_TAGS mode
      kasan: fix memory corruption in kasan_bitops_tags test
      kasan: move _RET_IP_ to inline wrappers
      kasan: fix bug detection via ksize for HW_TAGS mode
      kasan: add proper page allocator tests
      kasan: add a test for kmem_cache_alloc/free_bulk
      kasan: don't run tests when KASAN is not enabled

    Walter Wu <walter-zh.wu@mediatek.com>:
      kasan: remove redundant config option

Subsystem: mm/pagealloc

    Baoquan He <bhe@redhat.com>:
    Patch series "mm: clean up names and parameters of memmap_init_xxxx functions", v5:
      mm: fix prototype warning from kernel test robot
      mm: rename memmap_init() and memmap_init_zone()
      mm: simplify parater of function memmap_init_zone()
      mm: simplify parameter of setup_usemap()
      mm: remove unneeded local variable in free_area_init_core

    David Hildenbrand <david@redhat.com>:
    Patch series "mm: simplify free_highmem_page() and free_reserved_page()":
      video: fbdev: acornfb: remove free_unused_pages()
      mm: simplify free_highmem_page() and free_reserved_page()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/gfp: add kernel-doc for gfp_t

Subsystem: mm/memory-failure

    Aili Yao <yaoaili@kingsoft.com>:
      mm,hwpoison: send SIGBUS to PF_MCE_EARLY processes on action required events

Subsystem: mm/hugetlb

    Bibo Mao <maobibo@loongson.cn>:
      mm/huge_memory.c: update tlb entry if pmd is changed
      MIPS: do not call flush_tlb_all when setting pmd entry

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hugetlb: fix potential double free in hugetlb_register_node() error path

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm/hugetlb.c: fix unnecessary address expansion of pmd sharing

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call
      mm/hugetlb: use helper huge_page_order and pages_per_huge_page
      mm/hugetlb: fix use after free when subpool max_hpages accounting is not enabled

    Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>:
      mm/hugetlb: simplify the calculation of variables

    Joao Martins <joao.m.martins@oracle.com>:
    Patch series "mm/hugetlb: follow_hugetlb_page() improvements", v2:
      mm/hugetlb: grab head page refcount once for group of subpages
      mm/hugetlb: refactor subpage recording

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hugetlb: fix some comment typos

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/hugetlb: remove redundant check in preparing and destroying gigantic page

    Zhiyuan Dai <daizhiyuan@phytium.com.cn>:
      mm/hugetlb.c: fix typos in comments

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/huge_memory.c: remove unused return value of set_huge_zero_page()

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm/pmem: avoid inserting hugepage PTE entry with fsdax if hugepage support is disabled

    Miaohe Lin <linmiaohe@huawei.com>:
      hugetlb_cgroup: use helper pages_per_huge_page() in hugetlb_cgroup
      mm/hugetlb: use helper function range_in_vma() in page_table_shareable()
      mm/hugetlb: remove unnecessary VM_BUG_ON_PAGE on putback_active_hugepage()
      mm/hugetlb: use helper huge_page_size() to get hugepage size

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: fix update_and_free_page contig page struct assumption
      hugetlb: fix copy_huge_page_from_user contig page struct assumption

    Chen Wandun <chenwandun@huawei.com>:
      mm/hugetlb: suppress wrong warning info when alloc gigantic page

Subsystem: mm/vmscan

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/vmscan: __isolate_lru_page_prepare() cleanup

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/workingset.c: avoid unnecessary max_nodes estimation in count_shadow_nodes()

    Yu Zhao <yuzhao@google.com>:
    Patch series "mm: lru related cleanups", v2:
      mm/vmscan.c: use add_page_to_lru_list()
      include/linux/mm_inline.h: shuffle lru list addition and deletion functions
      mm: don't pass "enum lru_list" to lru list addition functions
      mm/swap.c: don't pass "enum lru_list" to trace_mm_lru_insertion()
      mm/swap.c: don't pass "enum lru_list" to del_page_from_lru_list()
      mm: add __clear_page_lru_flags() to replace page_off_lru()
      mm: VM_BUG_ON lru page flags
      include/linux/mm_inline.h: fold page_lru_base_type() into its sole caller
      include/linux/mm_inline.h: fold __update_lru_size() into its sole caller
      mm/vmscan.c: make lruvec_lru_size() static

    Oscar Salvador <osalvador@suse.de>:
      mm: workingset: clarify eviction order and distance calculation

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "create hugetlb flags to consolidate state", v3:
      hugetlb: use page.private for hugetlb specific page flags
      hugetlb: convert page_huge_active() HPageMigratable flag
      hugetlb: convert PageHugeTemporary() to HPageTemporary flag
      hugetlb: convert PageHugeFreed to HPageFreed flag
      include/linux/hugetlb.h: add synchronization information for new hugetlb specific flags
      hugetlb: fix uninitialized subpool pointer

    Dave Hansen <dave.hansen@linux.intel.com>:
      mm/vmscan: restore zone_reclaim_mode ABI

Subsystem: mm/z3fold

    Miaohe Lin <linmiaohe@huawei.com>:
      z3fold: remove unused attribute for release_z3fold_page
      z3fold: simplify the zhdr initialization code in init_z3fold_page()

Subsystem: mm/compaction

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/compaction: remove rcu_read_lock during page compaction

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/compaction: remove duplicated VM_BUG_ON_PAGE !PageLocked

    Charan Teja Reddy <charante@codeaurora.org>:
      mm/compaction: correct deferral logic for proactive compaction

    Wonhyuk Yang <vvghjk1234@gmail.com>:
      mm/compaction: fix misbehaviors of fast_find_migrateblock()

    Vlastimil Babka <vbabka@suse.cz>:
      mm, compaction: make fast_isolate_freepages() stay within zone

Subsystem: mm/mempolicy

    Huang Ying <ying.huang@intel.com>:
      numa balancing: migrate on fault among multiple bound nodes

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mempolicy: use helper range_in_vma() in queue_pages_test_walk()

Subsystem: mm/oom-kill

    Tang Yizhou <tangyizhou@huawei.com>:
      mm, oom: fix a comment in dump_task()

Subsystem: mm/hugetlbfs

    Mike Kravetz <mike.kravetz@oracle.com>:
      mm/hugetlb: change hugetlb_reserve_pages() to type bool
      hugetlbfs: remove special hugetlbfs_set_page_dirty()

    Miaohe Lin <linmiaohe@huawei.com>:
      hugetlbfs: remove useless BUG_ON(!inode) in hugetlbfs_setattr()
      hugetlbfs: use helper macro default_hstate in init_hugetlbfs_fs
      hugetlbfs: correct obsolete function name in hugetlbfs_read_iter()
      hugetlbfs: remove meaningless variable avoid_reserve
      hugetlbfs: make hugepage size conversion more readable
      hugetlbfs: correct some obsolete comments about inode i_mutex
      hugetlbfs: fix some comment typos
      hugetlbfs: remove unneeded return value of hugetlb_vmtruncate()

Subsystem: mm/migration

    Chengyang Fan <cy.fan@huawei.com>:
      mm/migrate: remove unneeded semicolons

 Documentation/admin-guide/cgroup-v2.rst         |    4 
 Documentation/admin-guide/kernel-parameters.txt |    8 
 Documentation/admin-guide/sysctl/vm.rst         |   10 
 Documentation/core-api/mm-api.rst               |    7 
 Documentation/dev-tools/kasan.rst               |   24 
 Documentation/vm/arch_pgtable_helpers.rst       |    8 
 arch/arm64/include/asm/memory.h                 |    1 
 arch/arm64/include/asm/mte-kasan.h              |   12 
 arch/arm64/kernel/mte.c                         |   12 
 arch/arm64/kernel/sleep.S                       |    2 
 arch/arm64/mm/fault.c                           |   20 
 arch/hexagon/configs/comet_defconfig            |    1 
 arch/ia64/include/asm/pgtable.h                 |    6 
 arch/ia64/mm/init.c                             |   18 
 arch/mips/mm/pgtable-32.c                       |    1 
 arch/mips/mm/pgtable-64.c                       |    1 
 arch/x86/kernel/acpi/wakeup_64.S                |    2 
 drivers/base/node.c                             |   33 
 drivers/video/fbdev/acornfb.c                   |   34 
 fs/block_dev.c                                  |    2 
 fs/btrfs/file.c                                 |    2 
 fs/buffer.c                                     |    7 
 fs/dcache.c                                     |    4 
 fs/direct-io.c                                  |    4 
 fs/exec.c                                       |    4 
 fs/fhandle.c                                    |    2 
 fs/fuse/dev.c                                   |    6 
 fs/hugetlbfs/inode.c                            |   72 --
 fs/ntfs/inode.c                                 |    6 
 fs/ntfs/layout.h                                |    4 
 fs/ocfs2/cluster/heartbeat.c                    |    8 
 fs/ocfs2/dlm/dlmast.c                           |   10 
 fs/ocfs2/dlm/dlmcommon.h                        |    4 
 fs/ocfs2/refcounttree.c                         |    2 
 fs/ocfs2/super.c                                |    2 
 fs/pipe.c                                       |    2 
 fs/proc/meminfo.c                               |   10 
 fs/proc/vmcore.c                                |    7 
 fs/ramfs/inode.c                                |   13 
 include/linux/fs.h                              |    4 
 include/linux/gfp.h                             |   14 
 include/linux/highmem-internal.h                |    5 
 include/linux/huge_mm.h                         |   15 
 include/linux/hugetlb.h                         |   98 ++
 include/linux/kasan-checks.h                    |    6 
 include/linux/kasan.h                           |   39 -
 include/linux/memcontrol.h                      |   43 -
 include/linux/migrate.h                         |    2 
 include/linux/mm.h                              |   28 
 include/linux/mm_inline.h                       |  123 +--
 include/linux/mmzone.h                          |   30 
 include/linux/page-flags.h                      |    6 
 include/linux/page_counter.h                    |    9 
 include/linux/pagemap.h                         |    5 
 include/linux/swap.h                            |    8 
 include/trace/events/kmem.h                     |   24 
 include/trace/events/pagemap.h                  |   11 
 include/uapi/linux/mempolicy.h                  |    4 
 init/Kconfig                                    |   14 
 lib/Kconfig.kasan                               |   14 
 lib/Makefile                                    |    2 
 lib/test_kasan.c                                |  446 ++++++++----
 lib/test_kasan_module.c                         |    5 
 mm/backing-dev.c                                |    6 
 mm/compaction.c                                 |   73 +-
 mm/debug.c                                      |   10 
 mm/debug_vm_pgtable.c                           |   86 ++
 mm/filemap.c                                    |  859 +++++++++++-------------
 mm/gup.c                                        |    5 
 mm/huge_memory.c                                |   28 
 mm/hugetlb.c                                    |  376 ++++------
 mm/hugetlb_cgroup.c                             |    6 
 mm/kasan/common.c                               |   60 -
 mm/kasan/generic.c                              |   40 -
 mm/kasan/hw_tags.c                              |   16 
 mm/kasan/kasan.h                                |   87 +-
 mm/kasan/quarantine.c                           |   22 
 mm/kasan/report.c                               |   15 
 mm/kasan/report_generic.c                       |   10 
 mm/kasan/report_hw_tags.c                       |    8 
 mm/kasan/report_sw_tags.c                       |    8 
 mm/kasan/shadow.c                               |   27 
 mm/kasan/sw_tags.c                              |   22 
 mm/khugepaged.c                                 |    6 
 mm/list_lru.c                                   |   12 
 mm/memcontrol.c                                 |  309 ++++----
 mm/memory-failure.c                             |   34 
 mm/memory.c                                     |   24 
 mm/memory_hotplug.c                             |   11 
 mm/mempolicy.c                                  |   18 
 mm/mempool.c                                    |    2 
 mm/migrate.c                                    |   10 
 mm/mlock.c                                      |    3 
 mm/mmap.c                                       |    4 
 mm/mprotect.c                                   |    7 
 mm/mremap.c                                     |    8 
 mm/oom_kill.c                                   |    5 
 mm/page_alloc.c                                 |   70 -
 mm/page_io.c                                    |   12 
 mm/page_owner.c                                 |    4 
 mm/page_reporting.c                             |    2 
 mm/pgtable-generic.c                            |    9 
 mm/rmap.c                                       |   35 
 mm/shmem.c                                      |    2 
 mm/slab.c                                       |   21 
 mm/slab.h                                       |   20 
 mm/slab_common.c                                |   40 -
 mm/slob.c                                       |    2 
 mm/slub.c                                       |  169 ++--
 mm/swap.c                                       |   54 -
 mm/swap_slots.c                                 |    3 
 mm/swap_state.c                                 |   31 
 mm/swapfile.c                                   |    8 
 mm/vmscan.c                                     |  100 +-
 mm/vmstat.c                                     |   14 
 mm/workingset.c                                 |    7 
 mm/z3fold.c                                     |   11 
 scripts/Makefile.kasan                          |   10 
 scripts/spelling.txt                            |   30 
 tools/objtool/check.c                           |    2 
 120 files changed, 2249 insertions(+), 1954 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-02-13  4:52 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-02-13  4:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

6 patches, based on dcc0b49040c70ad827a7f3d58a21b01fdb14e749.

Subsystems affected by this patch series:

  mm/pagemap
  scripts
  MAINTAINERS
  h8300

Subsystem: mm/pagemap

    Mike Rapoport <rppt@linux.ibm.com>:
      m68k: make __pfn_to_phys() and __phys_to_pfn() available for !MMU

Subsystem: scripts

    Rong Chen <rong.a.chen@intel.com>:
      scripts/recordmcount.pl: support big endian for ARCH sh

Subsystem: MAINTAINERS

    Andrey Konovalov <andreyknvl@google.com>:
      MAINTAINERS: update KASAN file list
      MAINTAINERS: update Andrey Konovalov's email address
      MAINTAINERS: add Andrey Konovalov to KASAN reviewers

Subsystem: h8300

    Randy Dunlap <rdunlap@infradead.org>:
      h8300: fix PREEMPTION build, TI_PRE_COUNT undefined

 MAINTAINERS                     |    8 +++++---
 arch/h8300/kernel/asm-offsets.c |    3 +++
 arch/m68k/include/asm/page.h    |    2 +-
 scripts/recordmcount.pl         |    6 +++++-
 4 files changed, 14 insertions(+), 5 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-02-09 21:41 incoming Andrew Morton
@ 2021-02-10 19:30 ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2021-02-10 19:30 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

Hah. This series shows a small deficiency in your scripting wrt the diffstat:

On Tue, Feb 9, 2021 at 1:41 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
>  .mailmap                          |    1
...
>  mm/slub.c                         |   18 +++++++++-
>  17 files changed, 172 insertions(+), 49 deletions(-)

It actually has 18 files changed, but one of them is a pure rename (no
change to the content), and apparently your diffstat tool can't handle
that case.

It *should* have ended with

 ...
 mm/slub.c                                          | 18 +++++-
 .../selftests/vm/{run_vmtests => run_vmtests.sh}   |  0
 18 files changed, 172 insertions(+), 49 deletions(-)
 rename tools/testing/selftests/vm/{run_vmtests => run_vmtests.sh} (100%)

if you'd done a proper "git diff -M --stat --summary" of the series.

[ Ok, by default git would actually have said

    18 files changed, 171 insertions(+), 48 deletions(-)

  but it looks like you use the patience diff option, which gives that
extra insertion/deletion line because it generates the diff a bit
differently ]

Not a big deal,, but it made me briefly wonder "why doesn't my
diffstat match yours".

           Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-02-09 21:41 Andrew Morton
  2021-02-10 19:30 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-02-09 21:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

14 patches, based on e0756cfc7d7cd08c98a53b6009c091a3f6a50be6.

Subsystems affected by this patch series:

  squashfs
  mm/kasan
  firmware
  mm/mremap
  mm/tmpfs
  mm/selftests
  MAINTAINERS
  mm/memcg
  mm/slub
  nilfs2

Subsystem: squashfs

    Phillip Lougher <phillip@squashfs.org.uk>:
    Patch series "Squashfs: fix BIO migration regression and add sanity checks":
      squashfs: avoid out of bounds writes in decompressors
      squashfs: add more sanity checks in id lookup
      squashfs: add more sanity checks in inode lookup
      squashfs: add more sanity checks in xattr id lookup

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix stack traces dependency for HW_TAGS

Subsystem: firmware

    Fangrui Song <maskray@google.com>:
      firmware_loader: align .builtin_fw to 8

Subsystem: mm/mremap

    Arnd Bergmann <arnd@arndb.de>:
      mm/mremap: fix BUILD_BUG_ON() error in get_extent

Subsystem: mm/tmpfs

    Seth Forshee <seth.forshee@canonical.com>:
      tmpfs: disallow CONFIG_TMPFS_INODE64 on s390
      tmpfs: disallow CONFIG_TMPFS_INODE64 on alpha

Subsystem: mm/selftests

    Rong Chen <rong.a.chen@intel.com>:
      selftests/vm: rename file run_vmtests to run_vmtests.sh

Subsystem: MAINTAINERS

    Andrey Ryabinin <ryabinin.a.a@gmail.com>:
      MAINTAINERS: update Andrey Ryabinin's email address

Subsystem: mm/memcg

    Johannes Weiner <hannes@cmpxchg.org>:
      Revert "mm: memcontrol: avoid workload stalls when lowering memory.high"

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: better heuristic for number of cpus when calculating slab order

Subsystem: nilfs2

    Joachim Henke <joachim.henke@t-systems.com>:
      nilfs2: make splice write available again

 .mailmap                          |    1 
 Documentation/dev-tools/kasan.rst |    3 -
 MAINTAINERS                       |    2 -
 fs/Kconfig                        |    4 +-
 fs/nilfs2/file.c                  |    1 
 fs/squashfs/block.c               |    8 ++++
 fs/squashfs/export.c              |   41 +++++++++++++++++++----
 fs/squashfs/id.c                  |   40 ++++++++++++++++++-----
 fs/squashfs/squashfs_fs_sb.h      |    1 
 fs/squashfs/super.c               |    6 +--
 fs/squashfs/xattr.h               |   10 +++++
 fs/squashfs/xattr_id.c            |   66 ++++++++++++++++++++++++++++++++------
 include/asm-generic/vmlinux.lds.h |    2 -
 mm/kasan/hw_tags.c                |    8 +---
 mm/memcontrol.c                   |    5 +-
 mm/mremap.c                       |    5 +-
 mm/slub.c                         |   18 +++++++++-
 17 files changed, 172 insertions(+), 49 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-02-05  2:31 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-02-05  2:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

18 patches, based on 5c279c4cf206e03995e04fd3404fa95ffd243a97.

Subsystems affected by this patch series:

  mm/hugetlb
  mm/compaction
  mm/vmalloc
  gcov
  mm/shmem
  mm/memblock
  mailmap
  mm/pagecache
  mm/kasan
  ubsan
  mm/hugetlb
  MAINTAINERS

Subsystem: mm/hugetlb

    Muchun Song <songmuchun@bytedance.com>:
      mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page
      mm: hugetlb: fix a race between freeing and dissolving the page
      mm: hugetlb: fix a race between isolating and freeing page
      mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active
      mm: migrate: do not migrate HugeTLB page whose refcount is one

Subsystem: mm/compaction

    Rokudo Yan <wu-yan@tcl.com>:
      mm, compaction: move high_pfn to the for loop scope

Subsystem: mm/vmalloc

    Rick Edgecombe <rick.p.edgecombe@intel.com>:
      mm/vmalloc: separate put pages and flush VM flags

Subsystem: gcov

    Johannes Berg <johannes.berg@intel.com>:
      init/gcov: allow CONFIG_CONSTRUCTORS on UML to fix module gcov

Subsystem: mm/shmem

    Hugh Dickins <hughd@google.com>:
      mm: thp: fix MADV_REMOVE deadlock on shmem THP

Subsystem: mm/memblock

    Roman Gushchin <guro@fb.com>:
      memblock: do not start bottom-up allocations with kernel_end

Subsystem: mailmap

    Viresh Kumar <viresh.kumar@linaro.org>:
      mailmap: fix name/email for Viresh Kumar

    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>:
      mailmap: add entries for Manivannan Sadhasivam

Subsystem: mm/pagecache

    Waiman Long <longman@redhat.com>:
      mm/filemap: add missing mem_cgroup_uncharge() to __add_to_page_cache_locked()

Subsystem: mm/kasan

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
    Patch series "kasan: Fix metadata detection for KASAN_HW_TAGS", v5:
      kasan: add explicit preconditions to kasan_report()
      kasan: make addr_has_metadata() return true for valid addresses

Subsystem: ubsan

    Nathan Chancellor <nathan@kernel.org>:
      ubsan: implement __ubsan_handle_alignment_assumption

Subsystem: mm/hugetlb

    Muchun Song <songmuchun@bytedance.com>:
      mm: hugetlb: fix missing put_page in gather_surplus_pages()

Subsystem: MAINTAINERS

    Nathan Chancellor <nathan@kernel.org>:
      MAINTAINERS/.mailmap: use my @kernel.org address

 .mailmap                |    5 ++++
 MAINTAINERS             |    2 -
 fs/hugetlbfs/inode.c    |    3 +-
 include/linux/hugetlb.h |    2 +
 include/linux/kasan.h   |    7 ++++++
 include/linux/vmalloc.h |    9 +-------
 init/Kconfig            |    1 
 init/main.c             |    8 ++++++-
 kernel/gcov/Kconfig     |    2 -
 lib/ubsan.c             |   31 ++++++++++++++++++++++++++++
 lib/ubsan.h             |    6 +++++
 mm/compaction.c         |    3 +-
 mm/filemap.c            |    4 +++
 mm/huge_memory.c        |   37 ++++++++++++++++++++-------------
 mm/hugetlb.c            |   53 ++++++++++++++++++++++++++++++++++++++++++------
 mm/kasan/kasan.h        |    2 -
 mm/memblock.c           |   49 +++++---------------------------------------
 mm/migrate.c            |    6 +++++
 18 files changed, 153 insertions(+), 77 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-01-24  5:00 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2021-01-24  5:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

19 patches, based on e1ae4b0be15891faf46d390e9f3dc9bd71a8cae1.

Subsystems affected by this patch series:

  mm/pagealloc
  mm/memcg
  mm/kasan
  ubsan
  mm/memory-failure
  mm/highmem
  proc
  MAINTAINERS

Subsystem: mm/pagealloc

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: fix initialization of struct page for holes in memory layout", v3:
      x86/setup: don't remove E820_TYPE_RAM for pfn 0
      mm: fix initialization of struct page for holes in memory layout

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: optimize objcg stock draining

    Shakeel Butt <shakeelb@google.com>:
      mm: memcg: fix memcg file_dirty numa stat
      mm: fix numa stats for thp migration

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: prevent starvation when writing memory.high

Subsystem: mm/kasan

    Lecopzer Chen <lecopzer@gmail.com>:
      kasan: fix unaligned address is unhandled in kasan_remove_zero_shadow
      kasan: fix incorrect arguments passing in kasan_add_zero_shadow

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix HW_TAGS boot parameters
      kasan, mm: fix conflicts with init_on_alloc/free
      kasan, mm: fix resetting page_alloc tags for HW_TAGS

Subsystem: ubsan

    Arnd Bergmann <arnd@arndb.de>:
      ubsan: disable unsigned-overflow check for i386

Subsystem: mm/memory-failure

    Dan Williams <dan.j.williams@intel.com>:
      mm: fix page reference leak in soft_offline_page()

Subsystem: mm/highmem

    Thomas Gleixner <tglx@linutronix.de>:
    Patch series "mm/highmem: Fix fallout from generic kmap_local conversions":
      sparc/mm/highmem: flush cache and TLB
      mm/highmem: prepare for overriding set_pte_at()
      mips/mm/highmem: use set_pte() for kmap_local()
      powerpc/mm/highmem: use __set_pte_at() for kmap_local()

Subsystem: proc

    Xiaoming Ni <nixiaoming@huawei.com>:
      proc_sysctl: fix oops caused by incorrect command parameters

Subsystem: MAINTAINERS

    Nathan Chancellor <natechancellor@gmail.com>:
      MAINTAINERS: add a couple more files to the Clang/LLVM section

 Documentation/dev-tools/kasan.rst  |   27 ++---------
 MAINTAINERS                        |    2 
 arch/mips/include/asm/highmem.h    |    1 
 arch/powerpc/include/asm/highmem.h |    2 
 arch/sparc/include/asm/highmem.h   |    9 ++-
 arch/x86/kernel/setup.c            |   20 +++-----
 fs/proc/proc_sysctl.c              |    7 ++-
 lib/Kconfig.ubsan                  |    1 
 mm/highmem.c                       |    7 ++-
 mm/kasan/hw_tags.c                 |   77 +++++++++++++--------------------
 mm/kasan/init.c                    |   23 +++++----
 mm/memcontrol.c                    |   11 +---
 mm/memory-failure.c                |   20 ++++++--
 mm/migrate.c                       |   27 ++++++-----
 mm/page_alloc.c                    |   86 ++++++++++++++++++++++---------------
 mm/slub.c                          |    7 +--
 16 files changed, 173 insertions(+), 154 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2021-01-12 23:48 incoming Andrew Morton
@ 2021-01-15 23:32 ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2021-01-15 23:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Tue, Jan 12, 2021 at 3:48 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> 10 patches, based on e609571b5ffa3528bf85292de1ceaddac342bc1c.

Whee. I had completely dropped the ball on this - I had built my usual
"akpm" branch with the patches, but then had completely forgotten
about it after doing my basic build tests.

I tend to leave it for a while to see if people send belated ACK/NAK's
for the patches, but that "for a while" is typically "overnight", not
several days.

So if you ever notice that I haven't merged your patch submission, and
you haven't seen me comment on them, feel free to ping me to remind
me.

Because it might just have gotten lost in the shuffle for some random
reason. Admittedly it's rare - I think this is the first time I just
randomly noticed three days later that I'd never done the actual merge
of the patch-series).

               Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2021-01-12 23:48 Andrew Morton
  2021-01-15 23:32 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2021-01-12 23:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

10 patches, based on e609571b5ffa3528bf85292de1ceaddac342bc1c.

Subsystems affected by this patch series:

  mm/slub
  mm/pagealloc
  mm/memcg
  mm/kasan
  mm/vmalloc
  mm/migration
  mm/hugetlb
  MAINTAINERS
  mm/memory-failure
  mm/process_vm_access

Subsystem: mm/slub

    Jann Horn <jannh@google.com>:
      mm, slub: consider rest of partial list if acquire_slab() fails

Subsystem: mm/pagealloc

    Hailong liu <liu.hailong6@zte.com.cn>:
      mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint

Subsystem: mm/memcg

    Hugh Dickins <hughd@google.com>:
      mm/memcontrol: fix warning in mem_cgroup_page_lruvec()

Subsystem: mm/kasan

    Hailong Liu <liu.hailong6@zte.com.cn>:
      arm/kasan: fix the array size of kasan_early_shadow_pte[]

Subsystem: mm/vmalloc

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/vmalloc.c: fix potential memory leak

Subsystem: mm/migration

    Jan Stancek <jstancek@redhat.com>:
      mm: migrate: initialize err in do_migrate_pages

Subsystem: mm/hugetlb

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/hugetlb: fix potential missing huge page size info

Subsystem: MAINTAINERS

    Vlastimil Babka <vbabka@suse.cz>:
      MAINTAINERS: add Vlastimil as slab allocators maintainer

Subsystem: mm/memory-failure

    Oscar Salvador <osalvador@suse.de>:
      mm,hwpoison: fix printing of page flags

Subsystem: mm/process_vm_access

    Andrew Morton <akpm@linux-foundation.org>:
      mm/process_vm_access.c: include compat.h

 MAINTAINERS                |    1 +
 include/linux/kasan.h      |    6 +++++-
 include/linux/memcontrol.h |    2 +-
 mm/hugetlb.c               |    2 +-
 mm/kasan/init.c            |    3 ++-
 mm/memory-failure.c        |    2 +-
 mm/mempolicy.c             |    2 +-
 mm/page_alloc.c            |   31 ++++++++++++++++---------------
 mm/process_vm_access.c     |    1 +
 mm/slub.c                  |    2 +-
 mm/vmalloc.c               |    4 +++-
 11 files changed, 33 insertions(+), 23 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-29 23:13 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-29 23:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

16 patches, based on dea8dcf2a9fa8cc540136a6cd885c3beece16ec3.

Subsystems affected by this patch series:

  mm/selftests
  mm/hugetlb
  kbuild
  checkpatch
  mm/pagecache
  mm/mremap
  mm/kasan
  misc
  lib
  mm/slub

Subsystem: mm/selftests

    Harish <harish@linux.ibm.com>:
      selftests/vm: fix building protection keys test

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      mm/hugetlb: fix deadlock in hugetlb_cow error path

Subsystem: kbuild

    Masahiro Yamada <masahiroy@kernel.org>:
      Revert "kbuild: avoid static_assert for genksyms"

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: prefer strscpy to strlcpy

Subsystem: mm/pagecache

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm: add prototype for __add_to_page_cache_locked()

    Baoquan He <bhe@redhat.com>:
      mm: memmap defer init doesn't work as expected

Subsystem: mm/mremap

    Kalesh Singh <kaleshsingh@google.com>:
      mm/mremap.c: fix extent calculation

    Nicholas Piggin <npiggin@gmail.com>:
      mm: generalise COW SMC TLB flushing race comment

Subsystem: mm/kasan

    Walter Wu <walter-zh.wu@mediatek.com>:
      kasan: fix null pointer dereference in kasan_record_aux_stack

Subsystem: misc

    Randy Dunlap <rdunlap@infradead.org>:
      local64.h: make <asm/local64.h> mandatory

    Huang Shijie <sjhuang@iluvatar.ai>:
      sizes.h: add SZ_8G/SZ_16G/SZ_32G macros

    Josh Poimboeuf <jpoimboe@redhat.com>:
      kdev_t: always inline major/minor helper functions

Subsystem: lib

    Huang Shijie <sjhuang@iluvatar.ai>:
      lib/genalloc: fix the overflow when size is too big

    Ilya Leoshkevich <iii@linux.ibm.com>:
      lib/zlib: fix inflating zlib streams on s390

    Randy Dunlap <rdunlap@infradead.org>:
      zlib: move EXPORT_SYMBOL() and MODULE_LICENSE() out of dfltcc_syms.c

Subsystem: mm/slub

    Roman Gushchin <guro@fb.com>:
      mm: slub: call account_slab_page() after slab page initialization

 arch/alpha/include/asm/local64.h    |    1 -
 arch/arc/include/asm/Kbuild         |    1 -
 arch/arm/include/asm/Kbuild         |    1 -
 arch/arm64/include/asm/Kbuild       |    1 -
 arch/csky/include/asm/Kbuild        |    1 -
 arch/h8300/include/asm/Kbuild       |    1 -
 arch/hexagon/include/asm/Kbuild     |    1 -
 arch/ia64/include/asm/local64.h     |    1 -
 arch/ia64/mm/init.c                 |    4 ++--
 arch/m68k/include/asm/Kbuild        |    1 -
 arch/microblaze/include/asm/Kbuild  |    1 -
 arch/mips/include/asm/Kbuild        |    1 -
 arch/nds32/include/asm/Kbuild       |    1 -
 arch/openrisc/include/asm/Kbuild    |    1 -
 arch/parisc/include/asm/Kbuild      |    1 -
 arch/powerpc/include/asm/Kbuild     |    1 -
 arch/riscv/include/asm/Kbuild       |    1 -
 arch/s390/include/asm/Kbuild        |    1 -
 arch/sh/include/asm/Kbuild          |    1 -
 arch/sparc/include/asm/Kbuild       |    1 -
 arch/x86/include/asm/local64.h      |    1 -
 arch/xtensa/include/asm/Kbuild      |    1 -
 include/asm-generic/Kbuild          |    1 +
 include/linux/build_bug.h           |    5 -----
 include/linux/kdev_t.h              |   22 +++++++++++-----------
 include/linux/mm.h                  |   12 ++++++++++--
 include/linux/sizes.h               |    3 +++
 lib/genalloc.c                      |   25 +++++++++++++------------
 lib/zlib_dfltcc/Makefile            |    2 +-
 lib/zlib_dfltcc/dfltcc.c            |    6 +++++-
 lib/zlib_dfltcc/dfltcc_deflate.c    |    3 +++
 lib/zlib_dfltcc/dfltcc_inflate.c    |    4 ++--
 lib/zlib_dfltcc/dfltcc_syms.c       |   17 -----------------
 mm/hugetlb.c                        |   22 +++++++++++++++++++++-
 mm/kasan/generic.c                  |    2 ++
 mm/memory.c                         |    8 +++++---
 mm/memory_hotplug.c                 |    2 +-
 mm/mremap.c                         |    4 +++-
 mm/page_alloc.c                     |    8 +++++---
 mm/slub.c                           |    5 ++---
 scripts/checkpatch.pl               |    6 ++++++
 tools/testing/selftests/vm/Makefile |   10 +++++-----
 42 files changed, 101 insertions(+), 91 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-22 19:58 incoming Andrew Morton
@ 2020-12-22 21:43 ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-12-22 21:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Tue, Dec 22, 2020 at 11:58 AM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> 60 patches, based on 8653b778e454a7708847aeafe689bce07aeeb94e.

I see that you enabled renaming in the patches. Lovely.

Can you also enable it in the diffstat?

>  74 files changed, 2869 insertions(+), 1553 deletions(-)

With -M in the diffstat, you should have seen

 72 files changed, 2775 insertions(+), 1460 deletions(-)

and if you add "--summary", you'll also see the rename part ofthe file
create/delete summary:

 rename mm/kasan/{tags_report.c => report_sw_tags.c} (78%)

which is often nice to see in addition to the line stats..

           Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-22 19:58 Andrew Morton
  2020-12-22 21:43 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-12-22 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


60 patches, based on 8653b778e454a7708847aeafe689bce07aeeb94e.

Subsystems affected by this patch series:

  mm/kasan

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: add hardware tag-based mode for arm64", v11:
      kasan: drop unnecessary GPL text from comment headers
      kasan: KASAN_VMALLOC depends on KASAN_GENERIC
      kasan: group vmalloc code
      kasan: shadow declarations only for software modes
      kasan: rename (un)poison_shadow to (un)poison_range
      kasan: rename KASAN_SHADOW_* to KASAN_GRANULE_*
      kasan: only build init.c for software modes
      kasan: split out shadow.c from common.c
      kasan: define KASAN_MEMORY_PER_SHADOW_PAGE
      kasan: rename report and tags files
      kasan: don't duplicate config dependencies
      kasan: hide invalid free check implementation
      kasan: decode stack frame only with KASAN_STACK_ENABLE
      kasan, arm64: only init shadow for software modes
      kasan, arm64: only use kasan_depth for software modes
      kasan, arm64: move initialization message
      kasan, arm64: rename kasan_init_tags and mark as __init
      kasan: rename addr_has_shadow to addr_has_metadata
      kasan: rename print_shadow_for_address to print_memory_metadata
      kasan: rename SHADOW layout macros to META
      kasan: separate metadata_fetch_row for each mode
      kasan: introduce CONFIG_KASAN_HW_TAGS

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      arm64: enable armv8.5-a asm-arch option
      arm64: mte: add in-kernel MTE helpers
      arm64: mte: reset the page tag in page->flags
      arm64: mte: add in-kernel tag fault handler
      arm64: kasan: allow enabling in-kernel MTE
      arm64: mte: convert gcr_user into an exclude mask
      arm64: mte: switch GCR_EL1 in kernel entry and exit
      kasan, mm: untag page address in free_reserved_area

    Andrey Konovalov <andreyknvl@google.com>:
      arm64: kasan: align allocations for HW_TAGS
      arm64: kasan: add arch layer for memory tagging helpers
      kasan: define KASAN_GRANULE_SIZE for HW_TAGS
      kasan, x86, s390: update undef CONFIG_KASAN
      kasan, arm64: expand CONFIG_KASAN checks
      kasan, arm64: implement HW_TAGS runtime
      kasan, arm64: print report from tag fault handler
      kasan, mm: reset tags when accessing metadata
      kasan, arm64: enable CONFIG_KASAN_HW_TAGS
      kasan: add documentation for hardware tag-based mode

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      kselftest/arm64: check GCR_EL1 after context switch

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: boot parameters for hardware tag-based mode", v4:
      kasan: simplify quarantine_put call site
      kasan: rename get_alloc/free_info
      kasan: introduce set_alloc_info
      kasan, arm64: unpoison stack only with CONFIG_KASAN_STACK
      kasan: allow VMAP_STACK for HW_TAGS mode
      kasan: remove __kasan_unpoison_stack
      kasan: inline kasan_reset_tag for tag-based modes
      kasan: inline random_tag for HW_TAGS
      kasan: open-code kasan_unpoison_slab
      kasan: inline (un)poison_range and check_invalid_free
      kasan: add and integrate kasan boot parameters
      kasan, mm: check kasan_enabled in annotations
      kasan, mm: rename kasan_poison_kfree
      kasan: don't round_up too much
      kasan: simplify assign_tag and set_tag calls
      kasan: clarify comment in __kasan_kfree_large
      kasan: sanitize objects when metadata doesn't fit
      kasan, mm: allow cache merging with no metadata
      kasan: update documentation

 Documentation/dev-tools/kasan.rst                         |  274 ++-
 arch/Kconfig                                              |    8 
 arch/arm64/Kconfig                                        |    9 
 arch/arm64/Makefile                                       |    7 
 arch/arm64/include/asm/assembler.h                        |    2 
 arch/arm64/include/asm/cache.h                            |    3 
 arch/arm64/include/asm/esr.h                              |    1 
 arch/arm64/include/asm/kasan.h                            |   17 
 arch/arm64/include/asm/memory.h                           |   15 
 arch/arm64/include/asm/mte-def.h                          |   16 
 arch/arm64/include/asm/mte-kasan.h                        |   67 
 arch/arm64/include/asm/mte.h                              |   22 
 arch/arm64/include/asm/processor.h                        |    2 
 arch/arm64/include/asm/string.h                           |    5 
 arch/arm64/include/asm/uaccess.h                          |   23 
 arch/arm64/kernel/asm-offsets.c                           |    3 
 arch/arm64/kernel/cpufeature.c                            |    3 
 arch/arm64/kernel/entry.S                                 |   41 
 arch/arm64/kernel/head.S                                  |    2 
 arch/arm64/kernel/hibernate.c                             |    5 
 arch/arm64/kernel/image-vars.h                            |    2 
 arch/arm64/kernel/kaslr.c                                 |    3 
 arch/arm64/kernel/module.c                                |    6 
 arch/arm64/kernel/mte.c                                   |  124 +
 arch/arm64/kernel/setup.c                                 |    2 
 arch/arm64/kernel/sleep.S                                 |    2 
 arch/arm64/kernel/smp.c                                   |    2 
 arch/arm64/lib/mte.S                                      |   16 
 arch/arm64/mm/copypage.c                                  |    9 
 arch/arm64/mm/fault.c                                     |   59 
 arch/arm64/mm/kasan_init.c                                |   41 
 arch/arm64/mm/mteswap.c                                   |    9 
 arch/arm64/mm/proc.S                                      |   23 
 arch/arm64/mm/ptdump.c                                    |    6 
 arch/s390/boot/string.c                                   |    1 
 arch/x86/boot/compressed/misc.h                           |    1 
 arch/x86/kernel/acpi/wakeup_64.S                          |    2 
 include/linux/kasan-checks.h                              |    2 
 include/linux/kasan.h                                     |  423 ++++-
 include/linux/mm.h                                        |   24 
 include/linux/moduleloader.h                              |    3 
 include/linux/page-flags-layout.h                         |    2 
 include/linux/sched.h                                     |    2 
 include/linux/string.h                                    |    2 
 init/init_task.c                                          |    2 
 kernel/fork.c                                             |    4 
 lib/Kconfig.kasan                                         |   71 
 lib/test_kasan.c                                          |    2 
 lib/test_kasan_module.c                                   |    2 
 mm/kasan/Makefile                                         |   33 
 mm/kasan/common.c                                         | 1006 +++-----------
 mm/kasan/generic.c                                        |   72 -
 mm/kasan/generic_report.c                                 |   13 
 mm/kasan/hw_tags.c                                        |  276 +++
 mm/kasan/init.c                                           |   25 
 mm/kasan/kasan.h                                          |  195 ++
 mm/kasan/quarantine.c                                     |   35 
 mm/kasan/report.c                                         |  363 +----
 mm/kasan/report_generic.c                                 |  169 ++
 mm/kasan/report_hw_tags.c                                 |   44 
 mm/kasan/report_sw_tags.c                                 |   22 
 mm/kasan/shadow.c                                         |  528 +++++++
 mm/kasan/sw_tags.c                                        |   34 
 mm/kasan/tags.c                                           |    7 
 mm/kasan/tags_report.c                                    |    7 
 mm/mempool.c                                              |    4 
 mm/page_alloc.c                                           |    9 
 mm/page_poison.c                                          |    2 
 mm/ptdump.c                                               |   13 
 mm/slab_common.c                                          |    5 
 mm/slub.c                                                 |   29 
 scripts/Makefile.lib                                      |    2 
 tools/testing/selftests/arm64/mte/Makefile                |    2 
 tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c |  155 ++
 74 files changed, 2869 insertions(+), 1553 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-18 22:00 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-18 22:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


78 patches, based on a409ed156a90093a03fe6a93721ddf4c591eac87.

Subsystems affected by this patch series:

  mm/memcg
  epoll
  mm/kasan
  mm/cleanups
  epoll

Subsystem: mm/memcg

    Alex Shi <alex.shi@linux.alibaba.com>:
    Patch series "bail out early for memcg disable":
      mm/memcg: bail early from swap accounting if memcg disabled
      mm/memcg: warning on !memcg after readahead page charged

    Wei Yang <richard.weiyang@gmail.com>:
      mm/memcg: remove unused definitions

    Shakeel Butt <shakeelb@google.com>:
      mm, kvm: account kvm_vcpu_mmap to kmemcg

    Hui Su <sh_def@163.com>:
      mm/memcontrol:rewrite mem_cgroup_page_lruvec()

Subsystem: epoll

    Soheil Hassas Yeganeh <soheil@google.com>:
    Patch series "simplify ep_poll":
      epoll: check for events when removing a timed out thread from the wait queue
      epoll: simplify signal handling
      epoll: pull fatal signal checks into ep_send_events()
      epoll: move eavail next to the list_empty_careful check
      epoll: simplify and optimize busy loop logic
      epoll: pull all code between fetch_events and send_event into the loop
      epoll: replace gotos with a proper loop
      epoll: eliminate unnecessary lock for zero timeout

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: add hardware tag-based mode for arm64", v11:
      kasan: drop unnecessary GPL text from comment headers
      kasan: KASAN_VMALLOC depends on KASAN_GENERIC
      kasan: group vmalloc code
      kasan: shadow declarations only for software modes
      kasan: rename (un)poison_shadow to (un)poison_range
      kasan: rename KASAN_SHADOW_* to KASAN_GRANULE_*
      kasan: only build init.c for software modes
      kasan: split out shadow.c from common.c
      kasan: define KASAN_MEMORY_PER_SHADOW_PAGE
      kasan: rename report and tags files
      kasan: don't duplicate config dependencies
      kasan: hide invalid free check implementation
      kasan: decode stack frame only with KASAN_STACK_ENABLE
      kasan, arm64: only init shadow for software modes
      kasan, arm64: only use kasan_depth for software modes
      kasan, arm64: move initialization message
      kasan, arm64: rename kasan_init_tags and mark as __init
      kasan: rename addr_has_shadow to addr_has_metadata
      kasan: rename print_shadow_for_address to print_memory_metadata
      kasan: rename SHADOW layout macros to META
      kasan: separate metadata_fetch_row for each mode
      kasan: introduce CONFIG_KASAN_HW_TAGS

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      arm64: enable armv8.5-a asm-arch option
      arm64: mte: add in-kernel MTE helpers
      arm64: mte: reset the page tag in page->flags
      arm64: mte: add in-kernel tag fault handler
      arm64: kasan: allow enabling in-kernel MTE
      arm64: mte: convert gcr_user into an exclude mask
      arm64: mte: switch GCR_EL1 in kernel entry and exit
      kasan, mm: untag page address in free_reserved_area

    Andrey Konovalov <andreyknvl@google.com>:
      arm64: kasan: align allocations for HW_TAGS
      arm64: kasan: add arch layer for memory tagging helpers
      kasan: define KASAN_GRANULE_SIZE for HW_TAGS
      kasan, x86, s390: update undef CONFIG_KASAN
      kasan, arm64: expand CONFIG_KASAN checks
      kasan, arm64: implement HW_TAGS runtime
      kasan, arm64: print report from tag fault handler
      kasan, mm: reset tags when accessing metadata
      kasan, arm64: enable CONFIG_KASAN_HW_TAGS
      kasan: add documentation for hardware tag-based mode

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      kselftest/arm64: check GCR_EL1 after context switch

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: boot parameters for hardware tag-based mode", v4:
      kasan: simplify quarantine_put call site
      kasan: rename get_alloc/free_info
      kasan: introduce set_alloc_info
      kasan, arm64: unpoison stack only with CONFIG_KASAN_STACK
      kasan: allow VMAP_STACK for HW_TAGS mode
      kasan: remove __kasan_unpoison_stack
      kasan: inline kasan_reset_tag for tag-based modes
      kasan: inline random_tag for HW_TAGS
      kasan: open-code kasan_unpoison_slab
      kasan: inline (un)poison_range and check_invalid_free
      kasan: add and integrate kasan boot parameters
      kasan, mm: check kasan_enabled in annotations
      kasan, mm: rename kasan_poison_kfree
      kasan: don't round_up too much
      kasan: simplify assign_tag and set_tag calls
      kasan: clarify comment in __kasan_kfree_large
      kasan: sanitize objects when metadata doesn't fit
      kasan, mm: allow cache merging with no metadata
      kasan: update documentation

Subsystem: mm/cleanups

    Colin Ian King <colin.king@canonical.com>:
      mm/Kconfig: fix spelling mistake "whats" -> "what's"

Subsystem: epoll

    Willem de Bruijn <willemb@google.com>:
    Patch series "add epoll_pwait2 syscall", v4:
      epoll: convert internal api to timespec64
      epoll: add syscall epoll_pwait2
      epoll: wire up syscall epoll_pwait2
      selftests/filesystems: expand epoll with epoll_pwait2

 Documentation/dev-tools/kasan.rst                             |  274 +-
 arch/Kconfig                                                  |    8 
 arch/alpha/kernel/syscalls/syscall.tbl                        |    1 
 arch/arm/tools/syscall.tbl                                    |    1 
 arch/arm64/Kconfig                                            |    9 
 arch/arm64/Makefile                                           |    7 
 arch/arm64/include/asm/assembler.h                            |    2 
 arch/arm64/include/asm/cache.h                                |    3 
 arch/arm64/include/asm/esr.h                                  |    1 
 arch/arm64/include/asm/kasan.h                                |   17 
 arch/arm64/include/asm/memory.h                               |   15 
 arch/arm64/include/asm/mte-def.h                              |   16 
 arch/arm64/include/asm/mte-kasan.h                            |   67 
 arch/arm64/include/asm/mte.h                                  |   22 
 arch/arm64/include/asm/processor.h                            |    2 
 arch/arm64/include/asm/string.h                               |    5 
 arch/arm64/include/asm/uaccess.h                              |   23 
 arch/arm64/include/asm/unistd.h                               |    2 
 arch/arm64/include/asm/unistd32.h                             |    2 
 arch/arm64/kernel/asm-offsets.c                               |    3 
 arch/arm64/kernel/cpufeature.c                                |    3 
 arch/arm64/kernel/entry.S                                     |   41 
 arch/arm64/kernel/head.S                                      |    2 
 arch/arm64/kernel/hibernate.c                                 |    5 
 arch/arm64/kernel/image-vars.h                                |    2 
 arch/arm64/kernel/kaslr.c                                     |    3 
 arch/arm64/kernel/module.c                                    |    6 
 arch/arm64/kernel/mte.c                                       |  124 +
 arch/arm64/kernel/setup.c                                     |    2 
 arch/arm64/kernel/sleep.S                                     |    2 
 arch/arm64/kernel/smp.c                                       |    2 
 arch/arm64/lib/mte.S                                          |   16 
 arch/arm64/mm/copypage.c                                      |    9 
 arch/arm64/mm/fault.c                                         |   59 
 arch/arm64/mm/kasan_init.c                                    |   41 
 arch/arm64/mm/mteswap.c                                       |    9 
 arch/arm64/mm/proc.S                                          |   23 
 arch/arm64/mm/ptdump.c                                        |    6 
 arch/ia64/kernel/syscalls/syscall.tbl                         |    1 
 arch/m68k/kernel/syscalls/syscall.tbl                         |    1 
 arch/microblaze/kernel/syscalls/syscall.tbl                   |    1 
 arch/mips/kernel/syscalls/syscall_n32.tbl                     |    1 
 arch/mips/kernel/syscalls/syscall_n64.tbl                     |    1 
 arch/mips/kernel/syscalls/syscall_o32.tbl                     |    1 
 arch/parisc/kernel/syscalls/syscall.tbl                       |    1 
 arch/powerpc/kernel/syscalls/syscall.tbl                      |    1 
 arch/s390/boot/string.c                                       |    1 
 arch/s390/kernel/syscalls/syscall.tbl                         |    1 
 arch/sh/kernel/syscalls/syscall.tbl                           |    1 
 arch/sparc/kernel/syscalls/syscall.tbl                        |    1 
 arch/x86/boot/compressed/misc.h                               |    1 
 arch/x86/entry/syscalls/syscall_32.tbl                        |    1 
 arch/x86/entry/syscalls/syscall_64.tbl                        |    1 
 arch/x86/kernel/acpi/wakeup_64.S                              |    2 
 arch/x86/kvm/x86.c                                            |    2 
 arch/xtensa/kernel/syscalls/syscall.tbl                       |    1 
 fs/eventpoll.c                                                |  359 ++-
 include/linux/compat.h                                        |    6 
 include/linux/kasan-checks.h                                  |    2 
 include/linux/kasan.h                                         |  423 ++--
 include/linux/memcontrol.h                                    |  137 -
 include/linux/mm.h                                            |   24 
 include/linux/mmdebug.h                                       |   13 
 include/linux/moduleloader.h                                  |    3 
 include/linux/page-flags-layout.h                             |    2 
 include/linux/sched.h                                         |    2 
 include/linux/string.h                                        |    2 
 include/linux/syscalls.h                                      |    5 
 include/uapi/asm-generic/unistd.h                             |    4 
 init/init_task.c                                              |    2 
 kernel/fork.c                                                 |    4 
 kernel/sys_ni.c                                               |    2 
 lib/Kconfig.kasan                                             |   71 
 lib/test_kasan.c                                              |    2 
 lib/test_kasan_module.c                                       |    2 
 mm/Kconfig                                                    |    2 
 mm/kasan/Makefile                                             |   33 
 mm/kasan/common.c                                             | 1006 ++--------
 mm/kasan/generic.c                                            |   72 
 mm/kasan/generic_report.c                                     |   13 
 mm/kasan/hw_tags.c                                            |  294 ++
 mm/kasan/init.c                                               |   25 
 mm/kasan/kasan.h                                              |  204 +-
 mm/kasan/quarantine.c                                         |   35 
 mm/kasan/report.c                                             |  363 +--
 mm/kasan/report_generic.c                                     |  169 +
 mm/kasan/report_hw_tags.c                                     |   44 
 mm/kasan/report_sw_tags.c                                     |   22 
 mm/kasan/shadow.c                                             |  541 +++++
 mm/kasan/sw_tags.c                                            |   34 
 mm/kasan/tags.c                                               |    7 
 mm/kasan/tags_report.c                                        |    7 
 mm/memcontrol.c                                               |   53 
 mm/mempool.c                                                  |    4 
 mm/page_alloc.c                                               |    9 
 mm/page_poison.c                                              |    2 
 mm/ptdump.c                                                   |   13 
 mm/slab_common.c                                              |    5 
 mm/slub.c                                                     |   29 
 scripts/Makefile.lib                                          |    2 
 tools/testing/selftests/arm64/mte/Makefile                    |    2 
 tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c     |  155 +
 tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c |   72 
 virt/kvm/coalesced_mmio.c                                     |    2 
 virt/kvm/kvm_main.c                                           |    2 
 105 files changed, 3268 insertions(+), 1873 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-16  4:41 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-16  4:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- lots of little subsystems

- a few post-linux-next MM material.  Most of this awaits more merging
  of other trees.


95 patches, based on 489e9fea66f31086f85d9a18e61e4791d94a56a4.

Subsystems affected by this patch series:

  mm/swap
  mm/memory-hotplug
  alpha
  procfs
  misc
  core-kernel
  bitmap
  lib
  lz4
  bitops
  checkpatch
  nilfs
  kdump
  rapidio
  gcov
  bfs
  relay
  resource
  ubsan
  reboot
  fault-injection
  lzo
  apparmor
  mm/pagemap
  mm/cleanups
  mm/gup

Subsystem: mm/swap

    Zhaoyang Huang <huangzhaoyang@gmail.com>:
      mm: fix a race on nr_swap_pages

Subsystem: mm/memory-hotplug

    Laurent Dufour <ldufour@linux.ibm.com>:
      mm/memory_hotplug: quieting offline operation

Subsystem: alpha

    Thomas Gleixner <tglx@linutronix.de>:
      alpha: replace bogus in_interrupt()

Subsystem: procfs

    Randy Dunlap <rdunlap@infradead.org>:
      procfs: delete duplicated words + other fixes

    Anand K Mistry <amistry@google.com>:
      proc: provide details on indirect branch speculation

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: fix lookup in /proc/net subdirectories after setns(2)

    Hui Su <sh_def@163.com>:
      fs/proc: make pde_get() return nothing

Subsystem: misc

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      asm-generic: force inlining of get_order() to work around gcc10 poor decision

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kernel.h: split out mathematical helpers

Subsystem: core-kernel

    Hui Su <sh_def@163.com>:
      kernel/acct.c: use #elif instead of #end and #elif

Subsystem: bitmap

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      include/linux/bitmap.h: convert bitmap_empty() / bitmap_full() to return boolean

    "Ma, Jianpeng" <jianpeng.ma@intel.com>:
      bitmap: remove unused function declaration

Subsystem: lib

    Geert Uytterhoeven <geert@linux-m68k.org>:
      lib/test_free_pages.c: add basic progress indicators

    "Gustavo A. R. Silva" <gustavoars@kernel.org>:
    Patch series "] lib/stackdepot.c: Replace one-element array with flexible-array member":
      lib/stackdepot.c: replace one-element array with flexible-array member
      lib/stackdepot.c: use flex_array_size() helper in memcpy()
      lib/stackdepot.c: use array_size() helper in jhash2()

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      lib/test_lockup.c: minimum fix to get it compiled on PREEMPT_RT

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      lib/list_kunit: follow new file name convention for KUnit tests
      lib/linear_ranges_kunit: follow new file name convention for KUnit tests
      lib/bits_kunit: follow new file name convention for KUnit tests
      lib/cmdline: fix get_option() for strings starting with hyphen
      lib/cmdline: allow NULL to be an output for get_option()
      lib/cmdline_kunit: add a new test suite for cmdline API

    Jakub Jelinek <jakub@redhat.com>:
      ilog2: improve ilog2 for constant arguments

    Nick Desaulniers <ndesaulniers@google.com>:
      lib/string: remove unnecessary #undefs

    Daniel Axtens <dja@axtens.net>:
    Patch series "Fortify strscpy()", v7:
      lib: string.h: detect intra-object overflow in fortified string functions
      lkdtm: tests for FORTIFY_SOURCE

    Francis Laniel <laniel_francis@privacyrequired.com>:
      string.h: add FORTIFY coverage for strscpy()
      drivers/misc/lkdtm: add new file in LKDTM to test fortified strscpy
      drivers/misc/lkdtm/lkdtm.h: correct wrong filenames in comment

    Alexey Dobriyan <adobriyan@gmail.com>:
      lib: cleanup kstrto*() usage

Subsystem: lz4

    Gao Xiang <hsiangkao@redhat.com>:
      lib/lz4: explicitly support in-place decompression

Subsystem: bitops

    Syed Nayyar Waris <syednwaris@gmail.com>:
    Patch series "Introduce the for_each_set_clump macro", v12:
      bitops: introduce the for_each_set_clump macro
      lib/test_bitmap.c: add for_each_set_clump test cases
      gpio: thunderx: utilize for_each_set_clump macro
      gpio: xilinx: utilize generic bitmap_get_value and _set_value

Subsystem: checkpatch

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: add new exception to repeated word check

    Aditya Srivastava <yashsri421@gmail.com>:
      checkpatch: fix false positives in REPEATED_WORD warning

    Łukasz Stelmach <l.stelmach@samsung.com>:
      checkpatch: ignore generated CamelCase defines and enum values

    Joe Perches <joe@perches.com>:
      checkpatch: prefer static const declarations
      checkpatch: allow --fix removal of unnecessary break statements

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: extend attributes check to handle more patterns

    Tom Rix <trix@redhat.com>:
      checkpatch: add a fixer for missing newline at eof

    Joe Perches <joe@perches.com>:
      checkpatch: update __attribute__((section("name"))) quote removal

    Aditya Srivastava <yashsri421@gmail.com>:
      checkpatch: add fix option for GERRIT_CHANGE_ID

    Joe Perches <joe@perches.com>:
      checkpatch: add __alias and __weak to suggested __attribute__ conversions

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: improve email parsing
      checkpatch: fix spelling errors and remove repeated word

    Aditya Srivastava <yashsri421@gmail.com>:
      checkpatch: avoid COMMIT_LOG_LONG_LINE warning for signature tags

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: fix unescaped left brace

    Aditya Srivastava <yashsri421@gmail.com>:
      checkpatch: add fix option for ASSIGNMENT_CONTINUATIONS
      checkpatch: add fix option for LOGICAL_CONTINUATIONS
      checkpatch: add fix and improve warning msg for non-standard signature

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: add warning for unnecessary use of %h[xudi] and %hh[xudi]
      checkpatch: add warning for lines starting with a '#' in commit log
      checkpatch: fix TYPO_SPELLING check for words with apostrophe

    Joe Perches <joe@perches.com>:
      checkpatch: add printk_once and printk_ratelimit to prefer pr_<level> warning

Subsystem: nilfs

    Alex Shi <alex.shi@linux.alibaba.com>:
      fs/nilfs2: remove some unused macros to tame gcc

Subsystem: kdump

    Alexander Egorenkov <egorenar@linux.ibm.com>:
      kdump: append uts_namespace.name offset to VMCOREINFO

Subsystem: rapidio

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      rapidio: remove unused rio_get_asm() and rio_get_device()

Subsystem: gcov

    Nick Desaulniers <ndesaulniers@google.com>:
      gcov: remove support for GCC < 4.9

    Alex Shi <alex.shi@linux.alibaba.com>:
      gcov: fix kernel-doc markup issue

Subsystem: bfs

    Randy Dunlap <rdunlap@infradead.org>:
      bfs: don't use WARNING: string when it's just info.

Subsystem: relay

    Jani Nikula <jani.nikula@intel.com>:
    Patch series "relay: cleanup and const callbacks", v2:
      relay: remove unused buf_mapped and buf_unmapped callbacks
      relay: require non-NULL callbacks in relay_open()
      relay: make create_buf_file and remove_buf_file callbacks mandatory
      relay: allow the use of const callback structs
      drm/i915: make relay callbacks const
      ath10k: make relay callbacks const
      ath11k: make relay callbacks const
      ath9k: make relay callbacks const
      blktrace: make relay callbacks const

Subsystem: resource

    Mauro Carvalho Chehab <mchehab+huawei@kernel.org>:
      kernel/resource.c: fix kernel-doc markups

Subsystem: ubsan

    Kees Cook <keescook@chromium.org>:
    Patch series "Clean up UBSAN Makefile", v2:
      ubsan: remove redundant -Wno-maybe-uninitialized
      ubsan: move cc-option tests into Kconfig
      ubsan: disable object-size sanitizer under GCC
      ubsan: disable UBSAN_TRAP for all*config
      ubsan: enable for all*config builds
      ubsan: remove UBSAN_MISC in favor of individual options
      ubsan: expand tests and reporting

    Dmitry Vyukov <dvyukov@google.com>:
      kcov: don't instrument with UBSAN

    Zou Wei <zou_wei@huawei.com>:
      lib/ubsan.c: mark type_check_kinds with static keyword

Subsystem: reboot

    Matteo Croce <mcroce@microsoft.com>:
      reboot: refactor and comment the cpu selection code
      reboot: allow to specify reboot mode via sysfs
      reboot: remove cf9_safe from allowed types and rename cf9_force
    Patch series "reboot: sysfs improvements":
      reboot: allow to override reboot type if quirks are found
      reboot: hide from sysfs not applicable settings

Subsystem: fault-injection

    Barnabás Pőcze <pobrn@protonmail.com>:
      fault-injection: handle EI_ETYPE_TRUE

Subsystem: lzo

    Jason Yan <yanaijie@huawei.com>:
      lib/lzo/lzo1x_compress.c: make lzogeneric1x_1_compress() static

Subsystem: apparmor

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      apparmor: remove duplicate macro list_entry_is_head()

Subsystem: mm/pagemap

    Christoph Hellwig <hch@lst.de>:
    Patch series "simplify follow_pte a bit":
      mm: unexport follow_pte_pmd
      mm: simplify follow_pte{,pmd}

Subsystem: mm/cleanups

    Haitao Shi <shihaitao1@huawei.com>:
      mm: fix some spelling mistakes in comments

Subsystem: mm/gup

    Jann Horn <jannh@google.com>:
      mmap locking API: don't check locking if the mm isn't live yet
      mm/gup: assert that the mmap lock is held in __get_user_pages()

 Documentation/ABI/testing/sysfs-kernel-reboot    |   32 
 Documentation/admin-guide/kdump/vmcoreinfo.rst   |    6 
 Documentation/dev-tools/ubsan.rst                |    1 
 Documentation/filesystems/proc.rst               |    2 
 MAINTAINERS                                      |    5 
 arch/alpha/kernel/process.c                      |    2 
 arch/powerpc/kernel/vmlinux.lds.S                |    4 
 arch/s390/pci/pci_mmio.c                         |    4 
 drivers/gpio/gpio-thunderx.c                     |   11 
 drivers/gpio/gpio-xilinx.c                       |   61 -
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c       |    2 
 drivers/misc/lkdtm/Makefile                      |    1 
 drivers/misc/lkdtm/bugs.c                        |   50 +
 drivers/misc/lkdtm/core.c                        |    3 
 drivers/misc/lkdtm/fortify.c                     |   82 ++
 drivers/misc/lkdtm/lkdtm.h                       |   19 
 drivers/net/wireless/ath/ath10k/spectral.c       |    2 
 drivers/net/wireless/ath/ath11k/spectral.c       |    2 
 drivers/net/wireless/ath/ath9k/common-spectral.c |    2 
 drivers/rapidio/rio.c                            |   81 --
 fs/bfs/inode.c                                   |    2 
 fs/dax.c                                         |    9 
 fs/exec.c                                        |    8 
 fs/nfs/callback_proc.c                           |    5 
 fs/nilfs2/segment.c                              |    5 
 fs/proc/array.c                                  |   28 
 fs/proc/base.c                                   |    2 
 fs/proc/generic.c                                |   24 
 fs/proc/internal.h                               |   10 
 fs/proc/proc_net.c                               |   20 
 include/asm-generic/bitops/find.h                |   19 
 include/asm-generic/getorder.h                   |    2 
 include/linux/bitmap.h                           |   67 +-
 include/linux/bitops.h                           |   24 
 include/linux/dcache.h                           |    1 
 include/linux/iommu-helper.h                     |    4 
 include/linux/kernel.h                           |  173 -----
 include/linux/log2.h                             |    3 
 include/linux/math.h                             |  177 +++++
 include/linux/mm.h                               |    6 
 include/linux/mm_types.h                         |   10 
 include/linux/mmap_lock.h                        |   16 
 include/linux/proc_fs.h                          |    8 
 include/linux/rcu_node_tree.h                    |    2 
 include/linux/relay.h                            |   29 
 include/linux/rio_drv.h                          |    3 
 include/linux/string.h                           |   75 +-
 include/linux/units.h                            |    2 
 kernel/Makefile                                  |    3 
 kernel/acct.c                                    |    7 
 kernel/crash_core.c                              |    1 
 kernel/fail_function.c                           |    6 
 kernel/gcov/gcc_4_7.c                            |   10 
 kernel/reboot.c                                  |  308 ++++++++-
 kernel/relay.c                                   |  111 ---
 kernel/resource.c                                |   24 
 kernel/trace/blktrace.c                          |    2 
 lib/Kconfig.debug                                |   11 
 lib/Kconfig.ubsan                                |  154 +++-
 lib/Makefile                                     |    7 
 lib/bits_kunit.c                                 |   75 ++
 lib/cmdline.c                                    |   20 
 lib/cmdline_kunit.c                              |  100 +++
 lib/errname.c                                    |    1 
 lib/error-inject.c                               |    2 
 lib/errseq.c                                     |    1 
 lib/find_bit.c                                   |   17 
 lib/linear_ranges_kunit.c                        |  228 +++++++
 lib/list-test.c                                  |  748 -----------------------
 lib/list_kunit.c                                 |  748 +++++++++++++++++++++++
 lib/lz4/lz4_decompress.c                         |    6 
 lib/lz4/lz4defs.h                                |    1 
 lib/lzo/lzo1x_compress.c                         |    2 
 lib/math/div64.c                                 |    4 
 lib/math/int_pow.c                               |    2 
 lib/math/int_sqrt.c                              |    3 
 lib/math/reciprocal_div.c                        |    9 
 lib/stackdepot.c                                 |   11 
 lib/string.c                                     |    4 
 lib/test_bitmap.c                                |  143 ++++
 lib/test_bits.c                                  |   75 --
 lib/test_firmware.c                              |    9 
 lib/test_free_pages.c                            |    5 
 lib/test_kmod.c                                  |   26 
 lib/test_linear_ranges.c                         |  228 -------
 lib/test_lockup.c                                |   16 
 lib/test_ubsan.c                                 |   74 ++
 lib/ubsan.c                                      |    2 
 mm/filemap.c                                     |    2 
 mm/gup.c                                         |    2 
 mm/huge_memory.c                                 |    2 
 mm/khugepaged.c                                  |    2 
 mm/memblock.c                                    |    2 
 mm/memory.c                                      |   36 -
 mm/memory_hotplug.c                              |    2 
 mm/migrate.c                                     |    2 
 mm/page_ext.c                                    |    2 
 mm/swapfile.c                                    |   11 
 scripts/Makefile.ubsan                           |   49 -
 scripts/checkpatch.pl                            |  495 +++++++++++----
 security/apparmor/apparmorfs.c                   |    3 
 tools/testing/selftests/lkdtm/tests.txt          |    1 
 102 files changed, 3022 insertions(+), 1899 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15 22:49   ` incoming Linus Torvalds
@ 2020-12-15 22:55     ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-15 22:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-MM, mm-commits

On Tue, 15 Dec 2020 14:49:24 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Dec 15, 2020 at 2:48 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > I will try to apply it on top of my merge of your previous series instead.
> 
> Yes, then it applies cleanly. So apparently we just have different
> concepts of what really constitutes a "base" for applying your series.
> 

oop, sorry, yes, the "based on" thing was wrong because I had two
series in flight simultaneously.  I've never tried that before..


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15 22:48 ` incoming Linus Torvalds
@ 2020-12-15 22:49   ` Linus Torvalds
  2020-12-15 22:55     ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-12-15 22:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Tue, Dec 15, 2020 at 2:48 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I will try to apply it on top of my merge of your previous series instead.

Yes, then it applies cleanly. So apparently we just have different
concepts of what really constitutes a "base" for applying your series.

              Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15 20:32 incoming Andrew Morton
  2020-12-15 21:00 ` incoming Linus Torvalds
@ 2020-12-15 22:48 ` Linus Torvalds
  2020-12-15 22:49   ` incoming Linus Torvalds
  1 sibling, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-12-15 22:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Tue, Dec 15, 2020 at 12:32 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> - more MM work: a memcg scalability improvememt
>
> 19 patches, based on 148842c98a24e508aecb929718818fbf4c2a6ff3.

With your re-send, I get all patches, but they don't actually apply cleanly.

Is that base correct?

I get

  error: patch failed: mm/huge_memory.c:2750
  error: mm/huge_memory.c: patch does not apply
  Patch failed at 0004 mm/thp: narrow lru locking

for that patch "[patch 04/19] mm/thp: narrow lru locking", and that's
definitely true: the patch fragment has

@@ -2750,7 +2751,7 @@ int split_huge_page_to_list(struct page
                                __dec_lruvec_page_state(head, NR_FILE_THPS);
                }

-               __split_huge_page(page, list, end, flags);
+               __split_huge_page(page, list, end);
                ret = 0;
        } else {
                if (IS_ENABLED(CONFIG_DEBUG_VM) && mapcount) {

but that __dec_lruvec_page_state() conversion was done by your
previous commit series.

So I have the feeling that what you actually mean by "base" isn't
actually really the base for that series at all..

I will try to apply it on top of my merge of your previous series instead.

              Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15 20:32 incoming Andrew Morton
@ 2020-12-15 21:00 ` Linus Torvalds
  2020-12-15 22:48 ` incoming Linus Torvalds
  1 sibling, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-12-15 21:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, mm-commits

On Tue, Dec 15, 2020 at 12:32 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> - more MM work: a memcg scalability improvememt
>
> 19 patches, based on 148842c98a24e508aecb929718818fbf4c2a6ff3.

I'm not seeing patch 10/19 at all.

And patch 19/19 is corrupted and has an attachment with a '^P'
character in it. I could fix it up, but with the missing patch in the
middle I'm not going to even try. 'b4' is also very unhappy about that
patch 19/19.

I don't know what went wrong, but I'll ignore this send - please
re-send the series at your leisure, ok?

            Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-15 20:32 Andrew Morton
  2020-12-15 21:00 ` incoming Linus Torvalds
  2020-12-15 22:48 ` incoming Linus Torvalds
  0 siblings, 2 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-15 20:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


- more MM work: a memcg scalability improvememt

19 patches, based on 148842c98a24e508aecb929718818fbf4c2a6ff3.

Subsystems affected by this patch series:


    Alex Shi <alex.shi@linux.alibaba.com>:
    Patch series "per memcg lru lock", v21:
      mm/thp: move lru_add_page_tail() to huge_memory.c
      mm/thp: use head for head page in lru_add_page_tail()
      mm/thp: simplify lru_add_page_tail()
      mm/thp: narrow lru locking
      mm/vmscan: remove unnecessary lruvec adding
      mm/rmap: stop store reordering issue on page->mapping

    Hugh Dickins <hughd@google.com>:
      mm: page_idle_get_page() does not need lru_lock

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/memcg: add debug checking in lock_page_memcg
      mm/swap.c: fold vm event PGROTATED into pagevec_move_tail_fn
      mm/lru: move lock into lru_note_cost
      mm/vmscan: remove lruvec reget in move_pages_to_lru
      mm/mlock: remove lru_lock on TestClearPageMlocked
      mm/mlock: remove __munlock_isolate_lru_page()
      mm/lru: introduce TestClearPageLRU()
      mm/compaction: do page isolation first in compaction
      mm/swap.c: serialize memcg changes in pagevec_lru_move_fn
      mm/lru: replace pgdat lru_lock with lruvec lock

    Alexander Duyck <alexander.h.duyck@linux.intel.com>:
      mm/lru: introduce relock_page_lruvec()

    Hugh Dickins <hughd@google.com>:
      mm/lru: revise the comments of lru_lock

 Documentation/admin-guide/cgroup-v1/memcg_test.rst |   15 -
 Documentation/admin-guide/cgroup-v1/memory.rst     |   23 -
 Documentation/trace/events-kmem.rst                |    2 
 Documentation/vm/unevictable-lru.rst               |   22 -
 include/linux/memcontrol.h                         |  110 +++++++
 include/linux/mm_types.h                           |    2 
 include/linux/mmzone.h                             |    6 
 include/linux/page-flags.h                         |    1 
 include/linux/swap.h                               |    4 
 mm/compaction.c                                    |   98 ++++---
 mm/filemap.c                                       |    4 
 mm/huge_memory.c                                   |  109 ++++---
 mm/memcontrol.c                                    |   84 +++++-
 mm/mlock.c                                         |   93 ++----
 mm/mmzone.c                                        |    1 
 mm/page_alloc.c                                    |    1 
 mm/page_idle.c                                     |    4 
 mm/rmap.c                                          |   12 
 mm/swap.c                                          |  292 ++++++++-------------
 mm/vmscan.c                                        |  239 ++++++++---------
 mm/workingset.c                                    |    2 
 21 files changed, 644 insertions(+), 480 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15  3:30   ` incoming Linus Torvalds
@ 2020-12-15 14:04     ` Konstantin Ryabitsev
  0 siblings, 0 replies; 307+ messages in thread
From: Konstantin Ryabitsev @ 2020-12-15 14:04 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, mm-commits, Linux-MM

On Mon, Dec 14, 2020 at 07:30:54PM -0800, Linus Torvalds wrote:
> > All the patches except for _one_ get a nice little green check-mark
> > next to them when I use 'git am' on this series.
> >
> > The one that did not was [patch 192/200].
> >
> > I have no idea why
> 
> Hmm. It looks like that patch is the only one in the series with the
> ">From" marker in the commit message, from the silly "clarify that
> this isn't the first line in a new message in mbox format".
> 
> And "b4 am" has turned the single ">" into two, making the stupid
> marker worse, and actually corrupting the end result.

It's a bug in b4 that I overlooked. Public-inbox emits mboxrd-formatted 
.mbox files, while Python's mailbox.mbox consumes mboxo only. The main 
distinction between the two is precisely that mboxrd will convert 
">From " into ">>From " in an attempt to avoid corruption during
escape/unescape (it didn't end up fixing the problem 100% and mostly 
introduced incompatibilities like this one).

I have a fix in master/stable-0.6.y and I'll release a 0.6.2 before the 
end of the week.

Thanks for the report.

-K


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15  3:25 ` incoming Linus Torvalds
@ 2020-12-15  3:30   ` Linus Torvalds
  2020-12-15 14:04     ` incoming Konstantin Ryabitsev
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-12-15  3:30 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: mm-commits, Linux-MM

On Mon, Dec 14, 2020 at 7:25 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> All the patches except for _one_ get a nice little green check-mark
> next to them when I use 'git am' on this series.
>
> The one that did not was [patch 192/200].
>
> I have no idea why

Hmm. It looks like that patch is the only one in the series with the
">From" marker in the commit message, from the silly "clarify that
this isn't the first line in a new message in mbox format".

And "b4 am" has turned the single ">" into two, making the stupid
marker worse, and actually corrupting the end result.

Coincidence? Or cause?

            Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-12-15  3:02 incoming Andrew Morton
@ 2020-12-15  3:25 ` Linus Torvalds
  2020-12-15  3:30   ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-12-15  3:25 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: mm-commits, Linux-MM

On Mon, Dec 14, 2020 at 7:02 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> 200 patches, based on 2c85ebc57b3e1817b6ce1a6b703928e113a90442.

I haven't actually processed the patches yet, but I have a question
for Konstantin wrt b4.

All the patches except for _one_ get a nice little green check-mark
next to them when I use 'git am' on this series.

The one that did not was [patch 192/200].

I have no idea why - and it doesn't matter a lot to me, it just stood
out as being different. I'm assuming Andrew has started doing patch
attestation, and that patch failed. But if so, maybe Konstantin wants
to know what went wrong.

Konstantin?

            Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-15  3:02 Andrew Morton
  2020-12-15  3:25 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-12-15  3:02 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- a few random little subsystems

- almost all of the MM patches which are staged ahead of linux-next
  material.  I'll trickle to post-linux-next work in as the dependents
  get merged up.


200 patches, based on 2c85ebc57b3e1817b6ce1a6b703928e113a90442.

Subsystems affected by this patch series:

  kthread
  kbuild
  ide
  ntfs
  ocfs2
  arch
  mm/slab-generic
  mm/slab
  mm/slub
  mm/dax
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/shmem
  mm/memcg
  mm/pagemap
  mm/mremap
  mm/hmm
  mm/vmalloc
  mm/documentation
  mm/kasan
  mm/pagealloc
  mm/memory-failure
  mm/hugetlb
  mm/vmscan
  mm/z3fold
  mm/compaction
  mm/oom-kill
  mm/migration
  mm/cma
  mm/page-poison
  mm/userfaultfd
  mm/zswap
  mm/zsmalloc
  mm/uaccess
  mm/zram
  mm/cleanups

Subsystem: kthread

    Rob Clark <robdclark@chromium.org>:
      kthread: add kthread_work tracepoints

    Petr Mladek <pmladek@suse.com>:
      kthread_worker: document CPU hotplug handling

Subsystem: kbuild

    Petr Vorel <petr.vorel@gmail.com>:
      uapi: move constants from <linux/kernel.h> to <linux/const.h>

Subsystem: ide

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      ide/falcon: remove in_interrupt() usage
      ide: remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister()

Subsystem: ntfs

    Alex Shi <alex.shi@linux.alibaba.com>:
      fs/ntfs: remove unused varibles
      fs/ntfs: remove unused variable attr_len

Subsystem: ocfs2

    Tom Rix <trix@redhat.com>:
      fs/ocfs2/cluster/tcp.c: remove unneeded break

    Mauricio Faria de Oliveira <mfo@canonical.com>:
      ocfs2: ratelimit the 'max lookup times reached' notice

Subsystem: arch

    Colin Ian King <colin.king@canonical.com>:
      arch/Kconfig: fix spelling mistakes

Subsystem: mm/slab-generic

    Hui Su <sh_def@163.com>:
      mm/slab_common.c: use list_for_each_entry in dump_unreclaimable_slab()

    Bartosz Golaszewski <bgolaszewski@baylibre.com>:
    Patch series "slab: provide and use krealloc_array()", v3:
      mm: slab: clarify krealloc()'s behavior with __GFP_ZERO
      mm: slab: provide krealloc_array()
      ALSA: pcm: use krealloc_array()
      vhost: vringh: use krealloc_array()
      pinctrl: use krealloc_array()
      edac: ghes: use krealloc_array()
      drm: atomic: use krealloc_array()
      hwtracing: intel: use krealloc_array()
      dma-buf: use krealloc_array()

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slab, slub: clear the slab_cache field when freeing page

Subsystem: mm/slab

    Alexander Popov <alex.popov@linux.com>:
      mm/slab: rerform init_on_free earlier

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: use kmem_cache_debug_flags() in deactivate_slab()

    Bharata B Rao <bharata@linux.ibm.com>:
      mm/slub: let number of online CPUs determine the slub page order

Subsystem: mm/dax

    Dan Williams <dan.j.williams@intel.com>:
      device-dax/kmem: use struct_size()

Subsystem: mm/debug

    Zhenhua Huang <zhenhuah@codeaurora.org>:
      mm: fix page_owner initializing issue for arm32

    Liam Mark <lmark@codeaurora.org>:
      mm/page_owner: record timestamp and pid

Subsystem: mm/pagecache

    Kent Overstreet <kent.overstreet@gmail.com>:
    Patch series "generic_file_buffered_read() improvements", v2:
      mm/filemap/c: break generic_file_buffered_read up into multiple functions
      mm/filemap.c: generic_file_buffered_read() now uses find_get_pages_contig

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/truncate: add parameter explanation for invalidate_mapping_pagevec

    Hailong Liu <carver4lio@163.com>:
      mm/filemap.c: remove else after a return

Subsystem: mm/gup

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "selftests/vm: gup_test, hmm-tests, assorted improvements", v3:
      mm/gup_benchmark: rename to mm/gup_test
      selftests/vm: use a common gup_test.h
      selftests/vm: rename run_vmtests --> run_vmtests.sh
      selftests/vm: minor cleanup: Makefile and gup_test.c
      selftests/vm: only some gup_test items are really benchmarks
      selftests/vm: gup_test: introduce the dump_pages() sub-test
      selftests/vm: run_vmtests.sh: update and clean up gup_test invocation
      selftests/vm: hmm-tests: remove the libhugetlbfs dependency
      selftests/vm: 2x speedup for run_vmtests.sh

    Barry Song <song.bao.hua@hisilicon.com>:
      mm/gup_test.c: mark gup_test_init as __init function
      mm/gup_test: GUP_TEST depends on DEBUG_FS

    Jason Gunthorpe <jgg@nvidia.com>:
    Patch series "Add a seqcount between gup_fast and copy_page_range()", v4:
      mm/gup: reorganize internal_get_user_pages_fast()
      mm/gup: prevent gup_fast from racing with COW during fork
      mm/gup: remove the vma allocation from gup_longterm_locked()
      mm/gup: combine put_compound_head() and unpin_user_page()

Subsystem: mm/swap

    Ralph Campbell <rcampbell@nvidia.com>:
      mm: handle zone device pages in release_pages()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/swapfile.c: use helper function swap_count() in add_swap_count_continuation()
      mm/swap_state: skip meaningless swap cache readahead when ra_info.win == 0
      mm/swapfile.c: remove unnecessary out label in __swap_duplicate()
      mm/swapfile.c: use memset to fill the swap_map with SWAP_HAS_CACHE

    Jeff Layton <jlayton@kernel.org>:
      mm: remove pagevec_lookup_range_nr_tag()

Subsystem: mm/shmem

    Hui Su <sh_def@163.com>:
      mm/shmem.c: make shmem_mapping() inline

    Randy Dunlap <rdunlap@infradead.org>:
      tmpfs: fix Documentation nits

Subsystem: mm/memcg

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: add file_thp, shmem_thp to memory.stat

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: remove unused mod_memcg_obj_state()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: memcontrol: eliminate redundant check in __mem_cgroup_insert_exceeded()

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcg/slab: fix return of child memcg objcg for root memcg
      mm: memcg/slab: fix use after free in obj_cgroup_charge

    Shakeel Butt <shakeelb@google.com>:
      mm/rmap: always do TTU_IGNORE_ACCESS

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/memcg: update page struct member in comments

    Roman Gushchin <guro@fb.com>:
      mm: memcg: fix obsolete code comments
    Patch series "mm: memcg: deprecate cgroup v1 non-hierarchical mode", v1:
      mm: memcg: deprecate the non-hierarchical mode
      docs: cgroup-v1: reflect the deprecation of the non-hierarchical mode
      cgroup: remove obsoleted broken_hierarchy and warned_broken_hierarchy

    Hui Su <sh_def@163.com>:
      mm/page_counter: use page_counter_read in page_counter_set_max

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      mm: memcg: remove obsolete memcg_has_children()

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcg/slab: rename *_lruvec_slab_state to *_lruvec_kmem_state

    Kaixu Xia <kaixuxia@tencent.com>:
      mm: memcontrol: sssign boolean values to a bool variable

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/memcg: remove incorrect comment

    Shakeel Butt <shakeelb@google.com>:
    Patch series "memcg: add pagetable comsumption to memory.stat", v2:
      mm: move lruvec stats update functions to vmstat.h
      mm: memcontrol: account pagetables per node

Subsystem: mm/pagemap

    Dan Williams <dan.j.williams@intel.com>:
      xen/unpopulated-alloc: consolidate pgmap manipulation

    Kalesh Singh <kaleshsingh@google.com>:
    Patch series "Speed up mremap on large regions", v4:
      kselftests: vm: add mremap tests
      mm: speedup mremap on 1GB or larger regions
      arm64: mremap speedup - enable HAVE_MOVE_PUD
      x86: mremap speedup - Enable HAVE_MOVE_PUD

    John Hubbard <jhubbard@nvidia.com>:
      mm: cleanup: remove unused tsk arg from __access_remote_vm

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/mapping_dirty_helpers: enhance the kernel-doc markups
      mm/page_vma_mapped.c: add colon to fix kernel-doc markups error for check_pte

    Axel Rasmussen <axelrasmussen@google.com>:
      mm: mmap_lock: add tracepoints around lock acquisition

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      sparc: fix handling of page table constructor failure
      mm: move free_unref_page to mm/internal.h

Subsystem: mm/mremap

    Dmitry Safonov <dima@arista.com>:
    Patch series "mremap: move_vma() fixes":
      mm/mremap: account memory on do_munmap() failure
      mm/mremap: for MREMAP_DONTUNMAP check security_vm_enough_memory_mm()
      mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio
      vm_ops: rename .split() callback to .may_split()
      mremap: check if it's possible to split original vma
      mm: forbid splitting special mappings

Subsystem: mm/hmm

    Daniel Vetter <daniel.vetter@ffwll.ch>:
      mm: track mmu notifiers in fs_reclaim_acquire/release
      mm: extract might_alloc() debug check
      locking/selftests: add testcases for fs_reclaim

Subsystem: mm/vmalloc

    Andrew Morton <akpm@linux-foundation.org>:
      mm/vmalloc.c:__vmalloc_area_node(): avoid 32-bit overflow

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: use free_vm_area() if an allocation fails
      mm/vmalloc: rework the drain logic

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/vmalloc: add 'align' parameter explanation for pvm_determine_end_from_reverse

    Baolin Wang <baolin.wang@linux.alibaba.com>:
      mm/vmalloc.c: remove unnecessary return statement

    Waiman Long <longman@redhat.com>:
      mm/vmalloc: Fix unlock order in s_stop()

Subsystem: mm/documentation

    Alex Shi <alex.shi@linux.alibaba.com>:
      docs/vm: remove unused 3 items explanation for /proc/vmstat

Subsystem: mm/kasan

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      mm/vmalloc.c: fix kasan shadow poisoning size

    Walter Wu <walter-zh.wu@mediatek.com>:
    Patch series "kasan: add workqueue stack for generic KASAN", v5:
      workqueue: kasan: record workqueue stack
      kasan: print workqueue stack
      lib/test_kasan.c: add workqueue test case
      kasan: update documentation for generic kasan

    Marco Elver <elver@google.com>:
      lkdtm: disable KASAN for rodata.o

Subsystem: mm/pagealloc

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "arch, mm: deprecate DISCONTIGMEM", v2:
      alpha: switch from DISCONTIGMEM to SPARSEMEM
      ia64: remove custom __early_pfn_to_nid()
      ia64: remove 'ifdef CONFIG_ZONE_DMA32' statements
      ia64: discontig: paging_init(): remove local max_pfn calculation
      ia64: split virtual map initialization out of paging_init()
      ia64: forbid using VIRTUAL_MEM_MAP with FLATMEM
      ia64: make SPARSEMEM default and disable DISCONTIGMEM
      arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
      arm, arm64: move free_unused_memmap() to generic mm
      arc: use FLATMEM with freeing of unused memory map instead of DISCONTIGMEM
      m68k/mm: make node data and node setup depend on CONFIG_DISCONTIGMEM
      m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM
      m68k: deprecate DISCONTIGMEM
    Patch series "arch, mm: improve robustness of direct map manipulation", v7:
      mm: introduce debug_pagealloc_{map,unmap}_pages() helpers
      PM: hibernate: make direct map manipulations more explicit
      arch, mm: restore dependency of __kernel_map_pages() on DEBUG_PAGEALLOC
      arch, mm: make kernel_page_present() always available

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "disable pcplists during memory offline", v3:
      mm, page_alloc: clean up pageset high and batch update
      mm, page_alloc: calculate pageset high and batch once per zone
      mm, page_alloc: remove setup_pageset()
      mm, page_alloc: simplify pageset_update()
      mm, page_alloc: cache pageset high and batch in struct zone
      mm, page_alloc: move draining pcplists to page isolation users
      mm, page_alloc: disable pcplists during memory offline

    Miaohe Lin <linmiaohe@huawei.com>:
      include/linux/page-flags.h: remove unused __[Set|Clear]PagePrivate

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/page-flags: fix comment
      mm/page_alloc: add __free_pages() documentation

    Zou Wei <zou_wei@huawei.com>:
      mm/page_alloc: mark some symbols with static keyword

    David Hildenbrand <david@redhat.com>:
      mm/page_alloc: clear all pages in post_alloc_hook() with init_on_alloc=1

    Lin Feng <linf@wangsu.com>:
      init/main: fix broken buffer_init when DEFERRED_STRUCT_PAGE_INIT set

    Lorenzo Stoakes <lstoakes@gmail.com>:
      mm: page_alloc: refactor setup_per_zone_lowmem_reserve()

    Muchun Song <songmuchun@bytedance.com>:
      mm/page_alloc: speed up the iteration of max_order

Subsystem: mm/memory-failure

    Oscar Salvador <osalvador@suse.de>:
    Patch series "HWpoison: further fixes and cleanups", v5:
      mm,hwpoison: drain pcplists before bailing out for non-buddy zero-refcount page
      mm,hwpoison: take free pages off the buddy freelists
      mm,hwpoison: drop unneeded pcplist draining
    Patch series "HWPoison: Refactor get page interface", v2:
      mm,hwpoison: refactor get_any_page
      mm,hwpoison: disable pcplists before grabbing a refcount
      mm,hwpoison: remove drain_all_pages from shake_page
      mm,memory_failure: always pin the page in madvise_inject_error
      mm,hwpoison: return -EBUSY when migration fails

Subsystem: mm/hugetlb

    Hui Su <sh_def@163.com>:
      mm/hugetlb.c: just use put_page_testzero() instead of page_count()

    Ralph Campbell <rcampbell@nvidia.com>:
      include/linux/huge_mm.h: remove extern keyword

    Alex Shi <alex.shi@linux.alibaba.com>:
      khugepaged: add parameter explanations for kernel-doc markup

    Liu Xiang <liu.xiang@zlingsmart.com>:
      mm: hugetlb: fix type of delta parameter and related local variables in gather_surplus_pages()

    Oscar Salvador <osalvador@suse.de>:
      mm,hugetlb: remove unneeded initialization

    Dan Carpenter <dan.carpenter@oracle.com>:
      hugetlb: fix an error code in hugetlb_reserve_pages()

Subsystem: mm/vmscan

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: don't wake kswapd prematurely when watermark boosting is disabled

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      mm/vmscan: drop unneeded assignment in kswapd()

    "logic.yu" <hymmsx.yu@gmail.com>:
      mm/vmscan.c: remove the filename in the top of file comment

    Muchun Song <songmuchun@bytedance.com>:
      mm/page_isolation: do not isolate the max order page

Subsystem: mm/z3fold

    Vitaly Wool <vitaly.wool@konsulko.com>:
    Patch series "z3fold: stability / rt fixes":
      z3fold: simplify freeing slots
      z3fold: stricter locking and more careful reclaim
      z3fold: remove preempt disabled sections for RT

Subsystem: mm/compaction

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/compaction: rename 'start_pfn' to 'iteration_start_pfn' in compact_zone()

    Hui Su <sh_def@163.com>:
      mm/compaction: move compaction_suitable's comment to right place
      mm/compaction: make defer_compaction and compaction_deferred static

Subsystem: mm/oom-kill

    Hui Su <sh_def@163.com>:
      mm/oom_kill: change comment and rename is_dump_unreclaim_slabs()

Subsystem: mm/migration

    Long Li <lonuxli.64@gmail.com>:
      mm/migrate.c: fix comment spelling

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/migrate.c: optimize migrate_vma_pages() mmu notifier

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: support THPs in zero_user_segments

    Yang Shi <shy828301@gmail.com>:
    Patch series "mm: misc migrate cleanup and improvement", v3:
      mm: truncate_complete_page() does not exist any more
      mm: migrate: simplify the logic for handling permanent failure
      mm: migrate: skip shared exec THP for NUMA balancing
      mm: migrate: clean up migrate_prep{_local}
      mm: migrate: return -ENOSYS if THP migration is unsupported

    Stephen Zhang <starzhangzsd@gmail.com>:
      mm: migrate: remove unused parameter in migrate_vma_insert_page()

Subsystem: mm/cma

    Lecopzer Chen <lecopzer.chen@mediatek.com>:
      mm/cma.c: remove redundant cma_mutex lock

    Charan Teja Reddy <charante@codeaurora.org>:
      mm: cma: improve pr_debug log in cma_release()

Subsystem: mm/page-poison

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "cleanup page poisoning", v3:
      mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters
      mm, page_poison: use static key more efficiently
      kernel/power: allow hibernation with page_poison sanity checking
      mm, page_poison: remove CONFIG_PAGE_POISONING_NO_SANITY
      mm, page_poison: remove CONFIG_PAGE_POISONING_ZERO

Subsystem: mm/userfaultfd

    Lokesh Gidra <lokeshgidra@google.com>:
    Patch series "Control over userfaultfd kernel-fault handling", v6:
      userfaultfd: add UFFD_USER_MODE_ONLY
      userfaultfd: add user-mode only option to unprivileged_userfaultfd sysctl knob

    Axel Rasmussen <axelrasmussen@google.com>:
      userfaultfd: selftests: make __{s,u}64 format specifiers portable

    Peter Xu <peterx@redhat.com>:
    Patch series "userfaultfd: selftests: Small fixes":
      userfaultfd/selftests: always dump something in modes
      userfaultfd/selftests: fix retval check for userfaultfd_open()
      userfaultfd/selftests: hint the test runner on required privilege

Subsystem: mm/zswap

    Joe Perches <joe@perches.com>:
      mm/zswap: make struct kernel_param_ops definitions const

    YueHaibing <yuehaibing@huawei.com>:
      mm/zswap: fix passing zero to 'PTR_ERR' warning

    Barry Song <song.bao.hua@hisilicon.com>:
      mm/zswap: move to use crypto_acomp API for hardware acceleration

Subsystem: mm/zsmalloc

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/zsmalloc.c: rework the list_add code in insert_zspage()

Subsystem: mm/uaccess

    Colin Ian King <colin.king@canonical.com>:
      mm/process_vm_access: remove redundant initialization of iov_r

Subsystem: mm/zram

    Minchan Kim <minchan@kernel.org>:
      zram: support page writeback
      zram: add stat to gather incompressible pages since zram set up

    Rui Salvaterra <rsalvaterra@gmail.com>:
      zram: break the strict dependency from lzo

Subsystem: mm/cleanups

    Mauro Carvalho Chehab <mchehab+huawei@kernel.org>:
      mm: fix kernel-doc markups

    Joe Perches <joe@perches.com>:
    Patch series "mm: Convert sysfs sprintf family to sysfs_emit", v2:
      mm: use sysfs_emit for struct kobject * uses
      mm: huge_memory: convert remaining use of sprintf to sysfs_emit and neatening
      mm:backing-dev: use sysfs_emit in macro defining functions
      mm: shmem: convert shmem_enabled_show to use sysfs_emit_at
      mm: slub: convert sysfs sprintf family to sysfs_emit/sysfs_emit_at

    "Gustavo A. R. Silva" <gustavoars@kernel.org>:
      mm: fix fall-through warnings for Clang

    Alexey Dobriyan <adobriyan@gmail.com>:
      mm: cleanup kstrto*() usage

 /mmap_lock.h                                         |  107 ++
 a/Documentation/admin-guide/blockdev/zram.rst        |    6 
 a/Documentation/admin-guide/cgroup-v1/memcg_test.rst |    8 
 a/Documentation/admin-guide/cgroup-v1/memory.rst     |   42 
 a/Documentation/admin-guide/cgroup-v2.rst            |   11 
 a/Documentation/admin-guide/mm/transhuge.rst         |   15 
 a/Documentation/admin-guide/sysctl/vm.rst            |   15 
 a/Documentation/core-api/memory-allocation.rst       |    4 
 a/Documentation/core-api/pin_user_pages.rst          |    8 
 a/Documentation/dev-tools/kasan.rst                  |    5 
 a/Documentation/filesystems/tmpfs.rst                |    8 
 a/Documentation/vm/memory-model.rst                  |    3 
 a/Documentation/vm/page_owner.rst                    |   12 
 a/arch/Kconfig                                       |   21 
 a/arch/alpha/Kconfig                                 |    8 
 a/arch/alpha/include/asm/mmzone.h                    |   14 
 a/arch/alpha/include/asm/page.h                      |    7 
 a/arch/alpha/include/asm/pgtable.h                   |   12 
 a/arch/alpha/include/asm/sparsemem.h                 |   18 
 a/arch/alpha/kernel/setup.c                          |    1 
 a/arch/arc/Kconfig                                   |    3 
 a/arch/arc/include/asm/page.h                        |   20 
 a/arch/arc/mm/init.c                                 |   29 
 a/arch/arm/Kconfig                                   |   12 
 a/arch/arm/kernel/vdso.c                             |    9 
 a/arch/arm/mach-bcm/Kconfig                          |    1 
 a/arch/arm/mach-davinci/Kconfig                      |    1 
 a/arch/arm/mach-exynos/Kconfig                       |    1 
 a/arch/arm/mach-highbank/Kconfig                     |    1 
 a/arch/arm/mach-omap2/Kconfig                        |    1 
 a/arch/arm/mach-s5pv210/Kconfig                      |    1 
 a/arch/arm/mach-tango/Kconfig                        |    1 
 a/arch/arm/mm/init.c                                 |   78 -
 a/arch/arm64/Kconfig                                 |    9 
 a/arch/arm64/include/asm/cacheflush.h                |    1 
 a/arch/arm64/include/asm/pgtable.h                   |    1 
 a/arch/arm64/kernel/vdso.c                           |   41 
 a/arch/arm64/mm/init.c                               |   68 -
 a/arch/arm64/mm/pageattr.c                           |   12 
 a/arch/ia64/Kconfig                                  |   11 
 a/arch/ia64/include/asm/meminit.h                    |    2 
 a/arch/ia64/mm/contig.c                              |   88 --
 a/arch/ia64/mm/discontig.c                           |   44 -
 a/arch/ia64/mm/init.c                                |   14 
 a/arch/ia64/mm/numa.c                                |   30 
 a/arch/m68k/Kconfig.cpu                              |   31 
 a/arch/m68k/include/asm/page.h                       |    2 
 a/arch/m68k/include/asm/page_mm.h                    |    7 
 a/arch/m68k/include/asm/virtconvert.h                |    7 
 a/arch/m68k/mm/init.c                                |   10 
 a/arch/mips/vdso/genvdso.c                           |    4 
 a/arch/nds32/mm/mm-nds32.c                           |    6 
 a/arch/powerpc/Kconfig                               |    5 
 a/arch/riscv/Kconfig                                 |    4 
 a/arch/riscv/include/asm/pgtable.h                   |    2 
 a/arch/riscv/include/asm/set_memory.h                |    1 
 a/arch/riscv/mm/pageattr.c                           |   31 
 a/arch/s390/Kconfig                                  |    4 
 a/arch/s390/configs/debug_defconfig                  |    2 
 a/arch/s390/configs/defconfig                        |    2 
 a/arch/s390/kernel/vdso.c                            |   11 
 a/arch/sparc/Kconfig                                 |    4 
 a/arch/sparc/mm/init_64.c                            |    2 
 a/arch/x86/Kconfig                                   |    5 
 a/arch/x86/entry/vdso/vma.c                          |   17 
 a/arch/x86/include/asm/set_memory.h                  |    1 
 a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c          |    2 
 a/arch/x86/kernel/tboot.c                            |    1 
 a/arch/x86/mm/pat/set_memory.c                       |    6 
 a/drivers/base/node.c                                |    2 
 a/drivers/block/zram/Kconfig                         |   42 
 a/drivers/block/zram/zcomp.c                         |    2 
 a/drivers/block/zram/zram_drv.c                      |   29 
 a/drivers/block/zram/zram_drv.h                      |    1 
 a/drivers/dax/device.c                               |    4 
 a/drivers/dax/kmem.c                                 |    2 
 a/drivers/dma-buf/sync_file.c                        |    3 
 a/drivers/edac/ghes_edac.c                           |    4 
 a/drivers/firmware/efi/efi.c                         |    1 
 a/drivers/gpu/drm/drm_atomic.c                       |    3 
 a/drivers/hwtracing/intel_th/msu.c                   |    2 
 a/drivers/ide/falconide.c                            |    2 
 a/drivers/ide/ide-probe.c                            |    3 
 a/drivers/misc/lkdtm/Makefile                        |    1 
 a/drivers/pinctrl/pinctrl-utils.c                    |    2 
 a/drivers/vhost/vringh.c                             |    3 
 a/drivers/virtio/virtio_balloon.c                    |    6 
 a/drivers/xen/unpopulated-alloc.c                    |   14 
 a/fs/aio.c                                           |    5 
 a/fs/ntfs/file.c                                     |    5 
 a/fs/ntfs/inode.c                                    |    2 
 a/fs/ntfs/logfile.c                                  |    3 
 a/fs/ocfs2/cluster/tcp.c                             |    1 
 a/fs/ocfs2/namei.c                                   |    4 
 a/fs/proc/kcore.c                                    |    2 
 a/fs/proc/meminfo.c                                  |    2 
 a/fs/userfaultfd.c                                   |   20 
 a/include/linux/cgroup-defs.h                        |   15 
 a/include/linux/compaction.h                         |   12 
 a/include/linux/fs.h                                 |    2 
 a/include/linux/gfp.h                                |    2 
 a/include/linux/highmem.h                            |   19 
 a/include/linux/huge_mm.h                            |   93 --
 a/include/linux/memcontrol.h                         |  148 ---
 a/include/linux/migrate.h                            |    4 
 a/include/linux/mm.h                                 |  118 +-
 a/include/linux/mm_types.h                           |    8 
 a/include/linux/mmap_lock.h                          |   94 ++
 a/include/linux/mmzone.h                             |   50 -
 a/include/linux/page-flags.h                         |    6 
 a/include/linux/page_ext.h                           |    8 
 a/include/linux/pagevec.h                            |    3 
 a/include/linux/poison.h                             |    4 
 a/include/linux/rmap.h                               |    1 
 a/include/linux/sched/mm.h                           |   16 
 a/include/linux/set_memory.h                         |    5 
 a/include/linux/shmem_fs.h                           |    6 
 a/include/linux/slab.h                               |   18 
 a/include/linux/vmalloc.h                            |    8 
 a/include/linux/vmstat.h                             |  104 ++
 a/include/trace/events/sched.h                       |   84 +
 a/include/uapi/linux/const.h                         |    5 
 a/include/uapi/linux/ethtool.h                       |    2 
 a/include/uapi/linux/kernel.h                        |    9 
 a/include/uapi/linux/lightnvm.h                      |    2 
 a/include/uapi/linux/mroute6.h                       |    2 
 a/include/uapi/linux/netfilter/x_tables.h            |    2 
 a/include/uapi/linux/netlink.h                       |    2 
 a/include/uapi/linux/sysctl.h                        |    2 
 a/include/uapi/linux/userfaultfd.h                   |    9 
 a/init/main.c                                        |    6 
 a/ipc/shm.c                                          |    8 
 a/kernel/cgroup/cgroup.c                             |   12 
 a/kernel/fork.c                                      |    3 
 a/kernel/kthread.c                                   |   29 
 a/kernel/power/hibernate.c                           |    2 
 a/kernel/power/power.h                               |    2 
 a/kernel/power/snapshot.c                            |   52 +
 a/kernel/ptrace.c                                    |    2 
 a/kernel/workqueue.c                                 |    3 
 a/lib/locking-selftest.c                             |   47 +
 a/lib/test_kasan_module.c                            |   29 
 a/mm/Kconfig                                         |   25 
 a/mm/Kconfig.debug                                   |   28 
 a/mm/Makefile                                        |    4 
 a/mm/backing-dev.c                                   |    8 
 a/mm/cma.c                                           |    6 
 a/mm/compaction.c                                    |   29 
 a/mm/filemap.c                                       |  823 ++++++++++---------
 a/mm/gup.c                                           |  329 ++-----
 a/mm/gup_benchmark.c                                 |  210 ----
 a/mm/gup_test.c                                      |  299 ++++++
 a/mm/gup_test.h                                      |   40 
 a/mm/highmem.c                                       |   52 +
 a/mm/huge_memory.c                                   |   86 +
 a/mm/hugetlb.c                                       |   28 
 a/mm/init-mm.c                                       |    1 
 a/mm/internal.h                                      |    5 
 a/mm/kasan/generic.c                                 |    3 
 a/mm/kasan/report.c                                  |    4 
 a/mm/khugepaged.c                                    |   58 -
 a/mm/ksm.c                                           |   50 -
 a/mm/madvise.c                                       |   14 
 a/mm/mapping_dirty_helpers.c                         |    6 
 a/mm/memblock.c                                      |   80 +
 a/mm/memcontrol.c                                    |  170 +--
 a/mm/memory-failure.c                                |  322 +++----
 a/mm/memory.c                                        |   24 
 a/mm/memory_hotplug.c                                |   44 -
 a/mm/mempolicy.c                                     |    8 
 a/mm/migrate.c                                       |  183 ++--
 a/mm/mm_init.c                                       |    1 
 a/mm/mmap.c                                          |   22 
 a/mm/mmap_lock.c                                     |  230 +++++
 a/mm/mmu_notifier.c                                  |    7 
 a/mm/mmzone.c                                        |   14 
 a/mm/mremap.c                                        |  282 ++++--
 a/mm/nommu.c                                         |    8 
 a/mm/oom_kill.c                                      |   14 
 a/mm/page_alloc.c                                    |  517 ++++++-----
 a/mm/page_counter.c                                  |    4 
 a/mm/page_ext.c                                      |   10 
 a/mm/page_isolation.c                                |   18 
 a/mm/page_owner.c                                    |   17 
 a/mm/page_poison.c                                   |   56 -
 a/mm/page_vma_mapped.c                               |    9 
 a/mm/process_vm_access.c                             |    2 
 a/mm/rmap.c                                          |    9 
 a/mm/shmem.c                                         |   39 
 a/mm/slab.c                                          |   10 
 a/mm/slab.h                                          |    9 
 a/mm/slab_common.c                                   |   10 
 a/mm/slob.c                                          |    6 
 a/mm/slub.c                                          |  156 +--
 a/mm/swap.c                                          |   12 
 a/mm/swap_state.c                                    |    7 
 a/mm/swapfile.c                                      |   14 
 a/mm/truncate.c                                      |   18 
 a/mm/vmalloc.c                                       |  105 +-
 a/mm/vmscan.c                                        |   21 
 a/mm/vmstat.c                                        |    6 
 a/mm/workingset.c                                    |    8 
 a/mm/z3fold.c                                        |  215 ++--
 a/mm/zsmalloc.c                                      |   11 
 a/mm/zswap.c                                         |  193 +++-
 a/sound/core/pcm_lib.c                               |    4 
 a/tools/include/linux/poison.h                       |    6 
 a/tools/testing/selftests/vm/.gitignore              |    4 
 a/tools/testing/selftests/vm/Makefile                |   41 
 a/tools/testing/selftests/vm/check_config.sh         |   31 
 a/tools/testing/selftests/vm/config                  |    2 
 a/tools/testing/selftests/vm/gup_benchmark.c         |  143 ---
 a/tools/testing/selftests/vm/gup_test.c              |  258 +++++
 a/tools/testing/selftests/vm/hmm-tests.c             |   10 
 a/tools/testing/selftests/vm/mremap_test.c           |  344 +++++++
 a/tools/testing/selftests/vm/run_vmtests             |   51 -
 a/tools/testing/selftests/vm/userfaultfd.c           |   94 --
 217 files changed, 4817 insertions(+), 3369 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-11 21:35 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-11 21:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

8 patches, based on 33dc9614dc208291d0c4bcdeb5d30d481dcd2c4c.

Subsystems affected by this patch series:

  mm/pagecache
  proc
  selftests
  kbuild
  mm/kasan
  mm/hugetlb

Subsystem: mm/pagecache

    Andrew Morton <akpm@linux-foundation.org>:
      revert "mm/filemap: add static for function __add_to_page_cache_locked"

Subsystem: proc

    Miles Chen <miles.chen@mediatek.com>:
      proc: use untagged_addr() for pagemap_read addresses

Subsystem: selftests

    Arnd Bergmann <arnd@arndb.de>:
      selftest/fpu: avoid clang warning

Subsystem: kbuild

    Arnd Bergmann <arnd@arndb.de>:
      kbuild: avoid static_assert for genksyms
      initramfs: fix clang build failure
      elfcore: fix building with clang

Subsystem: mm/kasan

    Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>:
      kasan: fix object remaining in offline per-cpu quarantine

Subsystem: mm/hugetlb

    Gerald Schaefer <gerald.schaefer@linux.ibm.com>:
      mm/hugetlb: clear compound_nr before freeing gigantic pages

 fs/proc/task_mmu.c        |    8 ++++++--
 include/linux/build_bug.h |    5 +++++
 include/linux/elfcore.h   |   22 ++++++++++++++++++++++
 init/initramfs.c          |    2 +-
 kernel/Makefile           |    1 -
 kernel/elfcore.c          |   26 --------------------------
 lib/Makefile              |    3 ++-
 mm/filemap.c              |    2 +-
 mm/hugetlb.c              |    1 +
 mm/kasan/quarantine.c     |   39 +++++++++++++++++++++++++++++++++++++++
 10 files changed, 77 insertions(+), 32 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-12-06  6:14 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-12-06  6:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

12 patches, based on 33256ce194110874d4bc90078b577c59f9076c59.

Subsystems affected by this patch series:

  lib
  coredump
  mm/memcg
  mm/zsmalloc
  mm/swap
  mailmap
  mm/selftests
  mm/pagecache
  mm/hugetlb
  mm/pagemap

Subsystem: lib

    Randy Dunlap <rdunlap@infradead.org>:
      zlib: export S390 symbols for zlib modules

Subsystem: coredump

    Menglong Dong <dong.menglong@zte.com.cn>:
      coredump: fix core_pattern parse error

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: fix obj_cgroup_charge() return value handling

    Yang Shi <shy828301@gmail.com>:
      mm: list_lru: set shrinker map bit when child nr_items is not zero

Subsystem: mm/zsmalloc

    Minchan Kim <minchan@kernel.org>:
      mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING

Subsystem: mm/swap

    Qian Cai <qcai@redhat.com>:
      mm/swapfile: do not sleep with a spin lock held

Subsystem: mailmap

    Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
      mailmap: add two more addresses of Uwe Kleine-König

Subsystem: mm/selftests

    Xingxing Su <suxingxing@loongson.cn>:
      tools/testing/selftests/vm: fix build error

    Axel Rasmussen <axelrasmussen@google.com>:
      userfaultfd: selftests: fix SIGSEGV if huge mmap fails

Subsystem: mm/pagecache

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/filemap: add static for function __add_to_page_cache_locked

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb_cgroup: fix offline of hugetlb cgroup with reservations

Subsystem: mm/pagemap

    Liu Zixian <liuzixian4@huawei.com>:
      mm/mmap.c: fix mmap return value when vma is merged after call_mmap()

 .mailmap                                 |    2 +
 arch/arm/configs/omap2plus_defconfig     |    1 
 fs/coredump.c                            |    3 +
 include/linux/zsmalloc.h                 |    1 
 lib/zlib_dfltcc/dfltcc_inflate.c         |    3 +
 mm/Kconfig                               |   13 -------
 mm/filemap.c                             |    2 -
 mm/hugetlb_cgroup.c                      |    8 +---
 mm/list_lru.c                            |   10 ++---
 mm/mmap.c                                |   26 ++++++--------
 mm/slab.h                                |   40 +++++++++++++---------
 mm/swapfile.c                            |    4 +-
 mm/zsmalloc.c                            |   54 -------------------------------
 tools/testing/selftests/vm/Makefile      |    4 ++
 tools/testing/selftests/vm/userfaultfd.c |   25 +++++++++-----
 15 files changed, 75 insertions(+), 121 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-11-22  6:16 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-11-22  6:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

8 patches, based on a349e4c659609fd20e4beea89e5c4a4038e33a95.

Subsystems affected by this patch series:

  mm/madvise
  kbuild
  mm/pagemap
  mm/readahead
  mm/memcg
  mm/userfaultfd
  vfs-akpm
  mm/madvise

Subsystem: mm/madvise

    Eric Dumazet <edumazet@google.com>:
      mm/madvise: fix memory leak from process_madvise

Subsystem: kbuild

    Nick Desaulniers <ndesaulniers@google.com>:
      compiler-clang: remove version check for BPF Tracing

Subsystem: mm/pagemap

    Dan Williams <dan.j.williams@intel.com>:
      mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports

Subsystem: mm/readahead

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: fix readahead_page_batch for retry entries

Subsystem: mm/memcg

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcg/slab: fix root memcg vmstats

Subsystem: mm/userfaultfd

    Gerald Schaefer <gerald.schaefer@linux.ibm.com>:
      mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()

Subsystem: vfs-akpm

    Yicong Yang <yangyicong@hisilicon.com>:
      libfs: fix error cast of negative value in simple_attr_write()

Subsystem: mm/madvise

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: fix madvise WILLNEED performance problem

 arch/ia64/include/asm/sparsemem.h    |    6 ++++++
 arch/powerpc/include/asm/mmzone.h    |    5 +++++
 arch/powerpc/include/asm/sparsemem.h |    5 ++---
 arch/powerpc/mm/mem.c                |    1 +
 arch/x86/include/asm/sparsemem.h     |   10 ++++++++++
 arch/x86/mm/numa.c                   |    2 ++
 drivers/dax/Kconfig                  |    1 -
 fs/libfs.c                           |    6 ++++--
 include/linux/compiler-clang.h       |    2 ++
 include/linux/memory_hotplug.h       |   14 --------------
 include/linux/numa.h                 |   30 +++++++++++++++++++++++++++++-
 include/linux/pagemap.h              |    2 ++
 mm/huge_memory.c                     |    9 ++++-----
 mm/madvise.c                         |    4 +---
 mm/memcontrol.c                      |    9 +++++++--
 mm/memory_hotplug.c                  |   18 ------------------
 16 files changed, 75 insertions(+), 49 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-11-14  6:51 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-11-14  6:51 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

14 patches, based on 9e6a39eae450b81c8b2c8cbbfbdf8218e9b40c81.

Subsystems affected by this patch series:

  mm/migration
  mm/vmscan
  mailmap
  mm/slub
  mm/gup
  kbuild
  reboot
  kernel/watchdog
  mm/memcg
  mm/hugetlbfs
  panic
  ocfs2

Subsystem: mm/migration

    Zi Yan <ziy@nvidia.com>:
      mm/compaction: count pages and stop correctly during page isolation
      mm/compaction: stop isolation if too many pages are isolated and we have pages to migrate

Subsystem: mm/vmscan

    Nicholas Piggin <npiggin@gmail.com>:
      mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit

Subsystem: mailmap

    Dmitry Baryshkov <dbaryshkov@gmail.com>:
      mailmap: fix entry for Dmitry Baryshkov/Eremin-Solenikov

Subsystem: mm/slub

    Laurent Dufour <ldufour@linux.ibm.com>:
      mm/slub: fix panic in slab_alloc_node()

Subsystem: mm/gup

    Jason Gunthorpe <jgg@nvidia.com>:
      mm/gup: use unpin_user_pages() in __gup_longterm_locked()

Subsystem: kbuild

    Arvind Sankar <nivedita@alum.mit.edu>:
      compiler.h: fix barrier_data() on clang

Subsystem: reboot

    Matteo Croce <mcroce@microsoft.com>:
    Patch series "fix parsing of reboot= cmdline", v3:
      Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
      reboot: fix overflow parsing reboot cpu number

Subsystem: kernel/watchdog

    Santosh Sivaraj <santosh@fossix.org>:
      kernel/watchdog: fix watchdog_allowed_mask not used warning

Subsystem: mm/memcg

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: fix missing wakeup polling thread

Subsystem: mm/hugetlbfs

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlbfs: fix anon huge page migration race

Subsystem: panic

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      panic: don't dump stack twice on warn

Subsystem: ocfs2

    Wengang Wang <wen.gang.wang@oracle.com>:
      ocfs2: initialize ip_next_orphan

 .mailmap                       |    5 +-
 fs/ocfs2/super.c               |    1 
 include/asm-generic/barrier.h  |    1 
 include/linux/compiler-clang.h |    6 --
 include/linux/compiler-gcc.h   |   19 --------
 include/linux/compiler.h       |   18 +++++++-
 include/linux/memcontrol.h     |   11 ++++-
 kernel/panic.c                 |    3 -
 kernel/reboot.c                |   28 ++++++------
 kernel/watchdog.c              |    4 -
 mm/compaction.c                |   12 +++--
 mm/gup.c                       |   14 ++++--
 mm/hugetlb.c                   |   90 ++---------------------------------------
 mm/memory-failure.c            |   36 +++++++---------
 mm/migrate.c                   |   46 +++++++++++---------
 mm/rmap.c                      |    5 --
 mm/slub.c                      |    2 
 mm/vmscan.c                    |    5 +-
 18 files changed, 119 insertions(+), 187 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-11-02  1:06 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-11-02  1:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

15 patches, based on 3cea11cd5e3b00d91caf0b4730194039b45c5891.

Subsystems affected by this patch series:

  mm/memremap
  mm/memcg
  mm/slab-generic
  mm/kasan
  mm/mempolicy
  signals
  lib
  mm/pagecache
  kthread
  mm/oom-kill
  mm/pagemap
  epoll
  core-kernel

Subsystem: mm/memremap

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/mremap_pages: fix static key devmap_managed_key updates

Subsystem: mm/memcg

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb_cgroup: fix reservation accounting

    zhongjiang-ali <zhongjiang-ali@linux.alibaba.com>:
      mm: memcontrol: correct the NR_ANON_THPS counter of hierarchical memcg

    Roman Gushchin <guro@fb.com>:
      mm: memcg: link page counters to root if use_hierarchy is false

Subsystem: mm/slab-generic

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: adopt KUNIT tests to SW_TAGS mode

Subsystem: mm/mempolicy

    Shijie Luo <luoshijie1@huawei.com>:
      mm: mempolicy: fix potential pte_unmap_unlock pte error

Subsystem: signals

    Oleg Nesterov <oleg@redhat.com>:
      ptrace: fix task_join_group_stop() for the case when current is traced

Subsystem: lib

    Vasily Gorbik <gor@linux.ibm.com>:
      lib/crc32test: remove extra local_irq_disable/enable

Subsystem: mm/pagecache

    Jason Yan <yanaijie@huawei.com>:
      mm/truncate.c: make __invalidate_mapping_pages() static

Subsystem: kthread

    Zqiang <qiang.zhang@windriver.com>:
      kthread_worker: prevent queuing delayed work from timer_fn when it is being canceled

Subsystem: mm/oom-kill

    Charles Haithcock <chaithco@redhat.com>:
      mm, oom: keep oom_adj under or at upper limit when printing

Subsystem: mm/pagemap

    Jason Gunthorpe <jgg@nvidia.com>:
      mm: always have io_remap_pfn_range() set pgprot_decrypted()

Subsystem: epoll

    Soheil Hassas Yeganeh <soheil@google.com>:
      epoll: check ep_events_available() upon timeout
      epoll: add a selftest for epoll timeout race

Subsystem: core-kernel

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      kernel/hung_task.c: make type annotations consistent

 fs/eventpoll.c                                                |   16 +
 fs/proc/base.c                                                |    2 
 include/linux/mm.h                                            |    9 
 include/linux/pgtable.h                                       |    4 
 kernel/hung_task.c                                            |    3 
 kernel/kthread.c                                              |    3 
 kernel/signal.c                                               |   19 -
 lib/crc32test.c                                               |    4 
 lib/test_kasan.c                                              |  149 +++++++---
 mm/hugetlb.c                                                  |   20 -
 mm/memcontrol.c                                               |   25 +
 mm/mempolicy.c                                                |    6 
 mm/memremap.c                                                 |   39 +-
 mm/truncate.c                                                 |    2 
 tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c |   95 ++++++
 15 files changed, 290 insertions(+), 106 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-10-17 23:13 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-10-17 23:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


40 patches, based on 9d9af1007bc08971953ae915d88dc9bb21344b53.

Subsystems affected by this patch series:

  ia64
  mm/memcg
  mm/migration
  mm/pagemap
  mm/gup
  mm/madvise
  mm/vmalloc
  misc

Subsystem: ia64

    Krzysztof Kozlowski <krzk@kernel.org>:
      ia64: fix build error with !COREDUMP

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm, memcg: rework remote charging API to support nesting
    Patch series "mm: kmem: kernel memory accounting in an interrupt context":
      mm: kmem: move memcg_kmem_bypass() calls to get_mem/obj_cgroup_from_current()
      mm: kmem: remove redundant checks from get_obj_cgroup_from_current()
      mm: kmem: prepare remote memcg charging infra for interrupt contexts
      mm: kmem: enable kernel memcg accounting from interrupt contexts

Subsystem: mm/migration

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
      mm/memory-failure: remove a wrapper for alloc_migration_target()
      mm/memory_hotplug: remove a wrapper for alloc_migration_target()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/migrate: avoid possible unnecessary process right check in kernel_move_pages()

Subsystem: mm/pagemap

    "Liam R. Howlett" <Liam.Howlett@Oracle.com>:
      mm/mmap: add inline vma_next() for readability of mmap code
      mm/mmap: add inline munmap_vma_range() for code readability

Subsystem: mm/gup

    Jann Horn <jannh@google.com>:
      mm/gup_benchmark: take the mmap lock around GUP
      binfmt_elf: take the mmap lock around find_extend_vma()
      mm/gup: assert that the mmap lock is held in __get_user_pages()

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "selftests/vm: gup_test, hmm-tests, assorted improvements", v2:
      mm/gup_benchmark: rename to mm/gup_test
      selftests/vm: use a common gup_test.h
      selftests/vm: rename run_vmtests --> run_vmtests.sh
      selftests/vm: minor cleanup: Makefile and gup_test.c
      selftests/vm: only some gup_test items are really benchmarks
      selftests/vm: gup_test: introduce the dump_pages() sub-test
      selftests/vm: run_vmtests.sh: update and clean up gup_test invocation
      selftests/vm: hmm-tests: remove the libhugetlbfs dependency
      selftests/vm: 10x speedup for hmm-tests

Subsystem: mm/madvise

    Minchan Kim <minchan@kernel.org>:
    Patch series "introduce memory hinting API for external process", v9:
      mm/madvise: pass mm to do_madvise
      pid: move pidfd_get_pid() to pid.c
      mm/madvise: introduce process_madvise() syscall: an external memory hinting API

Subsystem: mm/vmalloc

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "remove alloc_vm_area", v4:
      mm: update the documentation for vfree

    Christoph Hellwig <hch@lst.de>:
      mm: add a VM_MAP_PUT_PAGES flag for vmap
      mm: add a vmap_pfn function
      mm: allow a NULL fn callback in apply_to_page_range
      zsmalloc: switch from alloc_vm_area to get_vm_area
      drm/i915: use vmap in shmem_pin_map
      drm/i915: stop using kmap in i915_gem_object_map
      drm/i915: use vmap in i915_gem_object_map
      xen/xenbus: use apply_to_page_range directly in xenbus_map_ring_pv
      x86/xen: open code alloc_vm_area in arch_gnttab_valloc
      mm: remove alloc_vm_area
    Patch series "two small vmalloc cleanups":
      mm: cleanup the gfp_mask handling in __vmalloc_area_node
      mm: remove the filename in the top of file comment in vmalloc.c

Subsystem: misc

    Tian Tao <tiantao6@hisilicon.com>:
      mm: remove duplicate include statement in mmu.c

 Documentation/core-api/pin_user_pages.rst   |    8 
 arch/alpha/kernel/syscalls/syscall.tbl      |    1 
 arch/arm/mm/mmu.c                           |    1 
 arch/arm/tools/syscall.tbl                  |    1 
 arch/arm64/include/asm/unistd.h             |    2 
 arch/arm64/include/asm/unistd32.h           |    2 
 arch/ia64/kernel/Makefile                   |    2 
 arch/ia64/kernel/syscalls/syscall.tbl       |    1 
 arch/m68k/kernel/syscalls/syscall.tbl       |    1 
 arch/microblaze/kernel/syscalls/syscall.tbl |    1 
 arch/mips/kernel/syscalls/syscall_n32.tbl   |    1 
 arch/mips/kernel/syscalls/syscall_n64.tbl   |    1 
 arch/mips/kernel/syscalls/syscall_o32.tbl   |    1 
 arch/parisc/kernel/syscalls/syscall.tbl     |    1 
 arch/powerpc/kernel/syscalls/syscall.tbl    |    1 
 arch/s390/configs/debug_defconfig           |    2 
 arch/s390/configs/defconfig                 |    2 
 arch/s390/kernel/syscalls/syscall.tbl       |    1 
 arch/sh/kernel/syscalls/syscall.tbl         |    1 
 arch/sparc/kernel/syscalls/syscall.tbl      |    1 
 arch/x86/entry/syscalls/syscall_32.tbl      |    1 
 arch/x86/entry/syscalls/syscall_64.tbl      |    1 
 arch/x86/xen/grant-table.c                  |   27 +-
 arch/xtensa/kernel/syscalls/syscall.tbl     |    1 
 drivers/gpu/drm/i915/Kconfig                |    1 
 drivers/gpu/drm/i915/gem/i915_gem_pages.c   |  136 ++++------
 drivers/gpu/drm/i915/gt/shmem_utils.c       |   78 +-----
 drivers/xen/xenbus/xenbus_client.c          |   30 +-
 fs/binfmt_elf.c                             |    3 
 fs/buffer.c                                 |    6 
 fs/io_uring.c                               |    2 
 fs/notify/fanotify/fanotify.c               |    5 
 fs/notify/inotify/inotify_fsnotify.c        |    5 
 include/linux/memcontrol.h                  |   12 
 include/linux/mm.h                          |    2 
 include/linux/pid.h                         |    1 
 include/linux/sched/mm.h                    |   43 +--
 include/linux/syscalls.h                    |    2 
 include/linux/vmalloc.h                     |    7 
 include/uapi/asm-generic/unistd.h           |    4 
 kernel/exit.c                               |   19 -
 kernel/pid.c                                |   19 +
 kernel/sys_ni.c                             |    1 
 mm/Kconfig                                  |   24 +
 mm/Makefile                                 |    2 
 mm/gup.c                                    |    2 
 mm/gup_benchmark.c                          |  225 ------------------
 mm/gup_test.c                               |  295 +++++++++++++++++++++--
 mm/gup_test.h                               |   40 ++-
 mm/madvise.c                                |  125 ++++++++--
 mm/memcontrol.c                             |   83 ++++--
 mm/memory-failure.c                         |   18 -
 mm/memory.c                                 |   16 -
 mm/memory_hotplug.c                         |   46 +--
 mm/migrate.c                                |   71 +++--
 mm/mmap.c                                   |   74 ++++-
 mm/nommu.c                                  |    7 
 mm/percpu.c                                 |    3 
 mm/slab.h                                   |    3 
 mm/vmalloc.c                                |  147 +++++------
 mm/zsmalloc.c                               |   10 
 tools/testing/selftests/vm/.gitignore       |    3 
 tools/testing/selftests/vm/Makefile         |   40 ++-
 tools/testing/selftests/vm/check_config.sh  |   31 ++
 tools/testing/selftests/vm/config           |    2 
 tools/testing/selftests/vm/gup_benchmark.c  |  143 -----------
 tools/testing/selftests/vm/gup_test.c       |  260 ++++++++++++++++++--
 tools/testing/selftests/vm/hmm-tests.c      |   12 
 tools/testing/selftests/vm/run_vmtests      |  334 --------------------------
 tools/testing/selftests/vm/run_vmtests.sh   |  350 +++++++++++++++++++++++++++-
 70 files changed, 1580 insertions(+), 1224 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-10-16  2:40 incoming Andrew Morton
@ 2020-10-16  3:03 ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-10-16  3:03 UTC (permalink / raw)
  To: Linus Torvalds, mm-commits, linux-mm

And... I forgot to set in-reply-to :(

Shall resend, omitting linux-mm.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-10-16  2:40 Andrew Morton
  2020-10-16  3:03 ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-10-16  2:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- most of the rest of mm/

- various other subsystems

156 patches, based on 578a7155c5a1894a789d4ece181abf9d25dc6b0d.

Subsystems affected by this patch series:

  mm/dax
  mm/debug
  mm/thp
  mm/readahead
  mm/page-poison
  mm/util
  mm/memory-hotplug
  mm/zram
  mm/cleanups
  misc
  core-kernel
  get_maintainer
  MAINTAINERS
  lib
  bitops
  checkpatch
  binfmt
  ramfs
  autofs
  nilfs
  rapidio
  panic
  relay
  kgdb
  ubsan
  romfs
  fault-injection

Subsystem: mm/dax

    Dan Williams <dan.j.williams@intel.com>:
      device-dax/kmem: fix resource release

Subsystem: mm/debug

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
    Patch series "mm/debug_vm_pgtable fixes", v4:
      powerpc/mm: add DEBUG_VM WARN for pmd_clear
      powerpc/mm: move setting pte specific flags to pfn_pte
      mm/debug_vm_pgtable/ppc64: avoid setting top bits in radom value
      mm/debug_vm_pgtables/hugevmap: use the arch helper to identify huge vmap support.
      mm/debug_vm_pgtable/savedwrite: enable savedwrite test with CONFIG_NUMA_BALANCING
      mm/debug_vm_pgtable/THP: mark the pte entry huge before using set_pmd/pud_at
      mm/debug_vm_pgtable/set_pte/pmd/pud: don't use set_*_at to update an existing pte entry
      mm/debug_vm_pgtable/locks: move non page table modifying test together
      mm/debug_vm_pgtable/locks: take correct page table lock
      mm/debug_vm_pgtable/thp: use page table depost/withdraw with THP
      mm/debug_vm_pgtable/pmd_clear: don't use pmd/pud_clear on pte entries
      mm/debug_vm_pgtable/hugetlb: disable hugetlb test on ppc64
      mm/debug_vm_pgtable: avoid none pte in pte_clear_test
      mm/debug_vm_pgtable: avoid doing memory allocation with pgtable_t mapped.

Subsystem: mm/thp

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Fix read-only THP for non-tmpfs filesystems":
      XArray: add xa_get_order
      XArray: add xas_split
      mm/filemap: fix storing to a THP shadow entry
    Patch series "Remove assumptions of THP size":
      mm/filemap: fix page cache removal for arbitrary sized THPs
      mm/memory: remove page fault assumption of compound page size
      mm/page_owner: change split_page_owner to take a count

    "Kirill A. Shutemov" <kirill@shutemov.name>:
      mm/huge_memory: fix total_mapcount assumption of page size
      mm/huge_memory: fix split assumption of page size

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/huge_memory: fix page_trans_huge_mapcount assumption of THP size
      mm/huge_memory: fix can_split_huge_page assumption of THP size
      mm/rmap: fix assumptions of THP size
      mm/truncate: fix truncation for pages of arbitrary size
      mm/page-writeback: support tail pages in wait_for_stable_page
      mm/vmscan: allow arbitrary sized pages to be paged out
      fs: add a filesystem flag for THPs
      fs: do not update nr_thps for mappings which support THPs

    Huang Ying <ying.huang@intel.com>:
      mm: fix a race during THP splitting

Subsystem: mm/readahead

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Readahead patches for 5.9/5.10":
      mm/readahead: add DEFINE_READAHEAD
      mm/readahead: make page_cache_ra_unbounded take a readahead_control
      mm/readahead: make do_page_cache_ra take a readahead_control

    David Howells <dhowells@redhat.com>:
      mm/readahead: make ondemand_readahead take a readahead_control
      mm/readahead: pass readahead_control to force_page_cache_ra

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/readahead: add page_cache_sync_ra and page_cache_async_ra

    David Howells <dhowells@redhat.com>:
      mm/filemap: fold ra_submit into do_sync_mmap_readahead
      mm/readahead: pass a file_ra_state into force_page_cache_ra

Subsystem: mm/page-poison

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
    Patch series "HWPOISON: soft offline rework", v7:
      mm,hwpoison: cleanup unused PageHuge() check
      mm, hwpoison: remove recalculating hpage
      mm,hwpoison-inject: don't pin for hwpoison_filter

    Oscar Salvador <osalvador@suse.de>:
      mm,hwpoison: unexport get_hwpoison_page and make it static
      mm,hwpoison: refactor madvise_inject_error
      mm,hwpoison: kill put_hwpoison_page
      mm,hwpoison: unify THP handling for hard and soft offline
      mm,hwpoison: rework soft offline for free pages
      mm,hwpoison: rework soft offline for in-use pages
      mm,hwpoison: refactor soft_offline_huge_page and __soft_offline_page
      mm,hwpoison: return 0 if the page is already poisoned in soft-offline

    Naoya Horiguchi <naoya.horiguchi@nec.com>:
      mm,hwpoison: introduce MF_MSG_UNSPLIT_THP
      mm,hwpoison: double-check page count in __get_any_page()

    Oscar Salvador <osalvador@suse.de>:
      mm,hwpoison: try to narrow window race for free pages

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/page_poison.c: replace bool variable with static key

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/vmstat.c: use helper macro abs()

Subsystem: mm/util

    Bartosz Golaszewski <bgolaszewski@baylibre.com>:
      mm/util.c: update the kerneldoc for kstrdup_const()

    Jann Horn <jannh@google.com>:
      mm/mmu_notifier: fix mmget() assert in __mmu_interval_notifier_insert

Subsystem: mm/memory-hotplug

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/memory_hotplug: online_pages()/offline_pages() cleanups", v2:
      mm/memory_hotplug: inline __offline_pages() into offline_pages()
      mm/memory_hotplug: enforce section granularity when onlining/offlining
      mm/memory_hotplug: simplify page offlining
      mm/page_alloc: simplify __offline_isolated_pages()
      mm/memory_hotplug: drop nr_isolate_pageblock in offline_pages()
      mm/page_isolation: simplify return value of start_isolate_page_range()
      mm/memory_hotplug: simplify page onlining
      mm/page_alloc: drop stale pageblock comment in memmap_init_zone*()
      mm: pass migratetype into memmap_init_zone() and move_pfn_range_to_zone()
      mm/memory_hotplug: mark pageblocks MIGRATE_ISOLATE while onlining memory
    Patch series "selective merging of system ram resources", v4:
      kernel/resource: make release_mem_region_adjustable() never fail
      kernel/resource: move and rename IORESOURCE_MEM_DRIVER_MANAGED
      mm/memory_hotplug: guard more declarations by CONFIG_MEMORY_HOTPLUG
      mm/memory_hotplug: prepare passing flags to add_memory() and friends
      mm/memory_hotplug: MEMHP_MERGE_RESOURCE to specify merging of System RAM resources
      virtio-mem: try to merge system ram resources
      xen/balloon: try to merge system ram resources
      hv_balloon: try to merge system ram resources
      kernel/resource: make iomem_resource implicit in release_mem_region_adjustable()

    Laurent Dufour <ldufour@linux.ibm.com>:
      mm: don't panic when links can't be created in sysfs

    David Hildenbrand <david@redhat.com>:
    Patch series "mm: place pages to the freelist tail when onlining and undoing isolation", v2:
      mm/page_alloc: convert "report" flag of __free_one_page() to a proper flag
      mm/page_alloc: place pages to tail in __putback_isolated_page()
      mm/page_alloc: move pages to tail in move_to_free_list()
      mm/page_alloc: place pages to tail in __free_pages_core()
      mm/memory_hotplug: update comment regarding zone shuffling

Subsystem: mm/zram

    Douglas Anderson <dianders@chromium.org>:
      zram: failing to decompress is WARN_ON worthy

Subsystem: mm/cleanups

    YueHaibing <yuehaibing@huawei.com>:
      mm/slab.h: remove duplicate include

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/page_reporting.c: drop stale list head check in page_reporting_cycle

    Ira Weiny <ira.weiny@intel.com>:
      mm/highmem.c: clean up endif comments

    Yu Zhao <yuzhao@google.com>:
      mm: use self-explanatory macros rather than "2"

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: fix some broken comments

    Chen Tao <chentao3@hotmail.com>:
      mm: fix some comments formatting

    Xiaofei Tan <tanxiaofei@huawei.com>:
      mm/workingset.c: fix some doc warnings

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: use helper function put_write_access()

    Mike Rapoport <rppt@linux.ibm.com>:
      include/linux/mmzone.h: remove unused early_pfn_valid()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: rename page_order() to buddy_order()

Subsystem: misc

    Randy Dunlap <rdunlap@infradead.org>:
      fs: configfs: delete repeated words in comments

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kernel.h: split out min()/max() et al. helpers

Subsystem: core-kernel

    Liao Pingfang <liao.pingfang@zte.com.cn>:
      kernel/sys.c: replace do_brk with do_brk_flags in comment of prctl_set_mm_map()

    Randy Dunlap <rdunlap@infradead.org>:
      kernel/: fix repeated words in comments
      kernel: acct.c: fix some kernel-doc nits

Subsystem: get_maintainer

    Joe Perches <joe@perches.com>:
      get_maintainer: add test for file in VCS

Subsystem: MAINTAINERS

    Joe Perches <joe@perches.com>:
      get_maintainer: exclude MAINTAINERS file(s) from --git-fallback

    Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>:
      MAINTAINERS: jarkko.sakkinen@linux.intel.com -> jarkko@kernel.org

Subsystem: lib

    Randy Dunlap <rdunlap@infradead.org>:
      lib: bitmap: delete duplicated words
      lib: libcrc32c: delete duplicated words
      lib: decompress_bunzip2: delete duplicated words
      lib: dynamic_queue_limits: delete duplicated words + fix typo
      lib: earlycpio: delete duplicated words
      lib: radix-tree: delete duplicated words
      lib: syscall: delete duplicated words
      lib: test_sysctl: delete duplicated words
      lib/mpi/mpi-bit.c: fix spello of "functions"

    Stephen Boyd <swboyd@chromium.org>:
      lib/idr.c: document calling context for IDA APIs mustn't use locks
      lib/idr.c: document that ida_simple_{get,remove}() are deprecated

    Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
      lib/scatterlist.c: avoid a double memset

    Miaohe Lin <linmiaohe@huawei.com>:
      lib/percpu_counter.c: use helper macro abs()

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      include/linux/list.h: add a macro to test if entry is pointing to the head

    Dan Carpenter <dan.carpenter@oracle.com>:
      lib/test_hmm.c: fix an error code in dmirror_allocate_chunk()

    Tobias Jordan <kernel@cdqe.de>:
      lib/crc32.c: fix trivial typo in preprocessor condition

Subsystem: bitops

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      bitops: simplify get_count_order_long()
      bitops: use the same mechanism for get_count_order[_long]

Subsystem: checkpatch

    Jerome Forissier <jerome@forissier.org>:
      checkpatch: add --kconfig-prefix

    Joe Perches <joe@perches.com>:
      checkpatch: move repeated word test
      checkpatch: add test for comma use that should be semicolon

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      const_structs.checkpatch: add phy_ops

    Nicolas Boichat <drinkcat@chromium.org>:
      checkpatch: warn if trace_printk and friends are called

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      const_structs.checkpatch: add pinctrl_ops and pinmux_ops

    Joe Perches <joe@perches.com>:
      checkpatch: warn on self-assignments
      checkpatch: allow not using -f with files that are in git

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: extend author Signed-off-by check for split From: header

    Joe Perches <joe@perches.com>:
      checkpatch: emit a warning on embedded filenames

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: fix multi-statement macro checks for while blocks.

    Łukasz Stelmach <l.stelmach@samsung.com>:
      checkpatch: fix false positive on empty block comment lines

    Dwaipayan Ray <dwaipayanray1@gmail.com>:
      checkpatch: add new warnings to author signoff checks.

Subsystem: binfmt

    Chris Kennelly <ckennelly@google.com>:
    Patch series "Selecting Load Addresses According to p_align", v3:
      fs/binfmt_elf: use PT_LOAD p_align values for suitable start address
      tools/testing/selftests: add self-test for verifying load alignment

    Jann Horn <jannh@google.com>:
    Patch series "Fix ELF / FDPIC ELF core dumping, and use mmap_lock properly in there", v5:
      binfmt_elf_fdpic: stop using dump_emit() on user pointers on !MMU
      coredump: let dump_emit() bail out on short writes
      coredump: refactor page range dumping into common helper
      coredump: rework elf/elf_fdpic vma_dump_size() into common helper
      binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot
      mm/gup: take mmap_lock in get_dump_page()
      mm: remove the now-unnecessary mmget_still_valid() hack

Subsystem: ramfs

    Matthew Wilcox (Oracle) <willy@infradead.org>:
      ramfs: fix nommu mmap with gaps in the page cache

Subsystem: autofs

    Matthew Wilcox <willy@infradead.org>:
      autofs: harden ioctl table

Subsystem: nilfs

    Wang Hai <wanghai38@huawei.com>:
      nilfs2: fix some kernel-doc warnings for nilfs2

Subsystem: rapidio

    Souptick Joarder <jrdr.linux@gmail.com>:
      rapidio: fix error handling path

    Jing Xiangfeng <jingxiangfeng@huawei.com>:
      rapidio: fix the missed put_device() for rio_mport_add_riodev

Subsystem: panic

    Alexey Kardashevskiy <aik@ozlabs.ru>:
      panic: dump registers on panic_on_warn

Subsystem: relay

    Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
      kernel/relay.c: drop unneeded initialization

Subsystem: kgdb

    Ritesh Harjani <riteshh@linux.ibm.com>:
      scripts/gdb/proc: add struct mount & struct super_block addr in lx-mounts command
      scripts/gdb/tasks: add headers and improve spacing format

Subsystem: ubsan

    Elena Petrova <lenaptr@google.com>:
      sched.h: drop in_ubsan field when UBSAN is in trap mode

    George Popescu <georgepope@android.com>:
      ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang

Subsystem: romfs

    Libing Zhou <libing.zhou@nokia-sbell.com>:
      ROMFS: support inode blocks calculation

Subsystem: fault-injection

    Albert van der Linde <alinde@google.com>:
    Patch series "add fault injection to user memory access", v3:
      lib, include/linux: add usercopy failure capability
      lib, uaccess: add failure injection to usercopy functions

 .mailmap                                          |    1 
 Documentation/admin-guide/kernel-parameters.txt   |    1 
 Documentation/core-api/xarray.rst                 |   14 
 Documentation/fault-injection/fault-injection.rst |    7 
 MAINTAINERS                                       |    6 
 arch/ia64/mm/init.c                               |    4 
 arch/powerpc/include/asm/book3s/64/pgtable.h      |   29 +
 arch/powerpc/include/asm/nohash/pgtable.h         |    5 
 arch/powerpc/mm/pgtable.c                         |    5 
 arch/powerpc/platforms/powernv/memtrace.c         |    2 
 arch/powerpc/platforms/pseries/hotplug-memory.c   |    2 
 drivers/acpi/acpi_memhotplug.c                    |    3 
 drivers/base/memory.c                             |    3 
 drivers/base/node.c                               |   33 +-
 drivers/block/zram/zram_drv.c                     |    2 
 drivers/dax/kmem.c                                |   50 ++-
 drivers/hv/hv_balloon.c                           |    4 
 drivers/infiniband/core/uverbs_main.c             |    3 
 drivers/rapidio/devices/rio_mport_cdev.c          |   18 -
 drivers/s390/char/sclp_cmd.c                      |    2 
 drivers/vfio/pci/vfio_pci.c                       |   38 +-
 drivers/virtio/virtio_mem.c                       |    5 
 drivers/xen/balloon.c                             |    4 
 fs/autofs/dev-ioctl.c                             |    8 
 fs/binfmt_elf.c                                   |  267 +++-------------
 fs/binfmt_elf_fdpic.c                             |  176 ++--------
 fs/configfs/dir.c                                 |    2 
 fs/configfs/file.c                                |    2 
 fs/coredump.c                                     |  238 +++++++++++++-
 fs/ext4/verity.c                                  |    4 
 fs/f2fs/verity.c                                  |    4 
 fs/inode.c                                        |    2 
 fs/nilfs2/bmap.c                                  |    2 
 fs/nilfs2/cpfile.c                                |    6 
 fs/nilfs2/page.c                                  |    1 
 fs/nilfs2/sufile.c                                |    4 
 fs/proc/task_mmu.c                                |   18 -
 fs/ramfs/file-nommu.c                             |    2 
 fs/romfs/super.c                                  |    1 
 fs/userfaultfd.c                                  |   28 -
 include/linux/bitops.h                            |   13 
 include/linux/blkdev.h                            |    1 
 include/linux/bvec.h                              |    6 
 include/linux/coredump.h                          |   13 
 include/linux/fault-inject-usercopy.h             |   22 +
 include/linux/fs.h                                |   28 -
 include/linux/idr.h                               |   13 
 include/linux/ioport.h                            |   15 
 include/linux/jiffies.h                           |    3 
 include/linux/kernel.h                            |  150 ---------
 include/linux/list.h                              |   29 +
 include/linux/memory_hotplug.h                    |   42 +-
 include/linux/minmax.h                            |  153 +++++++++
 include/linux/mm.h                                |    5 
 include/linux/mmzone.h                            |   17 -
 include/linux/node.h                              |   16 
 include/linux/nodemask.h                          |    2 
 include/linux/page-flags.h                        |    6 
 include/linux/page_owner.h                        |    6 
 include/linux/pagemap.h                           |  111 ++++++
 include/linux/sched.h                             |    2 
 include/linux/sched/mm.h                          |   25 -
 include/linux/uaccess.h                           |   12 
 include/linux/vmstat.h                            |    2 
 include/linux/xarray.h                            |   22 +
 include/ras/ras_event.h                           |    3 
 kernel/acct.c                                     |   10 
 kernel/cgroup/cpuset.c                            |    2 
 kernel/dma/direct.c                               |    2 
 kernel/fork.c                                     |    4 
 kernel/futex.c                                    |    2 
 kernel/irq/timings.c                              |    2 
 kernel/jump_label.c                               |    2 
 kernel/kcsan/encoding.h                           |    2 
 kernel/kexec_core.c                               |    2 
 kernel/kexec_file.c                               |    2 
 kernel/kthread.c                                  |    2 
 kernel/livepatch/state.c                          |    2 
 kernel/panic.c                                    |   12 
 kernel/pid_namespace.c                            |    2 
 kernel/power/snapshot.c                           |    2 
 kernel/range.c                                    |    3 
 kernel/relay.c                                    |    2 
 kernel/resource.c                                 |  114 +++++--
 kernel/smp.c                                      |    2 
 kernel/sys.c                                      |    2 
 kernel/user_namespace.c                           |    2 
 lib/Kconfig.debug                                 |    7 
 lib/Kconfig.ubsan                                 |   14 
 lib/Makefile                                      |    1 
 lib/bitmap.c                                      |    2 
 lib/crc32.c                                       |    2 
 lib/decompress_bunzip2.c                          |    2 
 lib/dynamic_queue_limits.c                        |    4 
 lib/earlycpio.c                                   |    2 
 lib/fault-inject-usercopy.c                       |   39 ++
 lib/find_bit.c                                    |    1 
 lib/hexdump.c                                     |    1 
 lib/idr.c                                         |    9 
 lib/iov_iter.c                                    |    5 
 lib/libcrc32c.c                                   |    2 
 lib/math/rational.c                               |    2 
 lib/math/reciprocal_div.c                         |    1 
 lib/mpi/mpi-bit.c                                 |    2 
 lib/percpu_counter.c                              |    2 
 lib/radix-tree.c                                  |    2 
 lib/scatterlist.c                                 |    2 
 lib/strncpy_from_user.c                           |    3 
 lib/syscall.c                                     |    2 
 lib/test_hmm.c                                    |    2 
 lib/test_sysctl.c                                 |    2 
 lib/test_xarray.c                                 |   65 ++++
 lib/usercopy.c                                    |    5 
 lib/xarray.c                                      |  208 ++++++++++++
 mm/Kconfig                                        |    2 
 mm/compaction.c                                   |    6 
 mm/debug_vm_pgtable.c                             |  267 ++++++++--------
 mm/filemap.c                                      |   58 ++-
 mm/gup.c                                          |   73 ++--
 mm/highmem.c                                      |    4 
 mm/huge_memory.c                                  |   47 +-
 mm/hwpoison-inject.c                              |   18 -
 mm/internal.h                                     |   47 +-
 mm/khugepaged.c                                   |    2 
 mm/madvise.c                                      |   52 ---
 mm/memory-failure.c                               |  357 ++++++++++------------
 mm/memory.c                                       |    7 
 mm/memory_hotplug.c                               |  223 +++++--------
 mm/memremap.c                                     |    3 
 mm/migrate.c                                      |   11 
 mm/mmap.c                                         |    7 
 mm/mmu_notifier.c                                 |    2 
 mm/page-writeback.c                               |    1 
 mm/page_alloc.c                                   |  289 +++++++++++------
 mm/page_isolation.c                               |   16 
 mm/page_owner.c                                   |   10 
 mm/page_poison.c                                  |   20 -
 mm/page_reporting.c                               |    4 
 mm/readahead.c                                    |  174 ++++------
 mm/rmap.c                                         |   10 
 mm/shmem.c                                        |    2 
 mm/shuffle.c                                      |    2 
 mm/slab.c                                         |    2 
 mm/slab.h                                         |    1 
 mm/slub.c                                         |    2 
 mm/sparse.c                                       |    2 
 mm/swap_state.c                                   |    2 
 mm/truncate.c                                     |    6 
 mm/util.c                                         |    3 
 mm/vmscan.c                                       |    5 
 mm/vmstat.c                                       |    8 
 mm/workingset.c                                   |    2 
 scripts/Makefile.ubsan                            |   10 
 scripts/checkpatch.pl                             |  238 ++++++++++----
 scripts/const_structs.checkpatch                  |    3 
 scripts/gdb/linux/proc.py                         |   15 
 scripts/gdb/linux/tasks.py                        |    9 
 scripts/get_maintainer.pl                         |    9 
 tools/testing/selftests/exec/.gitignore           |    1 
 tools/testing/selftests/exec/Makefile             |    9 
 tools/testing/selftests/exec/load_address.c       |   68 ++++
 161 files changed, 2532 insertions(+), 1864 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-10-13 23:46 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-10-13 23:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

181 patches, based on 029f56db6ac248769f2c260bfaf3c3c0e23e904c.

Subsystems affected by this patch series:

  kbuild
  scripts
  ntfs
  ocfs2
  vfs
  mm/slab
  mm/slub
  mm/kmemleak
  mm/dax
  mm/debug
  mm/pagecache
  mm/fadvise
  mm/gup
  mm/swap
  mm/memremap
  mm/memcg
  mm/selftests
  mm/pagemap
  mm/mincore
  mm/hmm
  mm/dma
  mm/memory-failure
  mm/vmalloc
  mm/documentation
  mm/kasan
  mm/pagealloc
  mm/hugetlb
  mm/vmscan
  mm/z3fold
  mm/zbud
  mm/compaction
  mm/mempolicy
  mm/mempool
  mm/memblock
  mm/oom-kill
  mm/migration

Subsystem: kbuild

    Nick Desaulniers <ndesaulniers@google.com>:
    Patch series "set clang minimum version to 10.0.1", v3:
      compiler-clang: add build check for clang 10.0.1
      Revert "kbuild: disable clang's default use of -fmerge-all-constants"
      Revert "arm64: bti: Require clang >= 10.0.1 for in-kernel BTI support"
      Revert "arm64: vdso: Fix compilation with clang older than 8"
      Partially revert "ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer"

    Marco Elver <elver@google.com>:
      kasan: remove mentions of unsupported Clang versions

    Nick Desaulniers <ndesaulniers@google.com>:
      compiler-gcc: improve version error
      compiler.h: avoid escaped section names
      export.h: fix section name for CONFIG_TRIM_UNUSED_KSYMS for Clang

    Lukas Bulwahn <lukas.bulwahn@gmail.com>:
      kbuild: doc: describe proper script invocation

Subsystem: scripts

    Wang Qing <wangqing@vivo.com>:
      scripts/spelling.txt: increase error-prone spell checking

    Naoki Hayama <naoki.hayama@lineo.co.jp>:
      scripts/spelling.txt: add "arbitrary" typo

    Borislav Petkov <bp@suse.de>:
      scripts/decodecode: add the capability to supply the program counter

Subsystem: ntfs

    Rustam Kovhaev <rkovhaev@gmail.com>:
      ntfs: add check for mft record size in superblock

Subsystem: ocfs2

    Randy Dunlap <rdunlap@infradead.org>:
      ocfs2: delete repeated words in comments

    Gang He <ghe@suse.com>:
      ocfs2: fix potential soft lockup during fstrim

Subsystem: vfs

    Randy Dunlap <rdunlap@infradead.org>:
      fs/xattr.c: fix kernel-doc warnings for setxattr & removexattr

    Luo Jiaxing <luojiaxing@huawei.com>:
      fs_parse: mark fs_param_bad_value() as static

Subsystem: mm/slab

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/slab.c: clean code by removing redundant if condition

    tangjianqiang <wyqt1985@gmail.com>:
      include/linux/slab.h: fix a typo error in comment

Subsystem: mm/slub

    Abel Wu <wuyun.wu@huawei.com>:
      mm/slub.c: branch optimization in free slowpath
      mm/slub: fix missing ALLOC_SLOWPATH stat when bulk alloc
      mm/slub: make add_full() condition more explicit

Subsystem: mm/kmemleak

    Davidlohr Bueso <dave@stgolabs.net>:
      mm/kmemleak: rely on rcu for task stack scanning

    Hui Su <sh_def@163.com>:
      mm,kmemleak-test.c: move kmemleak-test.c to samples dir

Subsystem: mm/dax

    Dan Williams <dan.j.williams@intel.com>:
    Patch series "device-dax: Support sub-dividing soft-reserved ranges", v5:
      x86/numa: cleanup configuration dependent command-line options
      x86/numa: add 'nohmat' option
      efi/fake_mem: arrange for a resource entry per efi_fake_mem instance
      ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device
      resource: report parent to walk_iomem_res_desc() callback
      mm/memory_hotplug: introduce default phys_to_target_node() implementation
      ACPI: HMAT: attach a device for each soft-reserved range
      device-dax: drop the dax_region.pfn_flags attribute
      device-dax: move instance creation parameters to 'struct dev_dax_data'
      device-dax: make pgmap optional for instance creation
      device-dax/kmem: introduce dax_kmem_range()
      device-dax/kmem: move resource name tracking to drvdata
      device-dax/kmem: replace release_resource() with release_mem_region()
      device-dax: add an allocation interface for device-dax instances
      device-dax: introduce 'struct dev_dax' typed-driver operations
      device-dax: introduce 'seed' devices
      drivers/base: make device_find_child_by_name() compatible with sysfs inputs
      device-dax: add resize support
      mm/memremap_pages: convert to 'struct range'
      mm/memremap_pages: support multiple ranges per invocation
      device-dax: add dis-contiguous resource support
      device-dax: introduce 'mapping' devices

    Joao Martins <joao.m.martins@oracle.com>:
      device-dax: make align a per-device property

    Dan Williams <dan.j.williams@intel.com>:
      device-dax: add an 'align' attribute

    Joao Martins <joao.m.martins@oracle.com>:
      dax/hmem: introduce dax_hmem.region_idle parameter
      device-dax: add a range mapping allocation attribute

Subsystem: mm/debug

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/debug.c: do not dereference i_ino blindly

    John Hubbard <jhubbard@nvidia.com>:
      mm, dump_page: rename head_mapcount() --> head_compound_mapcount()

Subsystem: mm/pagecache

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Return head pages from find_*_entry", v2:
      mm: factor find_get_incore_page out of mincore_page
      mm: use find_get_incore_page in memcontrol
      mm: optimise madvise WILLNEED
      proc: optimise smaps for shmem entries
      i915: use find_lock_page instead of find_lock_entry
      mm: convert find_get_entry to return the head page
      mm/shmem: return head page from find_lock_entry
      mm: add find_lock_head
      mm/filemap: fix filemap_map_pages for THP

Subsystem: mm/fadvise

    Yafang Shao <laoar.shao@gmail.com>:
      mm, fadvise: improve the expensive remote LRU cache draining after FADV_DONTNEED

Subsystem: mm/gup

    Barry Song <song.bao.hua@hisilicon.com>:
      mm/gup_benchmark: update the documentation in Kconfig
      mm/gup_benchmark: use pin_user_pages for FOLL_LONGTERM flag
      mm/gup: don't permit users to call get_user_pages with FOLL_LONGTERM

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup: protect unpin_user_pages() against npages==-ERRNO

Subsystem: mm/swap

    Gao Xiang <hsiangkao@redhat.com>:
      swap: rename SWP_FS to SWAP_FS_OPS to avoid ambiguity

    Yu Zhao <yuzhao@google.com>:
      mm: remove activate_page() from unuse_pte()
      mm: remove superfluous __ClearPageActive()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/swap.c: fix confusing comment in release_pages()
      mm/swap_slots.c: remove always zero and unused return value of enable_swap_slots_cache()
      mm/page_io.c: remove useless out label in __swap_writepage()
      mm/swap.c: fix incomplete comment in lru_cache_add_inactive_or_unevictable()
      mm/swapfile.c: remove unnecessary goto out in _swap_info_get()
      mm/swapfile.c: fix potential memory leak in sys_swapon

Subsystem: mm/memremap

    Ira Weiny <ira.weiny@intel.com>:
      mm/memremap.c: convert devmap static branch to {inc,dec}

Subsystem: mm/memcg

    "Gustavo A. R. Silva" <gustavoars@kernel.org>:
      mm: memcontrol: use flex_array_size() helper in memcpy()
      mm: memcontrol: use the preferred form for passing the size of a structure type

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: fix racy access to page->mem_cgroup in mem_cgroup_from_obj()

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: memcontrol: correct the comment of mem_cgroup_iter()

    Waiman Long <longman@redhat.com>:
    Patch series "mm/memcg: Miscellaneous cleanups and streamlining", v2:
      mm/memcg: clean up obsolete enum charge_type
      mm/memcg: simplify mem_cgroup_get_max()
      mm/memcg: unify swap and memsw page counters

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: add the missing numa_stat interface for cgroup v2

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/page_counter: correct the obsolete func name in the comment of page_counter_try_charge()
      mm: memcontrol: reword obsolete comment of mem_cgroup_unmark_under_oom()

    Bharata B Rao <bharata@linux.ibm.com>:
      mm: memcg/slab: uncharge during kmem_cache_free_bulk()

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/memcg: fix device private memcg accounting

Subsystem: mm/selftests

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "selftests/vm: fix some minor aggravating factors in the Makefile":
      selftests/vm: fix false build success on the second and later attempts
      selftests/vm: fix incorrect gcc invocation in some cases

Subsystem: mm/pagemap

    Matthew Wilcox <willy@infradead.org>:
      mm: account PMD tables like PTE tables

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/memory.c: fix typo in __do_fault() comment
      mm/memory.c: replace vmf->vma with variable vma

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/mmap: rename __vma_unlink_common() to __vma_unlink()
      mm/mmap: leverage vma_rb_erase_ignore() to implement vma_rb_erase()

    Chinwen Chang <chinwen.chang@mediatek.com>:
    Patch series "Try to release mmap_lock temporarily in smaps_rollup", v4:
      mmap locking API: add mmap_lock_is_contended()
      mm: smaps*: extend smap_gather_stats to support specified beginning
      mm: proc: smaps_rollup: do not stall write attempts on mmap_lock

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Fix PageDoubleMap":
      mm: move PageDoubleMap bit
      mm: simplify PageDoubleMap with PF_SECOND policy

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/mmap: leave adjust_next as virtual address instead of page frame number

    Randy Dunlap <rdunlap@infradead.org>:
      mm/memory.c: fix spello of "function"

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/mmap: not necessary to check mapping separately
      mm/mmap: check on file instead of the rb_root_cached of its address_space

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: use helper function mapping_allow_writable()
      mm/mmap.c: use helper function allow_write_access() in __remove_shared_vm_struct()

    Liao Pingfang <liao.pingfang@zte.com.cn>:
      mm/mmap.c: replace do_brk with do_brk_flags in comment of insert_vm_struct()

    Peter Xu <peterx@redhat.com>:
      mm: remove src/dst mm parameter in copy_page_range()

Subsystem: mm/mincore

    yuleixzhang <yulei.kernel@gmail.com>:
      include/linux/huge_mm.h: remove mincore_huge_pmd declaration

Subsystem: mm/hmm

    Ralph Campbell <rcampbell@nvidia.com>:
      tools/testing/selftests/vm/hmm-tests.c: use the new SKIP() macro
      lib/test_hmm.c: remove unused dmirror_zero_page

Subsystem: mm/dma

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      mm/dmapool.c: replace open-coded list_for_each_entry_safe()
      mm/dmapool.c: replace hard coded function name with __func__

Subsystem: mm/memory-failure

    Xianting Tian <tian.xianting@h3c.com>:
      mm/memory-failure: do pgoff calculation before for_each_process()

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/memory-failure.c: remove unused macro `writeback'

Subsystem: mm/vmalloc

    Hui Su <sh_def@163.com>:
      mm/vmalloc.c: update the comment in __vmalloc_area_node()
      mm/vmalloc.c: fix the comment of find_vm_area

Subsystem: mm/documentation

    Alexander Gordeev <agordeev@linux.ibm.com>:
      docs/vm: fix 'mm_count' vs 'mm_users' counter confusion

Subsystem: mm/kasan

    Patricia Alfonso <trishalfonso@google.com>:
    Patch series "KASAN-KUnit Integration", v14:
      kasan/kunit: add KUnit Struct to Current Task
      KUnit: KASAN Integration
      KASAN: port KASAN Tests to KUnit
      KASAN: Testing Documentation

    David Gow <davidgow@google.com>:
      mm: kasan: do not panic if both panic_on_warn and kasan_multishot set

Subsystem: mm/pagealloc

    David Hildenbrand <david@redhat.com>:
    Patch series "mm / virtio-mem: support ZONE_MOVABLE", v5:
      mm/page_alloc: tweak comments in has_unmovable_pages()
      mm/page_isolation: exit early when pageblock is isolated in set_migratetype_isolate()
      mm/page_isolation: drop WARN_ON_ONCE() in set_migratetype_isolate()
      mm/page_isolation: cleanup set_migratetype_isolate()
      virtio-mem: don't special-case ZONE_MOVABLE
      mm: document semantics of ZONE_MOVABLE

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm, isolation: avoid checking unmovable pages across pageblock boundary

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/page_alloc.c: clean code by removing unnecessary initialization
      mm/page_alloc.c: micro-optimization remove unnecessary branch
      mm/page_alloc.c: fix early params garbage value accesses
      mm/page_alloc.c: clean code by merging two functions

    Yanfei Xu <yanfei.xu@windriver.com>:
      mm/page_alloc.c: __perform_reclaim should return 'unsigned long'

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mmzone: clean code by removing unused macro parameter

    Ralph Campbell <rcampbell@nvidia.com>:
      mm: move call to compound_head() in release_pages()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/page_alloc.c: fix freeing non-compound pages

    Michal Hocko <mhocko@suse.com>:
      include/linux/gfp.h: clarify usage of GFP_ATOMIC in !preemptible contexts

Subsystem: mm/hugetlb

    Baoquan He <bhe@redhat.com>:
    Patch series "mm/hugetlb: Small cleanup and improvement", v2:
      mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool
      mm/hugetlb.c: remove the unnecessary non_swap_entry()
      doc/vm: fix typo in the hugetlb admin documentation

    Wei Yang <richard.weiyang@linux.alibaba.com>:
    Patch series "mm/hugetlb: code refine and simplification", v4:
      mm/hugetlb: not necessary to coalesce regions recursively
      mm/hugetlb: remove VM_BUG_ON(!nrg) in get_file_region_entry_from_cache()
      mm/hugetlb: use list_splice to merge two list at once
      mm/hugetlb: count file_region to be added when regions_needed != NULL
      mm/hugetlb: a page from buddy is not on any list
      mm/hugetlb: narrow the hugetlb_lock protection area during preparing huge page
      mm/hugetlb: take the free hpage during the iteration directly

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlb: add lockdep check for i_mmap_rwsem held in huge_pmd_share

Subsystem: mm/vmscan

    Chunxin Zang <zangchunxin@bytedance.com>:
      mm/vmscan: fix infinite loop in drop_slab_node

    Hui Su <sh_def@163.com>:
      mm/vmscan: fix comments for isolate_lru_page()

Subsystem: mm/z3fold

    Hui Su <sh_def@163.com>:
      mm/z3fold.c: use xx_zalloc instead xx_alloc and memset

Subsystem: mm/zbud

    Xiang Chen <chenxiang66@hisilicon.com>:
      mm/zbud: remove redundant initialization

Subsystem: mm/compaction

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/compaction.c: micro-optimization remove unnecessary branch
      include/linux/compaction.h: clean code by removing unused enum value

    John Hubbard <jhubbard@nvidia.com>:
      selftests/vm: 8x compaction_test speedup

Subsystem: mm/mempolicy

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/mempolicy: remove or narrow the lock on current
      mm: remove unused alloc_page_vma_node()

Subsystem: mm/mempool

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mempool: add 'else' to split mutually exclusive case

Subsystem: mm/memblock

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "memblock: seasonal cleaning^w cleanup", v3:
      KVM: PPC: Book3S HV: simplify kvm_cma_reserve()
      dma-contiguous: simplify cma_early_percent_memory()
      arm, xtensa: simplify initialization of high memory pages
      arm64: numa: simplify dummy_numa_init()
      h8300, nds32, openrisc: simplify detection of memory extents
      riscv: drop unneeded node initialization
      mircoblaze: drop unneeded NUMA and sparsemem initializations
      memblock: make for_each_memblock_type() iterator private
      memblock: make memblock_debug and related functionality private
      memblock: reduce number of parameters in for_each_mem_range()
      arch, mm: replace for_each_memblock() with for_each_mem_pfn_range()
      arch, drivers: replace for_each_membock() with for_each_mem_range()
      x86/setup: simplify initrd relocation and reservation
      x86/setup: simplify reserve_crashkernel()
      memblock: remove unused memblock_mem_size()
      memblock: implement for_each_reserved_mem_region() using __next_mem_region()
      memblock: use separate iterators for memory and reserved regions

Subsystem: mm/oom-kill

    Suren Baghdasaryan <surenb@google.com>:
      mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary

Subsystem: mm/migration

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/migrate: remove cpages-- in migrate_vma_finalize()
      mm/migrate: remove obsolete comment about device public

 .clang-format                                |    7 
 Documentation/admin-guide/cgroup-v2.rst      |   69 +
 Documentation/admin-guide/mm/hugetlbpage.rst |    2 
 Documentation/dev-tools/kasan.rst            |   74 +
 Documentation/dev-tools/kmemleak.rst         |    2 
 Documentation/kbuild/makefiles.rst           |   20 
 Documentation/vm/active_mm.rst               |    2 
 Documentation/x86/x86_64/boot-options.rst    |    4 
 MAINTAINERS                                  |    2 
 Makefile                                     |    9 
 arch/arm/Kconfig                             |    2 
 arch/arm/include/asm/tlb.h                   |    1 
 arch/arm/kernel/setup.c                      |   18 
 arch/arm/mm/init.c                           |   59 -
 arch/arm/mm/mmu.c                            |   39 
 arch/arm/mm/pmsa-v7.c                        |   23 
 arch/arm/mm/pmsa-v8.c                        |   17 
 arch/arm/xen/mm.c                            |    7 
 arch/arm64/Kconfig                           |    2 
 arch/arm64/kernel/machine_kexec_file.c       |    6 
 arch/arm64/kernel/setup.c                    |    4 
 arch/arm64/kernel/vdso/Makefile              |    7 
 arch/arm64/mm/init.c                         |   11 
 arch/arm64/mm/kasan_init.c                   |   10 
 arch/arm64/mm/mmu.c                          |   11 
 arch/arm64/mm/numa.c                         |   15 
 arch/c6x/kernel/setup.c                      |    9 
 arch/h8300/kernel/setup.c                    |    8 
 arch/microblaze/mm/init.c                    |   23 
 arch/mips/cavium-octeon/dma-octeon.c         |   14 
 arch/mips/kernel/setup.c                     |   31 
 arch/mips/netlogic/xlp/setup.c               |    2 
 arch/nds32/kernel/setup.c                    |    8 
 arch/openrisc/kernel/setup.c                 |    9 
 arch/openrisc/mm/init.c                      |    8 
 arch/powerpc/kernel/fadump.c                 |   61 -
 arch/powerpc/kexec/file_load_64.c            |   16 
 arch/powerpc/kvm/book3s_hv_builtin.c         |   12 
 arch/powerpc/kvm/book3s_hv_uvmem.c           |   14 
 arch/powerpc/mm/book3s64/hash_utils.c        |   16 
 arch/powerpc/mm/book3s64/radix_pgtable.c     |   10 
 arch/powerpc/mm/kasan/kasan_init_32.c        |    8 
 arch/powerpc/mm/mem.c                        |   31 
 arch/powerpc/mm/numa.c                       |    7 
 arch/powerpc/mm/pgtable_32.c                 |    8 
 arch/riscv/mm/init.c                         |   36 
 arch/riscv/mm/kasan_init.c                   |   10 
 arch/s390/kernel/setup.c                     |   27 
 arch/s390/mm/page-states.c                   |    6 
 arch/s390/mm/vmem.c                          |    7 
 arch/sh/mm/init.c                            |    9 
 arch/sparc/mm/init_64.c                      |   12 
 arch/x86/include/asm/numa.h                  |    8 
 arch/x86/kernel/e820.c                       |   16 
 arch/x86/kernel/setup.c                      |   56 -
 arch/x86/mm/numa.c                           |   13 
 arch/x86/mm/numa_emulation.c                 |    3 
 arch/x86/xen/enlighten_pv.c                  |    2 
 arch/xtensa/mm/init.c                        |   55 -
 drivers/acpi/numa/hmat.c                     |   76 -
 drivers/acpi/numa/srat.c                     |    9 
 drivers/base/core.c                          |    2 
 drivers/bus/mvebu-mbus.c                     |   12 
 drivers/dax/Kconfig                          |    6 
 drivers/dax/Makefile                         |    3 
 drivers/dax/bus.c                            | 1237 +++++++++++++++++++++++----
 drivers/dax/bus.h                            |   34 
 drivers/dax/dax-private.h                    |   74 +
 drivers/dax/device.c                         |  164 +--
 drivers/dax/hmem.c                           |   56 -
 drivers/dax/hmem/Makefile                    |    8 
 drivers/dax/hmem/device.c                    |  100 ++
 drivers/dax/hmem/hmem.c                      |   93 +-
 drivers/dax/kmem.c                           |  236 ++---
 drivers/dax/pmem/compat.c                    |    2 
 drivers/dax/pmem/core.c                      |   36 
 drivers/firmware/efi/x86_fake_mem.c          |   12 
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c    |    4 
 drivers/gpu/drm/nouveau/nouveau_dmem.c       |   15 
 drivers/irqchip/irq-gic-v3-its.c             |    2 
 drivers/nvdimm/badrange.c                    |   26 
 drivers/nvdimm/claim.c                       |   13 
 drivers/nvdimm/nd.h                          |    3 
 drivers/nvdimm/pfn_devs.c                    |   13 
 drivers/nvdimm/pmem.c                        |   27 
 drivers/nvdimm/region.c                      |   21 
 drivers/pci/p2pdma.c                         |   12 
 drivers/virtio/virtio_mem.c                  |   47 -
 drivers/xen/unpopulated-alloc.c              |   45 
 fs/fs_parser.c                               |    2 
 fs/ntfs/inode.c                              |    6 
 fs/ocfs2/alloc.c                             |    6 
 fs/ocfs2/localalloc.c                        |    2 
 fs/proc/base.c                               |    3 
 fs/proc/task_mmu.c                           |  104 +-
 fs/xattr.c                                   |   22 
 include/acpi/acpi_numa.h                     |   14 
 include/kunit/test.h                         |    5 
 include/linux/acpi.h                         |    2 
 include/linux/compaction.h                   |    3 
 include/linux/compiler-clang.h               |    8 
 include/linux/compiler-gcc.h                 |    2 
 include/linux/compiler.h                     |    2 
 include/linux/dax.h                          |    8 
 include/linux/export.h                       |    2 
 include/linux/fs.h                           |    4 
 include/linux/gfp.h                          |    6 
 include/linux/huge_mm.h                      |    3 
 include/linux/kasan.h                        |    6 
 include/linux/memblock.h                     |   90 +
 include/linux/memcontrol.h                   |   13 
 include/linux/memory_hotplug.h               |   23 
 include/linux/memremap.h                     |   15 
 include/linux/mm.h                           |   36 
 include/linux/mmap_lock.h                    |    5 
 include/linux/mmzone.h                       |   37 
 include/linux/numa.h                         |   11 
 include/linux/oom.h                          |    1 
 include/linux/page-flags.h                   |   42 
 include/linux/pagemap.h                      |   43 
 include/linux/range.h                        |    6 
 include/linux/sched.h                        |    4 
 include/linux/sched/coredump.h               |    1 
 include/linux/slab.h                         |    2 
 include/linux/swap.h                         |   10 
 include/linux/swap_slots.h                   |    2 
 kernel/dma/contiguous.c                      |   11 
 kernel/fork.c                                |   25 
 kernel/resource.c                            |   11 
 lib/Kconfig.debug                            |    9 
 lib/Kconfig.kasan                            |   31 
 lib/Makefile                                 |    5 
 lib/kunit/test.c                             |   13 
 lib/test_free_pages.c                        |   42 
 lib/test_hmm.c                               |   65 -
 lib/test_kasan.c                             |  732 ++++++---------
 lib/test_kasan_module.c                      |  111 ++
 mm/Kconfig                                   |    4 
 mm/Makefile                                  |    1 
 mm/compaction.c                              |    5 
 mm/debug.c                                   |   18 
 mm/dmapool.c                                 |   46 -
 mm/fadvise.c                                 |    9 
 mm/filemap.c                                 |   78 -
 mm/gup.c                                     |   44 
 mm/gup_benchmark.c                           |   23 
 mm/huge_memory.c                             |    4 
 mm/hugetlb.c                                 |  100 +-
 mm/internal.h                                |    3 
 mm/kasan/report.c                            |   34 
 mm/kmemleak-test.c                           |   99 --
 mm/kmemleak.c                                |    8 
 mm/madvise.c                                 |   21 
 mm/memblock.c                                |  102 --
 mm/memcontrol.c                              |  262 +++--
 mm/memory-failure.c                          |    5 
 mm/memory.c                                  |  147 +--
 mm/memory_hotplug.c                          |   10 
 mm/mempolicy.c                               |    8 
 mm/mempool.c                                 |   18 
 mm/memremap.c                                |  344 ++++---
 mm/migrate.c                                 |    3 
 mm/mincore.c                                 |   28 
 mm/mmap.c                                    |   45 
 mm/oom_kill.c                                |    2 
 mm/page_alloc.c                              |   82 -
 mm/page_counter.c                            |    2 
 mm/page_io.c                                 |   14 
 mm/page_isolation.c                          |   41 
 mm/shmem.c                                   |   19 
 mm/slab.c                                    |    4 
 mm/slab.h                                    |   50 -
 mm/slub.c                                    |   33 
 mm/sparse.c                                  |   10 
 mm/swap.c                                    |   14 
 mm/swap_slots.c                              |    3 
 mm/swap_state.c                              |   38 
 mm/swapfile.c                                |   12 
 mm/truncate.c                                |   58 -
 mm/vmalloc.c                                 |    6 
 mm/vmscan.c                                  |    5 
 mm/z3fold.c                                  |    3 
 mm/zbud.c                                    |    1 
 samples/Makefile                             |    1 
 samples/kmemleak/Makefile                    |    3 
 samples/kmemleak/kmemleak-test.c             |   99 ++
 scripts/decodecode                           |   29 
 scripts/spelling.txt                         |    4 
 tools/testing/nvdimm/dax-dev.c               |   28 
 tools/testing/nvdimm/test/iomap.c            |    2 
 tools/testing/selftests/vm/Makefile          |   17 
 tools/testing/selftests/vm/compaction_test.c |   11 
 tools/testing/selftests/vm/gup_benchmark.c   |   14 
 tools/testing/selftests/vm/hmm-tests.c       |    4 
 194 files changed, 4273 insertions(+), 2777 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-10-11  6:15 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-10-11  6:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

5 patches, based on da690031a5d6d50a361e3f19f3eeabd086a6f20d.

Subsystems affected by this patch series:

  MAINTAINERS
  mm/pagemap
  mm/swap
  mm/hugetlb

Subsystem: MAINTAINERS

    Kees Cook <keescook@chromium.org>:
      MAINTAINERS: change hardening mailing list

    Antoine Tenart <atenart@kernel.org>:
      MAINTAINERS: Antoine Tenart's email address

Subsystem: mm/pagemap

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: mmap: Fix general protection fault in unlink_file_vma()

Subsystem: mm/swap

    Minchan Kim <minchan@kernel.org>:
      mm: validate inode in mapping_set_error()

Subsystem: mm/hugetlb

    Vijay Balakrishna <vijayb@linux.microsoft.com>:
      mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged

 .mailmap                   |    4 +++-
 MAINTAINERS                |    8 ++++----
 include/linux/khugepaged.h |    5 +++++
 include/linux/pagemap.h    |    3 ++-
 mm/khugepaged.c            |   13 +++++++++++--
 mm/mmap.c                  |    6 +++++-
 mm/page_alloc.c            |    3 +++
 7 files changed, 33 insertions(+), 9 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-10-03  5:20 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-10-03  5:20 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

3 patches, based on d3d45f8220d60a0b2aaaacf8fb2be4e6ffd9008e.

Subsystems affected by this patch series:

  mm/slub
  mm/cma
  scripts

Subsystem: mm/slub

    Eric Farman <farman@linux.ibm.com>:
      mm, slub: restore initial kmem_cache flags

Subsystem: mm/cma

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
      mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

Subsystem: scripts

    Eric Biggers <ebiggers@google.com>:
      scripts/spelling.txt: fix malformed entry

 mm/page_alloc.c      |   19 ++++++++++++++++---
 mm/slub.c            |    6 +-----
 scripts/spelling.txt |    2 +-
 3 files changed, 18 insertions(+), 9 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-09-26  4:17 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-09-26  4:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

9 patches, based on 7c7ec3226f5f33f9c050d85ec20f18419c622ad6.

Subsystems affected by this patch series:

  mm/thp
  mm/memcg
  mm/gup
  mm/migration
  lib
  x86
  mm/memory-hotplug

Subsystem: mm/thp

    Gao Xiang <hsiangkao@redhat.com>:
      mm, THP, swap: fix allocating cluster for swapfile by mistake

Subsystem: mm/memcg

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcontrol: fix missing suffix of workingset_restore

Subsystem: mm/gup

    Vasily Gorbik <gor@linux.ibm.com>:
      mm/gup: fix gup_fast with dynamic page table folding

Subsystem: mm/migration

    Zi Yan <ziy@nvidia.com>:
      mm/migrate: correct thp migration stats

Subsystem: lib

    Nick Desaulniers <ndesaulniers@google.com>:
      lib/string.c: implement stpcpy

    Jason Yan <yanaijie@huawei.com>:
      lib/memregion.c: include memregion.h

Subsystem: x86

    Mikulas Patocka <mpatocka@redhat.com>:
      arch/x86/lib/usercopy_64.c: fix  __copy_user_flushcache() cache writeback

Subsystem: mm/memory-hotplug

    Laurent Dufour <ldufour@linux.ibm.com>:
    Patch series "mm: fix memory to node bad links in sysfs", v3:
      mm: replace memmap_context by meminit_context
      mm: don't rely on system state to detect hot-plug operations

 Documentation/admin-guide/cgroup-v2.rst |   25 ++++++---
 arch/ia64/mm/init.c                     |    6 +-
 arch/s390/include/asm/pgtable.h         |   42 +++++++++++----
 arch/x86/lib/usercopy_64.c              |    2 
 drivers/base/node.c                     |   85 ++++++++++++++++++++------------
 include/linux/mm.h                      |    2 
 include/linux/mmzone.h                  |   11 +++-
 include/linux/node.h                    |   11 ++--
 include/linux/pgtable.h                 |   10 +++
 lib/memregion.c                         |    1 
 lib/string.c                            |   24 +++++++++
 mm/gup.c                                |   18 +++---
 mm/memcontrol.c                         |    4 -
 mm/memory_hotplug.c                     |    5 +
 mm/migrate.c                            |    7 +-
 mm/page_alloc.c                         |   10 +--
 mm/swapfile.c                           |    2 
 17 files changed, 181 insertions(+), 84 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-09-19  4:19 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-09-19  4:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

15 patches, based on 92ab97adeefccf375de7ebaad9d5b75d4125fe8b.

Subsystems affected by this patch series:

  mailmap
  mm/hotfixes
  mm/thp
  mm/memory-hotplug
  misc
  kcsan

Subsystem: mailmap

    Kees Cook <keescook@chromium.org>:
      mailmap: add older email addresses for Kees Cook

Subsystem: mm/hotfixes

    Hugh Dickins <hughd@google.com>:
    Patch series "mm: fixes to past from future testing":
      ksm: reinstate memcg charge on copied pages
      mm: migration of hugetlbfs page skip memcg
      shmem: shmem_writepage() split unlikely i915 THP
      mm: fix check_move_unevictable_pages() on THP
      mlock: fix unevictable_pgs event counts on THP

    Byron Stanoszek <gandalf@winds.org>:
      tmpfs: restore functionality of nr_inodes=0

    Muchun Song <songmuchun@bytedance.com>:
      kprobes: fix kill kprobe which has been marked as gone

Subsystem: mm/thp

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/thp: fix __split_huge_pmd_locked() for migration PMD

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      selftests/vm: fix display of page size in map_hugetlb

Subsystem: mm/memory-hotplug

    Pavel Tatashin <pasha.tatashin@soleen.com>:
      mm/memory_hotplug: drain per-cpu pages again during memory offline

Subsystem: misc

    Tobias Klauser <tklauser@distanz.ch>:
      ftrace: let ftrace_enable_sysctl take a kernel pointer buffer
      stackleak: let stack_erasing_sysctl take a kernel pointer buffer
      fs/fs-writeback.c: adjust dirtytime_interval_handler definition to match prototype

Subsystem: kcsan

    Changbin Du <changbin.du@gmail.com>:
      kcsan: kconfig: move to menu 'Generic Kernel Debugging Instruments'

 .mailmap                                 |    4 ++
 fs/fs-writeback.c                        |    2 -
 include/linux/ftrace.h                   |    3 --
 include/linux/stackleak.h                |    2 -
 kernel/kprobes.c                         |    9 +++++-
 kernel/stackleak.c                       |    2 -
 kernel/trace/ftrace.c                    |    3 --
 lib/Kconfig.debug                        |    4 --
 mm/huge_memory.c                         |   42 ++++++++++++++++---------------
 mm/ksm.c                                 |    4 ++
 mm/memory_hotplug.c                      |   14 ++++++++++
 mm/migrate.c                             |    3 +-
 mm/mlock.c                               |   24 +++++++++++------
 mm/page_isolation.c                      |    8 +++++
 mm/shmem.c                               |   20 +++++++++++---
 mm/swap.c                                |    6 ++--
 mm/vmscan.c                              |   10 +++++--
 tools/testing/selftests/vm/map_hugetlb.c |    2 -
 18 files changed, 111 insertions(+), 51 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-09-04 23:34 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-09-04 23:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

19 patches, based on 59126901f200f5fc907153468b03c64e0081b6e6.

Subsystems affected by this patch series:

  mm/memcg
  mm/slub
  MAINTAINERS
  mm/pagemap
  ipc
  fork
  checkpatch
  mm/madvise
  mm/migration
  mm/hugetlb
  lib

Subsystem: mm/memcg

    Michal Hocko <mhocko@suse.com>:
      memcg: fix use-after-free in uncharge_batch

    Xunlei Pang <xlpang@linux.alibaba.com>:
      mm: memcg: fix memcg reclaim soft lockup

Subsystem: mm/slub

    Eugeniu Rosca <erosca@de.adit-jv.com>:
      mm: slub: fix conversion of freelist_corrupted()

Subsystem: MAINTAINERS

    Robert Richter <rric@kernel.org>:
      MAINTAINERS: update Cavium/Marvell entries

    Nick Desaulniers <ndesaulniers@google.com>:
      MAINTAINERS: add LLVM maintainers

    Randy Dunlap <rdunlap@infradead.org>:
      MAINTAINERS: IA64: mark Status as Odd Fixes only

Subsystem: mm/pagemap

    Joerg Roedel <jroedel@suse.de>:
      mm: track page table modifications in __apply_to_page_range()

Subsystem: ipc

    Tobias Klauser <tklauser@distanz.ch>:
      ipc: adjust proc_ipc_sem_dointvec definition to match prototype

Subsystem: fork

    Tobias Klauser <tklauser@distanz.ch>:
      fork: adjust sysctl_max_threads definition to match prototype

Subsystem: checkpatch

    Mrinal Pandey <mrinalmni@gmail.com>:
      checkpatch: fix the usage of capture group ( ... )

Subsystem: mm/madvise

    Yang Shi <shy828301@gmail.com>:
      mm: madvise: fix vma user-after-free

Subsystem: mm/migration

    Alistair Popple <alistair@popple.id.au>:
      mm/migrate: fixup setting UFFD_WP flag
      mm/rmap: fixup copying of soft dirty and uffd ptes

    Ralph Campbell <rcampbell@nvidia.com>:
    Patch series "mm/migrate: preserve soft dirty in remove_migration_pte()":
      mm/migrate: remove unnecessary is_zone_device_page() check
      mm/migrate: preserve soft dirty in remove_migration_pte()

Subsystem: mm/hugetlb

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm/hugetlb: try preferred node first when alloc gigantic page from cma

    Muchun Song <songmuchun@bytedance.com>:
      mm/hugetlb: fix a race between hugetlb sysctl handlers

    David Howells <dhowells@redhat.com>:
      mm/khugepaged.c: fix khugepaged's request size in collapse_file

Subsystem: lib

    Jason Gunthorpe <jgg@nvidia.com>:
      include/linux/log2.h: add missing () around n in roundup_pow_of_two()

 MAINTAINERS           |   32 ++++++++++++++++----------------
 include/linux/log2.h  |    2 +-
 ipc/ipc_sysctl.c      |    2 +-
 kernel/fork.c         |    2 +-
 mm/hugetlb.c          |   49 +++++++++++++++++++++++++++++++++++++------------
 mm/khugepaged.c       |    2 +-
 mm/madvise.c          |    2 +-
 mm/memcontrol.c       |    6 ++++++
 mm/memory.c           |   37 ++++++++++++++++++++++++-------------
 mm/migrate.c          |   31 +++++++++++++++++++------------
 mm/rmap.c             |    9 +++++++--
 mm/slub.c             |   12 ++++++------
 mm/vmscan.c           |    8 ++++++++
 scripts/checkpatch.pl |    4 ++--
 14 files changed, 130 insertions(+), 68 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-08-21  0:41 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-08-21  0:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

11 patches, based on 7eac66d0456fe12a462e5c14c68e97c7460989da.

Subsystems affected by this patch series:

  misc
  mm/hugetlb
  mm/vmalloc
  mm/misc
  romfs
  relay
  uprobes
  squashfs
  mm/cma
  mm/pagealloc

Subsystem: misc

    Nick Desaulniers <ndesaulniers@google.com>:
      mailmap: add Andi Kleen

Subsystem: mm/hugetlb

    Xu Wang <vulab@iscas.ac.cn>:
      hugetlb_cgroup: convert comma to semicolon

    Hugh Dickins <hughd@google.com>:
      khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter()

Subsystem: mm/vmalloc

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm/vunmap: add cond_resched() in vunmap_pmd_range

Subsystem: mm/misc

    Leon Romanovsky <leonro@nvidia.com>:
      mm/rodata_test.c: fix missing function declaration

Subsystem: romfs

    Jann Horn <jannh@google.com>:
      romfs: fix uninitialized memory leak in romfs_dev_read()

Subsystem: relay

    Wei Yongjun <weiyongjun1@huawei.com>:
      kernel/relay.c: fix memleak on destroy relay channel

Subsystem: uprobes

    Hugh Dickins <hughd@google.com>:
      uprobes: __replace_page() avoid BUG in munlock_vma_page()

Subsystem: squashfs

    Phillip Lougher <phillip@squashfs.org.uk>:
      squashfs: avoid bio_alloc() failure with 1Mbyte blocks

Subsystem: mm/cma

    Doug Berger <opendmb@gmail.com>:
      mm: include CMA pages in lowmem_reserve at boot

Subsystem: mm/pagealloc

    Charan Teja Reddy <charante@codeaurora.org>:
      mm, page_alloc: fix core hung in free_pcppages_bulk()

 .mailmap                |    1 +
 fs/romfs/storage.c      |    4 +---
 fs/squashfs/block.c     |    6 +++++-
 kernel/events/uprobes.c |    2 +-
 kernel/relay.c          |    1 +
 mm/hugetlb_cgroup.c     |    4 ++--
 mm/khugepaged.c         |    2 +-
 mm/page_alloc.c         |    7 ++++++-
 mm/rodata_test.c        |    1 +
 mm/vmalloc.c            |    2 ++
 10 files changed, 21 insertions(+), 9 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-08-15  0:29 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-08-15  0:29 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


39 patches, based on b923f1247b72fc100b87792fd2129d026bb10e66.

Subsystems affected by this patch series:

  mm/hotfixes
  lz4
  exec
  mailmap
  mm/thp
  autofs
  mm/madvise
  sysctl
  mm/kmemleak
  mm/misc
  lib

Subsystem: mm/hotfixes

    Mike Rapoport <rppt@linux.ibm.com>:
      asm-generic: pgalloc.h: use correct #ifdef to enable pud_alloc_one()

    Baoquan He <bhe@redhat.com>:
      Revert "mm/vmstat.c: do not show lowmem reserve protection information of empty zone"

Subsystem: lz4

    Nick Terrell <terrelln@fb.com>:
      lz4: fix kernel decompression speed

Subsystem: exec

    Kees Cook <keescook@chromium.org>:
    Patch series "Fix S_ISDIR execve() errno":
      exec: restore EACCES of S_ISDIR execve()
      selftests/exec: add file type errno tests

Subsystem: mailmap

    Greg Kurz <groug@kaod.org>:
      mailmap: add entry for Greg Kurz

Subsystem: mm/thp

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "THP prep patches":
      mm: store compound_nr as well as compound_order
      mm: move page-flags include to top of file
      mm: add thp_order
      mm: add thp_size
      mm: replace hpage_nr_pages with thp_nr_pages
      mm: add thp_head
      mm: introduce offset_in_thp

Subsystem: autofs

    Randy Dunlap <rdunlap@infradead.org>:
      fs: autofs: delete repeated words in comments

Subsystem: mm/madvise

    Minchan Kim <minchan@kernel.org>:
    Patch series "introduce memory hinting API for external process", v8:
      mm/madvise: pass task and mm to do_madvise
      pid: move pidfd_get_pid() to pid.c
      mm/madvise: introduce process_madvise() syscall: an external memory hinting API
      mm/madvise: check fatal signal pending of target process

Subsystem: sysctl

    Xiaoming Ni <nixiaoming@huawei.com>:
      all arch: remove system call sys_sysctl

Subsystem: mm/kmemleak

    Qian Cai <cai@lca.pw>:
      mm/kmemleak: silence KCSAN splats in checksum

Subsystem: mm/misc

    Qian Cai <cai@lca.pw>:
      mm/frontswap: mark various intentional data races
      mm/page_io: mark various intentional data races
      mm/swap_state: mark various intentional data races

    Kirill A. Shutemov <kirill@shutemov.name>:
      mm/filemap.c: fix a data race in filemap_fault()

    Qian Cai <cai@lca.pw>:
      mm/swapfile: fix and annotate various data races
      mm/page_counter: fix various data races at memsw
      mm/memcontrol: fix a data race in scan count
      mm/list_lru: fix a data race in list_lru_count_one
      mm/mempool: fix a data race in mempool_free()
      mm/rmap: annotate a data race at tlb_flush_batched
      mm/swap.c: annotate data races for lru_rotate_pvecs
      mm: annotate a data race in page_zonenum()

    Romain Naour <romain.naour@gmail.com>:
      include/asm-generic/vmlinux.lds.h: align ro_after_init

    Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
      sh: clkfwk: remove r8/r16/r32
      sh: use generic strncpy()

Subsystem: lib

    Krzysztof Kozlowski <krzk@kernel.org>:
    Patch series "iomap: Constify ioreadX() iomem argument", v3:
      iomap: constify ioreadX() iomem argument (as in generic implementation)
      rtl818x: constify ioreadX() iomem argument (as in generic implementation)
      ntb: intel: constify ioreadX() iomem argument (as in generic implementation)
      virtio: pci: constify ioreadX() iomem argument (as in generic implementation)

 .mailmap                                               |    1 
 arch/alpha/include/asm/core_apecs.h                    |    6 
 arch/alpha/include/asm/core_cia.h                      |    6 
 arch/alpha/include/asm/core_lca.h                      |    6 
 arch/alpha/include/asm/core_marvel.h                   |    4 
 arch/alpha/include/asm/core_mcpcia.h                   |    6 
 arch/alpha/include/asm/core_t2.h                       |    2 
 arch/alpha/include/asm/io.h                            |   12 -
 arch/alpha/include/asm/io_trivial.h                    |   16 -
 arch/alpha/include/asm/jensen.h                        |    2 
 arch/alpha/include/asm/machvec.h                       |    6 
 arch/alpha/kernel/core_marvel.c                        |    2 
 arch/alpha/kernel/io.c                                 |   12 -
 arch/alpha/kernel/syscalls/syscall.tbl                 |    3 
 arch/arm/configs/am200epdkit_defconfig                 |    1 
 arch/arm/tools/syscall.tbl                             |    3 
 arch/arm64/include/asm/unistd.h                        |    2 
 arch/arm64/include/asm/unistd32.h                      |    6 
 arch/ia64/kernel/syscalls/syscall.tbl                  |    3 
 arch/m68k/kernel/syscalls/syscall.tbl                  |    3 
 arch/microblaze/kernel/syscalls/syscall.tbl            |    3 
 arch/mips/configs/cu1000-neo_defconfig                 |    1 
 arch/mips/kernel/syscalls/syscall_n32.tbl              |    3 
 arch/mips/kernel/syscalls/syscall_n64.tbl              |    3 
 arch/mips/kernel/syscalls/syscall_o32.tbl              |    3 
 arch/parisc/include/asm/io.h                           |    4 
 arch/parisc/kernel/syscalls/syscall.tbl                |    3 
 arch/parisc/lib/iomap.c                                |   72 +++---
 arch/powerpc/kernel/iomap.c                            |   28 +-
 arch/powerpc/kernel/syscalls/syscall.tbl               |    3 
 arch/s390/kernel/syscalls/syscall.tbl                  |    3 
 arch/sh/configs/dreamcast_defconfig                    |    1 
 arch/sh/configs/espt_defconfig                         |    1 
 arch/sh/configs/hp6xx_defconfig                        |    1 
 arch/sh/configs/landisk_defconfig                      |    1 
 arch/sh/configs/lboxre2_defconfig                      |    1 
 arch/sh/configs/microdev_defconfig                     |    1 
 arch/sh/configs/migor_defconfig                        |    1 
 arch/sh/configs/r7780mp_defconfig                      |    1 
 arch/sh/configs/r7785rp_defconfig                      |    1 
 arch/sh/configs/rts7751r2d1_defconfig                  |    1 
 arch/sh/configs/rts7751r2dplus_defconfig               |    1 
 arch/sh/configs/se7206_defconfig                       |    1 
 arch/sh/configs/se7343_defconfig                       |    1 
 arch/sh/configs/se7619_defconfig                       |    1 
 arch/sh/configs/se7705_defconfig                       |    1 
 arch/sh/configs/se7750_defconfig                       |    1 
 arch/sh/configs/se7751_defconfig                       |    1 
 arch/sh/configs/secureedge5410_defconfig               |    1 
 arch/sh/configs/sh03_defconfig                         |    1 
 arch/sh/configs/sh7710voipgw_defconfig                 |    1 
 arch/sh/configs/sh7757lcr_defconfig                    |    1 
 arch/sh/configs/sh7763rdp_defconfig                    |    1 
 arch/sh/configs/shmin_defconfig                        |    1 
 arch/sh/configs/titan_defconfig                        |    1 
 arch/sh/include/asm/string_32.h                        |   26 --
 arch/sh/kernel/iomap.c                                 |   22 -
 arch/sh/kernel/syscalls/syscall.tbl                    |    3 
 arch/sparc/kernel/syscalls/syscall.tbl                 |    3 
 arch/x86/entry/syscalls/syscall_32.tbl                 |    3 
 arch/x86/entry/syscalls/syscall_64.tbl                 |    4 
 arch/xtensa/kernel/syscalls/syscall.tbl                |    3 
 drivers/mailbox/bcm-pdc-mailbox.c                      |    2 
 drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h |    6 
 drivers/ntb/hw/intel/ntb_hw_gen1.c                     |    2 
 drivers/ntb/hw/intel/ntb_hw_gen3.h                     |    2 
 drivers/ntb/hw/intel/ntb_hw_intel.h                    |    2 
 drivers/nvdimm/btt.c                                   |    4 
 drivers/nvdimm/pmem.c                                  |    6 
 drivers/sh/clk/cpg.c                                   |   25 --
 drivers/virtio/virtio_pci_modern.c                     |    6 
 fs/autofs/dev-ioctl.c                                  |    4 
 fs/io_uring.c                                          |    2 
 fs/namei.c                                             |    4 
 include/asm-generic/iomap.h                            |   28 +-
 include/asm-generic/pgalloc.h                          |    2 
 include/asm-generic/vmlinux.lds.h                      |    1 
 include/linux/compat.h                                 |    5 
 include/linux/huge_mm.h                                |   58 ++++-
 include/linux/io-64-nonatomic-hi-lo.h                  |    4 
 include/linux/io-64-nonatomic-lo-hi.h                  |    4 
 include/linux/memcontrol.h                             |    2 
 include/linux/mm.h                                     |   16 -
 include/linux/mm_inline.h                              |    6 
 include/linux/mm_types.h                               |    1 
 include/linux/pagemap.h                                |    6 
 include/linux/pid.h                                    |    1 
 include/linux/syscalls.h                               |    4 
 include/linux/sysctl.h                                 |    6 
 include/uapi/asm-generic/unistd.h                      |    4 
 kernel/Makefile                                        |    2 
 kernel/exit.c                                          |   17 -
 kernel/pid.c                                           |   17 +
 kernel/sys_ni.c                                        |    3 
 kernel/sysctl_binary.c                                 |  171 --------------
 lib/iomap.c                                            |   30 +-
 lib/lz4/lz4_compress.c                                 |    4 
 lib/lz4/lz4_decompress.c                               |   18 -
 lib/lz4/lz4defs.h                                      |   10 
 lib/lz4/lz4hc_compress.c                               |    2 
 mm/compaction.c                                        |    2 
 mm/filemap.c                                           |   22 +
 mm/frontswap.c                                         |    8 
 mm/gup.c                                               |    2 
 mm/internal.h                                          |    4 
 mm/kmemleak.c                                          |    2 
 mm/list_lru.c                                          |    2 
 mm/madvise.c                                           |  190 ++++++++++++++--
 mm/memcontrol.c                                        |   10 
 mm/memory.c                                            |    4 
 mm/memory_hotplug.c                                    |    7 
 mm/mempolicy.c                                         |    2 
 mm/mempool.c                                           |    2 
 mm/migrate.c                                           |   18 -
 mm/mlock.c                                             |    9 
 mm/page_alloc.c                                        |    5 
 mm/page_counter.c                                      |   13 -
 mm/page_io.c                                           |   12 -
 mm/page_vma_mapped.c                                   |    6 
 mm/rmap.c                                              |   10 
 mm/swap.c                                              |   21 -
 mm/swap_state.c                                        |   10 
 mm/swapfile.c                                          |   33 +-
 mm/vmscan.c                                            |    6 
 mm/vmstat.c                                            |   12 -
 mm/workingset.c                                        |    6 
 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl     |    2 
 tools/perf/arch/s390/entry/syscalls/syscall.tbl        |    2 
 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl      |    2 
 tools/testing/selftests/exec/.gitignore                |    1 
 tools/testing/selftests/exec/Makefile                  |    5 
 tools/testing/selftests/exec/non-regular.c             |  196 +++++++++++++++++
 132 files changed, 815 insertions(+), 614 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-08-12  1:29 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-08-12  1:29 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- Most of the rest of MM

- various other subsystems


165 patches, based on 00e4db51259a5f936fec1424b884f029479d3981.

Subsystems affected by this patch series:

  mm/memcg
  mm/hugetlb
  mm/vmscan
  mm/proc
  mm/compaction
  mm/mempolicy
  mm/oom-kill
  mm/hugetlbfs
  mm/migration
  mm/thp
  mm/cma
  mm/util
  mm/memory-hotplug
  mm/cleanups
  mm/uaccess
  alpha
  misc
  sparse
  bitmap
  lib
  lz4
  bitops
  checkpatch
  autofs
  minix
  nilfs
  ufs
  fat
  signals
  kmod
  coredump
  exec
  kdump
  rapidio
  panic
  kcov
  kgdb
  ipc
  mm/migration
  mm/gup
  mm/pagemap

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
    Patch series "mm: memcg accounting of percpu memory", v3:
      percpu: return number of released bytes from pcpu_free_area()
      mm: memcg/percpu: account percpu memory to memory cgroups
      mm: memcg/percpu: per-memcg percpu memory statistics
      mm: memcg: charge memcg percpu memory to the parent cgroup
      kselftests: cgroup: add perpcu memory accounting test

Subsystem: mm/hugetlb

    Muchun Song <songmuchun@bytedance.com>:
      mm/hugetlb: add mempolicy check in the reservation routine

Subsystem: mm/vmscan

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
    Patch series "workingset protection/detection on the anonymous LRU list", v7:
      mm/vmscan: make active/inactive ratio as 1:1 for anon lru
      mm/vmscan: protect the workingset on anonymous LRU
      mm/workingset: prepare the workingset detection infrastructure for anon LRU
      mm/swapcache: support to handle the shadow entries
      mm/swap: implement workingset detection for anonymous LRU
      mm/vmscan: restore active/inactive ratio for anonymous LRU

Subsystem: mm/proc

    Michal Koutný <mkoutny@suse.com>:
      /proc/PID/smaps: consistent whitespace output format

Subsystem: mm/compaction

    Nitin Gupta <nigupta@nvidia.com>:
      mm: proactive compaction
      mm: fix compile error due to COMPACTION_HPAGE_ORDER
      mm: use unsigned types for fragmentation score

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/compaction: correct the comments of compact_defer_shift

Subsystem: mm/mempolicy

    Krzysztof Kozlowski <krzk@kernel.org>:
      mm: mempolicy: fix kerneldoc of numa_map_to_online_node()

    Wenchao Hao <haowenchao22@gmail.com>:
      mm/mempolicy.c: check parameters first in kernel_get_mempolicy

    Yanfei Xu <yanfei.xu@windriver.com>:
      include/linux/mempolicy.h: fix typo

Subsystem: mm/oom-kill

    Yafang Shao <laoar.shao@gmail.com>:
      mm, oom: make the calculation of oom badness more accurate

    Michal Hocko <mhocko@suse.com>:
      doc, mm: sync up oom_score_adj documentation
      doc, mm: clarify /proc/<pid>/oom_score value range

    Yafang Shao <laoar.shao@gmail.com>:
      mm, oom: show process exiting information in __oom_kill_process()

Subsystem: mm/hugetlbfs

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlbfs: prevent filesystem stacking of hugetlbfs
      hugetlbfs: remove call to huge_pte_alloc without i_mmap_rwsem

Subsystem: mm/migration

    Ralph Campbell <rcampbell@nvidia.com>:
    Patch series "mm/migrate: optimize migrate_vma_setup() for holes":
      mm/migrate: optimize migrate_vma_setup() for holes
      mm/migrate: add migrate-shared test for migrate_vma_*()

Subsystem: mm/thp

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: thp: remove debug_cow switch

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/vmstat: add events for THP migration without split

Subsystem: mm/cma

    Jianqun Xu <jay.xu@rock-chips.com>:
      mm/cma.c: fix NULL pointer dereference when cma could not be activated

    Barry Song <song.bao.hua@hisilicon.com>:
    Patch series "mm: fix the names of general cma and hugetlb cma", v2:
      mm: cma: fix the name of CMA areas
      mm: hugetlb: fix the name of hugetlb CMA

    Mike Kravetz <mike.kravetz@oracle.com>:
      cma: don't quit at first error when activating reserved areas

Subsystem: mm/util

    Waiman Long <longman@redhat.com>:
      include/linux/sched/mm.h: optimize current_gfp_context()

    Krzysztof Kozlowski <krzk@kernel.org>:
      mm: mmu_notifier: fix and extend kerneldoc

Subsystem: mm/memory-hotplug

    Daniel Jordan <daniel.m.jordan@oracle.com>:
      x86/mm: use max memory block size on bare metal

    Jia He <justin.he@arm.com>:
      mm/memory_hotplug: introduce default dummy memory_add_physaddr_to_nid()
      mm/memory_hotplug: fix unpaired mem_hotplug_begin/done

    Charan Teja Reddy <charante@codeaurora.org>:
      mm, memory_hotplug: update pcp lists everytime onlining a memory block

Subsystem: mm/cleanups

    Randy Dunlap <rdunlap@infradead.org>:
      mm: drop duplicated words in <linux/pgtable.h>
      mm: drop duplicated words in <linux/mm.h>
      include/linux/highmem.h: fix duplicated words in a comment
      include/linux/frontswap.h:  drop duplicated word in a comment
      include/linux/memcontrol.h: drop duplicate word and fix spello

    Arvind Sankar <nivedita@alum.mit.edu>:
      sh/mm: drop unused MAX_PHYSADDR_BITS
      sparc: drop unused MAX_PHYSADDR_BITS

    Randy Dunlap <rdunlap@infradead.org>:
      mm/compaction.c: delete duplicated word
      mm/filemap.c: delete duplicated word
      mm/hmm.c: delete duplicated word
      mm/hugetlb.c: delete duplicated words
      mm/memcontrol.c: delete duplicated words
      mm/memory.c: delete duplicated words
      mm/migrate.c: delete duplicated word
      mm/nommu.c: delete duplicated words
      mm/page_alloc.c: delete or fix duplicated words
      mm/shmem.c: delete duplicated word
      mm/slab_common.c: delete duplicated word
      mm/usercopy.c: delete duplicated word
      mm/vmscan.c: delete or fix duplicated words
      mm/zpool.c: delete duplicated word and fix grammar
      mm/zsmalloc.c: fix duplicated words

Subsystem: mm/uaccess

    Christoph Hellwig <hch@lst.de>:
    Patch series "clean up address limit helpers", v2:
      syscalls: use uaccess_kernel in addr_limit_user_check
      nds32: use uaccess_kernel in show_regs
      riscv: include <asm/pgtable.h> in <asm/uaccess.h>
      uaccess: remove segment_eq
      uaccess: add force_uaccess_{begin,end} helpers
      exec: use force_uaccess_begin during exec and exit

Subsystem: alpha

    Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
      alpha: fix annotation of io{read,write}{16,32}be()

Subsystem: misc

    Randy Dunlap <rdunlap@infradead.org>:
      include/linux/compiler-clang.h: drop duplicated word in a comment
      include/linux/exportfs.h: drop duplicated word in a comment
      include/linux/async_tx.h: drop duplicated word in a comment
      include/linux/xz.h: drop duplicated word

    Christoph Hellwig <hch@lst.de>:
      kernel: add a kernel_wait helper

    Feng Tang <feng.tang@intel.com>:
      ./Makefile: add debug option to enable function aligned on 32 bytes

    Arvind Sankar <nivedita@alum.mit.edu>:
      kernel.h: remove duplicate include of asm/div64.h

    "Alexander A. Klimov" <grandmaster@al2klimov.de>:
      include/: replace HTTP links with HTTPS ones

    Matthew Wilcox <willy@infradead.org>:
      include/linux/poison.h: remove obsolete comment

Subsystem: sparse

    Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
      sparse: group the defines by functionality

Subsystem: bitmap

    Stefano Brivio <sbrivio@redhat.com>:
    Patch series "lib: Fix bitmap_cut() for overlaps, add test":
      lib/bitmap.c: fix bitmap_cut() for partial overlapping case
      lib/test_bitmap.c: add test for bitmap_cut()

Subsystem: lib

    Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
      lib/generic-radix-tree.c: remove unneeded __rcu

    Geert Uytterhoeven <geert@linux-m68k.org>:
      lib/test_bitops: do the full test during module init

    Wei Yongjun <weiyongjun1@huawei.com>:
      lib/test_lockup.c: make symbol 'test_works' static

    Tiezhu Yang <yangtiezhu@loongson.cn>:
      lib/Kconfig.debug: make TEST_LOCKUP depend on module
      lib/test_lockup.c: fix return value of test_lockup_init()

    "Alexander A. Klimov" <grandmaster@al2klimov.de>:
      lib/: replace HTTP links with HTTPS ones

    "Kars Mulder" <kerneldev@karsmulder.nl>:
      kstrto*: correct documentation references to simple_strto*()
      kstrto*: do not describe simple_strto*() as obsolete/replaced

Subsystem: lz4

    Nick Terrell <terrelln@fb.com>:
      lz4: fix kernel decompression speed

Subsystem: bitops

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      lib/test_bits.c: add tests of GENMASK

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: add test for possible misuse of IS_ENABLED() without CONFIG_
      checkpatch: add --fix option for ASSIGN_IN_IF

    Quentin Monnet <quentin@isovalent.com>:
      checkpatch: fix CONST_STRUCT when const_structs.checkpatch is missing

    Joe Perches <joe@perches.com>:
      checkpatch: add test for repeated words
      checkpatch: remove missing switch/case break test

Subsystem: autofs

    Randy Dunlap <rdunlap@infradead.org>:
      autofs: fix doubled word

Subsystem: minix

    Eric Biggers <ebiggers@google.com>:
    Patch series "fs/minix: fix syzbot bugs and set s_maxbytes":
      fs/minix: check return value of sb_getblk()
      fs/minix: don't allow getting deleted inodes
      fs/minix: reject too-large maximum file size
      fs/minix: set s_maxbytes correctly
      fs/minix: fix block limit check for V1 filesystems
      fs/minix: remove expected error message in block_to_path()

Subsystem: nilfs

    Eric Biggers <ebiggers@google.com>:
    Patch series "nilfs2 updates":
      nilfs2: only call unlock_new_inode() if I_NEW

    Joe Perches <joe@perches.com>:
      nilfs2: convert __nilfs_msg to integrate the level and format
      nilfs2: use a more common logging style

Subsystem: ufs

    Colin Ian King <colin.king@canonical.com>:
      fs/ufs: avoid potential u32 multiplication overflow

Subsystem: fat

    Yubo Feng <fengyubo3@huawei.com>:
      fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes

    "Alexander A. Klimov" <grandmaster@al2klimov.de>:
      VFAT/FAT/MSDOS FILESYSTEM: replace HTTP links with HTTPS ones

    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
      fat: fix fat_ra_init() for data clusters == 0

Subsystem: signals

    Helge Deller <deller@gmx.de>:
      fs/signalfd.c: fix inconsistent return codes for signalfd4

Subsystem: kmod

    Tiezhu Yang <yangtiezhu@loongson.cn>:
    Patch series "kmod/umh: a few fixes":
      selftests: kmod: use variable NAME in kmod_test_0001()
      kmod: remove redundant "be an" in the comment
      test_kmod: avoid potential double free in trigger_config_run_type()

Subsystem: coredump

    Lepton Wu <ytht.net@gmail.com>:
      coredump: add %f for executable filename

Subsystem: exec

    Kees Cook <keescook@chromium.org>:
    Patch series "Relocate execve() sanity checks", v2:
      exec: change uselib(2) IS_SREG() failure to EACCES
      exec: move S_ISREG() check earlier
      exec: move path_noexec() check earlier

Subsystem: kdump

    Vijay Balakrishna <vijayb@linux.microsoft.com>:
      kdump: append kernel build-id string to VMCOREINFO

Subsystem: rapidio

    "Gustavo A. R. Silva" <gustavoars@kernel.org>:
      drivers/rapidio/devices/rio_mport_cdev.c: use struct_size() helper
      drivers/rapidio/rio-scan.c: use struct_size() helper
      rapidio/rio_mport_cdev: use array_size() helper in copy_{from,to}_user()

Subsystem: panic

    Tiezhu Yang <yangtiezhu@loongson.cn>:
      kernel/panic.c: make oops_may_print() return bool
      lib/Kconfig.debug: fix typo in the help text of CONFIG_PANIC_TIMEOUT

    Yue Hu <huyue2@yulong.com>:
      panic: make print_oops_end_marker() static

Subsystem: kcov

    Marco Elver <elver@google.com>:
      kcov: unconditionally add -fno-stack-protector to compiler options

    Wei Yongjun <weiyongjun1@huawei.com>:
      kcov: make some symbols static

Subsystem: kgdb

    Nick Desaulniers <ndesaulniers@google.com>:
      scripts/gdb: fix python 3.8 SyntaxWarning

Subsystem: ipc

    Alexey Dobriyan <adobriyan@gmail.com>:
      ipc: uninline functions

    Liao Pingfang <liao.pingfang@zte.com.cn>:
      ipc/shm.c: remove the superfluous break

Subsystem: mm/migration

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
    Patch series "clean-up the migration target allocation functions", v5:
      mm/page_isolation: prefer the node of the source page
      mm/migrate: move migration helper from .h to .c
      mm/hugetlb: unify migration callbacks
      mm/migrate: clear __GFP_RECLAIM to make the migration callback consistent with regular THP allocations
      mm/migrate: introduce a standard migration target allocation function
      mm/mempolicy: use a standard migration target allocation callback
      mm/page_alloc: remove a wrapper for alloc_migration_target()

Subsystem: mm/gup

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
      mm/gup: restrict CMA region by using allocation scope API
      mm/hugetlb: make hugetlb migration callback CMA aware
      mm/gup: use a standard migration target allocation callback

Subsystem: mm/pagemap

    Peter Xu <peterx@redhat.com>:
    Patch series "mm: Page fault accounting cleanups", v5:
      mm: do page fault accounting in handle_mm_fault
      mm/alpha: use general page fault accounting
      mm/arc: use general page fault accounting
      mm/arm: use general page fault accounting
      mm/arm64: use general page fault accounting
      mm/csky: use general page fault accounting
      mm/hexagon: use general page fault accounting
      mm/ia64: use general page fault accounting
      mm/m68k: use general page fault accounting
      mm/microblaze: use general page fault accounting
      mm/mips: use general page fault accounting
      mm/nds32: use general page fault accounting
      mm/nios2: use general page fault accounting
      mm/openrisc: use general page fault accounting
      mm/parisc: use general page fault accounting
      mm/powerpc: use general page fault accounting
      mm/riscv: use general page fault accounting
      mm/s390: use general page fault accounting
      mm/sh: use general page fault accounting
      mm/sparc32: use general page fault accounting
      mm/sparc64: use general page fault accounting
      mm/x86: use general page fault accounting
      mm/xtensa: use general page fault accounting
      mm: clean up the last pieces of page fault accountings
      mm/gup: remove task_struct pointer for all gup code

 Documentation/admin-guide/cgroup-v2.rst         |    4 
 Documentation/admin-guide/sysctl/kernel.rst     |    3 
 Documentation/admin-guide/sysctl/vm.rst         |   15 +
 Documentation/filesystems/proc.rst              |   11 -
 Documentation/vm/page_migration.rst             |   27 +++
 Makefile                                        |    4 
 arch/alpha/include/asm/io.h                     |    8 
 arch/alpha/include/asm/uaccess.h                |    2 
 arch/alpha/mm/fault.c                           |   10 -
 arch/arc/include/asm/segment.h                  |    3 
 arch/arc/kernel/process.c                       |    2 
 arch/arc/mm/fault.c                             |   20 --
 arch/arm/include/asm/uaccess.h                  |    4 
 arch/arm/kernel/signal.c                        |    2 
 arch/arm/mm/fault.c                             |   27 ---
 arch/arm64/include/asm/uaccess.h                |    2 
 arch/arm64/kernel/sdei.c                        |    2 
 arch/arm64/mm/fault.c                           |   31 ---
 arch/arm64/mm/numa.c                            |   10 -
 arch/csky/include/asm/segment.h                 |    2 
 arch/csky/mm/fault.c                            |   15 -
 arch/h8300/include/asm/segment.h                |    2 
 arch/hexagon/mm/vm_fault.c                      |   11 -
 arch/ia64/include/asm/uaccess.h                 |    2 
 arch/ia64/mm/fault.c                            |   11 -
 arch/ia64/mm/numa.c                             |    2 
 arch/m68k/include/asm/segment.h                 |    2 
 arch/m68k/include/asm/tlbflush.h                |    6 
 arch/m68k/mm/fault.c                            |   16 -
 arch/microblaze/include/asm/uaccess.h           |    2 
 arch/microblaze/mm/fault.c                      |   11 -
 arch/mips/include/asm/uaccess.h                 |    2 
 arch/mips/kernel/unaligned.c                    |   27 +--
 arch/mips/mm/fault.c                            |   16 -
 arch/nds32/include/asm/uaccess.h                |    2 
 arch/nds32/kernel/process.c                     |    2 
 arch/nds32/mm/alignment.c                       |    7 
 arch/nds32/mm/fault.c                           |   21 --
 arch/nios2/include/asm/uaccess.h                |    2 
 arch/nios2/mm/fault.c                           |   16 -
 arch/openrisc/include/asm/uaccess.h             |    2 
 arch/openrisc/mm/fault.c                        |   11 -
 arch/parisc/include/asm/uaccess.h               |    2 
 arch/parisc/mm/fault.c                          |   10 -
 arch/powerpc/include/asm/uaccess.h              |    3 
 arch/powerpc/mm/copro_fault.c                   |    7 
 arch/powerpc/mm/fault.c                         |   13 -
 arch/riscv/include/asm/uaccess.h                |    6 
 arch/riscv/mm/fault.c                           |   18 --
 arch/s390/include/asm/uaccess.h                 |    2 
 arch/s390/kvm/interrupt.c                       |    2 
 arch/s390/kvm/kvm-s390.c                        |    2 
 arch/s390/kvm/priv.c                            |    8 
 arch/s390/mm/fault.c                            |   18 --
 arch/s390/mm/gmap.c                             |    4 
 arch/sh/include/asm/segment.h                   |    3 
 arch/sh/include/asm/sparsemem.h                 |    4 
 arch/sh/kernel/traps_32.c                       |   12 -
 arch/sh/mm/fault.c                              |   13 -
 arch/sh/mm/init.c                               |    9 -
 arch/sparc/include/asm/sparsemem.h              |    1 
 arch/sparc/include/asm/uaccess_32.h             |    2 
 arch/sparc/include/asm/uaccess_64.h             |    2 
 arch/sparc/mm/fault_32.c                        |   15 -
 arch/sparc/mm/fault_64.c                        |   13 -
 arch/um/kernel/trap.c                           |    6 
 arch/x86/include/asm/uaccess.h                  |    2 
 arch/x86/mm/fault.c                             |   19 --
 arch/x86/mm/init_64.c                           |    9 +
 arch/x86/mm/numa.c                              |    1 
 arch/xtensa/include/asm/uaccess.h               |    2 
 arch/xtensa/mm/fault.c                          |   17 -
 drivers/firmware/arm_sdei.c                     |    5 
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c     |    2 
 drivers/infiniband/core/umem_odp.c              |    2 
 drivers/iommu/amd/iommu_v2.c                    |    2 
 drivers/iommu/intel/svm.c                       |    3 
 drivers/rapidio/devices/rio_mport_cdev.c        |    7 
 drivers/rapidio/rio-scan.c                      |    8 
 drivers/vfio/vfio_iommu_type1.c                 |    4 
 fs/coredump.c                                   |   17 +
 fs/exec.c                                       |   38 ++--
 fs/fat/Kconfig                                  |    2 
 fs/fat/fatent.c                                 |    3 
 fs/fat/file.c                                   |    4 
 fs/hugetlbfs/inode.c                            |    6 
 fs/minix/inode.c                                |   48 ++++-
 fs/minix/itree_common.c                         |    8 
 fs/minix/itree_v1.c                             |   16 -
 fs/minix/itree_v2.c                             |   15 -
 fs/minix/minix.h                                |    1 
 fs/namei.c                                      |   10 -
 fs/nilfs2/alloc.c                               |   38 ++--
 fs/nilfs2/btree.c                               |   42 ++--
 fs/nilfs2/cpfile.c                              |   10 -
 fs/nilfs2/dat.c                                 |   14 -
 fs/nilfs2/direct.c                              |   14 -
 fs/nilfs2/gcinode.c                             |    2 
 fs/nilfs2/ifile.c                               |    4 
 fs/nilfs2/inode.c                               |   32 +--
 fs/nilfs2/ioctl.c                               |   37 ++--
 fs/nilfs2/mdt.c                                 |    2 
 fs/nilfs2/namei.c                               |    6 
 fs/nilfs2/nilfs.h                               |   18 +-
 fs/nilfs2/page.c                                |   11 -
 fs/nilfs2/recovery.c                            |   32 +--
 fs/nilfs2/segbuf.c                              |    2 
 fs/nilfs2/segment.c                             |   38 ++--
 fs/nilfs2/sufile.c                              |   29 +--
 fs/nilfs2/super.c                               |   73 ++++----
 fs/nilfs2/sysfs.c                               |   29 +--
 fs/nilfs2/the_nilfs.c                           |   85 ++++-----
 fs/open.c                                       |    6 
 fs/proc/base.c                                  |   11 +
 fs/proc/task_mmu.c                              |    4 
 fs/signalfd.c                                   |   10 -
 fs/ufs/super.c                                  |    2 
 include/asm-generic/uaccess.h                   |    4 
 include/clocksource/timer-ti-dm.h               |    2 
 include/linux/async_tx.h                        |    2 
 include/linux/btree.h                           |    2 
 include/linux/compaction.h                      |    6 
 include/linux/compiler-clang.h                  |    2 
 include/linux/compiler_types.h                  |   44 ++---
 include/linux/crash_core.h                      |    6 
 include/linux/delay.h                           |    2 
 include/linux/dma/k3-psil.h                     |    2 
 include/linux/dma/k3-udma-glue.h                |    2 
 include/linux/dma/ti-cppi5.h                    |    2 
 include/linux/exportfs.h                        |    2 
 include/linux/frontswap.h                       |    2 
 include/linux/fs.h                              |   10 +
 include/linux/generic-radix-tree.h              |    2 
 include/linux/highmem.h                         |    2 
 include/linux/huge_mm.h                         |    7 
 include/linux/hugetlb.h                         |   53 ++++--
 include/linux/irqchip/irq-omap-intc.h           |    2 
 include/linux/jhash.h                           |    2 
 include/linux/kernel.h                          |   12 -
 include/linux/leds-ti-lmu-common.h              |    2 
 include/linux/memcontrol.h                      |   12 +
 include/linux/mempolicy.h                       |   18 +-
 include/linux/migrate.h                         |   42 +---
 include/linux/mm.h                              |   20 +-
 include/linux/mmzone.h                          |   17 +
 include/linux/oom.h                             |    4 
 include/linux/pgtable.h                         |   12 -
 include/linux/platform_data/davinci-cpufreq.h   |    2 
 include/linux/platform_data/davinci_asp.h       |    2 
 include/linux/platform_data/elm.h               |    2 
 include/linux/platform_data/gpio-davinci.h      |    2 
 include/linux/platform_data/gpmc-omap.h         |    2 
 include/linux/platform_data/mtd-davinci-aemif.h |    2 
 include/linux/platform_data/omap-twl4030.h      |    2 
 include/linux/platform_data/uio_pruss.h         |    2 
 include/linux/platform_data/usb-omap.h          |    2 
 include/linux/poison.h                          |    4 
 include/linux/sched/mm.h                        |    8 
 include/linux/sched/task.h                      |    1 
 include/linux/soc/ti/k3-ringacc.h               |    2 
 include/linux/soc/ti/knav_qmss.h                |    2 
 include/linux/soc/ti/ti-msgmgr.h                |    2 
 include/linux/swap.h                            |   25 ++
 include/linux/syscalls.h                        |    2 
 include/linux/uaccess.h                         |   20 ++
 include/linux/vm_event_item.h                   |    3 
 include/linux/wkup_m3_ipc.h                     |    2 
 include/linux/xxhash.h                          |    2 
 include/linux/xz.h                              |    4 
 include/linux/zlib.h                            |    2 
 include/soc/arc/aux.h                           |    2 
 include/trace/events/migrate.h                  |   17 +
 include/uapi/linux/auto_dev-ioctl.h             |    2 
 include/uapi/linux/elf.h                        |    2 
 include/uapi/linux/map_to_7segment.h            |    2 
 include/uapi/linux/types.h                      |    2 
 include/uapi/linux/usb/ch9.h                    |    2 
 ipc/sem.c                                       |    3 
 ipc/shm.c                                       |    4 
 kernel/Makefile                                 |    2 
 kernel/crash_core.c                             |   50 +++++
 kernel/events/callchain.c                       |    5 
 kernel/events/core.c                            |    5 
 kernel/events/uprobes.c                         |    8 
 kernel/exit.c                                   |   18 +-
 kernel/futex.c                                  |    2 
 kernel/kcov.c                                   |    6 
 kernel/kmod.c                                   |    5 
 kernel/kthread.c                                |    5 
 kernel/panic.c                                  |    4 
 kernel/stacktrace.c                             |    5 
 kernel/sysctl.c                                 |   11 +
 kernel/umh.c                                    |   29 ---
 lib/Kconfig.debug                               |   27 ++-
 lib/Makefile                                    |    1 
 lib/bitmap.c                                    |    4 
 lib/crc64.c                                     |    2 
 lib/decompress_bunzip2.c                        |    2 
 lib/decompress_unlzma.c                         |    6 
 lib/kstrtox.c                                   |   20 --
 lib/lz4/lz4_compress.c                          |    4 
 lib/lz4/lz4_decompress.c                        |   18 +-
 lib/lz4/lz4defs.h                               |   10 +
 lib/lz4/lz4hc_compress.c                        |    2 
 lib/math/rational.c                             |    2 
 lib/rbtree.c                                    |    2 
 lib/test_bitmap.c                               |   58 ++++++
 lib/test_bitops.c                               |   18 +-
 lib/test_bits.c                                 |   75 ++++++++
 lib/test_kmod.c                                 |    2 
 lib/test_lockup.c                               |    6 
 lib/ts_bm.c                                     |    2 
 lib/xxhash.c                                    |    2 
 lib/xz/xz_crc32.c                               |    2 
 lib/xz/xz_dec_bcj.c                             |    2 
 lib/xz/xz_dec_lzma2.c                           |    2 
 lib/xz/xz_lzma2.h                               |    2 
 lib/xz/xz_stream.h                              |    2 
 mm/cma.c                                        |   40 +---
 mm/cma.h                                        |    4 
 mm/compaction.c                                 |  207 +++++++++++++++++++++--
 mm/filemap.c                                    |    2 
 mm/gup.c                                        |  195 ++++++----------------
 mm/hmm.c                                        |    5 
 mm/huge_memory.c                                |   23 --
 mm/hugetlb.c                                    |   93 ++++------
 mm/internal.h                                   |    9 -
 mm/khugepaged.c                                 |    2 
 mm/ksm.c                                        |    3 
 mm/maccess.c                                    |   22 +-
 mm/memcontrol.c                                 |   42 +++-
 mm/memory-failure.c                             |    7 
 mm/memory.c                                     |  107 +++++++++---
 mm/memory_hotplug.c                             |   30 ++-
 mm/mempolicy.c                                  |   49 +----
 mm/migrate.c                                    |  151 ++++++++++++++---
 mm/mmu_notifier.c                               |    9 -
 mm/nommu.c                                      |    4 
 mm/oom_kill.c                                   |   24 +-
 mm/page_alloc.c                                 |   14 +
 mm/page_isolation.c                             |   21 --
 mm/percpu-internal.h                            |   55 ++++++
 mm/percpu-km.c                                  |    5 
 mm/percpu-stats.c                               |   36 ++--
 mm/percpu-vm.c                                  |    5 
 mm/percpu.c                                     |  208 +++++++++++++++++++++---
 mm/process_vm_access.c                          |    2 
 mm/rmap.c                                       |    2 
 mm/shmem.c                                      |    5 
 mm/slab_common.c                                |    2 
 mm/swap.c                                       |   13 -
 mm/swap_state.c                                 |   80 +++++++--
 mm/swapfile.c                                   |    4 
 mm/usercopy.c                                   |    2 
 mm/userfaultfd.c                                |    2 
 mm/vmscan.c                                     |   36 ++--
 mm/vmstat.c                                     |   32 +++
 mm/workingset.c                                 |   23 +-
 mm/zpool.c                                      |    8 
 mm/zsmalloc.c                                   |    2 
 scripts/checkpatch.pl                           |  116 +++++++++----
 scripts/gdb/linux/rbtree.py                     |    4 
 security/tomoyo/domain.c                        |    2 
 tools/testing/selftests/cgroup/test_kmem.c      |   70 +++++++-
 tools/testing/selftests/kmod/kmod.sh            |    4 
 tools/testing/selftests/vm/hmm-tests.c          |   35 ++++
 virt/kvm/async_pf.c                             |    2 
 virt/kvm/kvm_main.c                             |    2 
 268 files changed, 2481 insertions(+), 1551 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-08-07  6:16 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-08-07  6:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- A few MM hotfixes

- kthread, tools, scripts, ntfs and ocfs2

- Some of MM



163 patches, based on d6efb3ac3e6c19ab722b28bdb9252bae0b9676b6.

Subsystems affected by this patch series:

  mm/pagemap
  mm/hofixes
  mm/pagealloc
  kthread
  tools
  scripts
  ntfs
  ocfs2
  mm/slab-generic
  mm/slab
  mm/slub
  mm/kcsan
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/shmem
  mm/memcg
  mm/pagemap
  mm/mremap
  mm/mincore
  mm/sparsemem
  mm/vmalloc
  mm/kasan
  mm/pagealloc
  mm/hugetlb
  mm/vmscan

Subsystem: mm/pagemap

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/memory.c: avoid access flag update TLB flush for retried page fault

Subsystem: mm/hofixes

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/migrate: fix migrate_pgmap_owner w/o CONFIG_MMU_NOTIFIER

Subsystem: mm/pagealloc

    David Hildenbrand <david@redhat.com>:
      mm/shuffle: don't move pages between zones and don't read garbage memmaps

Subsystem: kthread

    Peter Zijlstra <peterz@infradead.org>:
      mm: fix kthread_use_mm() vs TLB invalidate

    Ilias Stamatis <stamatis.iliass@gmail.com>:
      kthread: remove incorrect comment in kthread_create_on_cpu()

Subsystem: tools

    "Alexander A. Klimov" <grandmaster@al2klimov.de>:
      tools/: replace HTTP links with HTTPS ones

    Gaurav Singh <gaurav1086@gmail.com>:
      tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference

Subsystem: scripts

    Jialu Xu <xujialu@vimux.org>:
      scripts/tags.sh: collect compiled source precisely

    Nikolay Borisov <nborisov@suse.com>:
      scripts/bloat-o-meter: Support comparing library archives

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      scripts/decode_stacktrace.sh: skip missing symbols
      scripts/decode_stacktrace.sh: guess basepath if not specified
      scripts/decode_stacktrace.sh: guess path to modules
      scripts/decode_stacktrace.sh: guess path to vmlinux by release name

    Joe Perches <joe@perches.com>:
      const_structs.checkpatch: add regulator_ops

    Colin Ian King <colin.king@canonical.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

Subsystem: ntfs

    Luca Stefani <luca.stefani.ge1@gmail.com>:
      ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type

Subsystem: ocfs2

    Gang He <ghe@suse.com>:
      ocfs2: fix remounting needed after setfacl command

    Randy Dunlap <rdunlap@infradead.org>:
      ocfs2: suballoc.h: delete a duplicated word

    Junxiao Bi <junxiao.bi@oracle.com>:
      ocfs2: change slot number type s16 to u16

    "Alexander A. Klimov" <grandmaster@al2klimov.de>:
      ocfs2: replace HTTP links with HTTPS ones

    Pavel Machek <pavel@ucw.cz>:
      ocfs2: fix unbalanced locking

Subsystem: mm/slab-generic

    Waiman Long <longman@redhat.com>:
      mm, treewide: rename kzfree() to kfree_sensitive()

    William Kucharski <william.kucharski@oracle.com>:
      mm: ksize() should silently accept a NULL pointer

Subsystem: mm/slab

    Kees Cook <keescook@chromium.org>:
    Patch series "mm: Expand CONFIG_SLAB_FREELIST_HARDENED to include SLAB":
      mm/slab: expand CONFIG_SLAB_FREELIST_HARDENED to include SLAB
      mm/slab: add naive detection of double free

    Long Li <lonuxli.64@gmail.com>:
      mm, slab: check GFP_SLAB_BUG_MASK before alloc_pages in kmalloc_order

    Xiao Yang <yangx.jy@cn.fujitsu.com>:
      mm/slab.c: update outdated kmem_list3 in a comment

Subsystem: mm/slub

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "slub_debug fixes and improvements":
      mm, slub: extend slub_debug syntax for multiple blocks
      mm, slub: make some slub_debug related attributes read-only
      mm, slub: remove runtime allocation order changes
      mm, slub: make remaining slub_debug related attributes read-only
      mm, slub: make reclaim_account attribute read-only
      mm, slub: introduce static key for slub_debug()
      mm, slub: introduce kmem_cache_debug_flags()
      mm, slub: extend checks guarded by slub_debug static key
      mm, slab/slub: move and improve cache_from_obj()
      mm, slab/slub: improve error reporting and overhead of cache_from_obj()

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/slub.c: drop lockdep_assert_held() from put_map()

Subsystem: mm/kcsan

    Marco Elver <elver@google.com>:
      mm, kcsan: instrument SLAB/SLUB free with "ASSERT_EXCLUSIVE_ACCESS"

Subsystem: mm/debug

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/debug_vm_pgtable: Add some more tests", v5:
      mm/debug_vm_pgtable: add tests validating arch helpers for core MM features
      mm/debug_vm_pgtable: add tests validating advanced arch page table helpers
      mm/debug_vm_pgtable: add debug prints for individual tests
      Documentation/mm: add descriptions for arch page table helpers

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Improvements for dump_page()", v2:
      mm/debug: handle page->mapping better in dump_page
      mm/debug: dump compound page information on a second line
      mm/debug: print head flags in dump_page
      mm/debug: switch dump_page to get_kernel_nofault
      mm/debug: print the inode number in dump_page
      mm/debug: print hashed address of struct page

    John Hubbard <jhubbard@nvidia.com>:
      mm, dump_page: do not crash with bad compound_mapcount()

Subsystem: mm/pagecache

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: filemap: clear idle flag for writes
      mm: filemap: add missing FGP_ flags in kerneldoc comment for pagecache_get_page

Subsystem: mm/gup

    Tang Yizhou <tangyizhou@huawei.com>:
      mm/gup.c: fix the comment of return value for populate_vma_page_range()

Subsystem: mm/swap

    Zhen Lei <thunder.leizhen@huawei.com>:
    Patch series "clean up some functions in mm/swap_slots.c":
      mm/swap_slots.c: simplify alloc_swap_slot_cache()
      mm/swap_slots.c: simplify enable_swap_slots_cache()
      mm/swap_slots.c: remove redundant check for swap_slot_cache_initialized

    Krzysztof Kozlowski <krzk@kernel.org>:
      mm: swap: fix kerneldoc of swap_vma_readahead()

    Xianting Tian <xianting_tian@126.com>:
      mm/page_io.c: use blk_io_schedule() for avoiding task hung in sync io

Subsystem: mm/shmem

    Chris Down <chris@chrisdown.name>:
    Patch series "tmpfs: inode: Reduce risk of inum overflow", v7:
      tmpfs: per-superblock i_ino support
      tmpfs: support 64-bit inums per-sb

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm: kmem: make memcg_kmem_enabled() irreversible
    Patch series "The new cgroup slab memory controller", v7:
      mm: memcg: factor out memcg- and lruvec-level changes out of __mod_lruvec_state()
      mm: memcg: prepare for byte-sized vmstat items
      mm: memcg: convert vmstat slab counters to bytes
      mm: slub: implement SLUB version of obj_to_index()

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: decouple reference counting from page accounting

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: obj_cgroup API
      mm: memcg/slab: allocate obj_cgroups for non-root slab pages
      mm: memcg/slab: save obj_cgroup for non-root slab objects
      mm: memcg/slab: charge individual slab objects instead of pages
      mm: memcg/slab: deprecate memory.kmem.slabinfo
      mm: memcg/slab: move memcg_kmem_bypass() to memcontrol.h
      mm: memcg/slab: use a single set of kmem_caches for all accounted allocations
      mm: memcg/slab: simplify memcg cache creation
      mm: memcg/slab: remove memcg_kmem_get_cache()
      mm: memcg/slab: deprecate slab_root_caches
      mm: memcg/slab: remove redundant check in memcg_accumulate_slabinfo()
      mm: memcg/slab: use a single set of kmem_caches for all allocations
      kselftests: cgroup: add kernel memory accounting tests
      tools/cgroup: add memcg_slabinfo.py tool

    Shakeel Butt <shakeelb@google.com>:
      mm: memcontrol: account kernel stack per node

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: remove unused argument by charge_slab_page()
      mm: slab: rename (un)charge_slab_page() to (un)account_slab_page()
      mm: kmem: switch to static_branch_likely() in memcg_kmem_enabled()
      mm: memcontrol: avoid workload stalls when lowering memory.high

    Chris Down <chris@chrisdown.name>:
    Patch series "mm, memcg: reclaim harder before high throttling", v2:
      mm, memcg: reclaim more aggressively before high allocator throttling
      mm, memcg: unify reclaim retry limits with page allocator

    Yafang Shao <laoar.shao@gmail.com>:
    Patch series "mm, memcg: memory.{low,min} reclaim fix & cleanup", v4:
      mm, memcg: avoid stale protection values when cgroup is above protection

    Chris Down <chris@chrisdown.name>:
      mm, memcg: decouple e{low,min} state mutations from protection checks

    Yafang Shao <laoar.shao@gmail.com>:
      memcg, oom: check memcg margin for parallel oom

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: restore proper dirty throttling when memory.high changes
      mm: memcontrol: don't count limit-setting reclaim as memory pressure

    Michal Koutný <mkoutny@suse.com>:
      mm/page_counter.c: fix protection usage propagation

Subsystem: mm/pagemap

    Ralph Campbell <rcampbell@nvidia.com>:
      mm: remove redundant check non_swap_entry()

    Alex Zhang <zhangalex@google.com>:
      mm/memory.c: make remap_pfn_range() reject unaligned addr

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: cleanup usage of <asm/pgalloc.h>":
      mm: remove unneeded includes of <asm/pgalloc.h>
      opeinrisc: switch to generic version of pte allocation
      xtensa: switch to generic version of pte allocation
      asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()
      asm-generic: pgalloc: provide generic pud_alloc_one() and pud_free_one()
      asm-generic: pgalloc: provide generic pgd_free()
      mm: move lib/ioremap.c to mm/

    Joerg Roedel <jroedel@suse.de>:
      mm: move p?d_alloc_track to separate header file

    Zhen Lei <thunder.leizhen@huawei.com>:
      mm/mmap: optimize a branch judgment in ksys_mmap_pgoff()

    Feng Tang <feng.tang@intel.com>:
    Patch series "make vm_committed_as_batch aware of vm overcommit policy", v6:
      proc/meminfo: avoid open coded reading of vm_committed_as
      mm/util.c: make vm_memory_committed() more accurate
      percpu_counter: add percpu_counter_sync()
      mm: adjust vm_committed_as_batch according to vm overcommit policy

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "arm64: Enable vmemmap mapping from device memory", v4:
      mm/sparsemem: enable vmem_altmap support in vmemmap_populate_basepages()
      mm/sparsemem: enable vmem_altmap support in vmemmap_alloc_block_buf()
      arm64/mm: enable vmem_altmap support for vmemmap mappings

    Miaohe Lin <linmiaohe@huawei.com>:
      mm: mmap: merge vma after call_mmap() if possible

    Peter Collingbourne <pcc@google.com>:
      mm: remove unnecessary wrapper function do_mmap_pgoff()

Subsystem: mm/mremap

    Wei Yang <richard.weiyang@linux.alibaba.com>:
    Patch series "mm/mremap: cleanup move_page_tables() a little", v5:
      mm/mremap: it is sure to have enough space when extent meets requirement
      mm/mremap: calculate extent in one place
      mm/mremap: start addresses are properly aligned

Subsystem: mm/mincore

    Ricardo Cañuelo <ricardo.canuelo@collabora.com>:
      selftests: add mincore() tests

Subsystem: mm/sparsemem

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/sparse: never partially remove memmap for early section
      mm/sparse: only sub-section aligned range would be populated

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/sparse: cleanup the code surrounding memory_present()

Subsystem: mm/vmalloc

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      vmalloc: convert to XArray

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: simplify merge_or_add_vmap_area()
      mm/vmalloc: simplify augment_tree_propagate_check()
      mm/vmalloc: switch to "propagate()" callback
      mm/vmalloc: update the header about KVA rework

    Mike Rapoport <rppt@linux.ibm.com>:
      mm: vmalloc: remove redundant assignment in unmap_kernel_range_noflush()

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc.c: remove BUG() from the find_va_links()

Subsystem: mm/kasan

    Marco Elver <elver@google.com>:
      kasan: improve and simplify Kconfig.kasan
      kasan: update required compiler versions in documentation

    Walter Wu <walter-zh.wu@mediatek.com>:
    Patch series "kasan: memorize and print call_rcu stack", v8:
      rcu: kasan: record and print call_rcu() call stack
      kasan: record and print the free track
      kasan: add tests for call_rcu stack recording
      kasan: update documentation for generic kasan

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      kasan: remove kasan_unpoison_stack_above_sp_to()

    Walter Wu <walter-zh.wu@mediatek.com>:
      lib/test_kasan.c: fix KASAN unit tests for tag-based KASAN

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kasan: support stack instrumentation for tag-based mode", v2:
      kasan: don't tag stacks allocated with pagealloc
      efi: provide empty efi_enter_virtual_mode implementation
      kasan, arm64: don't instrument functions that enable kasan
      kasan: allow enabling stack tagging for tag-based mode
      kasan: adjust kasan_stack_oob for tag-based mode

Subsystem: mm/pagealloc

    Vlastimil Babka <vbabka@suse.cz>:
      mm, page_alloc: use unlikely() in task_capc()

    Jaewon Kim <jaewon31.kim@samsung.com>:
      page_alloc: consider highatomic reserve in watermark fast

    Charan Teja Reddy <charante@codeaurora.org>:
      mm, page_alloc: skip ->waternark_boost for atomic order-0 allocations

    David Hildenbrand <david@redhat.com>:
      mm: remove vm_total_pages
      mm/page_alloc: remove nr_free_pagecache_pages()
      mm/memory_hotplug: document why shuffle_zone() is relevant
      mm/shuffle: remove dynamic reconfiguration

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/page_alloc.c: replace the definition of NR_MIGRATETYPE_BITS with PB_migratetype_bits
      mm/page_alloc.c: extract the common part in pfn_to_bitidx()
      mm/page_alloc.c: simplify pageblock bitmap access
      mm/page_alloc.c: remove unnecessary end_bitidx for [set|get]_pfnblock_flags_mask()

    Qian Cai <cai@lca.pw>:
      mm/page_alloc: silence a KASAN false positive

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/page_alloc: fallbacks at most has 3 elements

    Muchun Song <songmuchun@bytedance.com>:
      mm/page_alloc.c: skip setting nodemask when we are in interrupt

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
      mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

Subsystem: mm/hugetlb

    "Alexander A. Klimov" <grandmaster@al2klimov.de>:
      mm: thp: replace HTTP links with HTTPS ones

    Peter Xu <peterx@redhat.com>:
      mm/hugetlb: fix calculation of adjust_range_if_pmd_sharing_possible

    Hugh Dickins <hughd@google.com>:
      khugepaged: collapse_pte_mapped_thp() flush the right range
      khugepaged: collapse_pte_mapped_thp() protect the pmd lock
      khugepaged: retract_page_tables() remember to test exit
      khugepaged: khugepaged_test_exit() check mmget_still_valid()

Subsystem: mm/vmscan

    dylan-meiners <spacct.spacct@gmail.com>:
      mm/vmscan.c: fix typo

    Shakeel Butt <shakeelb@google.com>:
      mm: vmscan: consistent update to pgrefill

 Documentation/admin-guide/kernel-parameters.txt        |    2 
 Documentation/dev-tools/kasan.rst                      |   10 
 Documentation/filesystems/dlmfs.rst                    |    2 
 Documentation/filesystems/ocfs2.rst                    |    2 
 Documentation/filesystems/tmpfs.rst                    |   18 
 Documentation/vm/arch_pgtable_helpers.rst              |  258 +++++
 Documentation/vm/memory-model.rst                      |    9 
 Documentation/vm/slub.rst                              |   51 -
 arch/alpha/include/asm/pgalloc.h                       |   21 
 arch/alpha/include/asm/tlbflush.h                      |    1 
 arch/alpha/kernel/core_irongate.c                      |    1 
 arch/alpha/kernel/core_marvel.c                        |    1 
 arch/alpha/kernel/core_titan.c                         |    1 
 arch/alpha/kernel/machvec_impl.h                       |    2 
 arch/alpha/kernel/smp.c                                |    1 
 arch/alpha/mm/numa.c                                   |    1 
 arch/arc/mm/fault.c                                    |    1 
 arch/arc/mm/init.c                                     |    1 
 arch/arm/include/asm/pgalloc.h                         |   12 
 arch/arm/include/asm/tlb.h                             |    1 
 arch/arm/kernel/machine_kexec.c                        |    1 
 arch/arm/kernel/smp.c                                  |    1 
 arch/arm/kernel/suspend.c                              |    1 
 arch/arm/mach-omap2/omap-mpuss-lowpower.c              |    1 
 arch/arm/mm/hugetlbpage.c                              |    1 
 arch/arm/mm/init.c                                     |    9 
 arch/arm/mm/mmu.c                                      |    1 
 arch/arm64/include/asm/pgalloc.h                       |   39 
 arch/arm64/kernel/setup.c                              |    2 
 arch/arm64/kernel/smp.c                                |    1 
 arch/arm64/mm/hugetlbpage.c                            |    1 
 arch/arm64/mm/init.c                                   |    6 
 arch/arm64/mm/ioremap.c                                |    1 
 arch/arm64/mm/mmu.c                                    |   63 -
 arch/csky/include/asm/pgalloc.h                        |    7 
 arch/csky/kernel/smp.c                                 |    1 
 arch/hexagon/include/asm/pgalloc.h                     |    7 
 arch/ia64/include/asm/pgalloc.h                        |   24 
 arch/ia64/include/asm/tlb.h                            |    1 
 arch/ia64/kernel/process.c                             |    1 
 arch/ia64/kernel/smp.c                                 |    1 
 arch/ia64/kernel/smpboot.c                             |    1 
 arch/ia64/mm/contig.c                                  |    1 
 arch/ia64/mm/discontig.c                               |    4 
 arch/ia64/mm/hugetlbpage.c                             |    1 
 arch/ia64/mm/tlb.c                                     |    1 
 arch/m68k/include/asm/mmu_context.h                    |    2 
 arch/m68k/include/asm/sun3_pgalloc.h                   |    7 
 arch/m68k/kernel/dma.c                                 |    2 
 arch/m68k/kernel/traps.c                               |    3 
 arch/m68k/mm/cache.c                                   |    2 
 arch/m68k/mm/fault.c                                   |    1 
 arch/m68k/mm/kmap.c                                    |    2 
 arch/m68k/mm/mcfmmu.c                                  |    1 
 arch/m68k/mm/memory.c                                  |    1 
 arch/m68k/sun3x/dvma.c                                 |    2 
 arch/microblaze/include/asm/pgalloc.h                  |    6 
 arch/microblaze/include/asm/tlbflush.h                 |    1 
 arch/microblaze/kernel/process.c                       |    1 
 arch/microblaze/kernel/signal.c                        |    1 
 arch/microblaze/mm/init.c                              |    3 
 arch/mips/include/asm/pgalloc.h                        |   19 
 arch/mips/kernel/setup.c                               |    8 
 arch/mips/loongson64/numa.c                            |    1 
 arch/mips/sgi-ip27/ip27-memory.c                       |    2 
 arch/mips/sgi-ip32/ip32-memory.c                       |    1 
 arch/nds32/mm/mm-nds32.c                               |    2 
 arch/nios2/include/asm/pgalloc.h                       |    7 
 arch/openrisc/include/asm/pgalloc.h                    |   33 
 arch/openrisc/include/asm/tlbflush.h                   |    1 
 arch/openrisc/kernel/or32_ksyms.c                      |    1 
 arch/parisc/include/asm/mmu_context.h                  |    1 
 arch/parisc/include/asm/pgalloc.h                      |   12 
 arch/parisc/kernel/cache.c                             |    1 
 arch/parisc/kernel/pci-dma.c                           |    1 
 arch/parisc/kernel/process.c                           |    1 
 arch/parisc/kernel/signal.c                            |    1 
 arch/parisc/kernel/smp.c                               |    1 
 arch/parisc/mm/hugetlbpage.c                           |    1 
 arch/parisc/mm/init.c                                  |    5 
 arch/parisc/mm/ioremap.c                               |    2 
 arch/powerpc/include/asm/tlb.h                         |    1 
 arch/powerpc/mm/book3s64/hash_hugetlbpage.c            |    1 
 arch/powerpc/mm/book3s64/hash_pgtable.c                |    1 
 arch/powerpc/mm/book3s64/hash_tlb.c                    |    1 
 arch/powerpc/mm/book3s64/radix_hugetlbpage.c           |    1 
 arch/powerpc/mm/init_32.c                              |    1 
 arch/powerpc/mm/init_64.c                              |    4 
 arch/powerpc/mm/kasan/8xx.c                            |    1 
 arch/powerpc/mm/kasan/book3s_32.c                      |    1 
 arch/powerpc/mm/mem.c                                  |    3 
 arch/powerpc/mm/nohash/40x.c                           |    1 
 arch/powerpc/mm/nohash/8xx.c                           |    1 
 arch/powerpc/mm/nohash/fsl_booke.c                     |    1 
 arch/powerpc/mm/nohash/kaslr_booke.c                   |    1 
 arch/powerpc/mm/nohash/tlb.c                           |    1 
 arch/powerpc/mm/numa.c                                 |    1 
 arch/powerpc/mm/pgtable.c                              |    1 
 arch/powerpc/mm/pgtable_64.c                           |    1 
 arch/powerpc/mm/ptdump/hashpagetable.c                 |    2 
 arch/powerpc/mm/ptdump/ptdump.c                        |    1 
 arch/powerpc/platforms/pseries/cmm.c                   |    1 
 arch/riscv/include/asm/pgalloc.h                       |   18 
 arch/riscv/mm/fault.c                                  |    1 
 arch/riscv/mm/init.c                                   |    3 
 arch/s390/crypto/prng.c                                |    4 
 arch/s390/include/asm/tlb.h                            |    1 
 arch/s390/include/asm/tlbflush.h                       |    1 
 arch/s390/kernel/machine_kexec.c                       |    1 
 arch/s390/kernel/ptrace.c                              |    1 
 arch/s390/kvm/diag.c                                   |    1 
 arch/s390/kvm/priv.c                                   |    1 
 arch/s390/kvm/pv.c                                     |    1 
 arch/s390/mm/cmm.c                                     |    1 
 arch/s390/mm/init.c                                    |    1 
 arch/s390/mm/mmap.c                                    |    1 
 arch/s390/mm/pgtable.c                                 |    1 
 arch/sh/include/asm/pgalloc.h                          |    4 
 arch/sh/kernel/idle.c                                  |    1 
 arch/sh/kernel/machine_kexec.c                         |    1 
 arch/sh/mm/cache-sh3.c                                 |    1 
 arch/sh/mm/cache-sh7705.c                              |    1 
 arch/sh/mm/hugetlbpage.c                               |    1 
 arch/sh/mm/init.c                                      |    7 
 arch/sh/mm/ioremap_fixed.c                             |    1 
 arch/sh/mm/numa.c                                      |    3 
 arch/sh/mm/tlb-sh3.c                                   |    1 
 arch/sparc/include/asm/ide.h                           |    1 
 arch/sparc/include/asm/tlb_64.h                        |    1 
 arch/sparc/kernel/leon_smp.c                           |    1 
 arch/sparc/kernel/process_32.c                         |    1 
 arch/sparc/kernel/signal_32.c                          |    1 
 arch/sparc/kernel/smp_32.c                             |    1 
 arch/sparc/kernel/smp_64.c                             |    1 
 arch/sparc/kernel/sun4m_irq.c                          |    1 
 arch/sparc/mm/highmem.c                                |    1 
 arch/sparc/mm/init_64.c                                |    1 
 arch/sparc/mm/io-unit.c                                |    1 
 arch/sparc/mm/iommu.c                                  |    1 
 arch/sparc/mm/tlb.c                                    |    1 
 arch/um/include/asm/pgalloc.h                          |    9 
 arch/um/include/asm/pgtable-3level.h                   |    3 
 arch/um/kernel/mem.c                                   |   17 
 arch/x86/ia32/ia32_aout.c                              |    1 
 arch/x86/include/asm/mmu_context.h                     |    1 
 arch/x86/include/asm/pgalloc.h                         |   42 
 arch/x86/kernel/alternative.c                          |    1 
 arch/x86/kernel/apic/apic.c                            |    1 
 arch/x86/kernel/mpparse.c                              |    1 
 arch/x86/kernel/traps.c                                |    1 
 arch/x86/mm/fault.c                                    |    1 
 arch/x86/mm/hugetlbpage.c                              |    1 
 arch/x86/mm/init_32.c                                  |    2 
 arch/x86/mm/init_64.c                                  |   12 
 arch/x86/mm/kaslr.c                                    |    1 
 arch/x86/mm/pgtable_32.c                               |    1 
 arch/x86/mm/pti.c                                      |    1 
 arch/x86/platform/uv/bios_uv.c                         |    1 
 arch/x86/power/hibernate.c                             |    2 
 arch/xtensa/include/asm/pgalloc.h                      |   46 
 arch/xtensa/kernel/xtensa_ksyms.c                      |    1 
 arch/xtensa/mm/cache.c                                 |    1 
 arch/xtensa/mm/fault.c                                 |    1 
 crypto/adiantum.c                                      |    2 
 crypto/ahash.c                                         |    4 
 crypto/api.c                                           |    2 
 crypto/asymmetric_keys/verify_pefile.c                 |    4 
 crypto/deflate.c                                       |    2 
 crypto/drbg.c                                          |   10 
 crypto/ecc.c                                           |    8 
 crypto/ecdh.c                                          |    2 
 crypto/gcm.c                                           |    2 
 crypto/gf128mul.c                                      |    4 
 crypto/jitterentropy-kcapi.c                           |    2 
 crypto/rng.c                                           |    2 
 crypto/rsa-pkcs1pad.c                                  |    6 
 crypto/seqiv.c                                         |    2 
 crypto/shash.c                                         |    2 
 crypto/skcipher.c                                      |    2 
 crypto/testmgr.c                                       |    6 
 crypto/zstd.c                                          |    2 
 drivers/base/node.c                                    |   10 
 drivers/block/xen-blkback/common.h                     |    1 
 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c    |    2 
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c    |    2 
 drivers/crypto/amlogic/amlogic-gxl-cipher.c            |    4 
 drivers/crypto/atmel-ecc.c                             |    2 
 drivers/crypto/caam/caampkc.c                          |   28 
 drivers/crypto/cavium/cpt/cptvf_main.c                 |    6 
 drivers/crypto/cavium/cpt/cptvf_reqmanager.c           |   12 
 drivers/crypto/cavium/nitrox/nitrox_lib.c              |    4 
 drivers/crypto/cavium/zip/zip_crypto.c                 |    6 
 drivers/crypto/ccp/ccp-crypto-rsa.c                    |    6 
 drivers/crypto/ccree/cc_aead.c                         |    4 
 drivers/crypto/ccree/cc_buffer_mgr.c                   |    4 
 drivers/crypto/ccree/cc_cipher.c                       |    6 
 drivers/crypto/ccree/cc_hash.c                         |    8 
 drivers/crypto/ccree/cc_request_mgr.c                  |    2 
 drivers/crypto/marvell/cesa/hash.c                     |    2 
 drivers/crypto/marvell/octeontx/otx_cptvf_main.c       |    6 
 drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.h     |    2 
 drivers/crypto/nx/nx.c                                 |    4 
 drivers/crypto/virtio/virtio_crypto_algs.c             |   12 
 drivers/crypto/virtio/virtio_crypto_core.c             |    2 
 drivers/iommu/ipmmu-vmsa.c                             |    1 
 drivers/md/dm-crypt.c                                  |   32 
 drivers/md/dm-integrity.c                              |    6 
 drivers/misc/ibmvmc.c                                  |    6 
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |    2 
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c         |    6 
 drivers/net/ppp/ppp_mppe.c                             |    6 
 drivers/net/wireguard/noise.c                          |    4 
 drivers/net/wireguard/peer.c                           |    2 
 drivers/net/wireless/intel/iwlwifi/pcie/rx.c           |    2 
 drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c      |    6 
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c           |    6 
 drivers/net/wireless/intersil/orinoco/wext.c           |    4 
 drivers/s390/crypto/ap_bus.h                           |    4 
 drivers/staging/ks7010/ks_hostif.c                     |    2 
 drivers/staging/rtl8723bs/core/rtw_security.c          |    2 
 drivers/staging/wlan-ng/p80211netdev.c                 |    2 
 drivers/target/iscsi/iscsi_target_auth.c               |    2 
 drivers/xen/balloon.c                                  |    1 
 drivers/xen/privcmd.c                                  |    1 
 fs/Kconfig                                             |   21 
 fs/aio.c                                               |    6 
 fs/binfmt_elf_fdpic.c                                  |    1 
 fs/cifs/cifsencrypt.c                                  |    2 
 fs/cifs/connect.c                                      |   10 
 fs/cifs/dfs_cache.c                                    |    2 
 fs/cifs/misc.c                                         |    8 
 fs/crypto/inline_crypt.c                               |    5 
 fs/crypto/keyring.c                                    |    6 
 fs/crypto/keysetup_v1.c                                |    4 
 fs/ecryptfs/keystore.c                                 |    4 
 fs/ecryptfs/messaging.c                                |    2 
 fs/hugetlbfs/inode.c                                   |    2 
 fs/ntfs/dir.c                                          |    2 
 fs/ntfs/inode.c                                        |   27 
 fs/ntfs/inode.h                                        |    4 
 fs/ntfs/mft.c                                          |    4 
 fs/ocfs2/Kconfig                                       |    6 
 fs/ocfs2/acl.c                                         |    2 
 fs/ocfs2/blockcheck.c                                  |    2 
 fs/ocfs2/dlmglue.c                                     |    8 
 fs/ocfs2/ocfs2.h                                       |    4 
 fs/ocfs2/suballoc.c                                    |    4 
 fs/ocfs2/suballoc.h                                    |    2 
 fs/ocfs2/super.c                                       |    4 
 fs/proc/meminfo.c                                      |   10 
 include/asm-generic/pgalloc.h                          |   80 +
 include/asm-generic/tlb.h                              |    1 
 include/crypto/aead.h                                  |    2 
 include/crypto/akcipher.h                              |    2 
 include/crypto/gf128mul.h                              |    2 
 include/crypto/hash.h                                  |    2 
 include/crypto/internal/acompress.h                    |    2 
 include/crypto/kpp.h                                   |    2 
 include/crypto/skcipher.h                              |    2 
 include/linux/efi.h                                    |    4 
 include/linux/fs.h                                     |   17 
 include/linux/huge_mm.h                                |    2 
 include/linux/kasan.h                                  |    4 
 include/linux/memcontrol.h                             |  209 +++-
 include/linux/mm.h                                     |   86 -
 include/linux/mm_types.h                               |    5 
 include/linux/mman.h                                   |    4 
 include/linux/mmu_notifier.h                           |   13 
 include/linux/mmzone.h                                 |   54 -
 include/linux/pageblock-flags.h                        |   30 
 include/linux/percpu_counter.h                         |    4 
 include/linux/sched/mm.h                               |    8 
 include/linux/shmem_fs.h                               |    3 
 include/linux/slab.h                                   |   11 
 include/linux/slab_def.h                               |    9 
 include/linux/slub_def.h                               |   31 
 include/linux/swap.h                                   |    2 
 include/linux/vmstat.h                                 |   14 
 init/Kconfig                                           |    9 
 init/main.c                                            |    2 
 ipc/shm.c                                              |    2 
 kernel/fork.c                                          |   54 -
 kernel/kthread.c                                       |    8 
 kernel/power/snapshot.c                                |    2 
 kernel/rcu/tree.c                                      |    2 
 kernel/scs.c                                           |    2 
 kernel/sysctl.c                                        |    2 
 lib/Kconfig.kasan                                      |   39 
 lib/Makefile                                           |    1 
 lib/ioremap.c                                          |  287 -----
 lib/mpi/mpiutil.c                                      |    6 
 lib/percpu_counter.c                                   |   19 
 lib/test_kasan.c                                       |   87 +
 mm/Kconfig                                             |    6 
 mm/Makefile                                            |    2 
 mm/debug.c                                             |  103 +-
 mm/debug_vm_pgtable.c                                  |  666 +++++++++++++
 mm/filemap.c                                           |    9 
 mm/gup.c                                               |    3 
 mm/huge_memory.c                                       |   14 
 mm/hugetlb.c                                           |   25 
 mm/ioremap.c                                           |  289 +++++
 mm/kasan/common.c                                      |   41 
 mm/kasan/generic.c                                     |   43 
 mm/kasan/generic_report.c                              |    1 
 mm/kasan/kasan.h                                       |   25 
 mm/kasan/quarantine.c                                  |    1 
 mm/kasan/report.c                                      |   54 -
 mm/kasan/tags.c                                        |   37 
 mm/khugepaged.c                                        |   75 -
 mm/memcontrol.c                                        |  832 ++++++++++-------
 mm/memory.c                                            |   15 
 mm/memory_hotplug.c                                    |   11 
 mm/migrate.c                                           |    6 
 mm/mm_init.c                                           |   20 
 mm/mmap.c                                              |   45 
 mm/mremap.c                                            |   19 
 mm/nommu.c                                             |    6 
 mm/oom_kill.c                                          |    2 
 mm/page-writeback.c                                    |    6 
 mm/page_alloc.c                                        |  226 ++--
 mm/page_counter.c                                      |    6 
 mm/page_io.c                                           |    2 
 mm/pgalloc-track.h                                     |   51 +
 mm/shmem.c                                             |  133 ++
 mm/shuffle.c                                           |   46 
 mm/shuffle.h                                           |   17 
 mm/slab.c                                              |  129 +-
 mm/slab.h                                              |  755 ++++++---------
 mm/slab_common.c                                       |  829 ++--------------
 mm/slob.c                                              |   12 
 mm/slub.c                                              |  680 ++++---------
 mm/sparse-vmemmap.c                                    |   62 -
 mm/sparse.c                                            |   31 
 mm/swap_slots.c                                        |   45 
 mm/swap_state.c                                        |    2 
 mm/util.c                                              |   52 +
 mm/vmalloc.c                                           |  176 +--
 mm/vmscan.c                                            |   39 
 mm/vmstat.c                                            |   38 
 mm/workingset.c                                        |    6 
 net/atm/mpoa_caches.c                                  |    4 
 net/bluetooth/ecdh_helper.c                            |    6 
 net/bluetooth/smp.c                                    |   24 
 net/core/sock.c                                        |    2 
 net/ipv4/tcp_fastopen.c                                |    2 
 net/mac80211/aead_api.c                                |    4 
 net/mac80211/aes_gmac.c                                |    2 
 net/mac80211/key.c                                     |    2 
 net/mac802154/llsec.c                                  |   20 
 net/sctp/auth.c                                        |    2 
 net/sunrpc/auth_gss/gss_krb5_crypto.c                  |    4 
 net/sunrpc/auth_gss/gss_krb5_keys.c                    |    6 
 net/sunrpc/auth_gss/gss_krb5_mech.c                    |    2 
 net/tipc/crypto.c                                      |   10 
 net/wireless/core.c                                    |    2 
 net/wireless/ibss.c                                    |    4 
 net/wireless/lib80211_crypt_tkip.c                     |    2 
 net/wireless/lib80211_crypt_wep.c                      |    2 
 net/wireless/nl80211.c                                 |   24 
 net/wireless/sme.c                                     |    6 
 net/wireless/util.c                                    |    2 
 net/wireless/wext-sme.c                                |    2 
 scripts/Makefile.kasan                                 |    3 
 scripts/bloat-o-meter                                  |    2 
 scripts/coccinelle/free/devm_free.cocci                |    4 
 scripts/coccinelle/free/ifnullfree.cocci               |    4 
 scripts/coccinelle/free/kfree.cocci                    |    6 
 scripts/coccinelle/free/kfreeaddr.cocci                |    2 
 scripts/const_structs.checkpatch                       |    1 
 scripts/decode_stacktrace.sh                           |   85 +
 scripts/spelling.txt                                   |   19 
 scripts/tags.sh                                        |   18 
 security/apparmor/domain.c                             |    4 
 security/apparmor/include/file.h                       |    2 
 security/apparmor/policy.c                             |   24 
 security/apparmor/policy_ns.c                          |    6 
 security/apparmor/policy_unpack.c                      |   14 
 security/keys/big_key.c                                |    6 
 security/keys/dh.c                                     |   14 
 security/keys/encrypted-keys/encrypted.c               |   14 
 security/keys/trusted-keys/trusted_tpm1.c              |   34 
 security/keys/user_defined.c                           |    6 
 tools/cgroup/memcg_slabinfo.py                         |  226 ++++
 tools/include/linux/jhash.h                            |    2 
 tools/lib/rbtree.c                                     |    2 
 tools/lib/traceevent/event-parse.h                     |    2 
 tools/testing/ktest/examples/README                    |    2 
 tools/testing/ktest/examples/crosstests.conf           |    2 
 tools/testing/selftests/Makefile                       |    1 
 tools/testing/selftests/cgroup/.gitignore              |    1 
 tools/testing/selftests/cgroup/Makefile                |    2 
 tools/testing/selftests/cgroup/cgroup_util.c           |    2 
 tools/testing/selftests/cgroup/test_kmem.c             |  382 +++++++
 tools/testing/selftests/mincore/.gitignore             |    2 
 tools/testing/selftests/mincore/Makefile               |    6 
 tools/testing/selftests/mincore/mincore_selftest.c     |  361 +++++++
 397 files changed, 5547 insertions(+), 4072 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-07-24  4:14 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-07-24  4:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


15 patches, based on f37e99aca03f63aa3f2bd13ceaf769455d12c4b0.

Subsystems affected by this patch series:

  mm/pagemap
  mm/shmem
  mm/hotfixes
  mm/memcg
  mm/hugetlb
  mailmap
  squashfs
  scripts
  io-mapping
  MAINTAINERS
  gdb

Subsystem: mm/pagemap

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/memory.c: avoid access flag update TLB flush for retried page fault

    "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>:
      mm/mmap.c: close race between munmap() and expand_upwards()/downwards()

Subsystem: mm/shmem

    Chengguang Xu <cgxu519@mykernel.net>:
      vfs/xattr: mm/shmem: kernfs: release simple xattr entry in a right way

Subsystem: mm/hotfixes

    Tom Rix <trix@redhat.com>:
      mm: initialize return of vm_insert_pages

    Bhupesh Sharma <bhsharma@redhat.com>:
      mm/memcontrol: fix OOPS inside mem_cgroup_get_nr_swap_pages()

Subsystem: mm/memcg

    Hugh Dickins <hughd@google.com>:
      mm/memcg: fix refcount error while moving and swapping

    Muchun Song <songmuchun@bytedance.com>:
      mm: memcg/slab: fix memory leak at non-root kmem_cache destroy

Subsystem: mm/hugetlb

    Barry Song <song.bao.hua@hisilicon.com>:
      mm/hugetlb: avoid hardcoding while checking if cma is enabled

    "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>:
      khugepaged: fix null-pointer dereference due to race

Subsystem: mailmap

    Mike Rapoport <rppt@linux.ibm.com>:
      mailmap: add entry for Mike Rapoport

Subsystem: squashfs

    Phillip Lougher <phillip@squashfs.org.uk>:
      squashfs: fix length field overlap check in metadata reading

Subsystem: scripts

    Pi-Hsun Shih <pihsun@chromium.org>:
      scripts/decode_stacktrace: strip basepath from all paths

Subsystem: io-mapping

    "Michael J. Ruhl" <michael.j.ruhl@intel.com>:
      io-mapping: indicate mapping failure

Subsystem: MAINTAINERS

    Andrey Konovalov <andreyknvl@google.com>:
      MAINTAINERS: add KCOV section

Subsystem: gdb

    Stefano Garzarella <sgarzare@redhat.com>:
      scripts/gdb: fix lx-symbols 'gdb.error' while loading modules

 .mailmap                     |    3 +++
 MAINTAINERS                  |   11 +++++++++++
 fs/squashfs/block.c          |    2 +-
 include/linux/io-mapping.h   |    5 ++++-
 include/linux/xattr.h        |    3 ++-
 mm/hugetlb.c                 |   15 ++++++++++-----
 mm/khugepaged.c              |    3 +++
 mm/memcontrol.c              |   13 ++++++++++---
 mm/memory.c                  |    9 +++++++--
 mm/mmap.c                    |   16 ++++++++++++++--
 mm/shmem.c                   |    2 +-
 mm/slab_common.c             |   35 ++++++++++++++++++++++++++++-------
 scripts/decode_stacktrace.sh |    4 ++--
 scripts/gdb/linux/symbols.py |    2 +-
 14 files changed, 97 insertions(+), 26 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-07-03 22:14 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-07-03 22:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

5 patches, based on cdd3bb54332f82295ed90cd0c09c78cd0c0ee822.

Subsystems affected by this patch series:

  mm/hugetlb
  samples
  mm/cma
  mm/vmalloc
  mm/pagealloc

Subsystem: mm/hugetlb

    Mike Kravetz <mike.kravetz@oracle.com>:
      mm/hugetlb.c: fix pages per hugetlb calculation

Subsystem: samples

    Kees Cook <keescook@chromium.org>:
      samples/vfs: avoid warning in statx override

Subsystem: mm/cma

    Barry Song <song.bao.hua@hisilicon.com>:
      mm/cma.c: use exact_nid true to fix possible per-numa cma leak

Subsystem: mm/vmalloc

    Christoph Hellwig <hch@lst.de>:
      vmalloc: fix the owner argument for the new __vmalloc_node_range callers

Subsystem: mm/pagealloc

    Joel Savitz <jsavitz@redhat.com>:
      mm/page_alloc: fix documentation error

 arch/arm64/kernel/probes/kprobes.c |    2 +-
 arch/x86/hyperv/hv_init.c          |    3 ++-
 kernel/module.c                    |    2 +-
 mm/cma.c                           |    4 ++--
 mm/hugetlb.c                       |    2 +-
 mm/page_alloc.c                    |    2 +-
 samples/vfs/test-statx.c           |    2 ++
 7 files changed, 10 insertions(+), 7 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-26 17:39   ` incoming Konstantin Ryabitsev
@ 2020-06-26 17:40     ` Konstantin Ryabitsev
  0 siblings, 0 replies; 307+ messages in thread
From: Konstantin Ryabitsev @ 2020-06-26 17:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux-MM, mm-commits

On Fri, 26 Jun 2020 at 13:39, Konstantin Ryabitsev
<konstantin@linuxfoundation.org> wrote:
> > Konstantin, maybe mm-commits could be on lore too and then they'd have
> > been caught that way?
>
> Yes, I already have a request from Kees for linux-mm addition, so that
> should show up in archives before long.

correction: mm-commits, that is

-K


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-26  6:51 ` incoming Linus Torvalds
  2020-06-26  7:31   ` incoming Linus Torvalds
@ 2020-06-26 17:39   ` Konstantin Ryabitsev
  2020-06-26 17:40     ` incoming Konstantin Ryabitsev
  1 sibling, 1 reply; 307+ messages in thread
From: Konstantin Ryabitsev @ 2020-06-26 17:39 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux-MM, mm-commits

On Thu, Jun 25, 2020 at 11:51:06PM -0700, Linus Torvalds wrote:
> On Thu, Jun 25, 2020 at 8:28 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > 32 patches, based on 908f7d12d3ba51dfe0449b9723199b423f97ca9a.
> 
> You didn't cc lkml, so now none of the nice 'b4' automation seems to
> work for this series..
> 
> Yes, this cover-letter went to linux-mm (which is on lore), but the
> individual patches didn't.
> 
> Konstantin, maybe mm-commits could be on lore too and then they'd have
> been caught that way?

Yes, I already have a request from Kees for linux-mm addition, so that 
should show up in archives before long.

-K


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-26  6:51 ` incoming Linus Torvalds
@ 2020-06-26  7:31   ` Linus Torvalds
  2020-06-26 17:39   ` incoming Konstantin Ryabitsev
  1 sibling, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-06-26  7:31 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: Linux-MM, mm-commits

On Thu, Jun 25, 2020 at 11:51 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> You didn't cc lkml, so now none of the nice 'b4' automation seems to
> work for this series..

Note that I've picked them up the old-fashioned way, so don't re-send them.

So more of a note for "please, next time..."

                Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-26  3:28 incoming Andrew Morton
@ 2020-06-26  6:51 ` Linus Torvalds
  2020-06-26  7:31   ` incoming Linus Torvalds
  2020-06-26 17:39   ` incoming Konstantin Ryabitsev
  0 siblings, 2 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-06-26  6:51 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: Linux-MM, mm-commits

On Thu, Jun 25, 2020 at 8:28 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> 32 patches, based on 908f7d12d3ba51dfe0449b9723199b423f97ca9a.

You didn't cc lkml, so now none of the nice 'b4' automation seems to
work for this series..

Yes, this cover-letter went to linux-mm (which is on lore), but the
individual patches didn't.

Konstantin, maybe mm-commits could be on lore too and then they'd have
been caught that way?

                   Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-26  3:28 Andrew Morton
  2020-06-26  6:51 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-06-26  3:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

32 patches, based on 908f7d12d3ba51dfe0449b9723199b423f97ca9a.

Subsystems affected by this patch series:

  hotfixes
  mm/pagealloc
  kexec
  ocfs2
  lib
  misc
  mm/slab
  mm/slab
  mm/slub
  mm/swap
  mm/pagemap
  mm/vmalloc
  mm/memcg
  mm/gup
  mm/thp
  mm/vmscan
  x86
  mm/memory-hotplug
  MAINTAINERS

Subsystem: hotfixes

    Stafford Horne <shorne@gmail.com>:
      openrisc: fix boot oops when DEBUG_VM is enabled

    Michal Hocko <mhocko@suse.com>:
      mm: do_swap_page(): fix up the error code

Subsystem: mm/pagealloc

    Vlastimil Babka <vbabka@suse.cz>:
      mm, compaction: make capture control handling safe wrt interrupts

Subsystem: kexec

    Lianbo Jiang <lijiang@redhat.com>:
      kexec: do not verify the signature without the lockdown or mandatory signature

Subsystem: ocfs2

    Junxiao Bi <junxiao.bi@oracle.com>:
    Patch series "ocfs2: fix nfsd over ocfs2 issues", v2:
      ocfs2: avoid inode removal while nfsd is accessing it
      ocfs2: load global_inode_alloc
      ocfs2: fix panic on nfs server over ocfs2
      ocfs2: fix value of OCFS2_INVALID_SLOT

Subsystem: lib

    Randy Dunlap <rdunlap@infradead.org>:
      lib: fix test_hmm.c reference after free

Subsystem: misc

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      linux/bits.h: fix unsigned less than zero warnings

Subsystem: mm/slab

    Waiman Long <longman@redhat.com>:
      mm, slab: fix sign conversion problem in memcg_uncharge_slab()

Subsystem: mm/slab

    Waiman Long <longman@redhat.com>:
      mm/slab: use memzero_explicit() in kzfree()

Subsystem: mm/slub

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      slub: cure list_slab_objects() from double fix

Subsystem: mm/swap

    Hugh Dickins <hughd@google.com>:
      mm: fix swap cache node allocation mask

Subsystem: mm/pagemap

    Arjun Roy <arjunroy@google.com>:
      mm/memory.c: properly pte_offset_map_lock/unlock in vm_insert_pages()

    Christophe Leroy <christophe.leroy@csgroup.eu>:
      mm/debug_vm_pgtable: fix build failure with powerpc 8xx

    Stephen Rothwell <sfr@canb.auug.org.au>:
      make asm-generic/cacheflush.h more standalone

    Nathan Chancellor <natechancellor@gmail.com>:
      media: omap3isp: remove cacheflush.h

Subsystem: mm/vmalloc

    Masanari Iida <standby24x7@gmail.com>:
      mm/vmalloc.c: fix a warning while make xmldocs

Subsystem: mm/memcg

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: handle div0 crash race condition in memory.low

    Muchun Song <songmuchun@bytedance.com>:
      mm/memcontrol.c: add missed css_put()

    Chris Down <chris@chrisdown.name>:
      mm/memcontrol.c: prevent missed memory.low load tears

Subsystem: mm/gup

    Souptick Joarder <jrdr.linux@gmail.com>:
      docs: mm/gup: minor documentation update

Subsystem: mm/thp

    Yang Shi <yang.shi@linux.alibaba.com>:
      doc: THP CoW fault no longer allocate THP

Subsystem: mm/vmscan

    Johannes Weiner <hannes@cmpxchg.org>:
    Patch series "fix for "mm: balance LRU lists based on relative thrashing" patchset":
      mm: workingset: age nonresident information alongside anonymous pages

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
      mm/swap: fix for "mm: workingset: age nonresident information alongside anonymous pages"
      mm/memory: fix IO cost for anonymous page

Subsystem: x86

    Christoph Hellwig <hch@lst.de>:
    Patch series "fix a hyperv W^X violation and remove vmalloc_exec":
      x86/hyperv: allocate the hypercall page with only read and execute bits
      arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
      mm: remove vmalloc_exec

Subsystem: mm/memory-hotplug

    Ben Widawsky <ben.widawsky@intel.com>:
      mm/memory_hotplug.c: fix false softlockup during pfn range removal

Subsystem: MAINTAINERS

    Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
      MAINTAINERS: update info for sparse

 Documentation/admin-guide/cgroup-v2.rst    |    4 +-
 Documentation/admin-guide/mm/transhuge.rst |    3 -
 Documentation/core-api/pin_user_pages.rst  |    2 -
 MAINTAINERS                                |    4 +-
 arch/arm64/kernel/probes/kprobes.c         |   12 +------
 arch/openrisc/kernel/dma.c                 |    5 +++
 arch/x86/hyperv/hv_init.c                  |    4 +-
 arch/x86/include/asm/pgtable_types.h       |    2 +
 drivers/media/platform/omap3isp/isp.c      |    2 -
 drivers/media/platform/omap3isp/ispvideo.c |    1 
 fs/ocfs2/dlmglue.c                         |   17 ++++++++++
 fs/ocfs2/ocfs2.h                           |    1 
 fs/ocfs2/ocfs2_fs.h                        |    4 +-
 fs/ocfs2/suballoc.c                        |    9 +++--
 include/asm-generic/cacheflush.h           |    5 +++
 include/linux/bits.h                       |    3 +
 include/linux/mmzone.h                     |    4 +-
 include/linux/swap.h                       |    1 
 include/linux/vmalloc.h                    |    1 
 kernel/kexec_file.c                        |   36 ++++------------------
 kernel/module.c                            |    4 +-
 lib/test_hmm.c                             |    3 -
 mm/compaction.c                            |   17 ++++++++--
 mm/debug_vm_pgtable.c                      |    4 +-
 mm/memcontrol.c                            |   18 ++++++++---
 mm/memory.c                                |   33 +++++++++++++-------
 mm/memory_hotplug.c                        |   13 ++++++--
 mm/nommu.c                                 |   17 ----------
 mm/slab.h                                  |    4 +-
 mm/slab_common.c                           |    2 -
 mm/slub.c                                  |   19 ++---------
 mm/swap.c                                  |    3 -
 mm/swap_state.c                            |    4 +-
 mm/vmalloc.c                               |   21 -------------
 mm/vmscan.c                                |    3 +
 mm/workingset.c                            |   46 +++++++++++++++++------------
 36 files changed, 168 insertions(+), 163 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-12  0:30 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-12  0:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


A few fixes and stragglers.


5 patches, based on 623f6dc593eaf98b91916836785278eddddaacf8.

Subsystems affected by this patch series:

  mm/memory-failure
  ocfs2
  lib/lzo
  misc

Subsystem: mm/memory-failure

    Naoya Horiguchi <nao.horiguchi@gmail.com>:
    Patch series "hwpoison: fixes signaling on memory error":
      mm/memory-failure: prioritize prctl(PR_MCE_KILL) over vm.memory_failure_early_kill
      mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread

Subsystem: ocfs2

    Tom Seewald <tseewald@gmail.com>:
      ocfs2: fix build failure when TCP/IP is disabled

Subsystem: lib/lzo

    Dave Rodgman <dave.rodgman@arm.com>:
      lib/lzo: fix ambiguous encoding bug in lzo-rle

Subsystem: misc

    Christoph Hellwig <hch@lst.de>:
      amdgpu: a NULL ->mm does not mean a thread is a kthread

 Documentation/lzo.txt                      |    8 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |    2 -
 fs/ocfs2/Kconfig                           |    2 -
 lib/lzo/lzo1x_compress.c                   |   13 ++++++++
 mm/memory-failure.c                        |   43 +++++++++++++++++------------
 5 files changed, 47 insertions(+), 21 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-11  1:40 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-11  1:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- various hotfixes and minor things

- hch's use_mm/unuse_mm clearnups

- new syscall process_madvise(): perform madvise() on a process other
  than self

25 patches, based on 6f630784cc0d92fb58ea326e2bc01aa056279ecb.

Subsystems affected by this patch series:

  mm/hugetlb
  scripts
  kcov
  lib
  nilfs
  checkpatch
  lib
  mm/debug
  ocfs2
  lib
  misc
  mm/madvise

Subsystem: mm/hugetlb

    Dan Carpenter <dan.carpenter@oracle.com>:
      khugepaged: selftests: fix timeout condition in wait_for_scan()

Subsystem: scripts

    SeongJae Park <sjpark@amazon.de>:
      scripts/spelling: add a few more typos

Subsystem: kcov

    Andrey Konovalov <andreyknvl@google.com>:
      kcov: check kcov_softirq in kcov_remote_stop()

Subsystem: lib

    Joe Perches <joe@perches.com>:
      lib/lz4/lz4_decompress.c: document deliberate use of `&'

Subsystem: nilfs

    Ryusuke Konishi <konishi.ryusuke@gmail.com>:
      nilfs2: fix null pointer dereference at nilfs_segctor_do_construct()

Subsystem: checkpatch

    Tim Froidcoeur <tim.froidcoeur@tessares.net>:
      checkpatch: correct check for kernel parameters doc

Subsystem: lib

    Alexander Gordeev <agordeev@linux.ibm.com>:
      lib: fix bitmap_parse() on 64-bit big endian archs

Subsystem: mm/debug

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm/debug_vm_pgtable: fix kernel crash by checking for THP support

Subsystem: ocfs2

    Keyur Patel <iamkeyur96@gmail.com>:
      ocfs2: fix spelling mistake and grammar

    Ben Widawsky <ben.widawsky@intel.com>:
      mm: add comments on pglist_data zones

Subsystem: lib

    Wei Yang <richard.weiyang@gmail.com>:
      lib: test get_count_order/long in test_bitops.c

Subsystem: misc

    Walter Wu <walter-zh.wu@mediatek.com>:
      stacktrace: cleanup inconsistent variable type

    Christoph Hellwig <hch@lst.de>:
    Patch series "improve use_mm / unuse_mm", v2:
      kernel: move use_mm/unuse_mm to kthread.c
      kernel: move use_mm/unuse_mm to kthread.c
      kernel: better document the use_mm/unuse_mm API contract
      kernel: set USER_DS in kthread_use_mm

Subsystem: mm/madvise

    Minchan Kim <minchan@kernel.org>:
    Patch series "introduce memory hinting API for external process", v7:
      mm/madvise: pass task and mm to do_madvise
      mm/madvise: introduce process_madvise() syscall: an external memory hinting API
      mm/madvise: check fatal signal pending of target process
      pid: move pidfd_get_pid() to pid.c
      mm/madvise: support both pid and pidfd for process_madvise

    Oleksandr Natalenko <oleksandr@redhat.com>:
      mm/madvise: allow KSM hints for remote API

    Minchan Kim <minchan@kernel.org>:
      mm: support vector address ranges for process_madvise
      mm: use only pidfd for process_madvise syscall

    YueHaibing <yuehaibing@huawei.com>:
      mm/madvise.c: remove duplicated include

 arch/alpha/kernel/syscalls/syscall.tbl              |    1 
 arch/arm/tools/syscall.tbl                          |    1 
 arch/arm64/include/asm/unistd.h                     |    2 
 arch/arm64/include/asm/unistd32.h                   |    4 
 arch/ia64/kernel/syscalls/syscall.tbl               |    1 
 arch/m68k/kernel/syscalls/syscall.tbl               |    1 
 arch/microblaze/kernel/syscalls/syscall.tbl         |    1 
 arch/mips/kernel/syscalls/syscall_n32.tbl           |    3 
 arch/mips/kernel/syscalls/syscall_n64.tbl           |    1 
 arch/mips/kernel/syscalls/syscall_o32.tbl           |    3 
 arch/parisc/kernel/syscalls/syscall.tbl             |    3 
 arch/powerpc/kernel/syscalls/syscall.tbl            |    3 
 arch/powerpc/platforms/powernv/vas-fault.c          |    4 
 arch/s390/kernel/syscalls/syscall.tbl               |    3 
 arch/sh/kernel/syscalls/syscall.tbl                 |    1 
 arch/sparc/kernel/syscalls/syscall.tbl              |    3 
 arch/x86/entry/syscalls/syscall_32.tbl              |    3 
 arch/x86/entry/syscalls/syscall_64.tbl              |    5 
 arch/xtensa/kernel/syscalls/syscall.tbl             |    1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h          |    5 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c |    1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c  |    1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c   |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c   |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c   |    2 
 drivers/gpu/drm/i915/gvt/kvmgt.c                    |    2 
 drivers/usb/gadget/function/f_fs.c                  |   10 
 drivers/usb/gadget/legacy/inode.c                   |    6 
 drivers/vfio/vfio_iommu_type1.c                     |    6 
 drivers/vhost/vhost.c                               |    8 
 fs/aio.c                                            |    1 
 fs/io-wq.c                                          |   15 -
 fs/io_uring.c                                       |   11 
 fs/nilfs2/segment.c                                 |    2 
 fs/ocfs2/mmap.c                                     |    2 
 include/linux/compat.h                              |   10 
 include/linux/kthread.h                             |    9 
 include/linux/mm.h                                  |    3 
 include/linux/mmu_context.h                         |    5 
 include/linux/mmzone.h                              |   14 
 include/linux/pid.h                                 |    1 
 include/linux/stacktrace.h                          |    2 
 include/linux/syscalls.h                            |   16 -
 include/uapi/asm-generic/unistd.h                   |    7 
 kernel/exit.c                                       |   17 -
 kernel/kcov.c                                       |   26 +
 kernel/kthread.c                                    |   95 +++++-
 kernel/pid.c                                        |   17 +
 kernel/sys_ni.c                                     |    2 
 lib/Kconfig.debug                                   |   10 
 lib/bitmap.c                                        |    9 
 lib/lz4/lz4_decompress.c                            |    3 
 lib/test_bitops.c                                   |   53 +++
 mm/Makefile                                         |    2 
 mm/debug_vm_pgtable.c                               |    6 
 mm/madvise.c                                        |  295 ++++++++++++++------
 mm/mmu_context.c                                    |   64 ----
 mm/oom_kill.c                                       |    6 
 mm/vmacache.c                                       |    4 
 scripts/checkpatch.pl                               |    4 
 scripts/spelling.txt                                |    9 
 tools/testing/selftests/vm/khugepaged.c             |    2 
 62 files changed, 526 insertions(+), 285 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-08  4:35 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-08  4:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


Various trees.  Mainly those parts of MM whose linux-next dependents
are now merged.  I'm still sitting on ~160 patches which await merges
from -next.


54 patches, based on 9aa900c8094dba7a60dc805ecec1e9f720744ba1.

Subsystems affected by this patch series:

  mm/proc
  ipc
  dynamic-debug
  panic
  lib
  sysctl
  mm/gup
  mm/pagemap

Subsystem: mm/proc

    SeongJae Park <sjpark@amazon.de>:
      mm/page_idle.c: skip offline pages

Subsystem: ipc

    Jules Irenge <jbi.octave@gmail.com>:
      ipc/msg: add missing annotation for freeque()

    Giuseppe Scrivano <gscrivan@redhat.com>:
      ipc/namespace.c: use a work queue to free_ipc

Subsystem: dynamic-debug

    Orson Zhai <orson.zhai@unisoc.com>:
      dynamic_debug: add an option to enable dynamic debug for modules only

Subsystem: panic

    Rafael Aquini <aquini@redhat.com>:
      kernel: add panic_on_taint

Subsystem: lib

    Manfred Spraul <manfred@colorfullife.com>:
      xarray.h: correct return code documentation for xa_store_{bh,irq}()

Subsystem: sysctl

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "support setting sysctl parameters from kernel command line", v3:
      kernel/sysctl: support setting sysctl parameters from kernel command line
      kernel/sysctl: support handling command line aliases
      kernel/hung_task convert hung_task_panic boot parameter to sysctl
      tools/testing/selftests/sysctl/sysctl.sh: support CONFIG_TEST_SYSCTL=y
      lib/test_sysctl: support testing of sysctl. boot parameter

    "Guilherme G. Piccoli" <gpiccoli@canonical.com>:
      kernel/watchdog.c: convert {soft/hard}lockup boot parameters to sysctl aliases
      kernel/hung_task.c: introduce sysctl to print all traces when a hung task is detected
      panic: add sysctl to dump all CPUs backtraces on oops event

    Rafael Aquini <aquini@redhat.com>:
      kernel/sysctl.c: ignore out-of-range taint bits introduced via kernel.tainted

Subsystem: mm/gup

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm/gup.c: convert to use get_user_{page|pages}_fast_only()

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup: update pin_user_pages.rst for "case 3" (mmu notifiers)
    Patch series "mm/gup: introduce pin_user_pages_locked(), use it in frame_vector.c", v2:
      mm/gup: introduce pin_user_pages_locked()
      mm/gup: frame_vector: convert get_user_pages() --> pin_user_pages()
      mm/gup: documentation fix for pin_user_pages*() APIs
    Patch series "vhost, docs: convert to pin_user_pages(), new "case 5"":
      docs: mm/gup: pin_user_pages.rst: add a "case 5"
      vhost: convert get_user_pages() --> pin_user_pages()

Subsystem: mm/pagemap

    Alexander Gordeev <agordeev@linux.ibm.com>:
      mm/mmap.c: add more sanity checks to get_unmapped_area()
      mm/mmap.c: do not allow mappings outside of allowed limits

    Christoph Hellwig <hch@lst.de>:
    Patch series "sort out the flush_icache_range mess", v2:
      arm: fix the flush_icache_range arguments in set_fiq_handler
      nds32: unexport flush_icache_page
      powerpc: unexport flush_icache_user_range
      unicore32: remove flush_cache_user_range
      asm-generic: fix the inclusion guards for cacheflush.h
      asm-generic: don't include <linux/mm.h> in cacheflush.h
      asm-generic: improve the flush_dcache_page stub
      alpha: use asm-generic/cacheflush.h
      arm64: use asm-generic/cacheflush.h
      c6x: use asm-generic/cacheflush.h
      hexagon: use asm-generic/cacheflush.h
      ia64: use asm-generic/cacheflush.h
      microblaze: use asm-generic/cacheflush.h
      m68knommu: use asm-generic/cacheflush.h
      openrisc: use asm-generic/cacheflush.h
      powerpc: use asm-generic/cacheflush.h
      riscv: use asm-generic/cacheflush.h
      arm,sparc,unicore32: remove flush_icache_user_range
      mm: rename flush_icache_user_range to flush_icache_user_page
      asm-generic: add a flush_icache_user_range stub
      sh: implement flush_icache_user_range
      xtensa: implement flush_icache_user_range
      arm: rename flush_cache_user_range to flush_icache_user_range
      m68k: implement flush_icache_user_range
      exec: only build read_code when needed
      exec: use flush_icache_user_range in read_code
      binfmt_flat: use flush_icache_user_range
      nommu: use flush_icache_user_range in brk and mmap
      module: move the set_fs hack for flush_icache_range to m68k

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      doc: cgroup: update note about conditions when oom killer is invoked

 Documentation/admin-guide/cgroup-v2.rst           |   17 +-
 Documentation/admin-guide/dynamic-debug-howto.rst |    5 
 Documentation/admin-guide/kdump/kdump.rst         |    8 +
 Documentation/admin-guide/kernel-parameters.txt   |   34 +++-
 Documentation/admin-guide/sysctl/kernel.rst       |   37 ++++
 Documentation/core-api/pin_user_pages.rst         |   47 ++++--
 arch/alpha/include/asm/cacheflush.h               |   38 +----
 arch/alpha/kernel/smp.c                           |    2 
 arch/arm/include/asm/cacheflush.h                 |    7 
 arch/arm/kernel/fiq.c                             |    4 
 arch/arm/kernel/traps.c                           |    2 
 arch/arm64/include/asm/cacheflush.h               |   46 ------
 arch/c6x/include/asm/cacheflush.h                 |   19 --
 arch/hexagon/include/asm/cacheflush.h             |   19 --
 arch/ia64/include/asm/cacheflush.h                |   30 ----
 arch/m68k/include/asm/cacheflush_mm.h             |    6 
 arch/m68k/include/asm/cacheflush_no.h             |   19 --
 arch/m68k/mm/cache.c                              |   13 +
 arch/microblaze/include/asm/cacheflush.h          |   29 ---
 arch/nds32/include/asm/cacheflush.h               |    4 
 arch/nds32/mm/cacheflush.c                        |    3 
 arch/openrisc/include/asm/cacheflush.h            |   33 ----
 arch/powerpc/include/asm/cacheflush.h             |   46 +-----
 arch/powerpc/kvm/book3s_64_mmu_hv.c               |    2 
 arch/powerpc/kvm/book3s_64_mmu_radix.c            |    2 
 arch/powerpc/mm/mem.c                             |    3 
 arch/powerpc/perf/callchain_64.c                  |    4 
 arch/riscv/include/asm/cacheflush.h               |   65 --------
 arch/sh/include/asm/cacheflush.h                  |    1 
 arch/sparc/include/asm/cacheflush_32.h            |    2 
 arch/sparc/include/asm/cacheflush_64.h            |    1 
 arch/um/include/asm/tlb.h                         |    2 
 arch/unicore32/include/asm/cacheflush.h           |   11 -
 arch/x86/include/asm/cacheflush.h                 |    2 
 arch/xtensa/include/asm/cacheflush.h              |    2 
 drivers/media/platform/omap3isp/ispvideo.c        |    2 
 drivers/nvdimm/pmem.c                             |    3 
 drivers/vhost/vhost.c                             |    5 
 fs/binfmt_flat.c                                  |    2 
 fs/exec.c                                         |    5 
 fs/proc/proc_sysctl.c                             |  163 ++++++++++++++++++++--
 include/asm-generic/cacheflush.h                  |   25 +--
 include/linux/dev_printk.h                        |    6 
 include/linux/dynamic_debug.h                     |    2 
 include/linux/ipc_namespace.h                     |    2 
 include/linux/kernel.h                            |    9 +
 include/linux/mm.h                                |   12 +
 include/linux/net.h                               |    3 
 include/linux/netdevice.h                         |    6 
 include/linux/printk.h                            |    9 -
 include/linux/sched/sysctl.h                      |    7 
 include/linux/sysctl.h                            |    4 
 include/linux/xarray.h                            |    4 
 include/rdma/ib_verbs.h                           |    6 
 init/main.c                                       |    2 
 ipc/msg.c                                         |    2 
 ipc/namespace.c                                   |   24 ++-
 kernel/events/core.c                              |    4 
 kernel/events/uprobes.c                           |    2 
 kernel/hung_task.c                                |   30 ++--
 kernel/module.c                                   |    8 -
 kernel/panic.c                                    |   45 ++++++
 kernel/sysctl.c                                   |   38 ++++-
 kernel/watchdog.c                                 |   37 +---
 lib/Kconfig.debug                                 |   12 +
 lib/Makefile                                      |    2 
 lib/dynamic_debug.c                               |    9 -
 lib/test_sysctl.c                                 |   13 +
 mm/frame_vector.c                                 |    7 
 mm/gup.c                                          |   74 +++++++--
 mm/mmap.c                                         |   28 ++-
 mm/nommu.c                                        |    4 
 mm/page_alloc.c                                   |    9 -
 mm/page_idle.c                                    |    7 
 tools/testing/selftests/sysctl/sysctl.sh          |   44 +++++
 virt/kvm/kvm_main.c                               |    8 -
 76 files changed, 732 insertions(+), 517 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-04 23:45 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-04 23:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


- More MM work.  100ish more to go.  Mike's "mm: remove
  __ARCH_HAS_5LEVEL_HACK" series should fix the current ppc issue.

- Various other little subsystems

127 patches, based on 6929f71e46bdddbf1c4d67c2728648176c67c555.


Subsystems affected by this patch series:

  kcov
  mm/pagemap
  mm/vmalloc
  mm/kmap
  mm/util
  mm/memory-hotplug
  mm/cleanups
  mm/zram
  procfs
  core-kernel
  get_maintainer
  lib
  bitops
  checkpatch
  binfmt
  init
  fat
  seq_file
  exec
  rapidio
  relay
  selftests
  ubsan

Subsystem: kcov

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kcov: collect coverage from usb soft interrupts", v4:
      kcov: cleanup debug messages
      kcov: fix potential use-after-free in kcov_remote_start
      kcov: move t->kcov assignments into kcov_start/stop
      kcov: move t->kcov_sequence assignment
      kcov: use t->kcov_mode as enabled indicator
      kcov: collect coverage from interrupts
      usb: core: kcov: collect coverage from usb complete callback

Subsystem: mm/pagemap

    Feng Tang <feng.tang@intel.com>:
      mm/util.c: remove the VM_WARN_ONCE for vm_committed_as underflow check

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: remove __ARCH_HAS_5LEVEL_HACK", v4:
      h8300: remove usage of __ARCH_USE_5LEVEL_HACK
      arm: add support for folded p4d page tables
      arm64: add support for folded p4d page tables
      hexagon: remove __ARCH_USE_5LEVEL_HACK
      ia64: add support for folded p4d page tables
      nios2: add support for folded p4d page tables
      openrisc: add support for folded p4d page tables
      powerpc: add support for folded p4d page tables

    Geert Uytterhoeven <geert+renesas@glider.be>:
      sh: fault: modernize printing of kernel messages

    Mike Rapoport <rppt@linux.ibm.com>:
      sh: drop __pXd_offset() macros that duplicate pXd_index() ones
      sh: add support for folded p4d page tables
      unicore32: remove __ARCH_USE_5LEVEL_HACK
      asm-generic: remove pgtable-nop4d-hack.h
      mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/debug: Add tests validating architecture page table:
      x86/mm: define mm_p4d_folded()
      mm/debug: add tests validating architecture page table helpers

Subsystem: mm/vmalloc

    Jeongtae Park <jtp.park@samsung.com>:
      mm/vmalloc: fix a typo in comment

Subsystem: mm/kmap

    Ira Weiny <ira.weiny@intel.com>:
    Patch series "Remove duplicated kmap code", v3:
      arch/kmap: remove BUG_ON()
      arch/xtensa: move kmap build bug out of the way
      arch/kmap: remove redundant arch specific kmaps
      arch/kunmap: remove duplicate kunmap implementations
      {x86,powerpc,microblaze}/kmap: move preempt disable
      arch/kmap_atomic: consolidate duplicate code
      arch/kunmap_atomic: consolidate duplicate code
      arch/kmap: ensure kmap_prot visibility
      arch/kmap: don't hard code kmap_prot values
      arch/kmap: define kmap_atomic_prot() for all arch's
      drm: remove drm specific kmap_atomic code
      kmap: remove kmap_atomic_to_page()
      parisc/kmap: remove duplicate kmap code
      sparc: remove unnecessary includes
      kmap: consolidate kmap_prot definitions

Subsystem: mm/util

    Waiman Long <longman@redhat.com>:
      mm: add kvfree_sensitive() for freeing sensitive data objects

Subsystem: mm/memory-hotplug

    Vishal Verma <vishal.l.verma@intel.com>:
      mm/memory_hotplug: refrain from adding memory into an impossible node

    David Hildenbrand <david@redhat.com>:
      powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable()
      mm/memory_hotplug: remove is_mem_section_removable()
    Patch series "mm/memory_hotplug: handle memblocks only with:
      mm/memory_hotplug: set node_start_pfn of hotadded pgdat to 0
      mm/memory_hotplug: handle memblocks only with CONFIG_ARCH_KEEP_MEMBLOCK
    Patch series "mm/memory_hotplug: Interface to add driver-managed system:
      mm/memory_hotplug: introduce add_memory_driver_managed()
      kexec_file: don't place kexec images on IORESOURCE_MEM_DRIVER_MANAGED
      device-dax: add memory via add_memory_driver_managed()

    Michal Hocko <mhocko@kernel.org>:
      mm/memory_hotplug: disable the functionality for 32b

Subsystem: mm/cleanups

    chenqiwu <chenqiwu@xiaomi.com>:
      mm: replace zero-length array with flexible-array member

    Ethon Paul <ethp@qq.com>:
      mm/memory_hotplug: fix a typo in comment "recoreded"->"recorded"
      mm: ksm: fix a typo in comment "alreaady"->"already"
      mm: mmap: fix a typo in comment "compatbility"->"compatibility"
      mm/hugetlb: fix a typos in comments
      mm/vmsan: fix some typos in comment
      mm/compaction: fix a typo in comment "pessemistic"->"pessimistic"
      mm/memblock: fix a typo in comment "implict"->"implicit"
      mm/list_lru: fix a typo in comment "numbesr"->"numbers"
      mm/filemap: fix a typo in comment "unneccssary"->"unnecessary"
      mm/frontswap: fix some typos in frontswap.c
      mm, memcg: fix some typos in memcontrol.c
      mm: fix a typo in comment "strucure"->"structure"
      mm/slub: fix a typo in comment "disambiguiation"->"disambiguation"
      mm/sparse: fix a typo in comment "convienence"->"convenience"
      mm/page-writeback: fix a typo in comment "effictive"->"effective"
      mm/memory: fix a typo in comment "attampt"->"attempt"

    Zou Wei <zou_wei@huawei.com>:
      mm: use false for bool variable

    Jason Yan <yanaijie@huawei.com>:
      include/linux/mm.h: return true in cpupid_pid_unset()

Subsystem: mm/zram

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      zcomp: Use ARRAY_SIZE() for backends list

Subsystem: procfs

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: rename "catch" function argument

Subsystem: core-kernel

    Jason Yan <yanaijie@huawei.com>:
      user.c: make uidhash_table static

Subsystem: get_maintainer

    Joe Perches <joe@perches.com>:
      get_maintainer: add email addresses from .yaml files
      get_maintainer: fix unexpected behavior for path/to//file (double slashes)

Subsystem: lib

    Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
      lib/math: avoid trailing newline hidden in pr_fmt()

    KP Singh <kpsingh@chromium.org>:
      lib: Add might_fault() to strncpy_from_user.

    Jason Yan <yanaijie@huawei.com>:
      lib/test_lockup.c: make test_inode static

    Jann Horn <jannh@google.com>:
      lib/zlib: remove outdated and incorrect pre-increment optimization

    Joe Perches <joe@perches.com>:
      lib/percpu-refcount.c: use a more common logging style

    Tan Hu <tan.hu@zte.com.cn>:
      lib/flex_proportions.c: cleanup __fprop_inc_percpu_max

    Jesse Brandeburg <jesse.brandeburg@intel.com>:
      lib: make a test module with set/clear bit

Subsystem: bitops

    Arnd Bergmann <arnd@arndb.de>:
      include/linux/bitops.h: avoid clang shift-count-overflow warnings

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: additional MAINTAINER section entry ordering checks
      checkpatch: look for c99 comments in ctx_locate_comment
      checkpatch: disallow --git and --file/--fix

    Geert Uytterhoeven <geert+renesas@glider.be>:
      checkpatch: use patch subject when reading from stdin

Subsystem: binfmt

    Anthony Iliopoulos <ailiop@suse.com>:
      fs/binfmt_elf: remove redundant elf_map ifndef

    Nick Desaulniers <ndesaulniers@google.com>:
      elfnote: mark all .note sections SHF_ALLOC

Subsystem: init

    Chris Down <chris@chrisdown.name>:
      init: allow distribution configuration of default init

Subsystem: fat

    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
      fat: don't allow to mount if the FAT length == 0
      fat: improve the readahead for FAT entries

Subsystem: seq_file

    Joe Perches <joe@perches.com>:
      fs/seq_file.c: seq_read: Update pr_info_ratelimited

    Kefeng Wang <wangkefeng.wang@huawei.com>:
    Patch series "seq_file: Introduce DEFINE_SEQ_ATTRIBUTE() helper macro":
      include/linux/seq_file.h: introduce DEFINE_SEQ_ATTRIBUTE() helper macro
      mm/vmstat.c: convert to use DEFINE_SEQ_ATTRIBUTE macro
      kernel/kprobes.c: convert to use DEFINE_SEQ_ATTRIBUTE macro

Subsystem: exec

    Christoph Hellwig <hch@lst.de>:
      exec: simplify the copy_strings_kernel calling convention
      exec: open code copy_string_kernel

Subsystem: rapidio

    Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>:
      rapidio: avoid data race between file operation callbacks and mport_cdev_add().

    John Hubbard <jhubbard@nvidia.com>:
      rapidio: convert get_user_pages() --> pin_user_pages()

Subsystem: relay

    Daniel Axtens <dja@axtens.net>:
      kernel/relay.c: handle alloc_percpu returning NULL in relay_open

    Pengcheng Yang <yangpc@wangsu.com>:
      kernel/relay.c: fix read_pos error when multiple readers

Subsystem: selftests

    Ram Pai <linuxram@us.ibm.com>:
    Patch series "selftests, powerpc, x86: Memory Protection Keys", v19:
      selftests/x86/pkeys: move selftests to arch-neutral directory
      selftests/vm/pkeys: rename all references to pkru to a generic name
      selftests/vm/pkeys: move generic definitions to header file

    Thiago Jung Bauermann <bauerman@linux.ibm.com>:
      selftests/vm/pkeys: move some definitions to arch-specific header
      selftests/vm/pkeys: make gcc check arguments of sigsafe_printf()

    Sandipan Das <sandipan@linux.ibm.com>:
      selftests: vm: pkeys: Use sane types for pkey register
      selftests: vm: pkeys: add helpers for pkey bits

    Ram Pai <linuxram@us.ibm.com>:
      selftests/vm/pkeys: fix pkey_disable_clear()
      selftests/vm/pkeys: fix assertion in pkey_disable_set/clear()
      selftests/vm/pkeys: fix alloc_random_pkey() to make it really random

    Sandipan Das <sandipan@linux.ibm.com>:
      selftests: vm: pkeys: use the correct huge page size

    Ram Pai <linuxram@us.ibm.com>:
      selftests/vm/pkeys: introduce generic pkey abstractions
      selftests/vm/pkeys: introduce powerpc support

    "Desnes A. Nunes do Rosario" <desnesn@linux.vnet.ibm.com>:
      selftests/vm/pkeys: fix number of reserved powerpc pkeys

    Ram Pai <linuxram@us.ibm.com>:
      selftests/vm/pkeys: fix assertion in test_pkey_alloc_exhaust()
      selftests/vm/pkeys: improve checks to determine pkey support
      selftests/vm/pkeys: associate key on a mapped page and detect access violation
      selftests/vm/pkeys: associate key on a mapped page and detect write violation
      selftests/vm/pkeys: detect write violation on a mapped access-denied-key page
      selftests/vm/pkeys: introduce a sub-page allocator
      selftests/vm/pkeys: test correct behaviour of pkey-0
      selftests/vm/pkeys: override access right definitions on powerpc

    Sandipan Das <sandipan@linux.ibm.com>:
      selftests: vm: pkeys: use the correct page size on powerpc
      selftests: vm: pkeys: fix multilib builds for x86

    Jagadeesh Pagadala <jagdsh.linux@gmail.com>:
      tools/testing/selftests/vm: remove duplicate headers

Subsystem: ubsan

    Arnd Bergmann <arnd@arndb.de>:
      lib/ubsan.c: fix gcc-10 warnings

 Documentation/dev-tools/kcov.rst                               |   17 
 Documentation/features/debug/debug-vm-pgtable/arch-support.txt |   34 
 arch/arc/Kconfig                                               |    1 
 arch/arc/include/asm/highmem.h                                 |   20 
 arch/arc/mm/highmem.c                                          |   34 
 arch/arm/include/asm/highmem.h                                 |    9 
 arch/arm/include/asm/pgtable.h                                 |    1 
 arch/arm/lib/uaccess_with_memcpy.c                             |    7 
 arch/arm/mach-sa1100/assabet.c                                 |    2 
 arch/arm/mm/dump.c                                             |   29 
 arch/arm/mm/fault-armv.c                                       |    7 
 arch/arm/mm/fault.c                                            |   22 
 arch/arm/mm/highmem.c                                          |   41 
 arch/arm/mm/idmap.c                                            |    3 
 arch/arm/mm/init.c                                             |    2 
 arch/arm/mm/ioremap.c                                          |   12 
 arch/arm/mm/mm.h                                               |    2 
 arch/arm/mm/mmu.c                                              |   35 
 arch/arm/mm/pgd.c                                              |   40 
 arch/arm64/Kconfig                                             |    1 
 arch/arm64/include/asm/kvm_mmu.h                               |   10 
 arch/arm64/include/asm/pgalloc.h                               |   10 
 arch/arm64/include/asm/pgtable-types.h                         |    5 
 arch/arm64/include/asm/pgtable.h                               |   37 
 arch/arm64/include/asm/stage2_pgtable.h                        |   48 
 arch/arm64/kernel/hibernate.c                                  |   44 
 arch/arm64/kvm/mmu.c                                           |  209 
 arch/arm64/mm/fault.c                                          |    9 
 arch/arm64/mm/hugetlbpage.c                                    |   15 
 arch/arm64/mm/kasan_init.c                                     |   26 
 arch/arm64/mm/mmu.c                                            |   52 
 arch/arm64/mm/pageattr.c                                       |    7 
 arch/csky/include/asm/highmem.h                                |   12 
 arch/csky/mm/highmem.c                                         |   64 
 arch/h8300/include/asm/pgtable.h                               |    1 
 arch/hexagon/include/asm/fixmap.h                              |    4 
 arch/hexagon/include/asm/pgtable.h                             |    1 
 arch/ia64/include/asm/pgalloc.h                                |    4 
 arch/ia64/include/asm/pgtable.h                                |   17 
 arch/ia64/mm/fault.c                                           |    7 
 arch/ia64/mm/hugetlbpage.c                                     |   18 
 arch/ia64/mm/init.c                                            |   28 
 arch/microblaze/include/asm/highmem.h                          |   55 
 arch/microblaze/mm/highmem.c                                   |   21 
 arch/microblaze/mm/init.c                                      |    3 
 arch/mips/include/asm/highmem.h                                |   11 
 arch/mips/mm/cache.c                                           |    6 
 arch/mips/mm/highmem.c                                         |   62 
 arch/nds32/include/asm/highmem.h                               |    9 
 arch/nds32/mm/highmem.c                                        |   49 
 arch/nios2/include/asm/pgtable.h                               |    3 
 arch/nios2/mm/fault.c                                          |    9 
 arch/nios2/mm/ioremap.c                                        |    6 
 arch/openrisc/include/asm/pgtable.h                            |    1 
 arch/openrisc/mm/fault.c                                       |   10 
 arch/openrisc/mm/init.c                                        |    4 
 arch/parisc/include/asm/cacheflush.h                           |   32 
 arch/powerpc/Kconfig                                           |    1 
 arch/powerpc/include/asm/book3s/32/pgtable.h                   |    1 
 arch/powerpc/include/asm/book3s/64/hash.h                      |    4 
 arch/powerpc/include/asm/book3s/64/pgalloc.h                   |    4 
 arch/powerpc/include/asm/book3s/64/pgtable.h                   |   60 
 arch/powerpc/include/asm/book3s/64/radix.h                     |    6 
 arch/powerpc/include/asm/highmem.h                             |   56 
 arch/powerpc/include/asm/nohash/32/pgtable.h                   |    1 
 arch/powerpc/include/asm/nohash/64/pgalloc.h                   |    2 
 arch/powerpc/include/asm/nohash/64/pgtable-4k.h                |   32 
 arch/powerpc/include/asm/nohash/64/pgtable.h                   |    6 
 arch/powerpc/include/asm/pgtable.h                             |   10 
 arch/powerpc/kvm/book3s_64_mmu_radix.c                         |   32 
 arch/powerpc/lib/code-patching.c                               |    7 
 arch/powerpc/mm/book3s64/hash_pgtable.c                        |    4 
 arch/powerpc/mm/book3s64/radix_pgtable.c                       |   26 
 arch/powerpc/mm/book3s64/subpage_prot.c                        |    6 
 arch/powerpc/mm/highmem.c                                      |   26 
 arch/powerpc/mm/hugetlbpage.c                                  |   28 
 arch/powerpc/mm/kasan/kasan_init_32.c                          |    2 
 arch/powerpc/mm/mem.c                                          |    3 
 arch/powerpc/mm/nohash/book3e_pgtable.c                        |   15 
 arch/powerpc/mm/pgtable.c                                      |   30 
 arch/powerpc/mm/pgtable_64.c                                   |   10 
 arch/powerpc/mm/ptdump/hashpagetable.c                         |   20 
 arch/powerpc/mm/ptdump/ptdump.c                                |   12 
 arch/powerpc/platforms/pseries/hotplug-memory.c                |   26 
 arch/powerpc/xmon/xmon.c                                       |   27 
 arch/s390/Kconfig                                              |    1 
 arch/sh/include/asm/pgtable-2level.h                           |    1 
 arch/sh/include/asm/pgtable-3level.h                           |    1 
 arch/sh/include/asm/pgtable_32.h                               |    5 
 arch/sh/include/asm/pgtable_64.h                               |    5 
 arch/sh/kernel/io_trapped.c                                    |    7 
 arch/sh/mm/cache-sh4.c                                         |    4 
 arch/sh/mm/cache-sh5.c                                         |    7 
 arch/sh/mm/fault.c                                             |   64 
 arch/sh/mm/hugetlbpage.c                                       |   28 
 arch/sh/mm/init.c                                              |   15 
 arch/sh/mm/kmap.c                                              |    2 
 arch/sh/mm/tlbex_32.c                                          |    6 
 arch/sh/mm/tlbex_64.c                                          |    7 
 arch/sparc/include/asm/highmem.h                               |   29 
 arch/sparc/mm/highmem.c                                        |   31 
 arch/sparc/mm/io-unit.c                                        |    1 
 arch/sparc/mm/iommu.c                                          |    1 
 arch/unicore32/include/asm/pgtable.h                           |    1 
 arch/unicore32/kernel/hibernate.c                              |    4 
 arch/x86/Kconfig                                               |    1 
 arch/x86/include/asm/fixmap.h                                  |    1 
 arch/x86/include/asm/highmem.h                                 |   37 
 arch/x86/include/asm/pgtable_64.h                              |    6 
 arch/x86/mm/highmem_32.c                                       |   52 
 arch/xtensa/include/asm/highmem.h                              |   31 
 arch/xtensa/mm/highmem.c                                       |   28 
 drivers/block/zram/zcomp.c                                     |    7 
 drivers/dax/dax-private.h                                      |    1 
 drivers/dax/kmem.c                                             |   28 
 drivers/gpu/drm/ttm/ttm_bo_util.c                              |   56 
 drivers/gpu/drm/vmwgfx/vmwgfx_blit.c                           |   17 
 drivers/rapidio/devices/rio_mport_cdev.c                       |   27 
 drivers/usb/core/hcd.c                                         |    3 
 fs/binfmt_elf.c                                                |    4 
 fs/binfmt_em86.c                                               |    6 
 fs/binfmt_misc.c                                               |    4 
 fs/binfmt_script.c                                             |    6 
 fs/exec.c                                                      |   58 
 fs/fat/fatent.c                                                |  103 
 fs/fat/inode.c                                                 |    6 
 fs/proc/array.c                                                |    8 
 fs/seq_file.c                                                  |    7 
 include/asm-generic/5level-fixup.h                             |   59 
 include/asm-generic/pgtable-nop4d-hack.h                       |   64 
 include/asm-generic/pgtable-nopud.h                            |    4 
 include/drm/ttm/ttm_bo_api.h                                   |    4 
 include/linux/binfmts.h                                        |    3 
 include/linux/bitops.h                                         |    2 
 include/linux/elfnote.h                                        |    2 
 include/linux/highmem.h                                        |   89 
 include/linux/ioport.h                                         |    1 
 include/linux/memory_hotplug.h                                 |    9 
 include/linux/mm.h                                             |   12 
 include/linux/sched.h                                          |    3 
 include/linux/seq_file.h                                       |   19 
 init/Kconfig                                                   |   10 
 init/main.c                                                    |   10 
 kernel/kcov.c                                                  |  282 -
 kernel/kexec_file.c                                            |    5 
 kernel/kprobes.c                                               |   34 
 kernel/relay.c                                                 |   22 
 kernel/user.c                                                  |    2 
 lib/Kconfig.debug                                              |   44 
 lib/Makefile                                                   |    2 
 lib/flex_proportions.c                                         |    7 
 lib/math/prime_numbers.c                                       |   10 
 lib/percpu-refcount.c                                          |    6 
 lib/strncpy_from_user.c                                        |    1 
 lib/test_bitops.c                                              |   60 
 lib/test_lockup.c                                              |    2 
 lib/ubsan.c                                                    |   33 
 lib/zlib_inflate/inffast.c                                     |   91 
 mm/Kconfig                                                     |    4 
 mm/Makefile                                                    |    1 
 mm/compaction.c                                                |    2 
 mm/debug_vm_pgtable.c                                          |  382 +
 mm/filemap.c                                                   |    2 
 mm/frontswap.c                                                 |    6 
 mm/huge_memory.c                                               |    2 
 mm/hugetlb.c                                                   |   16 
 mm/internal.h                                                  |    2 
 mm/kasan/init.c                                                |   11 
 mm/ksm.c                                                       |   10 
 mm/list_lru.c                                                  |    2 
 mm/memblock.c                                                  |    2 
 mm/memcontrol.c                                                |    4 
 mm/memory.c                                                    |   10 
 mm/memory_hotplug.c                                            |  179 
 mm/mmap.c                                                      |    2 
 mm/mremap.c                                                    |    2 
 mm/page-writeback.c                                            |    2 
 mm/slub.c                                                      |    2 
 mm/sparse.c                                                    |    2 
 mm/util.c                                                      |   22 
 mm/vmalloc.c                                                   |    2 
 mm/vmscan.c                                                    |    6 
 mm/vmstat.c                                                    |   32 
 mm/zbud.c                                                      |    2 
 scripts/checkpatch.pl                                          |   62 
 scripts/get_maintainer.pl                                      |   46 
 security/keys/internal.h                                       |   11 
 security/keys/keyctl.c                                         |   16 
 tools/testing/selftests/lib/config                             |    1 
 tools/testing/selftests/vm/.gitignore                          |    1 
 tools/testing/selftests/vm/Makefile                            |   75 
 tools/testing/selftests/vm/mremap_dontunmap.c                  |    1 
 tools/testing/selftests/vm/pkey-helpers.h                      |  557 +-
 tools/testing/selftests/vm/pkey-powerpc.h                      |  153 
 tools/testing/selftests/vm/pkey-x86.h                          |  191 
 tools/testing/selftests/vm/protection_keys.c                   | 2370 ++++++++--
 tools/testing/selftests/x86/.gitignore                         |    1 
 tools/testing/selftests/x86/Makefile                           |    2 
 tools/testing/selftests/x86/pkey-helpers.h                     |  219 
 tools/testing/selftests/x86/protection_keys.c                  | 1506 ------
 200 files changed, 5182 insertions(+), 4033 deletions(-)




^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-03 22:55 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-03 22:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


More mm/ work, plenty more to come.

131 patches, based on d6f9469a03d832dcd17041ed67774ffb5f3e73b3.

Subsystems affected by this patch series:

  mm/slub
  mm/memcg
  mm/gup
  mm/kasan
  mm/pagealloc
  mm/hugetlb
  mm/vmscan
  mm/tools
  mm/mempolicy
  mm/memblock
  mm/hugetlbfs
  mm/thp
  mm/mmap
  mm/kconfig

Subsystem: mm/slub

    Wang Hai <wanghai38@huawei.com>:
      mm/slub: fix a memory leak in sysfs_slab_add()

Subsystem: mm/memcg

    Shakeel Butt <shakeelb@google.com>:
      mm/memcg: optimize memory.numa_stat like memory.stat

Subsystem: mm/gup

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()", v2:
      mm/gup: move __get_user_pages_fast() down a few lines in gup.c
      mm/gup: refactor and de-duplicate gup_fast() code
      mm/gup: introduce pin_user_pages_fast_only()
      drm/i915: convert get_user_pages() --> pin_user_pages()
      mm/gup: might_lock_read(mmap_sem) in get_user_pages_fast()

Subsystem: mm/kasan

    Daniel Axtens <dja@axtens.net>:
    Patch series "Fix some incompatibilites between KASAN and FORTIFY_SOURCE", v4:
      kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE
      string.h: fix incompatibility between FORTIFY_SOURCE and KASAN

Subsystem: mm/pagealloc

    Michal Hocko <mhocko@suse.com>:
      mm: clarify __GFP_MEMALLOC usage

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: rework free_area_init*() funcitons":
      mm: memblock: replace dereferences of memblock_region.nid with API calls
      mm: make early_pfn_to_nid() and related defintions close to each other
      mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option
      mm: free_area_init: use maximal zone PFNs rather than zone sizes
      mm: use free_area_init() instead of free_area_init_nodes()
      alpha: simplify detection of memory zone boundaries
      arm: simplify detection of memory zone boundaries
      arm64: simplify detection of memory zone boundaries for UMA configs
      csky: simplify detection of memory zone boundaries
      m68k: mm: simplify detection of memory zone boundaries
      parisc: simplify detection of memory zone boundaries
      sparc32: simplify detection of memory zone boundaries
      unicore32: simplify detection of memory zone boundaries
      xtensa: simplify detection of memory zone boundaries

    Baoquan He <bhe@redhat.com>:
      mm: memmap_init: iterate over memblock regions rather that check each PFN

    Mike Rapoport <rppt@linux.ibm.com>:
      mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES
      mm: free_area_init: allow defining max_zone_pfn in descending order
      mm: rename free_area_init_node() to free_area_init_memoryless_node()
      mm: clean up free_area_init_node() and its helpers
      mm: simplify find_min_pfn_with_active_regions()
      docs/vm: update memory-models documentation

    Wei Yang <richard.weiyang@gmail.com>:
    Patch series "mm/page_alloc.c: cleanup on check page", v3:
      mm/page_alloc.c: bad_[reason|flags] is not necessary when PageHWPoison
      mm/page_alloc.c: bad_flags is not necessary for bad_page()
      mm/page_alloc.c: rename free_pages_check_bad() to check_free_page_bad()
      mm/page_alloc.c: rename free_pages_check() to check_free_page()
      mm/page_alloc.c: extract check_[new|free]_page_bad() common part to page_bad_reason()

    Roman Gushchin <guro@fb.com>:
      mm,page_alloc,cma: conditionally prefer cma pageblocks for movable allocations

    Baoquan He <bhe@redhat.com>:
      mm/page_alloc.c: remove unused free_bootmem_with_active_regions
    Patch series "improvements about lowmem_reserve and /proc/zoneinfo", v2:
      mm/page_alloc.c: only tune sysctl_lowmem_reserve_ratio value once when changing it
      mm/page_alloc.c: clear out zone->lowmem_reserve[] if the zone is empty
      mm/vmstat.c: do not show lowmem reserve protection information of empty zone

    Joonsoo Kim <iamjoonsoo.kim@lge.com>:
    Patch series "integrate classzone_idx and high_zoneidx", v5:
      mm/page_alloc: use ac->high_zoneidx for classzone_idx
      mm/page_alloc: integrate classzone_idx and high_zoneidx

    Wei Yang <richard.weiyang@gmail.com>:
      mm/page_alloc.c: use NODE_MASK_NONE in build_zonelists()
      mm: rename gfpflags_to_migratetype to gfp_migratetype for same convention

    Sandipan Das <sandipan@linux.ibm.com>:
      mm/page_alloc.c: reset numa stats for boot pagesets

    Charan Teja Reddy <charante@codeaurora.org>:
      mm, page_alloc: reset the zone->watermark_boost early

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/page_alloc: restrict and formalize compound_page_dtors[]

    Daniel Jordan <daniel.m.jordan@oracle.com>:
    Patch series "initialize deferred pages with interrupts enabled", v4:
      mm/pagealloc.c: call touch_nmi_watchdog() on max order boundaries in deferred init

    Pavel Tatashin <pasha.tatashin@soleen.com>:
      mm: initialize deferred pages with interrupts enabled
      mm: call cond_resched() from deferred_init_memmap()

    Daniel Jordan <daniel.m.jordan@oracle.com>:
    Patch series "padata: parallelize deferred page init", v3:
      padata: remove exit routine
      padata: initialize earlier
      padata: allocate work structures for parallel jobs from a pool
      padata: add basic support for multithreaded jobs
      mm: don't track number of pages during deferred initialization
      mm: parallelize deferred_init_memmap()
      mm: make deferred init's max threads arch-specific
      padata: document multithreaded jobs

    Chen Tao <chentao107@huawei.com>:
      mm/page_alloc.c: add missing newline

Subsystem: mm/hugetlb

    "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>:
    Patch series "thp/khugepaged improvements and CoW semantics", v4:
      khugepaged: add self test
      khugepaged: do not stop collapse if less than half PTEs are referenced
      khugepaged: drain all LRU caches before scanning pages
      khugepaged: drain LRU add pagevec after swapin
      khugepaged: allow to collapse a page shared across fork
      khugepaged: allow to collapse PTE-mapped compound pages
      thp: change CoW semantics for anon-THP
      khugepaged: introduce 'max_ptes_shared' tunable

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "Clean up hugetlb boot command line processing", v4:
      hugetlbfs: add arch_hugetlb_valid_size
      hugetlbfs: move hugepagesz= parsing to arch independent code
      hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate
      hugetlbfs: clean up command line processing
      hugetlbfs: fix changes to command line processing

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm/hugetlb: avoid unnecessary check on pud and pmd entry in huge_pte_offset

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/hugetlb: Add some new generic fallbacks", v3:
      arm64/mm: drop __HAVE_ARCH_HUGE_PTEP_GET
      mm/hugetlb: define a generic fallback for is_hugepage_only_range()
      mm/hugetlb: define a generic fallback for arch_clear_hugepage_flags()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: simplify calling a compound page destructor

Subsystem: mm/vmscan

    Wei Yang <richard.weiyang@gmail.com>:
      mm/vmscan.c: use update_lru_size() in update_lru_sizes()

    Jaewon Kim <jaewon31.kim@samsung.com>:
      mm/vmscan: count layzfree pages and fix nr_isolated_* mismatch

    Maninder Singh <maninder1.s@samsung.com>:
      mm/vmscan.c: change prototype for shrink_page_list

    Qiwu Chen <qiwuchen55@gmail.com>:
      mm/vmscan: update the comment of should_continue_reclaim()

    Johannes Weiner <hannes@cmpxchg.org>:
    Patch series "mm: memcontrol: charge swapin pages on instantiation", v2:
      mm: fix NUMA node file count error in replace_page_cache()
      mm: memcontrol: fix stat-corrupting race in charge moving
      mm: memcontrol: drop @compound parameter from memcg charging API
      mm: shmem: remove rare optimization when swapin races with hole punching
      mm: memcontrol: move out cgroup swaprate throttling
      mm: memcontrol: convert page cache to a new mem_cgroup_charge() API
      mm: memcontrol: prepare uncharging for removal of private page type counters
      mm: memcontrol: prepare move_account for removal of private page type counters
      mm: memcontrol: prepare cgroup vmstat infrastructure for native anon counters
      mm: memcontrol: switch to native NR_FILE_PAGES and NR_SHMEM counters
      mm: memcontrol: switch to native NR_ANON_MAPPED counter
      mm: memcontrol: switch to native NR_ANON_THPS counter
      mm: memcontrol: convert anon and file-thp to new mem_cgroup_charge() API
      mm: memcontrol: drop unused try/commit/cancel charge API
      mm: memcontrol: prepare swap controller setup for integration
      mm: memcontrol: make swap tracking an integral part of memory control
      mm: memcontrol: charge swapin pages on instantiation

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm: memcontrol: document the new swap control behavior

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: delete unused lrucare handling
      mm: memcontrol: update page->mem_cgroup stability rules
      mm: fix LRU balancing effect of new transparent huge pages
      mm: keep separate anon and file statistics on page reclaim activity
      mm: allow swappiness that prefers reclaiming anon over the file workingset
      mm: fold and remove lru_cache_add_anon() and lru_cache_add_file()
      mm: workingset: let cache workingset challenge anon
      mm: remove use-once cache bias from LRU balancing
      mm: vmscan: drop unnecessary div0 avoidance rounding in get_scan_count()
      mm: base LRU balancing on an explicit cost model
      mm: deactivations shouldn't bias the LRU balance
      mm: only count actual rotations as LRU reclaim cost
      mm: balance LRU lists based on relative thrashing
      mm: vmscan: determine anon/file pressure balance at the reclaim root
      mm: vmscan: reclaim writepage is IO cost
      mm: vmscan: limit the range of LRU type balancing

    Shakeel Butt <shakeelb@google.com>:
      mm: swap: fix vmstats for huge pages
      mm: swap: memcg: fix memcg stats for huge pages

Subsystem: mm/tools

    Changhee Han <ch0.han@lge.com>:
      tools/vm/page_owner_sort.c: filter out unneeded line

Subsystem: mm/mempolicy

    Michal Hocko <mhocko@suse.com>:
      mm, mempolicy: fix up gup usage in lookup_node

Subsystem: mm/memblock

    chenqiwu <chenqiwu@xiaomi.com>:
      include/linux/memblock.h: fix minor typo and unclear comment

    Mike Rapoport <rppt@linux.ibm.com>:
      sparc32: register memory occupied by kernel as memblock.memory

Subsystem: mm/hugetlbfs

    Shijie Hu <hushijie3@huawei.com>:
      hugetlbfs: get unmapped area below TASK_UNMAPPED_BASE for hugetlbfs

Subsystem: mm/thp

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: thp: don't need to drain lru cache when splitting and mlocking THP

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/thp: Rename pmd_mknotpresent() as pmd_mknotvalid()", v2:
      powerpc/mm: drop platform defined pmd_mknotpresent()
      mm/thp: rename pmd_mknotpresent() as pmd_mkinvalid()

Subsystem: mm/mmap

    Scott Cheloha <cheloha@linux.vnet.ibm.com>:
      drivers/base/memory.c: cache memory blocks in xarray to accelerate lookup

Subsystem: mm/kconfig

    Zong Li <zong.li@sifive.com>:
    Patch series "Extract DEBUG_WX to shared use":
      mm: add DEBUG_WX support
      riscv: support DEBUG_WX
      x86: mm: use ARCH_HAS_DEBUG_WX instead of arch defined
      arm64: mm: use ARCH_HAS_DEBUG_WX instead of arch defined

 Documentation/admin-guide/cgroup-v1/memory.rst           |   19 
 Documentation/admin-guide/kernel-parameters.txt          |   40 
 Documentation/admin-guide/mm/hugetlbpage.rst             |   35 
 Documentation/admin-guide/mm/transhuge.rst               |    7 
 Documentation/admin-guide/sysctl/vm.rst                  |   23 
 Documentation/core-api/padata.rst                        |   41 
 Documentation/features/vm/numa-memblock/arch-support.txt |   34 
 Documentation/vm/memory-model.rst                        |    9 
 Documentation/vm/page_owner.rst                          |    3 
 arch/alpha/mm/init.c                                     |   16 
 arch/alpha/mm/numa.c                                     |   22 
 arch/arc/include/asm/hugepage.h                          |    2 
 arch/arc/mm/init.c                                       |   41 
 arch/arm/include/asm/hugetlb.h                           |    7 
 arch/arm/include/asm/pgtable-3level.h                    |    2 
 arch/arm/mm/init.c                                       |   66 
 arch/arm64/Kconfig                                       |    2 
 arch/arm64/Kconfig.debug                                 |   29 
 arch/arm64/include/asm/hugetlb.h                         |   13 
 arch/arm64/include/asm/pgtable.h                         |    2 
 arch/arm64/mm/hugetlbpage.c                              |   48 
 arch/arm64/mm/init.c                                     |   56 
 arch/arm64/mm/numa.c                                     |    9 
 arch/c6x/mm/init.c                                       |    8 
 arch/csky/kernel/setup.c                                 |   26 
 arch/h8300/mm/init.c                                     |    6 
 arch/hexagon/mm/init.c                                   |    6 
 arch/ia64/Kconfig                                        |    1 
 arch/ia64/include/asm/hugetlb.h                          |    5 
 arch/ia64/mm/contig.c                                    |    2 
 arch/ia64/mm/discontig.c                                 |    2 
 arch/m68k/mm/init.c                                      |    6 
 arch/m68k/mm/mcfmmu.c                                    |    9 
 arch/m68k/mm/motorola.c                                  |   15 
 arch/m68k/mm/sun3mmu.c                                   |   10 
 arch/microblaze/Kconfig                                  |    1 
 arch/microblaze/mm/init.c                                |    2 
 arch/mips/Kconfig                                        |    1 
 arch/mips/include/asm/hugetlb.h                          |   11 
 arch/mips/include/asm/pgtable.h                          |    2 
 arch/mips/loongson64/numa.c                              |    2 
 arch/mips/mm/init.c                                      |    2 
 arch/mips/sgi-ip27/ip27-memory.c                         |    2 
 arch/nds32/mm/init.c                                     |   11 
 arch/nios2/mm/init.c                                     |    8 
 arch/openrisc/mm/init.c                                  |    9 
 arch/parisc/include/asm/hugetlb.h                        |   10 
 arch/parisc/mm/init.c                                    |   22 
 arch/powerpc/Kconfig                                     |   10 
 arch/powerpc/include/asm/book3s/64/pgtable.h             |    4 
 arch/powerpc/include/asm/hugetlb.h                       |    5 
 arch/powerpc/mm/hugetlbpage.c                            |   38 
 arch/powerpc/mm/mem.c                                    |    2 
 arch/riscv/Kconfig                                       |    2 
 arch/riscv/include/asm/hugetlb.h                         |   10 
 arch/riscv/include/asm/ptdump.h                          |   11 
 arch/riscv/mm/hugetlbpage.c                              |   44 
 arch/riscv/mm/init.c                                     |    5 
 arch/s390/Kconfig                                        |    1 
 arch/s390/include/asm/hugetlb.h                          |    8 
 arch/s390/mm/hugetlbpage.c                               |   34 
 arch/s390/mm/init.c                                      |    2 
 arch/sh/Kconfig                                          |    1 
 arch/sh/include/asm/hugetlb.h                            |    7 
 arch/sh/mm/init.c                                        |    2 
 arch/sparc/Kconfig                                       |   10 
 arch/sparc/include/asm/hugetlb.h                         |   10 
 arch/sparc/mm/init_32.c                                  |    1 
 arch/sparc/mm/init_64.c                                  |   67 
 arch/sparc/mm/srmmu.c                                    |   21 
 arch/um/kernel/mem.c                                     |   12 
 arch/unicore32/include/asm/memory.h                      |    2 
 arch/unicore32/include/mach/memory.h                     |    6 
 arch/unicore32/kernel/pci.c                              |   14 
 arch/unicore32/mm/init.c                                 |   43 
 arch/x86/Kconfig                                         |   11 
 arch/x86/Kconfig.debug                                   |   27 
 arch/x86/include/asm/hugetlb.h                           |   10 
 arch/x86/include/asm/pgtable.h                           |    2 
 arch/x86/mm/hugetlbpage.c                                |   35 
 arch/x86/mm/init.c                                       |    2 
 arch/x86/mm/init_64.c                                    |   12 
 arch/x86/mm/kmmio.c                                      |    2 
 arch/x86/mm/numa.c                                       |   11 
 arch/xtensa/mm/init.c                                    |    8 
 drivers/base/memory.c                                    |   44 
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c              |   22 
 fs/cifs/file.c                                           |   10 
 fs/fuse/dev.c                                            |    2 
 fs/hugetlbfs/inode.c                                     |   67 
 include/asm-generic/hugetlb.h                            |    2 
 include/linux/compaction.h                               |    9 
 include/linux/gfp.h                                      |    7 
 include/linux/hugetlb.h                                  |   16 
 include/linux/memblock.h                                 |   15 
 include/linux/memcontrol.h                               |  102 -
 include/linux/mm.h                                       |   52 
 include/linux/mmzone.h                                   |   46 
 include/linux/padata.h                                   |   43 
 include/linux/string.h                                   |   60 
 include/linux/swap.h                                     |   17 
 include/linux/vm_event_item.h                            |    4 
 include/linux/vmstat.h                                   |    2 
 include/trace/events/compaction.h                        |   22 
 include/trace/events/huge_memory.h                       |    3 
 include/trace/events/vmscan.h                            |   14 
 init/Kconfig                                             |   17 
 init/main.c                                              |    2 
 kernel/events/uprobes.c                                  |   22 
 kernel/padata.c                                          |  293 +++-
 kernel/sysctl.c                                          |    3 
 lib/test_kasan.c                                         |   29 
 mm/Kconfig                                               |    9 
 mm/Kconfig.debug                                         |   32 
 mm/compaction.c                                          |   70 -
 mm/filemap.c                                             |   55 
 mm/gup.c                                                 |  237 ++-
 mm/huge_memory.c                                         |  282 ----
 mm/hugetlb.c                                             |  260 ++-
 mm/internal.h                                            |   25 
 mm/khugepaged.c                                          |  316 ++--
 mm/memblock.c                                            |   19 
 mm/memcontrol.c                                          |  642 +++------
 mm/memory.c                                              |  103 -
 mm/memory_hotplug.c                                      |   10 
 mm/mempolicy.c                                           |    5 
 mm/migrate.c                                             |   30 
 mm/oom_kill.c                                            |    4 
 mm/page_alloc.c                                          |  735 ++++------
 mm/page_owner.c                                          |    7 
 mm/pgtable-generic.c                                     |    2 
 mm/rmap.c                                                |   53 
 mm/shmem.c                                               |  156 --
 mm/slab.c                                                |    4 
 mm/slub.c                                                |    8 
 mm/swap.c                                                |  199 +-
 mm/swap_cgroup.c                                         |   10 
 mm/swap_state.c                                          |  110 -
 mm/swapfile.c                                            |   39 
 mm/userfaultfd.c                                         |   15 
 mm/vmscan.c                                              |  344 ++--
 mm/vmstat.c                                              |   16 
 mm/workingset.c                                          |   23 
 tools/testing/selftests/vm/.gitignore                    |    1 
 tools/testing/selftests/vm/Makefile                      |    1 
 tools/testing/selftests/vm/khugepaged.c                  | 1035 +++++++++++++++
 tools/vm/page_owner_sort.c                               |    5 
 147 files changed, 3876 insertions(+), 3108 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-02 21:38     ` incoming Andrew Morton
@ 2020-06-02 22:18       ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-06-02 22:18 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Tue, Jun 2, 2020 at 2:38 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Tue, 2 Jun 2020 13:45:49 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
> >
> > Hmm. I have no issues with conflicts, and already took your previous series.
>
> Well that's odd.

I meant "I saw the conflicts and had no issue with them". Nothing odd.

And I actually much prefer seeing conflicts from your series (against
other pulls I've done) over having you delay your patch bombs because
of any fear for them.

              Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-02 20:45   ` incoming Linus Torvalds
@ 2020-06-02 21:38     ` Andrew Morton
  2020-06-02 22:18       ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-06-02 21:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, Linux-MM

On Tue, 2 Jun 2020 13:45:49 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Jun 2, 2020 at 1:08 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > The local_lock merge made rather a mess of all of this.  I'm
> > cooking up a full resend of the same material.
> 
> Hmm. I have no issues with conflicts, and already took your previous series.

Well that's odd.

> I've pushed it out now - does my tree match what you expect?

Yup, thanks.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-02 20:08 ` incoming Andrew Morton
@ 2020-06-02 20:45   ` Linus Torvalds
  2020-06-02 21:38     ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-06-02 20:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Tue, Jun 2, 2020 at 1:08 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> The local_lock merge made rather a mess of all of this.  I'm
> cooking up a full resend of the same material.

Hmm. I have no issues with conflicts, and already took your previous series.

I've pushed it out now - does my tree match what you expect?

            Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-02 20:09 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-06-02 20:09 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


A few little subsystems and a start of a lot of MM patches.

128 patches, based on f359287765c04711ff54fbd11645271d8e5ff763:


Subsystems affected by this patch series:

  squashfs
  ocfs2
  parisc
  vfs
  mm/slab-generic
  mm/slub
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/memory-failure
  mm/vmalloc
  mm/kasan

Subsystem: squashfs

    Philippe Liard <pliard@google.com>:
      squashfs: migrate from ll_rw_block usage to BIO

Subsystem: ocfs2

    Jules Irenge <jbi.octave@gmail.com>:
      ocfs2: add missing annotation for dlm_empty_lockres()

    Gang He <ghe@suse.com>:
      ocfs2: mount shared volume without ha stack

Subsystem: parisc

    Andrew Morton <akpm@linux-foundation.org>:
      arch/parisc/include/asm/pgtable.h: remove unused `old_pte'

Subsystem: vfs

    Jeff Layton <jlayton@redhat.com>:
    Patch series "vfs: have syncfs() return error when there are writeback:
      vfs: track per-sb writeback errors and report them to syncfs
      fs/buffer.c: record blockdev write errors in super_block that it backs

Subsystem: mm/slab-generic

    Vlastimil Babka <vbabka@suse.cz>:
      usercopy: mark dma-kmalloc caches as usercopy caches

Subsystem: mm/slub

    Dongli Zhang <dongli.zhang@oracle.com>:
      mm/slub.c: fix corrupted freechain in deactivate_slab()

    Christoph Lameter <cl@linux.com>:
      slub: Remove userspace notifier for cache add/remove

    Christopher Lameter <cl@linux.com>:
      slub: remove kmalloc under list_lock from list_slab_objects() V2

    Qian Cai <cai@lca.pw>:
      mm/slub: fix stack overruns with SLUB_STATS

    Andrew Morton <akpm@linux-foundation.org>:
      Documentation/vm/slub.rst: s/Toggle/Enable/

Subsystem: mm/debug

    Vlastimil Babka <vbabka@suse.cz>:
      mm, dump_page(): do not crash with invalid mapping pointer

Subsystem: mm/pagecache

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Change readahead API", v11:
      mm: move readahead prototypes from mm.h
      mm: return void from various readahead functions
      mm: ignore return value of ->readpages
      mm: move readahead nr_pages check into read_pages
      mm: add new readahead_control API
      mm: use readahead_control to pass arguments
      mm: rename various 'offset' parameters to 'index'
      mm: rename readahead loop variable to 'i'
      mm: remove 'page_offset' from readahead loop
      mm: put readahead pages in cache earlier
      mm: add readahead address space operation
      mm: move end_index check out of readahead loop
      mm: add page_cache_readahead_unbounded
      mm: document why we don't set PageReadahead
      mm: use memalloc_nofs_save in readahead path
      fs: convert mpage_readpages to mpage_readahead
      btrfs: convert from readpages to readahead
      erofs: convert uncompressed files from readpages to readahead
      erofs: convert compressed files from readpages to readahead
      ext4: convert from readpages to readahead
      ext4: pass the inode to ext4_mpage_readpages
      f2fs: convert from readpages to readahead
      f2fs: pass the inode to f2fs_mpage_readpages
      fuse: convert from readpages to readahead
      iomap: convert from readpages to readahead

    Guoqing Jiang <guoqing.jiang@cloud.ionos.com>:
    Patch series "Introduce attach/detach_page_private to cleanup code":
      include/linux/pagemap.h: introduce attach/detach_page_private
      md: remove __clear_page_buffers and use attach/detach_page_private
      btrfs: use attach/detach_page_private
      fs/buffer.c: use attach/detach_page_private
      f2fs: use attach/detach_page_private
      iomap: use attach/detach_page_private
      ntfs: replace attach_page_buffers with attach_page_private
      orangefs: use attach/detach_page_private
      buffer_head.h: remove attach_page_buffers
      mm/migrate.c: call detach_page_private to cleanup code
      mm_types.h: change set_page_private to inline function

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/filemap.c: remove misleading comment

    Chao Yu <yuchao0@huawei.com>:
      mm/page-writeback.c: remove unused variable

    NeilBrown <neilb@suse.de>:
      mm/writeback: replace PF_LESS_THROTTLE with PF_LOCAL_THROTTLE
      mm/writeback: discard NR_UNSTABLE_NFS, use NR_WRITEBACK instead

Subsystem: mm/gup

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm/gup.c: update the documentation

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup: introduce pin_user_pages_unlocked
      ivtv: convert get_user_pages() --> pin_user_pages()

    Miles Chen <miles.chen@mediatek.com>:
      mm/gup.c: further document vma_permits_fault()

Subsystem: mm/swap

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/swapfile: use list_{prev,next}_entry() instead of open-coding

    Qian Cai <cai@lca.pw>:
      mm/swap_state: fix a data race in swapin_nr_pages

    Andrea Righi <andrea.righi@canonical.com>:
      mm: swap: properly update readahead statistics in unuse_pte_range()

    Wei Yang <richard.weiyang@gmail.com>:
      mm/swapfile.c: offset is only used when there is more slots
      mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually exclusive
      mm/swapfile.c: remove the unnecessary goto for SSD case
      mm/swapfile.c: simplify the calculation of n_goal
      mm/swapfile.c: remove the extra check in scan_swap_map_slots()
      mm/swapfile.c: found_free could be represented by (tmp < max)
      mm/swapfile.c: tmp is always smaller than max
      mm/swapfile.c: omit a duplicate code by compare tmp and max first

    Huang Ying <ying.huang@intel.com>:
      swap: try to scan more free slots even when fragmented

    Wei Yang <richard.weiyang@gmail.com>:
      mm/swapfile.c: classify SWAP_MAP_XXX to make it more readable
      mm/swapfile.c: __swap_entry_free() always free 1 entry

    Huang Ying <ying.huang@intel.com>:
      mm/swapfile.c: use prandom_u32_max()
      swap: reduce lock contention on swap cache from swap slots allocation

    Randy Dunlap <rdunlap@infradead.org>:
      mm: swapfile: fix /proc/swaps heading and Size/Used/Priority alignment

    Miaohe Lin <linmiaohe@huawei.com>:
      include/linux/swap.h: delete meaningless __add_to_swap_cache() declaration

Subsystem: mm/memcg

    Yafang Shao <laoar.shao@gmail.com>:
      mm, memcg: add workingset_restore in memory.stat

    Kaixu Xia <kaixuxia@tencent.com>:
      mm: memcontrol: simplify value comparison between count and limit

    Shakeel Butt <shakeelb@google.com>:
      memcg: expose root cgroup's memory.stat

    Jakub Kicinski <kuba@kernel.org>:
    Patch series "memcg: Slow down swap allocation as the available space gets:
      mm/memcg: prepare for swap over-high accounting and penalty calculation
      mm/memcg: move penalty delay clamping out of calculate_high_delay()
      mm/memcg: move cgroup high memory limit setting into struct page_counter
      mm/memcg: automatically penalize tasks with high swap use

    Zefan Li <lizefan@huawei.com>:
      memcg: fix memcg_kmem_bypass() for remote memcg charging

Subsystem: mm/pagemap

    Steven Price <steven.price@arm.com>:
    Patch series "Fix W+X debug feature on x86":
      x86: mm: ptdump: calculate effective permissions correctly
      mm: ptdump: expand type of 'val' in note_page()

    Huang Ying <ying.huang@intel.com>:
      /proc/PID/smaps: Add PMD migration entry parsing

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/memory: remove unnecessary pte_devmap case in copy_one_pte()

Subsystem: mm/memory-failure

    Wetp Zhang <wetp.zy@linux.alibaba.com>:
      mm, memory_failure: don't send BUS_MCEERR_AO for action required error

Subsystem: mm/vmalloc

    Christoph Hellwig <hch@lst.de>:
    Patch series "decruft the vmalloc API", v2:
      x86/hyperv: use vmalloc_exec for the hypercall page
      x86: fix vmap arguments in map_irq_stack
      staging: android: ion: use vmap instead of vm_map_ram
      staging: media: ipu3: use vmap instead of reimplementing it
      dma-mapping: use vmap insted of reimplementing it
      powerpc: add an ioremap_phb helper
      powerpc: remove __ioremap_at and __iounmap_at
      mm: remove __get_vm_area
      mm: unexport unmap_kernel_range_noflush
      mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING
      mm: only allow page table mappings for built-in zsmalloc
      mm: pass addr as unsigned long to vb_free
      mm: remove vmap_page_range_noflush and vunmap_page_range
      mm: rename vmap_page_range to map_kernel_range
      mm: don't return the number of pages from map_kernel_range{,_noflush}
      mm: remove map_vm_range
      mm: remove unmap_vmap_area
      mm: remove the prot argument from vm_map_ram
      mm: enforce that vmap can't map pages executable
      gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc
      mm: remove the pgprot argument to __vmalloc
      mm: remove the prot argument to __vmalloc_node
      mm: remove both instances of __vmalloc_node_flags
      mm: remove __vmalloc_node_flags_caller
      mm: switch the test_vmalloc module to use __vmalloc_node
      mm: remove vmalloc_user_node_flags
      arm64: use __vmalloc_node in arch_alloc_vmap_stack
      powerpc: use __vmalloc_node in alloc_vm_stack
      s390: use __vmalloc_node in stack_alloc

    Joerg Roedel <jroedel@suse.de>:
    Patch series "mm: Get rid of vmalloc_sync_(un)mappings()", v3:
      mm: add functions to track page directory modifications
      mm/vmalloc: track which page-table levels were modified
      mm/ioremap: track which page-table levels were modified
      x86/mm/64: implement arch_sync_kernel_mappings()
      x86/mm/32: implement arch_sync_kernel_mappings()
      mm: remove vmalloc_sync_(un)mappings()
      x86/mm: remove vmalloc faulting

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix clang compilation warning due to stack protector

    Kees Cook <keescook@chromium.org>:
      ubsan: entirely disable alignment checks under UBSAN_TRAP

    Jing Xia <jing.xia@unisoc.com>:
      mm/mm_init.c: report kasan-tag information stored in page->flags

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: move kasan_report() into report.c

 Documentation/admin-guide/cgroup-v2.rst            |   24 +
 Documentation/core-api/cachetlb.rst                |    2 
 Documentation/filesystems/locking.rst              |    6 
 Documentation/filesystems/proc.rst                 |    4 
 Documentation/filesystems/vfs.rst                  |   15 
 Documentation/vm/slub.rst                          |    2 
 arch/arm/configs/omap2plus_defconfig               |    2 
 arch/arm64/include/asm/pgtable.h                   |    3 
 arch/arm64/include/asm/vmap_stack.h                |    6 
 arch/arm64/mm/dump.c                               |    2 
 arch/parisc/include/asm/pgtable.h                  |    2 
 arch/powerpc/include/asm/io.h                      |   10 
 arch/powerpc/include/asm/pci-bridge.h              |    2 
 arch/powerpc/kernel/irq.c                          |    5 
 arch/powerpc/kernel/isa-bridge.c                   |   28 +
 arch/powerpc/kernel/pci_64.c                       |   56 +-
 arch/powerpc/mm/ioremap_64.c                       |   50 --
 arch/riscv/include/asm/pgtable.h                   |    4 
 arch/riscv/mm/ptdump.c                             |    2 
 arch/s390/kernel/setup.c                           |    9 
 arch/sh/kernel/cpu/sh4/sq.c                        |    3 
 arch/x86/hyperv/hv_init.c                          |    5 
 arch/x86/include/asm/kvm_host.h                    |    3 
 arch/x86/include/asm/pgtable-2level_types.h        |    2 
 arch/x86/include/asm/pgtable-3level_types.h        |    2 
 arch/x86/include/asm/pgtable_64_types.h            |    2 
 arch/x86/include/asm/pgtable_types.h               |    8 
 arch/x86/include/asm/switch_to.h                   |   23 -
 arch/x86/kernel/irq_64.c                           |    2 
 arch/x86/kernel/setup_percpu.c                     |    6 
 arch/x86/kvm/svm/sev.c                             |    3 
 arch/x86/mm/dump_pagetables.c                      |   35 +
 arch/x86/mm/fault.c                                |  196 ----------
 arch/x86/mm/init_64.c                              |    5 
 arch/x86/mm/pti.c                                  |    8 
 arch/x86/mm/tlb.c                                  |   37 -
 block/blk-core.c                                   |    1 
 drivers/acpi/apei/ghes.c                           |    6 
 drivers/base/node.c                                |    2 
 drivers/block/drbd/drbd_bitmap.c                   |    4 
 drivers/block/loop.c                               |    2 
 drivers/dax/device.c                               |    1 
 drivers/gpu/drm/drm_scatter.c                      |   11 
 drivers/gpu/drm/etnaviv/etnaviv_dump.c             |    4 
 drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c   |    2 
 drivers/lightnvm/pblk-init.c                       |    5 
 drivers/md/dm-bufio.c                              |    4 
 drivers/md/md-bitmap.c                             |   12 
 drivers/media/common/videobuf2/videobuf2-dma-sg.c  |    3 
 drivers/media/common/videobuf2/videobuf2-vmalloc.c |    3 
 drivers/media/pci/ivtv/ivtv-udma.c                 |   19 -
 drivers/media/pci/ivtv/ivtv-yuv.c                  |   17 
 drivers/media/pci/ivtv/ivtvfb.c                    |    4 
 drivers/mtd/ubi/io.c                               |    4 
 drivers/pcmcia/electra_cf.c                        |   45 --
 drivers/scsi/sd_zbc.c                              |    3 
 drivers/staging/android/ion/ion_heap.c             |    4 
 drivers/staging/media/ipu3/ipu3-css-pool.h         |    4 
 drivers/staging/media/ipu3/ipu3-dmamap.c           |   30 -
 fs/block_dev.c                                     |    7 
 fs/btrfs/disk-io.c                                 |    4 
 fs/btrfs/extent_io.c                               |   64 ---
 fs/btrfs/extent_io.h                               |    3 
 fs/btrfs/inode.c                                   |   39 --
 fs/buffer.c                                        |   23 -
 fs/erofs/data.c                                    |   41 --
 fs/erofs/decompressor.c                            |    2 
 fs/erofs/zdata.c                                   |   31 -
 fs/exfat/inode.c                                   |    7 
 fs/ext2/inode.c                                    |   10 
 fs/ext4/ext4.h                                     |    5 
 fs/ext4/inode.c                                    |   25 -
 fs/ext4/readpage.c                                 |   25 -
 fs/ext4/verity.c                                   |   35 -
 fs/f2fs/data.c                                     |   56 +-
 fs/f2fs/f2fs.h                                     |   14 
 fs/f2fs/verity.c                                   |   35 -
 fs/fat/inode.c                                     |    7 
 fs/file_table.c                                    |    1 
 fs/fs-writeback.c                                  |    1 
 fs/fuse/file.c                                     |  100 +----
 fs/gfs2/aops.c                                     |   23 -
 fs/gfs2/dir.c                                      |    9 
 fs/gfs2/quota.c                                    |    2 
 fs/hpfs/file.c                                     |    7 
 fs/iomap/buffered-io.c                             |  113 +----
 fs/iomap/trace.h                                   |    2 
 fs/isofs/inode.c                                   |    7 
 fs/jfs/inode.c                                     |    7 
 fs/mpage.c                                         |   38 --
 fs/nfs/blocklayout/extent_tree.c                   |    2 
 fs/nfs/internal.h                                  |   10 
 fs/nfs/write.c                                     |    4 
 fs/nfsd/vfs.c                                      |    9 
 fs/nilfs2/inode.c                                  |   15 
 fs/ntfs/aops.c                                     |    2 
 fs/ntfs/malloc.h                                   |    2 
 fs/ntfs/mft.c                                      |    2 
 fs/ocfs2/aops.c                                    |   34 -
 fs/ocfs2/dlm/dlmmaster.c                           |    1 
 fs/ocfs2/ocfs2.h                                   |    4 
 fs/ocfs2/slot_map.c                                |   46 +-
 fs/ocfs2/super.c                                   |   21 +
 fs/omfs/file.c                                     |    7 
 fs/open.c                                          |    3 
 fs/orangefs/inode.c                                |   32 -
 fs/proc/meminfo.c                                  |    3 
 fs/proc/task_mmu.c                                 |   16 
 fs/qnx6/inode.c                                    |    7 
 fs/reiserfs/inode.c                                |    8 
 fs/squashfs/block.c                                |  273 +++++++-------
 fs/squashfs/decompressor.h                         |    5 
 fs/squashfs/decompressor_multi.c                   |    9 
 fs/squashfs/decompressor_multi_percpu.c            |   17 
 fs/squashfs/decompressor_single.c                  |    9 
 fs/squashfs/lz4_wrapper.c                          |   17 
 fs/squashfs/lzo_wrapper.c                          |   17 
 fs/squashfs/squashfs.h                             |    4 
 fs/squashfs/xz_wrapper.c                           |   51 +-
 fs/squashfs/zlib_wrapper.c                         |   63 +--
 fs/squashfs/zstd_wrapper.c                         |   62 +--
 fs/sync.c                                          |    6 
 fs/ubifs/debug.c                                   |    2 
 fs/ubifs/lprops.c                                  |    2 
 fs/ubifs/lpt_commit.c                              |    4 
 fs/ubifs/orphan.c                                  |    2 
 fs/udf/inode.c                                     |    7 
 fs/xfs/kmem.c                                      |    2 
 fs/xfs/xfs_aops.c                                  |   13 
 fs/xfs/xfs_buf.c                                   |    2 
 fs/zonefs/super.c                                  |    7 
 include/asm-generic/5level-fixup.h                 |    5 
 include/asm-generic/pgtable.h                      |   27 +
 include/linux/buffer_head.h                        |    8 
 include/linux/fs.h                                 |   18 
 include/linux/iomap.h                              |    3 
 include/linux/memcontrol.h                         |    4 
 include/linux/mm.h                                 |   67 ++-
 include/linux/mm_types.h                           |    6 
 include/linux/mmzone.h                             |    1 
 include/linux/mpage.h                              |    4 
 include/linux/page_counter.h                       |    8 
 include/linux/pagemap.h                            |  193 ++++++++++
 include/linux/ptdump.h                             |    3 
 include/linux/sched.h                              |    3 
 include/linux/swap.h                               |   17 
 include/linux/vmalloc.h                            |   49 +-
 include/linux/zsmalloc.h                           |    2 
 include/trace/events/erofs.h                       |    6 
 include/trace/events/f2fs.h                        |    6 
 include/trace/events/writeback.h                   |    5 
 kernel/bpf/core.c                                  |    6 
 kernel/bpf/syscall.c                               |   29 -
 kernel/dma/remap.c                                 |   48 --
 kernel/groups.c                                    |    2 
 kernel/module.c                                    |    3 
 kernel/notifier.c                                  |    1 
 kernel/sys.c                                       |    2 
 kernel/trace/trace.c                               |   12 
 lib/Kconfig.ubsan                                  |    2 
 lib/ioremap.c                                      |   46 +-
 lib/test_vmalloc.c                                 |   26 -
 mm/Kconfig                                         |    4 
 mm/debug.c                                         |   56 ++
 mm/fadvise.c                                       |    6 
 mm/filemap.c                                       |    1 
 mm/gup.c                                           |   77 +++-
 mm/internal.h                                      |   14 
 mm/kasan/Makefile                                  |   21 -
 mm/kasan/common.c                                  |   19 -
 mm/kasan/report.c                                  |   22 +
 mm/memcontrol.c                                    |  198 +++++++---
 mm/memory-failure.c                                |   15 
 mm/memory.c                                        |    2 
 mm/migrate.c                                       |    9 
 mm/mm_init.c                                       |   16 
 mm/nommu.c                                         |   52 +-
 mm/page-writeback.c                                |   62 ++-
 mm/page_alloc.c                                    |    7 
 mm/percpu.c                                        |    2 
 mm/ptdump.c                                        |   17 
 mm/readahead.c                                     |  349 ++++++++++--------
 mm/slab_common.c                                   |    3 
 mm/slub.c                                          |   67 ++-
 mm/swap_state.c                                    |    5 
 mm/swapfile.c                                      |  194 ++++++----
 mm/util.c                                          |    2 
 mm/vmalloc.c                                       |  399 ++++++++-------------
 mm/vmscan.c                                        |    4 
 mm/vmstat.c                                        |   11 
 mm/zsmalloc.c                                      |   12 
 net/bridge/netfilter/ebtables.c                    |    6 
 net/ceph/ceph_common.c                             |    3 
 sound/core/memalloc.c                              |    2 
 sound/core/pcm_memory.c                            |    2 
 195 files changed, 2292 insertions(+), 2288 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-06-02  4:44 incoming Andrew Morton
@ 2020-06-02 20:08 ` Andrew Morton
  2020-06-02 20:45   ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-06-02 20:08 UTC (permalink / raw)
  To: Linus Torvalds, mm-commits, linux-mm

The local_lock merge made rather a mess of all of this.  I'm 
cooking up a full resend of the same material.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-06-02  4:44 Andrew Morton
  2020-06-02 20:08 ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-06-02  4:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


A few little subsystems and a start of a lot of MM patches.

128 patches, based on 9bf9511e3d9f328c03f6f79bfb741c3d18f2f2c0:

Subsystems affected by this patch series:

  squashfs
  ocfs2
  parisc
  vfs
  mm/slab-generic
  mm/slub
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/memory-failure
  mm/vmalloc
  mm/kasan

Subsystem: squashfs

    Philippe Liard <pliard@google.com>:
      squashfs: migrate from ll_rw_block usage to BIO

Subsystem: ocfs2

    Jules Irenge <jbi.octave@gmail.com>:
      ocfs2: add missing annotation for dlm_empty_lockres()

    Gang He <ghe@suse.com>:
      ocfs2: mount shared volume without ha stack

Subsystem: parisc

    Andrew Morton <akpm@linux-foundation.org>:
      arch/parisc/include/asm/pgtable.h: remove unused `old_pte'

Subsystem: vfs

    Jeff Layton <jlayton@redhat.com>:
    Patch series "vfs: have syncfs() return error when there are writeback:
      vfs: track per-sb writeback errors and report them to syncfs
      fs/buffer.c: record blockdev write errors in super_block that it backs

Subsystem: mm/slab-generic

    Vlastimil Babka <vbabka@suse.cz>:
      usercopy: mark dma-kmalloc caches as usercopy caches

Subsystem: mm/slub

    Dongli Zhang <dongli.zhang@oracle.com>:
      mm/slub.c: fix corrupted freechain in deactivate_slab()

    Christoph Lameter <cl@linux.com>:
      slub: Remove userspace notifier for cache add/remove

    Christopher Lameter <cl@linux.com>:
      slub: remove kmalloc under list_lock from list_slab_objects() V2

    Qian Cai <cai@lca.pw>:
      mm/slub: fix stack overruns with SLUB_STATS

    Andrew Morton <akpm@linux-foundation.org>:
      Documentation/vm/slub.rst: s/Toggle/Enable/

Subsystem: mm/debug

    Vlastimil Babka <vbabka@suse.cz>:
      mm, dump_page(): do not crash with invalid mapping pointer

Subsystem: mm/pagecache

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
    Patch series "Change readahead API", v11:
      mm: move readahead prototypes from mm.h
      mm: return void from various readahead functions
      mm: ignore return value of ->readpages
      mm: move readahead nr_pages check into read_pages
      mm: add new readahead_control API
      mm: use readahead_control to pass arguments
      mm: rename various 'offset' parameters to 'index'
      mm: rename readahead loop variable to 'i'
      mm: remove 'page_offset' from readahead loop
      mm: put readahead pages in cache earlier
      mm: add readahead address space operation
      mm: move end_index check out of readahead loop
      mm: add page_cache_readahead_unbounded
      mm: document why we don't set PageReadahead
      mm: use memalloc_nofs_save in readahead path
      fs: convert mpage_readpages to mpage_readahead
      btrfs: convert from readpages to readahead
      erofs: convert uncompressed files from readpages to readahead
      erofs: convert compressed files from readpages to readahead
      ext4: convert from readpages to readahead
      ext4: pass the inode to ext4_mpage_readpages
      f2fs: convert from readpages to readahead
      f2fs: pass the inode to f2fs_mpage_readpages
      fuse: convert from readpages to readahead
      iomap: convert from readpages to readahead

    Guoqing Jiang <guoqing.jiang@cloud.ionos.com>:
    Patch series "Introduce attach/detach_page_private to cleanup code":
      include/linux/pagemap.h: introduce attach/detach_page_private
      md: remove __clear_page_buffers and use attach/detach_page_private
      btrfs: use attach/detach_page_private
      fs/buffer.c: use attach/detach_page_private
      f2fs: use attach/detach_page_private
      iomap: use attach/detach_page_private
      ntfs: replace attach_page_buffers with attach_page_private
      orangefs: use attach/detach_page_private
      buffer_head.h: remove attach_page_buffers
      mm/migrate.c: call detach_page_private to cleanup code
      mm_types.h: change set_page_private to inline function

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/filemap.c: remove misleading comment

    Chao Yu <yuchao0@huawei.com>:
      mm/page-writeback.c: remove unused variable

    NeilBrown <neilb@suse.de>:
      mm/writeback: replace PF_LESS_THROTTLE with PF_LOCAL_THROTTLE
      mm/writeback: discard NR_UNSTABLE_NFS, use NR_WRITEBACK instead

Subsystem: mm/gup

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm/gup.c: update the documentation

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup: introduce pin_user_pages_unlocked
      ivtv: convert get_user_pages() --> pin_user_pages()

    Miles Chen <miles.chen@mediatek.com>:
      mm/gup.c: further document vma_permits_fault()

Subsystem: mm/swap

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/swapfile: use list_{prev,next}_entry() instead of open-coding

    Qian Cai <cai@lca.pw>:
      mm/swap_state: fix a data race in swapin_nr_pages

    Andrea Righi <andrea.righi@canonical.com>:
      mm: swap: properly update readahead statistics in unuse_pte_range()

    Wei Yang <richard.weiyang@gmail.com>:
      mm/swapfile.c: offset is only used when there is more slots
      mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually exclusive
      mm/swapfile.c: remove the unnecessary goto for SSD case
      mm/swapfile.c: simplify the calculation of n_goal
      mm/swapfile.c: remove the extra check in scan_swap_map_slots()
      mm/swapfile.c: found_free could be represented by (tmp < max)
      mm/swapfile.c: tmp is always smaller than max
      mm/swapfile.c: omit a duplicate code by compare tmp and max first

    Huang Ying <ying.huang@intel.com>:
      swap: try to scan more free slots even when fragmented

    Wei Yang <richard.weiyang@gmail.com>:
      mm/swapfile.c: classify SWAP_MAP_XXX to make it more readable
      mm/swapfile.c: __swap_entry_free() always free 1 entry

    Huang Ying <ying.huang@intel.com>:
      mm/swapfile.c: use prandom_u32_max()
      swap: reduce lock contention on swap cache from swap slots allocation

    Randy Dunlap <rdunlap@infradead.org>:
      mm: swapfile: fix /proc/swaps heading and Size/Used/Priority alignment

    Miaohe Lin <linmiaohe@huawei.com>:
      include/linux/swap.h: delete meaningless __add_to_swap_cache() declaration

Subsystem: mm/memcg

    Yafang Shao <laoar.shao@gmail.com>:
      mm, memcg: add workingset_restore in memory.stat

    Kaixu Xia <kaixuxia@tencent.com>:
      mm: memcontrol: simplify value comparison between count and limit

    Shakeel Butt <shakeelb@google.com>:
      memcg: expose root cgroup's memory.stat

    Jakub Kicinski <kuba@kernel.org>:
    Patch series "memcg: Slow down swap allocation as the available space gets:
      mm/memcg: prepare for swap over-high accounting and penalty calculation
      mm/memcg: move penalty delay clamping out of calculate_high_delay()
      mm/memcg: move cgroup high memory limit setting into struct page_counter
      mm/memcg: automatically penalize tasks with high swap use

    Zefan Li <lizefan@huawei.com>:
      memcg: fix memcg_kmem_bypass() for remote memcg charging

Subsystem: mm/pagemap

    Steven Price <steven.price@arm.com>:
    Patch series "Fix W+X debug feature on x86":
      x86: mm: ptdump: calculate effective permissions correctly
      mm: ptdump: expand type of 'val' in note_page()

    Huang Ying <ying.huang@intel.com>:
      /proc/PID/smaps: Add PMD migration entry parsing

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/memory: remove unnecessary pte_devmap case in copy_one_pte()

Subsystem: mm/memory-failure

    Wetp Zhang <wetp.zy@linux.alibaba.com>:
      mm, memory_failure: don't send BUS_MCEERR_AO for action required error

Subsystem: mm/vmalloc

    Christoph Hellwig <hch@lst.de>:
    Patch series "decruft the vmalloc API", v2:
      x86/hyperv: use vmalloc_exec for the hypercall page
      x86: fix vmap arguments in map_irq_stack
      staging: android: ion: use vmap instead of vm_map_ram
      staging: media: ipu3: use vmap instead of reimplementing it
      dma-mapping: use vmap insted of reimplementing it
      powerpc: add an ioremap_phb helper
      powerpc: remove __ioremap_at and __iounmap_at
      mm: remove __get_vm_area
      mm: unexport unmap_kernel_range_noflush
      mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING
      mm: only allow page table mappings for built-in zsmalloc
      mm: pass addr as unsigned long to vb_free
      mm: remove vmap_page_range_noflush and vunmap_page_range
      mm: rename vmap_page_range to map_kernel_range
      mm: don't return the number of pages from map_kernel_range{,_noflush}
      mm: remove map_vm_range
      mm: remove unmap_vmap_area
      mm: remove the prot argument from vm_map_ram
      mm: enforce that vmap can't map pages executable
      gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc
      mm: remove the pgprot argument to __vmalloc
      mm: remove the prot argument to __vmalloc_node
      mm: remove both instances of __vmalloc_node_flags
      mm: remove __vmalloc_node_flags_caller
      mm: switch the test_vmalloc module to use __vmalloc_node
      mm: remove vmalloc_user_node_flags
      arm64: use __vmalloc_node in arch_alloc_vmap_stack
      powerpc: use __vmalloc_node in alloc_vm_stack
      s390: use __vmalloc_node in stack_alloc

    Joerg Roedel <jroedel@suse.de>:
    Patch series "mm: Get rid of vmalloc_sync_(un)mappings()", v3:
      mm: add functions to track page directory modifications
      mm/vmalloc: track which page-table levels were modified
      mm/ioremap: track which page-table levels were modified
      x86/mm/64: implement arch_sync_kernel_mappings()
      x86/mm/32: implement arch_sync_kernel_mappings()
      mm: remove vmalloc_sync_(un)mappings()
      x86/mm: remove vmalloc faulting

Subsystem: mm/kasan

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: fix clang compilation warning due to stack protector

    Kees Cook <keescook@chromium.org>:
      ubsan: entirely disable alignment checks under UBSAN_TRAP

    Jing Xia <jing.xia@unisoc.com>:
      mm/mm_init.c: report kasan-tag information stored in page->flags

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: move kasan_report() into report.c

 Documentation/admin-guide/cgroup-v2.rst            |   24 +
 Documentation/core-api/cachetlb.rst                |    2 
 Documentation/filesystems/locking.rst              |    6 
 Documentation/filesystems/proc.rst                 |    4 
 Documentation/filesystems/vfs.rst                  |   15 
 Documentation/vm/slub.rst                          |    2 
 arch/arm/configs/omap2plus_defconfig               |    2 
 arch/arm64/include/asm/pgtable.h                   |    3 
 arch/arm64/include/asm/vmap_stack.h                |    6 
 arch/arm64/mm/dump.c                               |    2 
 arch/parisc/include/asm/pgtable.h                  |    2 
 arch/powerpc/include/asm/io.h                      |   10 
 arch/powerpc/include/asm/pci-bridge.h              |    2 
 arch/powerpc/kernel/irq.c                          |    5 
 arch/powerpc/kernel/isa-bridge.c                   |   28 +
 arch/powerpc/kernel/pci_64.c                       |   56 +-
 arch/powerpc/mm/ioremap_64.c                       |   50 --
 arch/riscv/include/asm/pgtable.h                   |    4 
 arch/riscv/mm/ptdump.c                             |    2 
 arch/s390/kernel/setup.c                           |    9 
 arch/sh/kernel/cpu/sh4/sq.c                        |    3 
 arch/x86/hyperv/hv_init.c                          |    5 
 arch/x86/include/asm/kvm_host.h                    |    3 
 arch/x86/include/asm/pgtable-2level_types.h        |    2 
 arch/x86/include/asm/pgtable-3level_types.h        |    2 
 arch/x86/include/asm/pgtable_64_types.h            |    2 
 arch/x86/include/asm/pgtable_types.h               |    8 
 arch/x86/include/asm/switch_to.h                   |   23 -
 arch/x86/kernel/irq_64.c                           |    2 
 arch/x86/kernel/setup_percpu.c                     |    6 
 arch/x86/kvm/svm/sev.c                             |    3 
 arch/x86/mm/dump_pagetables.c                      |   35 +
 arch/x86/mm/fault.c                                |  196 ----------
 arch/x86/mm/init_64.c                              |    5 
 arch/x86/mm/pti.c                                  |    8 
 arch/x86/mm/tlb.c                                  |   37 -
 block/blk-core.c                                   |    1 
 drivers/acpi/apei/ghes.c                           |    6 
 drivers/base/node.c                                |    2 
 drivers/block/drbd/drbd_bitmap.c                   |    4 
 drivers/block/loop.c                               |    2 
 drivers/dax/device.c                               |    1 
 drivers/gpu/drm/drm_scatter.c                      |   11 
 drivers/gpu/drm/etnaviv/etnaviv_dump.c             |    4 
 drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c   |    2 
 drivers/lightnvm/pblk-init.c                       |    5 
 drivers/md/dm-bufio.c                              |    4 
 drivers/md/md-bitmap.c                             |   12 
 drivers/media/common/videobuf2/videobuf2-dma-sg.c  |    3 
 drivers/media/common/videobuf2/videobuf2-vmalloc.c |    3 
 drivers/media/pci/ivtv/ivtv-udma.c                 |   19 -
 drivers/media/pci/ivtv/ivtv-yuv.c                  |   17 
 drivers/media/pci/ivtv/ivtvfb.c                    |    4 
 drivers/mtd/ubi/io.c                               |    4 
 drivers/pcmcia/electra_cf.c                        |   45 --
 drivers/scsi/sd_zbc.c                              |    3 
 drivers/staging/android/ion/ion_heap.c             |    4 
 drivers/staging/media/ipu3/ipu3-css-pool.h         |    4 
 drivers/staging/media/ipu3/ipu3-dmamap.c           |   30 -
 fs/block_dev.c                                     |    7 
 fs/btrfs/disk-io.c                                 |    4 
 fs/btrfs/extent_io.c                               |   64 ---
 fs/btrfs/extent_io.h                               |    3 
 fs/btrfs/inode.c                                   |   39 --
 fs/buffer.c                                        |   23 -
 fs/erofs/data.c                                    |   41 --
 fs/erofs/decompressor.c                            |    2 
 fs/erofs/zdata.c                                   |   31 -
 fs/exfat/inode.c                                   |    7 
 fs/ext2/inode.c                                    |   10 
 fs/ext4/ext4.h                                     |    5 
 fs/ext4/inode.c                                    |   25 -
 fs/ext4/readpage.c                                 |   25 -
 fs/ext4/verity.c                                   |   35 -
 fs/f2fs/data.c                                     |   56 +-
 fs/f2fs/f2fs.h                                     |   14 
 fs/f2fs/verity.c                                   |   35 -
 fs/fat/inode.c                                     |    7 
 fs/file_table.c                                    |    1 
 fs/fs-writeback.c                                  |    1 
 fs/fuse/file.c                                     |  100 +----
 fs/gfs2/aops.c                                     |   23 -
 fs/gfs2/dir.c                                      |    9 
 fs/gfs2/quota.c                                    |    2 
 fs/hpfs/file.c                                     |    7 
 fs/iomap/buffered-io.c                             |  113 +----
 fs/iomap/trace.h                                   |    2 
 fs/isofs/inode.c                                   |    7 
 fs/jfs/inode.c                                     |    7 
 fs/mpage.c                                         |   38 --
 fs/nfs/blocklayout/extent_tree.c                   |    2 
 fs/nfs/internal.h                                  |   10 
 fs/nfs/write.c                                     |    4 
 fs/nfsd/vfs.c                                      |    9 
 fs/nilfs2/inode.c                                  |   15 
 fs/ntfs/aops.c                                     |    2 
 fs/ntfs/malloc.h                                   |    2 
 fs/ntfs/mft.c                                      |    2 
 fs/ocfs2/aops.c                                    |   34 -
 fs/ocfs2/dlm/dlmmaster.c                           |    1 
 fs/ocfs2/ocfs2.h                                   |    4 
 fs/ocfs2/slot_map.c                                |   46 +-
 fs/ocfs2/super.c                                   |   21 +
 fs/omfs/file.c                                     |    7 
 fs/open.c                                          |    3 
 fs/orangefs/inode.c                                |   32 -
 fs/proc/meminfo.c                                  |    3 
 fs/proc/task_mmu.c                                 |   16 
 fs/qnx6/inode.c                                    |    7 
 fs/reiserfs/inode.c                                |    8 
 fs/squashfs/block.c                                |  273 +++++++-------
 fs/squashfs/decompressor.h                         |    5 
 fs/squashfs/decompressor_multi.c                   |    9 
 fs/squashfs/decompressor_multi_percpu.c            |   17 
 fs/squashfs/decompressor_single.c                  |    9 
 fs/squashfs/lz4_wrapper.c                          |   17 
 fs/squashfs/lzo_wrapper.c                          |   17 
 fs/squashfs/squashfs.h                             |    4 
 fs/squashfs/xz_wrapper.c                           |   51 +-
 fs/squashfs/zlib_wrapper.c                         |   63 +--
 fs/squashfs/zstd_wrapper.c                         |   62 +--
 fs/sync.c                                          |    6 
 fs/ubifs/debug.c                                   |    2 
 fs/ubifs/lprops.c                                  |    2 
 fs/ubifs/lpt_commit.c                              |    4 
 fs/ubifs/orphan.c                                  |    2 
 fs/udf/inode.c                                     |    7 
 fs/xfs/kmem.c                                      |    2 
 fs/xfs/xfs_aops.c                                  |   13 
 fs/xfs/xfs_buf.c                                   |    2 
 fs/zonefs/super.c                                  |    7 
 include/asm-generic/5level-fixup.h                 |    5 
 include/asm-generic/pgtable.h                      |   27 +
 include/linux/buffer_head.h                        |    8 
 include/linux/fs.h                                 |   18 
 include/linux/iomap.h                              |    3 
 include/linux/memcontrol.h                         |    4 
 include/linux/mm.h                                 |   67 ++-
 include/linux/mm_types.h                           |    6 
 include/linux/mmzone.h                             |    1 
 include/linux/mpage.h                              |    4 
 include/linux/page_counter.h                       |    8 
 include/linux/pagemap.h                            |  193 ++++++++++
 include/linux/ptdump.h                             |    3 
 include/linux/sched.h                              |    3 
 include/linux/swap.h                               |   17 
 include/linux/vmalloc.h                            |   49 +-
 include/linux/zsmalloc.h                           |    2 
 include/trace/events/erofs.h                       |    6 
 include/trace/events/f2fs.h                        |    6 
 include/trace/events/writeback.h                   |    5 
 kernel/bpf/core.c                                  |    6 
 kernel/bpf/syscall.c                               |   29 -
 kernel/dma/remap.c                                 |   48 --
 kernel/groups.c                                    |    2 
 kernel/module.c                                    |    3 
 kernel/notifier.c                                  |    1 
 kernel/sys.c                                       |    2 
 kernel/trace/trace.c                               |   12 
 lib/Kconfig.ubsan                                  |    2 
 lib/ioremap.c                                      |   46 +-
 lib/test_vmalloc.c                                 |   26 -
 mm/Kconfig                                         |    4 
 mm/debug.c                                         |   56 ++
 mm/fadvise.c                                       |    6 
 mm/filemap.c                                       |    1 
 mm/gup.c                                           |   77 +++-
 mm/internal.h                                      |   14 
 mm/kasan/Makefile                                  |   21 -
 mm/kasan/common.c                                  |   19 -
 mm/kasan/report.c                                  |   22 +
 mm/memcontrol.c                                    |  198 +++++++---
 mm/memory-failure.c                                |   15 
 mm/memory.c                                        |    2 
 mm/migrate.c                                       |    9 
 mm/mm_init.c                                       |   16 
 mm/nommu.c                                         |   52 +-
 mm/page-writeback.c                                |   62 ++-
 mm/page_alloc.c                                    |    7 
 mm/percpu.c                                        |    2 
 mm/ptdump.c                                        |   17 
 mm/readahead.c                                     |  349 ++++++++++--------
 mm/slab_common.c                                   |    3 
 mm/slub.c                                          |   67 ++-
 mm/swap_state.c                                    |    5 
 mm/swapfile.c                                      |  194 ++++++----
 mm/util.c                                          |    2 
 mm/vmalloc.c                                       |  399 ++++++++-------------
 mm/vmscan.c                                        |    4 
 mm/vmstat.c                                        |   11 
 mm/zsmalloc.c                                      |   12 
 net/bridge/netfilter/ebtables.c                    |    6 
 net/ceph/ceph_common.c                             |    3 
 sound/core/memalloc.c                              |    2 
 sound/core/pcm_memory.c                            |    2 
 195 files changed, 2292 insertions(+), 2288 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-05-29 21:12       ` incoming Andrew Morton
@ 2020-05-29 21:20         ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-05-29 21:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Fri, May 29, 2020 at 2:12 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> Stupid diffstat.  Means that basically all my diffstats are very wrong.

I'm actually used to diffstats not matching 100%/

Usually it's not due to this issue - a "git diff --stat" *will* give
the stat from the actual combined diff result - but with git diffstats
the issue is that I might have gotten a patch from another source.

So the diffstat I see after-the-merge is possibly different from the
pre-merge diffstat simply due to merge issues.

So then I usually take a look at "ok, why did that diffstat differ"
and go "Ahh".

In your case, when I looked at the diffstat, I couldn't for the life
of me see how you would have gotten the diffstat you did, since I only
saw a single patch with no merge issues.

> Thanks for spotting it.
>
> I can fix that...

I can also just live with it, knowing what your workflow is. The
diffstat matching exactly just isn't that important - in fact,
different versions of "diff" can give slightly different output anyway
depending on diff algorithms even when they are looking at the exact
same before/after state. There's not necessarily always only one way
to generate a valid diff.

So to me, the diffstat is more of a guide than a hard thing, and I
want to see the rough outline,

In fact, one reason I want to see it in pull requests is actually just
that I want to get a feel for what changes even before I do the pull
or merge, so it's not just a "match against what I get" thing.

                      Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-05-29 20:38     ` incoming Linus Torvalds
@ 2020-05-29 21:12       ` Andrew Morton
  2020-05-29 21:20         ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-05-29 21:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, Linux-MM

On Fri, 29 May 2020 13:38:35 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Fri, May 29, 2020 at 1:31 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > Bah.  I got lazy (didn't want to interrupt an ongoing build) so I
> > generated the diffstat prior to folding two patches into a single one.
> > Evidently diffstat isn't as smart as I had assumed!
> 
> Ahh. Yes - given two patches, diffstat just adds up the line number
> counts for the individual diffs, it doesn't count some kind of
> "combined diff result" line counts.

Stupid diffstat.  Means that basically all my diffstats are very wrong.
Thanks for spotting it.

I can fix that...


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-05-29 20:31   ` incoming Andrew Morton
@ 2020-05-29 20:38     ` Linus Torvalds
  2020-05-29 21:12       ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-05-29 20:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Fri, May 29, 2020 at 1:31 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> Bah.  I got lazy (didn't want to interrupt an ongoing build) so I
> generated the diffstat prior to folding two patches into a single one.
> Evidently diffstat isn't as smart as I had assumed!

Ahh. Yes - given two patches, diffstat just adds up the line number
counts for the individual diffs, it doesn't count some kind of
"combined diff result" line counts.

               Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-05-28 20:10 ` incoming Linus Torvalds
@ 2020-05-29 20:31   ` Andrew Morton
  2020-05-29 20:38     ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-05-29 20:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, Linux-MM

On Thu, 28 May 2020 13:10:18 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> Hmm..
> 
> On Wed, May 27, 2020 at 10:20 PM Andrew Morton
> <akpm@linux-foundation.org> wrote:
> >
> >  fs/binfmt_elf.c                |    2 +-
> >  include/asm-generic/topology.h |    2 +-
> >  include/linux/mm.h             |   19 +++++++++++++++----
> >  mm/khugepaged.c                |    1 +
> >  mm/z3fold.c                    |    3 +++
> >  5 files changed, 21 insertions(+), 6 deletions(-)
> 
> I wonder how you generate that diffstat.
> 
> The change to <linux/mm.h> simply doesn't match what you sent me.  The
> patch you sent me that changed mm.h had this:
> 
>  include/linux/mm.h |   15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> (note 15 lines changed: it's +13 and -2) but now suddenly in your
> overall diffstat you have that
> 
>   include/linux/mm.h             |   19 +++++++++++++++----
> 
> with +15/-4.
> 
> So your diffstat simply doesn't match what you are sending. What's going on?
> 

Bah.  I got lazy (didn't want to interrupt an ongoing build) so I
generated the diffstat prior to folding two patches into a single one. 
Evidently diffstat isn't as smart as I had assumed!


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-05-28  5:20 incoming Andrew Morton
@ 2020-05-28 20:10 ` Linus Torvalds
  2020-05-29 20:31   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-05-28 20:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

Hmm..

On Wed, May 27, 2020 at 10:20 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
>  fs/binfmt_elf.c                |    2 +-
>  include/asm-generic/topology.h |    2 +-
>  include/linux/mm.h             |   19 +++++++++++++++----
>  mm/khugepaged.c                |    1 +
>  mm/z3fold.c                    |    3 +++
>  5 files changed, 21 insertions(+), 6 deletions(-)

I wonder how you generate that diffstat.

The change to <linux/mm.h> simply doesn't match what you sent me.  The
patch you sent me that changed mm.h had this:

 include/linux/mm.h |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(note 15 lines changed: it's +13 and -2) but now suddenly in your
overall diffstat you have that

  include/linux/mm.h             |   19 +++++++++++++++----

with +15/-4.

So your diffstat simply doesn't match what you are sending. What's going on?

               Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-05-28  5:20 Andrew Morton
  2020-05-28 20:10 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-05-28  5:20 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


5 fixes, based on 444fc5cde64330661bf59944c43844e7d4c2ccd8:


    Qian Cai <cai@lca.pw>:
      mm/z3fold: silence kmemleak false positives of slots

    Hugh Dickins <hughd@google.com>:
      mm,thp: stop leaking unreleased file pages

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()

    Alexander Potapenko <glider@google.com>:
      fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

    Arnd Bergmann <arnd@arndb.de>:
      include/asm-generic/topology.h: guard cpumask_of_node() macro argument

 fs/binfmt_elf.c                |    2 +-
 include/asm-generic/topology.h |    2 +-
 include/linux/mm.h             |   19 +++++++++++++++----
 mm/khugepaged.c                |    1 +
 mm/z3fold.c                    |    3 +++
 5 files changed, 21 insertions(+), 6 deletions(-)




^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-05-23  5:22 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-05-23  5:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

11 fixes, based on 444565650a5fe9c63ddf153e6198e31705dedeb2:


    David Hildenbrand <david@redhat.com>:
      device-dax: don't leak kernel memory to user space after unloading kmem

    Nick Desaulniers <ndesaulniers@google.com>:
      x86: bitops: fix build regression

    John Hubbard <jhubbard@nvidia.com>:
      rapidio: fix an error in get_user_pages_fast() error handling
      selftests/vm/.gitignore: add mremap_dontunmap
      selftests/vm/write_to_hugetlbfs.c: fix unused variable warning

    Marco Elver <elver@google.com>:
      kasan: disable branch tracing for core runtime

    Arnd Bergmann <arnd@arndb.de>:
      sh: include linux/time_types.h for sockios

    Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>:
      MAINTAINERS: update email address for Naoya Horiguchi

    Mike Rapoport <rppt@linux.ibm.com>:
      sparc32: use PUD rather than PGD to get PMD in srmmu_nocache_init()

    Uladzislau Rezki <uladzislau.rezki@sony.com>:
      z3fold: fix use-after-free when freeing handles

    Baoquan He <bhe@redhat.com>:
      MAINTAINERS: add files related to kdump

 MAINTAINERS                                     |    7 ++++++-
 arch/sh/include/uapi/asm/sockios.h              |    2 ++
 arch/sparc/mm/srmmu.c                           |    2 +-
 arch/x86/include/asm/bitops.h                   |   12 ++++++------
 drivers/dax/kmem.c                              |   14 +++++++++++---
 drivers/rapidio/devices/rio_mport_cdev.c        |    5 +++++
 mm/kasan/Makefile                               |   16 ++++++++--------
 mm/kasan/generic.c                              |    1 -
 mm/kasan/tags.c                                 |    1 -
 mm/z3fold.c                                     |   11 ++++++-----
 tools/testing/selftests/vm/.gitignore           |    1 +
 tools/testing/selftests/vm/write_to_hugetlbfs.c |    2 --
 12 files changed, 46 insertions(+), 28 deletions(-)





^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-05-14  0:50 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-05-14  0:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

7 fixes, based on 24085f70a6e1b0cb647ec92623284641d8270637:

    Yafang Shao <laoar.shao@gmail.com>:
      mm, memcg: fix inconsistent oom event behavior

    Roman Penyaev <rpenyaev@suse.de>:
      epoll: call final ep_events_available() check under the lock

    Peter Xu <peterx@redhat.com>:
      mm/gup: fix fixup_user_fault() on multiple retries

    Brian Geffon <bgeffon@google.com>:
      userfaultfd: fix remap event with MREMAP_DONTUNMAP

    Vasily Averin <vvs@virtuozzo.com>:
      ipc/util.c: sysvipc_find_ipc() incorrectly updates position index

    Andrey Konovalov <andreyknvl@google.com>:
      kasan: consistently disable debugging features
      kasan: add missing functions declarations to kasan.h

 fs/eventpoll.c             |   48 ++++++++++++++++++++++++++-------------------
 include/linux/memcontrol.h |    2 +
 ipc/util.c                 |   12 +++++------
 mm/gup.c                   |   12 ++++++-----
 mm/kasan/Makefile          |   15 +++++++++-----
 mm/kasan/kasan.h           |   34 ++++++++++++++++++++++++++++++-
 mm/mremap.c                |    2 -
 7 files changed, 86 insertions(+), 39 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-05-08  1:35 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-05-08  1:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


14 fixes and one selftest to verify the ipc fixes herein.


15 patches, based on a811c1fa0a02c062555b54651065899437bacdbe:


    Oleg Nesterov <oleg@redhat.com>:
      ipc/mqueue.c: change __do_notify() to bypass check_kill_permission()

    Yafang Shao <laoar.shao@gmail.com>:
      mm, memcg: fix error return value of mem_cgroup_css_alloc()

    David Hildenbrand <david@redhat.com>:
      mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous()

    Maciej Grochowski <maciej.grochowski@pm.me>:
      kernel/kcov.c: fix typos in kcov_remote_start documentation

    Ivan Delalande <colona@arista.com>:
      scripts/decodecode: fix trapping instruction formatting

    Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>:
      arch/x86/kvm/svm/sev.c: change flag passed to GUP fast in sev_pin_memory()

    Khazhismel Kumykov <khazhy@google.com>:
      eventpoll: fix missing wakeup for ovflist in ep_poll_callback

    Aymeric Agon-Rambosson <aymeric.agon@yandex.com>:
      scripts/gdb: repair rb_first() and rb_last()

    Waiman Long <longman@redhat.com>:
      mm/slub: fix incorrect interpretation of s->offset

    Filipe Manana <fdmanana@suse.com>:
      percpu: make pcpu_alloc() aware of current gfp context

    Roman Penyaev <rpenyaev@suse.de>:
      kselftests: introduce new epoll60 testcase for catching lost wakeups
      epoll: atomically remove wait entry on wake up

    Qiwu Chen <qiwuchen55@gmail.com>:
      mm/vmscan: remove unnecessary argument description of isolate_lru_pages()

    Kees Cook <keescook@chromium.org>:
      ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST

    Henry Willard <henry.willard@oracle.com>:
      mm: limit boost_watermark on small zones

 arch/x86/kvm/svm/sev.c                                        |    2 
 fs/eventpoll.c                                                |   61 ++--
 ipc/mqueue.c                                                  |   34 +-
 kernel/kcov.c                                                 |    4 
 lib/Kconfig.ubsan                                             |   15 -
 mm/memcontrol.c                                               |   15 -
 mm/page_alloc.c                                               |    9 
 mm/percpu.c                                                   |   14 
 mm/slub.c                                                     |   45 ++-
 mm/vmscan.c                                                   |    1 
 scripts/decodecode                                            |    2 
 scripts/gdb/linux/rbtree.py                                   |    4 
 tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c |  146 ++++++++++
 tools/testing/selftests/wireguard/qemu/debug.config           |    1 
 14 files changed, 275 insertions(+), 78 deletions(-)





^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-04-21  1:13 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-04-21  1:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


15 fixes, based on ae83d0b416db002fe95601e7f97f64b59514d936:


    Masahiro Yamada <masahiroy@kernel.org>:
      sh: fix build error in mm/init.c

    Kees Cook <keescook@chromium.org>:
      slub: avoid redzone when choosing freepointer location

    Peter Xu <peterx@redhat.com>:
      mm/userfaultfd: disable userfaultfd-wp on x86_32

    Bartosz Golaszewski <bgolaszewski@baylibre.com>:
      MAINTAINERS: add an entry for kfifo

    Longpeng <longpeng2@huawei.com>:
      mm/hugetlb: fix a addressing exception caused by huge_pte_offset

    Michal Hocko <mhocko@suse.com>:
      mm, gup: return EINTR when gup is interrupted by fatal signals

    Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
      checkpatch: fix a typo in the regex for $allocFunctions

    George Burgess IV <gbiv@google.com>:
      tools/build: tweak unused value workaround

    Muchun Song <songmuchun@bytedance.com>:
      mm/ksm: fix NULL pointer dereference when KSM zero page is enabled

    Hugh Dickins <hughd@google.com>:
      mm/shmem: fix build without THP

    Jann Horn <jannh@google.com>:
      vmalloc: fix remap_vmalloc_range() bounds checks

    Hugh Dickins <hughd@google.com>:
      shmem: fix possible deadlocks on shmlock_user_lock

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: shmem: disable interrupt when acquiring info->lock in userfaultfd_copy path

    Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
      coredump: fix null pointer dereference on coredump

    Lucas Stach <l.stach@pengutronix.de>:
      tools/vm: fix cross-compile build

 MAINTAINERS                                      |    7 +++++++
 arch/sh/mm/init.c                                |    2 +-
 arch/x86/Kconfig                                 |    2 +-
 fs/coredump.c                                    |    2 ++
 fs/proc/vmcore.c                                 |    5 +++--
 include/linux/vmalloc.h                          |    2 +-
 mm/gup.c                                         |    2 +-
 mm/hugetlb.c                                     |   14 ++++++++------
 mm/ksm.c                                         |   12 ++++++++++--
 mm/shmem.c                                       |   13 ++++++++-----
 mm/slub.c                                        |   12 ++++++++++--
 mm/vmalloc.c                                     |   16 +++++++++++++---
 samples/vfio-mdev/mdpy.c                         |    2 +-
 scripts/checkpatch.pl                            |    2 +-
 tools/build/feature/test-sync-compare-and-swap.c |    2 +-
 tools/vm/Makefile                                |    2 ++
 16 files changed, 70 insertions(+), 27 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-04-12  7:41 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-04-12  7:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


A straggler.  This patch caused a lot of build errors on a lot of
architectures for a long time, but Anshuman believes it's all fixed up
now.

1 patch, based on GIT b032227c62939b5481bcd45442b36dfa263f4a7c.

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/debug: add tests validating architecture page table helpers

 Documentation/features/debug/debug-vm-pgtable/arch-support.txt |   34 
 arch/arc/Kconfig                                               |    1 
 arch/arm64/Kconfig                                             |    1 
 arch/powerpc/Kconfig                                           |    1 
 arch/s390/Kconfig                                              |    1 
 arch/x86/Kconfig                                               |    1 
 arch/x86/include/asm/pgtable_64.h                              |    6 
 include/linux/mmdebug.h                                        |    5 
 init/main.c                                                    |    2 
 lib/Kconfig.debug                                              |   26 
 mm/Makefile                                                    |    1 
 mm/debug_vm_pgtable.c                                          |  392 ++++++++++
 12 files changed, 471 insertions(+)




^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-04-10 21:30 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-04-10 21:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


Almost all of the rest of MM.  Various other things.

35 patches, based on c0cc271173b2e1c2d8d0ceaef14e4dfa79eefc0d.

Subsystems affected by this patch series:

  hfs
  mm/memcg
  mm/slab-generic
  mm/slab
  mm/pagealloc
  mm/gup
  ocfs2
  mm/hugetlb
  mm/pagemap
  mm/memremap
  kmod
  misc
  seqfile

Subsystem: hfs

    Simon Gander <simon@tuxera.com>:
      hfsplus: fix crash and filesystem corruption when deleting files

Subsystem: mm/memcg

    Jakub Kicinski <kuba@kernel.org>:
      mm, memcg: do not high throttle allocators based on wraparound

Subsystem: mm/slab-generic

    Qiujun Huang <hqjagain@gmail.com>:
      mm, slab_common: fix a typo in comment "eariler"->"earlier"

Subsystem: mm/slab

    Mauro Carvalho Chehab <mchehab+huawei@kernel.org>:
      docs: mm: slab.h: fix a broken cross-reference

Subsystem: mm/pagealloc

    Randy Dunlap <rdunlap@infradead.org>:
      mm/page_alloc.c: fix kernel-doc warning

    Jason Yan <yanaijie@huawei.com>:
      mm/page_alloc: make pcpu_drain_mutex and pcpu_drain static

Subsystem: mm/gup

    Miles Chen <miles.chen@mediatek.com>:
      mm/gup: fix null pointer dereference detected by coverity

Subsystem: ocfs2

    Changwei Ge <chge@linux.alibaba.com>:
      ocfs2: no need try to truncate file beyond i_size

Subsystem: mm/hugetlb

    Aslan Bakirov <aslan@fb.com>:
      mm: cma: NUMA node interface

    Roman Gushchin <guro@fb.com>:
      mm: hugetlb: optionally allocate gigantic hugepages using cma

Subsystem: mm/pagemap

    Jaewon Kim <jaewon31.kim@samsung.com>:
      mm/mmap.c: initialize align_offset explicitly for vm_unmapped_area

    Arjun Roy <arjunroy@google.com>:
      mm/memory.c: refactor insert_page to prepare for batched-lock insert
      mm: bring sparc pte_index() semantics inline with other platforms
      mm: define pte_index as macro for x86
      mm/memory.c: add vm_insert_pages()

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS
      mm/vma: introduce VM_ACCESS_FLAGS
      mm/special: create generic fallbacks for pte_special() and pte_mkspecial()

Subsystem: mm/memremap

    Logan Gunthorpe <logang@deltatee.com>:
    Patch series "Allow setting caching mode in arch_add_memory() for P2PDMA", v4:
      mm/memory_hotplug: drop the flags field from struct mhp_restrictions
      mm/memory_hotplug: rename mhp_restrictions to mhp_params
      x86/mm: thread pgprot_t through init_memory_mapping()
      x86/mm: introduce __set_memory_prot()
      powerpc/mm: thread pgprot_t through create_section_mapping()
      mm/memory_hotplug: add pgprot_t to mhp_params
      mm/memremap: set caching mode for PCI P2PDMA memory to WC

Subsystem: kmod

    Eric Biggers <ebiggers@google.com>:
    Patch series "module autoloading fixes and cleanups", v5:
      kmod: make request_module() return an error when autoloading is disabled
      fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once()
      docs: admin-guide: document the kernel.modprobe sysctl
      selftests: kmod: fix handling test numbers above 9
      selftests: kmod: test disabling module autoloading

Subsystem: misc

    Pali Rohár <pali@kernel.org>:
      change email address for Pali Rohár

    kbuild test robot <lkp@intel.com>:
      drivers/dma/tegra20-apb-dma.c: fix platform_get_irq.cocci warnings

Subsystem: seqfile

    Vasily Averin <vvs@virtuozzo.com>:
    Patch series "seq_file .next functions should increase position index":
      fs/seq_file.c: seq_read(): add info message about buggy .next functions
      kernel/gcov/fs.c: gcov_seq_next() should increase position index
      ipc/util.c: sysvipc_find_ipc() should increase position index

 Documentation/ABI/testing/sysfs-platform-dell-laptop |    8 
 Documentation/admin-guide/kernel-parameters.txt      |    8 
 Documentation/admin-guide/sysctl/kernel.rst          |   21 ++
 MAINTAINERS                                          |   16 -
 arch/alpha/include/asm/page.h                        |    3 
 arch/alpha/include/asm/pgtable.h                     |    2 
 arch/arc/include/asm/page.h                          |    2 
 arch/arm/include/asm/page.h                          |    4 
 arch/arm/include/asm/pgtable-2level.h                |    2 
 arch/arm/include/asm/pgtable.h                       |   15 -
 arch/arm/mach-omap2/omap-secure.c                    |    2 
 arch/arm/mach-omap2/omap-secure.h                    |    2 
 arch/arm/mach-omap2/omap-smc.S                       |    2 
 arch/arm/mm/fault.c                                  |    2 
 arch/arm/mm/mmu.c                                    |   14 +
 arch/arm64/include/asm/page.h                        |    4 
 arch/arm64/mm/fault.c                                |    2 
 arch/arm64/mm/init.c                                 |    6 
 arch/arm64/mm/mmu.c                                  |    7 
 arch/c6x/include/asm/page.h                          |    5 
 arch/csky/include/asm/page.h                         |    3 
 arch/csky/include/asm/pgtable.h                      |    3 
 arch/h8300/include/asm/page.h                        |    2 
 arch/hexagon/include/asm/page.h                      |    3 
 arch/hexagon/include/asm/pgtable.h                   |    2 
 arch/ia64/include/asm/page.h                         |    5 
 arch/ia64/include/asm/pgtable.h                      |    2 
 arch/ia64/mm/init.c                                  |    7 
 arch/m68k/include/asm/mcf_pgtable.h                  |   10 -
 arch/m68k/include/asm/motorola_pgtable.h             |    2 
 arch/m68k/include/asm/page.h                         |    3 
 arch/m68k/include/asm/sun3_pgtable.h                 |    2 
 arch/microblaze/include/asm/page.h                   |    2 
 arch/microblaze/include/asm/pgtable.h                |    4 
 arch/mips/include/asm/page.h                         |    5 
 arch/mips/include/asm/pgtable.h                      |   44 +++-
 arch/nds32/include/asm/page.h                        |    3 
 arch/nds32/include/asm/pgtable.h                     |    9 -
 arch/nds32/mm/fault.c                                |    2 
 arch/nios2/include/asm/page.h                        |    3 
 arch/nios2/include/asm/pgtable.h                     |    3 
 arch/openrisc/include/asm/page.h                     |    5 
 arch/openrisc/include/asm/pgtable.h                  |    2 
 arch/parisc/include/asm/page.h                       |    3 
 arch/parisc/include/asm/pgtable.h                    |    2 
 arch/powerpc/include/asm/book3s/64/hash.h            |    3 
 arch/powerpc/include/asm/book3s/64/radix.h           |    3 
 arch/powerpc/include/asm/page.h                      |    9 -
 arch/powerpc/include/asm/page_64.h                   |    7 
 arch/powerpc/include/asm/sparsemem.h                 |    3 
 arch/powerpc/mm/book3s64/hash_utils.c                |    5 
 arch/powerpc/mm/book3s64/pgtable.c                   |    7 
 arch/powerpc/mm/book3s64/pkeys.c                     |    2 
 arch/powerpc/mm/book3s64/radix_pgtable.c             |   18 +-
 arch/powerpc/mm/mem.c                                |   12 -
 arch/riscv/include/asm/page.h                        |    3 
 arch/s390/include/asm/page.h                         |    3 
 arch/s390/mm/fault.c                                 |    2 
 arch/s390/mm/init.c                                  |    9 -
 arch/sh/include/asm/page.h                           |    3 
 arch/sh/mm/init.c                                    |    7 
 arch/sparc/include/asm/page_32.h                     |    3 
 arch/sparc/include/asm/page_64.h                     |    3 
 arch/sparc/include/asm/pgtable_32.h                  |    7 
 arch/sparc/include/asm/pgtable_64.h                  |   10 -
 arch/um/include/asm/pgtable.h                        |   10 -
 arch/unicore32/include/asm/page.h                    |    3 
 arch/unicore32/include/asm/pgtable.h                 |    3 
 arch/unicore32/mm/fault.c                            |    2 
 arch/x86/include/asm/page_types.h                    |    7 
 arch/x86/include/asm/pgtable.h                       |    6 
 arch/x86/include/asm/set_memory.h                    |    1 
 arch/x86/kernel/amd_gart_64.c                        |    3 
 arch/x86/kernel/setup.c                              |    4 
 arch/x86/mm/init.c                                   |    9 -
 arch/x86/mm/init_32.c                                |   19 +-
 arch/x86/mm/init_64.c                                |   42 ++--
 arch/x86/mm/mm_internal.h                            |    3 
 arch/x86/mm/pat/set_memory.c                         |   13 +
 arch/x86/mm/pkeys.c                                  |    2 
 arch/x86/platform/uv/bios_uv.c                       |    3 
 arch/x86/um/asm/vm-flags.h                           |   10 -
 arch/xtensa/include/asm/page.h                       |    3 
 arch/xtensa/include/asm/pgtable.h                    |    3 
 drivers/char/hw_random/omap3-rom-rng.c               |    4 
 drivers/dma/tegra20-apb-dma.c                        |    1 
 drivers/hwmon/dell-smm-hwmon.c                       |    4 
 drivers/platform/x86/dell-laptop.c                   |    4 
 drivers/platform/x86/dell-rbtn.c                     |    4 
 drivers/platform/x86/dell-rbtn.h                     |    2 
 drivers/platform/x86/dell-smbios-base.c              |    4 
 drivers/platform/x86/dell-smbios-smm.c               |    2 
 drivers/platform/x86/dell-smbios.h                   |    2 
 drivers/platform/x86/dell-smo8800.c                  |    2 
 drivers/platform/x86/dell-wmi.c                      |    4 
 drivers/power/supply/bq2415x_charger.c               |    4 
 drivers/power/supply/bq27xxx_battery.c               |    2 
 drivers/power/supply/isp1704_charger.c               |    2 
 drivers/power/supply/rx51_battery.c                  |    4 
 drivers/staging/gasket/gasket_core.c                 |    2 
 fs/filesystems.c                                     |    4 
 fs/hfsplus/attributes.c                              |    4 
 fs/ocfs2/alloc.c                                     |    4 
 fs/seq_file.c                                        |    7 
 fs/udf/ecma_167.h                                    |    2 
 fs/udf/osta_udf.h                                    |    2 
 include/linux/cma.h                                  |   14 +
 include/linux/hugetlb.h                              |   12 +
 include/linux/memblock.h                             |    3 
 include/linux/memory_hotplug.h                       |   21 +-
 include/linux/mm.h                                   |   34 +++
 include/linux/power/bq2415x_charger.h                |    2 
 include/linux/slab.h                                 |    2 
 ipc/util.c                                           |    2 
 kernel/gcov/fs.c                                     |    2 
 kernel/kmod.c                                        |    4 
 mm/cma.c                                             |   16 +
 mm/gup.c                                             |    3 
 mm/hugetlb.c                                         |  109 ++++++++++++
 mm/memblock.c                                        |    2 
 mm/memcontrol.c                                      |    3 
 mm/memory.c                                          |  168 +++++++++++++++++--
 mm/memory_hotplug.c                                  |   13 -
 mm/memremap.c                                        |   17 +
 mm/mmap.c                                            |    4 
 mm/mprotect.c                                        |    4 
 mm/page_alloc.c                                      |    5 
 mm/slab_common.c                                     |    2 
 tools/laptop/freefall/freefall.c                     |    2 
 tools/testing/selftests/kmod/kmod.sh                 |   43 ++++
 130 files changed, 710 insertions(+), 370 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-04-07  3:02 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-04-07  3:02 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


- a lot more of MM, quite a bit more yet to come.

- various other subsystems



166 patches based on 7e63420847ae5f1036e4f7c42f0b3282e73efbc2.

Subsystems affected by this patch series:

  mm/memcg
  mm/pagemap
  mm/vmalloc
  mm/pagealloc
  mm/migration
  mm/thp
  mm/ksm
  mm/madvise
  mm/virtio
  mm/userfaultfd
  mm/memory-hotplug
  mm/shmem
  mm/rmap
  mm/zswap
  mm/zsmalloc
  mm/cleanups
  procfs
  misc
  MAINTAINERS
  bitops
  lib
  checkpatch
  epoll
  binfmt
  kallsyms
  reiserfs
  kmod
  gcov
  kconfig
  kcov
  ubsan
  fault-injection
  ipc

Subsystem: mm/memcg

    Chris Down <chris@chrisdown.name>:
      mm, memcg: bypass high reclaim iteration for cgroup hierarchy root

Subsystem: mm/pagemap

    Li Xinhai <lixinhai.lxh@gmail.com>:
    Patch series "mm: Fix misuse of parent anon_vma in dup_mmap path":
      mm: don't prepare anon_vma if vma has VM_WIPEONFORK
      Revert "mm/rmap.c: reuse mergeable anon_vma as parent when fork"
      mm: set vm_next and vm_prev to NULL in vm_area_dup()

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/vma: Use all available wrappers when possible", v2:
      mm/vma: add missing VMA flag readable name for VM_SYNC
      mm/vma: make vma_is_accessible() available for general use
      mm/vma: replace all remaining open encodings with is_vm_hugetlb_page()
      mm/vma: replace all remaining open encodings with vma_is_anonymous()
      mm/vma: append unlikely() while testing VMA access permissions

Subsystem: mm/vmalloc

    Qiujun Huang <hqjagain@gmail.com>:
      mm/vmalloc: fix a typo in comment

Subsystem: mm/pagealloc

    Michal Hocko <mhocko@suse.com>:
      mm: make it clear that gfp reclaim modifiers are valid only for sleepable allocations

Subsystem: mm/migration

    Wei Yang <richardw.yang@linux.intel.com>:
    Patch series "cleanup on do_pages_move()", v5:
      mm/migrate.c: no need to check for i > start in do_pages_move()
      mm/migrate.c: wrap do_move_pages_to_node() and store_status()
      mm/migrate.c: check pagelist in move_pages_and_store_status()
      mm/migrate.c: unify "not queued for migration" handling in do_pages_move()

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/migrate.c: migrate PG_readahead flag

Subsystem: mm/thp

    David Rientjes <rientjes@google.com>:
      mm, shmem: add vmstat for hugepage fallback
      mm, thp: track fallbacks due to failed memcg charges separately

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      include/linux/pagemap.h: optimise find_subpage for !THP
      mm: remove CONFIG_TRANSPARENT_HUGE_PAGECACHE

Subsystem: mm/ksm

    Li Chen <chenli@uniontech.com>:
      mm/ksm.c: update get_user_pages() argument in comment

Subsystem: mm/madvise

    Huang Ying <ying.huang@intel.com>:
      mm: code cleanup for MADV_FREE

Subsystem: mm/virtio

    Alexander Duyck <alexander.h.duyck@linux.intel.com>:
    Patch series "mm / virtio: Provide support for free page reporting", v17:
      mm: adjust shuffle code to allow for future coalescing
      mm: use zone and order instead of free area in free_list manipulators
      mm: add function __putback_isolated_page
      mm: introduce Reported pages
      virtio-balloon: pull page poisoning config out of free page hinting
      virtio-balloon: add support for providing free page reports to host
      mm/page_reporting: rotate reported pages to the tail of the list
      mm/page_reporting: add budget limit on how many pages can be reported per pass
      mm/page_reporting: add free page reporting documentation

    David Hildenbrand <david@redhat.com>:
      virtio-balloon: switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM

Subsystem: mm/userfaultfd

    Shaohua Li <shli@fb.com>:
    Patch series "userfaultfd: write protection support", v6:
      userfaultfd: wp: add helper for writeprotect check

    Andrea Arcangeli <aarcange@redhat.com>:
      userfaultfd: wp: hook userfault handler to write protection fault
      userfaultfd: wp: add WP pagetable tracking to x86
      userfaultfd: wp: userfaultfd_pte/huge_pmd_wp() helpers
      userfaultfd: wp: add UFFDIO_COPY_MODE_WP

    Peter Xu <peterx@redhat.com>:
      mm: merge parameters for change_protection()
      userfaultfd: wp: apply _PAGE_UFFD_WP bit
      userfaultfd: wp: drop _PAGE_UFFD_WP properly when fork
      userfaultfd: wp: add pmd_swp_*uffd_wp() helpers
      userfaultfd: wp: support swap and page migration
      khugepaged: skip collapse if uffd-wp detected

    Shaohua Li <shli@fb.com>:
      userfaultfd: wp: support write protection for userfault vma range

    Andrea Arcangeli <aarcange@redhat.com>:
      userfaultfd: wp: add the writeprotect API to userfaultfd ioctl

    Shaohua Li <shli@fb.com>:
      userfaultfd: wp: enabled write protection in userfaultfd API

    Peter Xu <peterx@redhat.com>:
      userfaultfd: wp: don't wake up when doing write protect

    Martin Cracauer <cracauer@cons.org>:
      userfaultfd: wp: UFFDIO_REGISTER_MODE_WP documentation update

    Peter Xu <peterx@redhat.com>:
      userfaultfd: wp: declare _UFFDIO_WRITEPROTECT conditionally
      userfaultfd: selftests: refactor statistics
      userfaultfd: selftests: add write-protect test

Subsystem: mm/memory-hotplug

    David Hildenbrand <david@redhat.com>:
    Patch series "mm: drop superfluous section checks when onlining/offlining":
      drivers/base/memory.c: drop section_count
      drivers/base/memory.c: drop pages_correctly_probed()
      mm/page_ext.c: drop pfn_present() check when onlining

    Baoquan He <bhe@redhat.com>:
      mm/memory_hotplug.c: only respect mem= parameter during boot stage

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug.c: simplify calculation of number of pages in __remove_pages()
      mm/memory_hotplug.c: cleanup __add_pages()

    Baoquan He <bhe@redhat.com>:
    Patch series "mm/hotplug: Only use subsection map for VMEMMAP", v4:
      mm/sparse.c: introduce new function fill_subsection_map()
      mm/sparse.c: introduce a new function clear_subsection_map()
      mm/sparse.c: only use subsection map in VMEMMAP case
      mm/sparse.c: add note about only VMEMMAP supporting sub-section hotplug
      mm/sparse.c: move subsection_map related functions together

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/memory_hotplug: allow to specify a default online_type", v3:
      drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE
      drivers/base/memory: map MMOP_OFFLINE to 0
      drivers/base/memory: store mapping between MMOP_* and string in an array
      powernv/memtrace: always online added memory blocks
      hv_balloon: don't check for memhp_auto_online manually
      mm/memory_hotplug: unexport memhp_auto_online
      mm/memory_hotplug: convert memhp_auto_online to store an online_type
      mm/memory_hotplug: allow to specify a default online_type

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/memory_hotplug.c: use __pfn_to_section() instead of open-coding

Subsystem: mm/shmem

    Kees Cook <keescook@chromium.org>:
      mm/shmem.c: distribute switch variables for initialization

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/shmem.c: clean code by removing unnecessary assignment

    Hugh Dickins <hughd@google.com>:
      mm: huge tmpfs: try to split_huge_page() when punching hole

Subsystem: mm/rmap

    Palmer Dabbelt <palmerdabbelt@google.com>:
      mm: prevent a warning when casting void* -> enum

Subsystem: mm/zswap

    "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>:
      mm/zswap: allow setting default status, compressor and allocator in Kconfig

Subsystem: mm/zsmalloc

Subsystem: mm/cleanups

    Jules Irenge <jbi.octave@gmail.com>:
      mm/compaction: add missing annotation for compact_lock_irqsave
      mm/hugetlb: add missing annotation for gather_surplus_pages()
      mm/mempolicy: add missing annotation for queue_pages_pmd()
      mm/slub: add missing annotation for get_map()
      mm/slub: add missing annotation for put_map()
      mm/zsmalloc: add missing annotation for migrate_read_lock()
      mm/zsmalloc: add missing annotation for migrate_read_unlock()
      mm/zsmalloc: add missing annotation for pin_tag()
      mm/zsmalloc: add missing annotation for unpin_tag()

    chenqiwu <chenqiwu@xiaomi.com>:
      mm: fix ambiguous comments for better code readability

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/mm_init.c: clean code. Use BUILD_BUG_ON when comparing compile time constant

    Joe Perches <joe@perches.com>:
      mm: use fallthrough;

    Steven Price <steven.price@arm.com>:
      include/linux/swapops.h: correct guards for non_swap_entry()

    Ira Weiny <ira.weiny@intel.com>:
      include/linux/memremap.h: remove stale comments

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/dmapool.c: micro-optimisation remove unnecessary branch

    Waiman Long <longman@redhat.com>:
      mm: remove dummy struct bootmem_data/bootmem_data_t

Subsystem: procfs

    Jules Irenge <jbi.octave@gmail.com>:
      fs/proc/inode.c: annotate close_pdeo() for sparse

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: faster open/read/close with "permanent" files
      proc: speed up /proc/*/statm

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      proc: inline vma_stop into m_stop
      proc: remove m_cache_vma
      proc: use ppos instead of m->version
      seq_file: remove m->version
      proc: inline m_next_vma into m_next

Subsystem: misc

    Michal Simek <michal.simek@xilinx.com>:
      asm-generic: fix unistd_32.h generation format

    Nathan Chancellor <natechancellor@gmail.com>:
      kernel/extable.c: use address-of operator on section symbols

    Masahiro Yamada <masahiroy@kernel.org>:
      sparc,x86: vdso: remove meaningless undefining CONFIG_OPTIMIZE_INLINING
      compiler: remove CONFIG_OPTIMIZE_INLINING entirely

    Vegard Nossum <vegard.nossum@oracle.com>:
      compiler.h: fix error in BUILD_BUG_ON() reporting

Subsystem: MAINTAINERS

    Joe Perches <joe@perches.com>:
      MAINTAINERS: list the section entries in the preferred order

Subsystem: bitops

    Josh Poimboeuf <jpoimboe@redhat.com>:
      bitops: always inline sign extension helpers

Subsystem: lib

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      lib/test_lockup: test module to generate lockups

    Colin Ian King <colin.king@canonical.com>:
      lib/test_lockup.c: fix spelling mistake "iteraions" -> "iterations"

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      lib/test_lockup.c: add parameters for locking generic vfs locks

    "Gustavo A. R. Silva" <gustavo@embeddedor.com>:
      lib/bch.c: replace zero-length array with flexible-array member
      lib/ts_bm.c: replace zero-length array with flexible-array member
      lib/ts_fsm.c: replace zero-length array with flexible-array member
      lib/ts_kmp.c: replace zero-length array with flexible-array member

    Geert Uytterhoeven <geert+renesas@glider.be>:
      lib/scatterlist: fix sg_copy_buffer() kerneldoc

    Kees Cook <keescook@chromium.org>:
      lib: test_stackinit.c: XFAIL switch variable init tests

    Alexander Potapenko <glider@google.com>:
      lib/stackdepot.c: check depot_index before accessing the stack slab
lib/stackdepot.c: fix a condition in stack_depot_fetch()
      lib/stackdepot.c: build with -fno-builtin
      kasan: stackdepot: move filter_irq_stacks() to stackdepot.c

    Qian Cai <cai@lca.pw>:
      percpu_counter: fix a data race at vm_committed_as

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      lib/test_bitmap.c: make use of EXP2_IN_BITS

    chenqiwu <chenqiwu@xiaomi.com>:
      lib/rbtree: fix coding style of assignments

    Dan Carpenter <dan.carpenter@oracle.com>:
      lib/test_kmod.c: remove a NULL test

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      linux/bits.h: add compile time sanity check of GENMASK inputs

    Chris Wilson <chris@chris-wilson.co.uk>:
      lib/list: prevent compiler reloads inside 'safe' list iteration

    Nathan Chancellor <natechancellor@gmail.com>:
      lib/dynamic_debug.c: use address-of operator on section symbols

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: remove email address comment from email address comparisons

    Lubomir Rintel <lkundrak@v3.sk>:
      checkpatch: check SPDX tags in YAML files

    John Hubbard <jhubbard@nvidia.com>:
      checkpatch: support "base-commit:" format

    Joe Perches <joe@perches.com>:
      checkpatch: prefer fallthrough; over fallthrough comments

    Antonio Borneo <borneo.antonio@gmail.com>:
      checkpatch: fix minor typo and mixed space+tab in indentation
      checkpatch: fix multiple const * types
      checkpatch: add command-line option for TAB size

    Joe Perches <joe@perches.com>:
      checkpatch: improve Gerrit Change-Id: test

    Lubomir Rintel <lkundrak@v3.sk>:
      checkpatch: check proper licensing of Devicetree bindings

    Joe Perches <joe@perches.com>:
      checkpatch: avoid warning about uninitialized_var()

Subsystem: epoll

    Roman Penyaev <rpenyaev@suse.de>:
      kselftest: introduce new epoll test case

    Jason Baron <jbaron@akamai.com>:
      fs/epoll: make nesting accounting safe for -rt kernel

Subsystem: binfmt

    Alexey Dobriyan <adobriyan@gmail.com>:
      fs/binfmt_elf.c: delete "loc" variable
      fs/binfmt_elf.c: allocate less for static executable
      fs/binfmt_elf.c: don't free interpreter's ELF pheaders on common path

Subsystem: kallsyms

    Will Deacon <will@kernel.org>:
    Patch series "Unexport kallsyms_lookup_name() and kallsyms_on_each_symbol()":
      samples/hw_breakpoint: drop HW_BREAKPOINT_R when reporting writes
      samples/hw_breakpoint: drop use of kallsyms_lookup_name()
      kallsyms: unexport kallsyms_lookup_name() and kallsyms_on_each_symbol()

Subsystem: reiserfs

    Colin Ian King <colin.king@canonical.com>:
      reiserfs: clean up several indentation issues

Subsystem: kmod

    Qiujun Huang <hqjagain@gmail.com>:
      kernel/kmod.c: fix a typo "assuems" -> "assumes"

Subsystem: gcov

    "Gustavo A. R. Silva" <gustavo@embeddedor.com>:
      gcov: gcc_4_7: replace zero-length array with flexible-array member
      gcov: gcc_3_4: replace zero-length array with flexible-array member
      kernel/gcov/fs.c: replace zero-length array with flexible-array member

Subsystem: kconfig

    Krzysztof Kozlowski <krzk@kernel.org>:
      init/Kconfig: clean up ANON_INODES and old IO schedulers options

Subsystem: kcov

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "kcov: collect coverage from usb soft interrupts", v4:
      kcov: cleanup debug messages
      kcov: fix potential use-after-free in kcov_remote_start
      kcov: move t->kcov assignments into kcov_start/stop
      kcov: move t->kcov_sequence assignment
      kcov: use t->kcov_mode as enabled indicator
      kcov: collect coverage from interrupts
      usb: core: kcov: collect coverage from usb complete callback

Subsystem: ubsan

    Kees Cook <keescook@chromium.org>:
    Patch series "ubsan: Split out bounds checker", v5:
      ubsan: add trap instrumentation option
      ubsan: split "bounds" checker from other options
      drivers/misc/lkdtm/bugs.c: add arithmetic overflow and array bounds checks
      ubsan: check panic_on_warn
      kasan: unset panic_on_warn before calling panic()
      ubsan: include bug type in report header

Subsystem: fault-injection

    Qiujun Huang <hqjagain@gmail.com>:
      lib/Kconfig.debug: fix a typo "capabilitiy" -> "capability"

Subsystem: ipc

    Somala Swaraj <somalaswaraj@gmail.com>:
      ipc/mqueue.c: fix a brace coding style issue

    Jason Yan <yanaijie@huawei.com>:
      ipc/shm.c: make compat_ksys_shmctl() static

 Documentation/admin-guide/kernel-parameters.txt               |   13 
 Documentation/admin-guide/mm/transhuge.rst                    |   14 
 Documentation/admin-guide/mm/userfaultfd.rst                  |   51 
 Documentation/dev-tools/kcov.rst                              |   17 
 Documentation/vm/free_page_reporting.rst                      |   41 
 Documentation/vm/zswap.rst                                    |   20 
 MAINTAINERS                                                   |   35 
 arch/alpha/include/asm/mmzone.h                               |    2 
 arch/alpha/kernel/syscalls/syscallhdr.sh                      |    2 
 arch/csky/mm/fault.c                                          |    4 
 arch/ia64/kernel/syscalls/syscallhdr.sh                       |    2 
 arch/ia64/kernel/vmlinux.lds.S                                |    2 
 arch/m68k/mm/fault.c                                          |    4 
 arch/microblaze/kernel/syscalls/syscallhdr.sh                 |    2 
 arch/mips/kernel/syscalls/syscallhdr.sh                       |    3 
 arch/mips/mm/fault.c                                          |    4 
 arch/nds32/kernel/vmlinux.lds.S                               |    1 
 arch/parisc/kernel/syscalls/syscallhdr.sh                     |    2 
 arch/powerpc/kernel/syscalls/syscallhdr.sh                    |    3 
 arch/powerpc/kvm/e500_mmu_host.c                              |    2 
 arch/powerpc/mm/fault.c                                       |    2 
 arch/powerpc/platforms/powernv/memtrace.c                     |   14 
 arch/sh/kernel/syscalls/syscallhdr.sh                         |    2 
 arch/sh/mm/fault.c                                            |    2 
 arch/sparc/kernel/syscalls/syscallhdr.sh                      |    2 
 arch/sparc/vdso/vdso32/vclock_gettime.c                       |    4 
 arch/x86/Kconfig                                              |    1 
 arch/x86/configs/i386_defconfig                               |    1 
 arch/x86/configs/x86_64_defconfig                             |    1 
 arch/x86/entry/vdso/vdso32/vclock_gettime.c                   |    4 
 arch/x86/include/asm/pgtable.h                                |   67 +
 arch/x86/include/asm/pgtable_64.h                             |    8 
 arch/x86/include/asm/pgtable_types.h                          |   12 
 arch/x86/mm/fault.c                                           |    2 
 arch/xtensa/kernel/syscalls/syscallhdr.sh                     |    2 
 drivers/base/memory.c                                         |  138 --
 drivers/hv/hv_balloon.c                                       |   25 
 drivers/misc/lkdtm/bugs.c                                     |   75 +
 drivers/misc/lkdtm/core.c                                     |    3 
 drivers/misc/lkdtm/lkdtm.h                                    |    3 
 drivers/usb/core/hcd.c                                        |    3 
 drivers/virtio/Kconfig                                        |    1 
 drivers/virtio/virtio_balloon.c                               |  190 ++-
 fs/binfmt_elf.c                                               |   56 
 fs/eventpoll.c                                                |   64 -
 fs/proc/array.c                                               |   39 
 fs/proc/cpuinfo.c                                             |    1 
 fs/proc/generic.c                                             |   31 
 fs/proc/inode.c                                               |  188 ++-
 fs/proc/internal.h                                            |    6 
 fs/proc/kmsg.c                                                |    1 
 fs/proc/stat.c                                                |    1 
 fs/proc/task_mmu.c                                            |   97 -
 fs/reiserfs/do_balan.c                                        |    2 
 fs/reiserfs/ioctl.c                                           |   11 
 fs/reiserfs/namei.c                                           |   10 
 fs/seq_file.c                                                 |   28 
 fs/userfaultfd.c                                              |  116 +
 include/asm-generic/pgtable.h                                 |    1 
 include/asm-generic/pgtable_uffd.h                            |   66 +
 include/asm-generic/tlb.h                                     |    3 
 include/linux/bitops.h                                        |    4 
 include/linux/bits.h                                          |   22 
 include/linux/compiler.h                                      |    2 
 include/linux/compiler_types.h                                |   11 
 include/linux/gfp.h                                           |    2 
 include/linux/huge_mm.h                                       |    2 
 include/linux/list.h                                          |   50 
 include/linux/memory.h                                        |    1 
 include/linux/memory_hotplug.h                                |   13 
 include/linux/memremap.h                                      |    2 
 include/linux/mm.h                                            |   25 
 include/linux/mm_inline.h                                     |   15 
 include/linux/mm_types.h                                      |    4 
 include/linux/mmzone.h                                        |   47 
 include/linux/page-flags.h                                    |   16 
 include/linux/page_reporting.h                                |   26 
 include/linux/pagemap.h                                       |    4 
 include/linux/percpu_counter.h                                |    4 
 include/linux/proc_fs.h                                       |   17 
 include/linux/sched.h                                         |    3 
 include/linux/seq_file.h                                      |    1 
 include/linux/shmem_fs.h                                      |   10 
 include/linux/stackdepot.h                                    |    2 
 include/linux/swapops.h                                       |    5 
 include/linux/userfaultfd_k.h                                 |   42 
 include/linux/vm_event_item.h                                 |    5 
 include/trace/events/huge_memory.h                            |    1 
 include/trace/events/mmflags.h                                |    1 
 include/trace/events/vmscan.h                                 |    2 
 include/uapi/linux/userfaultfd.h                              |   40 
 include/uapi/linux/virtio_balloon.h                           |    1 
 init/Kconfig                                                  |    8 
 ipc/mqueue.c                                                  |    5 
 ipc/shm.c                                                     |    2 
 ipc/util.c                                                    |    1 
 kernel/configs/tiny.config                                    |    1 
 kernel/events/core.c                                          |    3 
 kernel/extable.c                                              |    3 
 kernel/fork.c                                                 |   10 
 kernel/gcov/fs.c                                              |    2 
 kernel/gcov/gcc_3_4.c                                         |    6 
 kernel/gcov/gcc_4_7.c                                         |    2 
 kernel/kallsyms.c                                             |    2 
 kernel/kcov.c                                                 |  282 +++-
 kernel/kmod.c                                                 |    2 
 kernel/module.c                                               |    1 
 kernel/sched/fair.c                                           |    2 
 lib/Kconfig.debug                                             |   35 
 lib/Kconfig.ubsan                                             |   51 
 lib/Makefile                                                  |    8 
 lib/bch.c                                                     |    2 
 lib/dynamic_debug.c                                           |    2 
 lib/rbtree.c                                                  |    4 
 lib/scatterlist.c                                             |    2 
 lib/stackdepot.c                                              |   39 
 lib/test_bitmap.c                                             |    2 
 lib/test_kmod.c                                               |    2 
 lib/test_lockup.c                                             |  601 +++++++++-
 lib/test_stackinit.c                                          |   28 
 lib/ts_bm.c                                                   |    2 
 lib/ts_fsm.c                                                  |    2 
 lib/ts_kmp.c                                                  |    2 
 lib/ubsan.c                                                   |   47 
 mm/Kconfig                                                    |  135 ++
 mm/Makefile                                                   |    1 
 mm/compaction.c                                               |    3 
 mm/dmapool.c                                                  |    4 
 mm/filemap.c                                                  |   14 
 mm/gup.c                                                      |    9 
 mm/huge_memory.c                                              |   36 
 mm/hugetlb.c                                                  |    1 
 mm/hugetlb_cgroup.c                                           |    6 
 mm/internal.h                                                 |    2 
 mm/kasan/common.c                                             |   23 
 mm/kasan/report.c                                             |   10 
 mm/khugepaged.c                                               |   39 
 mm/ksm.c                                                      |    5 
 mm/list_lru.c                                                 |    2 
 mm/memcontrol.c                                               |    5 
 mm/memory-failure.c                                           |    2 
 mm/memory.c                                                   |   42 
 mm/memory_hotplug.c                                           |   53 
 mm/mempolicy.c                                                |   11 
 mm/migrate.c                                                  |  122 +-
 mm/mm_init.c                                                  |    2 
 mm/mmap.c                                                     |   10 
 mm/mprotect.c                                                 |   76 -
 mm/page_alloc.c                                               |  174 ++
 mm/page_ext.c                                                 |    5 
 mm/page_isolation.c                                           |    6 
 mm/page_reporting.c                                           |  384 ++++++
 mm/page_reporting.h                                           |   54 
 mm/rmap.c                                                     |   23 
 mm/shmem.c                                                    |  168 +-
 mm/shuffle.c                                                  |   12 
 mm/shuffle.h                                                  |    6 
 mm/slab_common.c                                              |    1 
 mm/slub.c                                                     |    3 
 mm/sparse.c                                                   |  236 ++-
 mm/swap.c                                                     |   20 
 mm/swapfile.c                                                 |    1 
 mm/userfaultfd.c                                              |   98 +
 mm/vmalloc.c                                                  |    2 
 mm/vmscan.c                                                   |   12 
 mm/vmstat.c                                                   |    3 
 mm/zsmalloc.c                                                 |   10 
 mm/zswap.c                                                    |   24 
 samples/hw_breakpoint/data_breakpoint.c                       |   11 
 scripts/Makefile.ubsan                                        |   16 
 scripts/checkpatch.pl                                         |  155 +-
 tools/lib/rbtree.c                                            |    4 
 tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c |   67 +
 tools/testing/selftests/vm/userfaultfd.c                      |  233 +++
 174 files changed, 3990 insertions(+), 1399 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-04-02  4:01 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-04-02  4:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


A large amount of MM, plenty more to come.


155 patches, based on GIT 1a323ea5356edbb3073dc59d51b9e6b86908857d

Subsystems affected by this patch series:

  tools
  kthread
  kbuild
  scripts
  ocfs2
  vfs
  mm/slub
  mm/kmemleak
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/mremap
  mm/sparsemem
  mm/kasan
  mm/pagealloc
  mm/vmscan
  mm/compaction
  mm/mempolicy
  mm/hugetlbfs
  mm/hugetlb

Subsystem: tools

    David Ahern <dsahern@kernel.org>:
      tools/accounting/getdelays.c: fix netlink attribute length

Subsystem: kthread

    Petr Mladek <pmladek@suse.com>:
      kthread: mark timer used by delayed kthread works as IRQ safe

Subsystem: kbuild

    Masahiro Yamada <masahiroy@kernel.org>:
      asm-generic: make more kernel-space headers mandatory

Subsystem: scripts

    Jonathan Neuschäfer <j.neuschaefer@gmx.net>:
      scripts/spelling.txt: add syfs/sysfs pattern

    Colin Ian King <colin.king@canonical.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

Subsystem: ocfs2

    Alex Shi <alex.shi@linux.alibaba.com>:
      ocfs2: remove FS_OCFS2_NM
      ocfs2: remove unused macros
      ocfs2: use OCFS2_SEC_BITS in macro
      ocfs2: remove dlm_lock_is_remote

    wangyan <wangyan122@huawei.com>:
      ocfs2: there is no need to log twice in several functions
      ocfs2: correct annotation from "l_next_rec" to "l_next_free_rec"

    Alex Shi <alex.shi@linux.alibaba.com>:
      ocfs2: remove useless err

    Jules Irenge <jbi.octave@gmail.com>:
      ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock()

    "Gustavo A. R. Silva" <gustavo@embeddedor.com>:
      ocfs2: replace zero-length array with flexible-array member
      ocfs2: cluster: replace zero-length array with flexible-array member
      ocfs2: dlm: replace zero-length array with flexible-array member
      ocfs2: ocfs2_fs.h: replace zero-length array with flexible-array member

    wangjian <wangjian161@huawei.com>:
      ocfs2: roll back the reference count modification of the parent directory if an error occurs

    Takashi Iwai <tiwai@suse.de>:
      ocfs2: use scnprintf() for avoiding potential buffer overflow

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      ocfs2: use memalloc_nofs_save instead of memalloc_noio_save

Subsystem: vfs

    Kees Cook <keescook@chromium.org>:
      fs_parse: Remove pr_notice() about each validation

Subsystem: mm/slub

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/slub.c: replace cpu_slab->partial with wrapped APIs
      mm/slub.c: replace kmem_cache->cpu_partial with wrapped APIs

    Kees Cook <keescook@chromium.org>:
      slub: improve bit diffusion for freelist ptr obfuscation
      slub: relocate freelist pointer to middle of object

    Vlastimil Babka <vbabka@suse.cz>:
      Revert "topology: add support for node_to_mem_node() to determine the fallback node"

Subsystem: mm/kmemleak

    Nathan Chancellor <natechancellor@gmail.com>:
      mm/kmemleak.c: use address-of operator on section symbols

    Qian Cai <cai@lca.pw>:
      mm/Makefile: disable KCSAN for kmemleak

Subsystem: mm/pagecache

    Jan Kara <jack@suse.cz>:
      mm/filemap.c: don't bother dropping mmap_sem for zero size readahead

    Mauricio Faria de Oliveira <mfo@canonical.com>:
      mm/page-writeback.c: write_cache_pages(): deduplicate identical checks

    Xianting Tian <xianting_tian@126.com>:
      mm/filemap.c: clear page error before actual read

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm/filemap.c: remove unused argument from shrink_readahead_size_eio()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm/filemap.c: use vm_fault error code directly
      include/linux/pagemap.h: rename arguments to find_subpage
      mm/page-writeback.c: use VM_BUG_ON_PAGE in clear_page_dirty_for_io
      mm/filemap.c: unexport find_get_entry
      mm/filemap.c: rewrite pagecache_get_page documentation

Subsystem: mm/gup

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "mm/gup: track FOLL_PIN pages", v6:
      mm/gup: split get_user_pages_remote() into two routines
      mm/gup: pass a flags arg to __gup_device_* functions
      mm: introduce page_ref_sub_return()
      mm/gup: pass gup flags to two more routines
      mm/gup: require FOLL_GET for get_user_pages_fast()
      mm/gup: track FOLL_PIN pages
      mm/gup: page->hpage_pinned_refcount: exact pin counts for huge pages
      mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN) reporting
      mm/gup_benchmark: support pin_user_pages() and related calls
      selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN coverage

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: improve dump_page() for compound pages

    John Hubbard <jhubbard@nvidia.com>:
      mm: dump_page(): additional diagnostics for huge pinned pages

    Claudio Imbrenda <imbrenda@linux.ibm.com>:
      mm/gup/writeback: add callbacks for inaccessible pages

    Pingfan Liu <kernelfans@gmail.com>:
      mm/gup: rename nr as nr_pinned in get_user_pages_fast()
      mm/gup: fix omission of check on FOLL_LONGTERM in gup fast path

Subsystem: mm/swap

    Chen Wandun <chenwandun@huawei.com>:
      mm/swapfile.c: fix comments for swapcache_prepare

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/swap.c: not necessary to export __pagevec_lru_add()

    Qian Cai <cai@lca.pw>:
      mm/swapfile: fix data races in try_to_unuse()

    Wei Yang <richard.weiyang@linux.alibaba.com>:
      mm/swap_slots.c: assign|reset cache slot by value directly

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: swap: make page_evictable() inline
      mm: swap: use smp_mb__after_atomic() to order LRU bit set

    Wei Yang <richard.weiyang@gmail.com>:
      mm/swap_state.c: use the same way to count page in [add_to|delete_from]_swap_cache

Subsystem: mm/memcg

    Yafang Shao <laoar.shao@gmail.com>:
      mm, memcg: fix build error around the usage of kmem_caches

    Kirill Tkhai <ktkhai@virtuozzo.com>:
      mm/memcontrol.c: allocate shrinker_map on appropriate NUMA node

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: use mem_cgroup_from_obj()
    Patch series "mm: memcg: kmem API cleanup", v2:
      mm: kmem: cleanup (__)memcg_kmem_charge_memcg() arguments
      mm: kmem: cleanup memcg_kmem_uncharge_memcg() arguments
      mm: kmem: rename memcg_kmem_(un)charge() into memcg_kmem_(un)charge_page()
      mm: kmem: switch to nr_pages in (__)memcg_kmem_charge_memcg()
      mm: memcg/slab: cache page number in memcg_(un)charge_slab()
      mm: kmem: rename (__)memcg_kmem_(un)charge_memcg() to __memcg_kmem_(un)charge()

    Johannes Weiner <hannes@cmpxchg.org>:
    Patch series "mm: memcontrol: recursive memory.low protection", v3:
      mm: memcontrol: fix memory.low proportional distribution
      mm: memcontrol: clean up and document effective low/min calculations
      mm: memcontrol: recursive memory.low protection

    Shakeel Butt <shakeelb@google.com>:
      memcg: css_tryget_online cleanups

    Vincenzo Frascino <vincenzo.frascino@arm.com>:
      mm/memcontrol.c: make mem_cgroup_id_get_many() __maybe_unused

    Chris Down <chris@chrisdown.name>:
      mm, memcg: prevent memory.high load/store tearing
      mm, memcg: prevent memory.max load tearing
      mm, memcg: prevent memory.low load/store tearing
      mm, memcg: prevent memory.min load/store tearing
      mm, memcg: prevent memory.swap.max load tearing
      mm, memcg: prevent mem_cgroup_protected store tearing

    Roman Gushchin <guro@fb.com>:
      mm: memcg: make memory.oom.group tolerable to task migration

Subsystem: mm/pagemap

    Thomas Hellstrom <thellstrom@vmware.com>:
      mm/mapping_dirty_helpers: Update huge page-table entry callbacks

    Anshuman Khandual <anshuman.khandual@arm.com>:
    Patch series "mm/vma: some more minor changes", v2:
      mm/vma: move VM_NO_KHUGEPAGED into generic header
      mm/vma: make vma_is_foreign() available for general use
      mm/vma: make is_vma_temporary_stack() available for general use

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: add pagemap.h to the fine documentation

    Peter Xu <peterx@redhat.com>:
    Patch series "mm: Page fault enhancements", v6:
      mm/gup: rename "nonblocking" to "locked" where proper
      mm/gup: fix __get_user_pages() on fault retry of hugetlb
      mm: introduce fault_signal_pending()
      x86/mm: use helper fault_signal_pending()
      arc/mm: use helper fault_signal_pending()
      arm64/mm: use helper fault_signal_pending()
      powerpc/mm: use helper fault_signal_pending()
      sh/mm: use helper fault_signal_pending()
      mm: return faster for non-fatal signals in user mode faults
      userfaultfd: don't retake mmap_sem to emulate NOPAGE
      mm: introduce FAULT_FLAG_DEFAULT
      mm: introduce FAULT_FLAG_INTERRUPTIBLE
      mm: allow VM_FAULT_RETRY for multiple times
      mm/gup: allow VM_FAULT_RETRY for multiple times
      mm/gup: allow to react to fatal signals
      mm/userfaultfd: honor FAULT_FLAG_KILLABLE in fault path

    WANG Wenhu <wenhu.wang@vivo.com>:
      mm: clarify a confusing comment for remap_pfn_range()

    Wang Wenhu <wenhu.wang@vivo.com>:
      mm/memory.c: clarify a confusing comment for vm_iomap_memory

    Jaewon Kim <jaewon31.kim@samsung.com>:
    Patch series "mm: mmap: add mmap trace point", v3:
      mmap: remove inline of vm_unmapped_area
      mm: mmap: add trace point of vm_unmapped_area

Subsystem: mm/mremap

    Brian Geffon <bgeffon@google.com>:
      mm/mremap: add MREMAP_DONTUNMAP to mremap()
      selftests: add MREMAP_DONTUNMAP selftest

Subsystem: mm/sparsemem

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/sparsemem: get address to page struct instead of address to pfn

    Pingfan Liu <kernelfans@gmail.com>:
      mm/sparse: rename pfn_present() to pfn_in_present_section()

    Baoquan He <bhe@redhat.com>:
      mm/sparse.c: use kvmalloc/kvfree to alloc/free memmap for the classic sparse
      mm/sparse.c: allocate memmap preferring the given node

Subsystem: mm/kasan

    Walter Wu <walter-zh.wu@mediatek.com>:
    Patch series "fix the missing underflow in memory operation function", v4:
      kasan: detect negative size in memory operation function
      kasan: add test for invalid size in memmove

Subsystem: mm/pagealloc

    Joel Savitz <jsavitz@redhat.com>:
      mm/page_alloc: increase default min_free_kbytes bound

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm, pagealloc: micro-optimisation: save two branches on hot page allocation path

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/page_alloc.c: use free_area_empty() instead of open-coding

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/page_alloc.c: micro-optimisation Remove unnecessary branch

    chenqiwu <chenqiwu@xiaomi.com>:
      mm/page_alloc: simplify page_is_buddy() for better code readability

Subsystem: mm/vmscan

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: vmpressure: don't need call kfree if kstrndup fails
      mm: vmpressure: use mem_cgroup_is_root API
      mm: vmscan: replace open codings to NUMA_NO_NODE

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/vmscan.c: remove cpu online notification for now

    Qian Cai <cai@lca.pw>:
      mm/vmscan.c: fix data races using kswapd_classzone_idx

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/vmscan.c: Clean code by removing unnecessary assignment

    Kirill Tkhai <ktkhai@virtuozzo.com>:
      mm/vmscan.c: make may_enter_fs bool in shrink_page_list()

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/vmscan.c: do_try_to_free_pages(): clean code by removing unnecessary assignment

    Michal Hocko <mhocko@suse.com>:
      selftests: vm: drop dependencies on page flags from mlock2 tests

Subsystem: mm/compaction

    Rik van Riel <riel@surriel.com>:
    Patch series "fix THP migration for CMA allocations", v2:
      mm,compaction,cma: add alloc_contig flag to compact_control
      mm,thp,compaction,cma: allow THP migration for CMA allocations

    Vlastimil Babka <vbabka@suse.cz>:
      mm, compaction: fully assume capture is not NULL in compact_zone_order()

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/compaction: really limit compact_unevictable_allowed to 0 and 1
      mm/compaction: Disable compact_unevictable_allowed on RT

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/compaction.c: clean code by removing unnecessary assignment

Subsystem: mm/mempolicy

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm/mempolicy: support MPOL_MF_STRICT for huge page mapping
      mm/mempolicy: check hugepage migration is supported by arch in vma_migratable()

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: mempolicy: use VM_BUG_ON_VMA in queue_pages_test_walk()

    Randy Dunlap <rdunlap@infradead.org>:
      mm: mempolicy: require at least one nodeid for MPOL_PREFERRED

    Colin Ian King <colin.king@canonical.com>:
      mm/memblock.c: remove redundant assignment to variable max_addr

Subsystem: mm/hugetlbfs

    Mike Kravetz <mike.kravetz@oracle.com>:
    Patch series "hugetlbfs: use i_mmap_rwsem for more synchronization", v2:
      hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization
      hugetlbfs: Use i_mmap_rwsem to address page fault/truncate race

Subsystem: mm/hugetlb

    Mina Almasry <almasrymina@google.com>:
      hugetlb_cgroup: add hugetlb_cgroup reservation counter
      hugetlb_cgroup: add interface for charge/uncharge hugetlb reservations
      mm/hugetlb_cgroup: fix hugetlb_cgroup migration
      hugetlb_cgroup: add reservation accounting for private mappings
      hugetlb: disable region_add file_region coalescing
      hugetlb_cgroup: add accounting for shared mappings
      hugetlb_cgroup: support noreserve mappings
      hugetlb: support file_region coalescing again
      hugetlb_cgroup: add hugetlb_cgroup reservation tests
      hugetlb_cgroup: add hugetlb_cgroup reservation docs

    Mateusz Nosek <mateusznosek0@gmail.com>:
      mm/hugetlb.c: clean code by removing unnecessary initialization

    Vlastimil Babka <vbabka@suse.cz>:
      mm/hugetlb: remove unnecessary memory fetch in PageHeadHuge()

    Christophe Leroy <christophe.leroy@c-s.fr>:
      selftests/vm: fix map_hugetlb length used for testing read and write
      mm/hugetlb: fix build failure with HUGETLB_PAGE but not HUGEBTLBFS

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      include/linux/huge_mm.h: check PageTail in hpage_nr_pages even when !THP

 Documentation/admin-guide/cgroup-v1/hugetlb.rst        |  103 +-
 Documentation/admin-guide/cgroup-v2.rst                |   11 
 Documentation/admin-guide/sysctl/vm.rst                |    3 
 Documentation/core-api/mm-api.rst                      |    3 
 Documentation/core-api/pin_user_pages.rst              |   86 +
 arch/alpha/include/asm/Kbuild                          |   11 
 arch/alpha/mm/fault.c                                  |    6 
 arch/arc/include/asm/Kbuild                            |   21 
 arch/arc/mm/fault.c                                    |   37 
 arch/arm/include/asm/Kbuild                            |   12 
 arch/arm/mm/fault.c                                    |    7 
 arch/arm64/include/asm/Kbuild                          |   18 
 arch/arm64/mm/fault.c                                  |   26 
 arch/c6x/include/asm/Kbuild                            |   37 
 arch/csky/include/asm/Kbuild                           |   36 
 arch/h8300/include/asm/Kbuild                          |   46 
 arch/hexagon/include/asm/Kbuild                        |   33 
 arch/hexagon/mm/vm_fault.c                             |    5 
 arch/ia64/include/asm/Kbuild                           |    7 
 arch/ia64/mm/fault.c                                   |    5 
 arch/m68k/include/asm/Kbuild                           |   24 
 arch/m68k/mm/fault.c                                   |    7 
 arch/microblaze/include/asm/Kbuild                     |   29 
 arch/microblaze/mm/fault.c                             |    5 
 arch/mips/include/asm/Kbuild                           |   13 
 arch/mips/mm/fault.c                                   |    5 
 arch/nds32/include/asm/Kbuild                          |   37 
 arch/nds32/mm/fault.c                                  |    5 
 arch/nios2/include/asm/Kbuild                          |   38 
 arch/nios2/mm/fault.c                                  |    7 
 arch/openrisc/include/asm/Kbuild                       |   36 
 arch/openrisc/mm/fault.c                               |    5 
 arch/parisc/include/asm/Kbuild                         |   18 
 arch/parisc/mm/fault.c                                 |    8 
 arch/powerpc/include/asm/Kbuild                        |    4 
 arch/powerpc/mm/book3s64/pkeys.c                       |   12 
 arch/powerpc/mm/fault.c                                |   20 
 arch/powerpc/platforms/pseries/hotplug-memory.c        |    2 
 arch/riscv/include/asm/Kbuild                          |   28 
 arch/riscv/mm/fault.c                                  |    9 
 arch/s390/include/asm/Kbuild                           |   15 
 arch/s390/mm/fault.c                                   |   10 
 arch/sh/include/asm/Kbuild                             |   16 
 arch/sh/mm/fault.c                                     |   13 
 arch/sparc/include/asm/Kbuild                          |   14 
 arch/sparc/mm/fault_32.c                               |    5 
 arch/sparc/mm/fault_64.c                               |    5 
 arch/um/kernel/trap.c                                  |    3 
 arch/unicore32/include/asm/Kbuild                      |   34 
 arch/unicore32/mm/fault.c                              |    8 
 arch/x86/include/asm/Kbuild                            |    2 
 arch/x86/include/asm/mmu_context.h                     |   15 
 arch/x86/mm/fault.c                                    |   32 
 arch/xtensa/include/asm/Kbuild                         |   26 
 arch/xtensa/mm/fault.c                                 |    5 
 drivers/base/node.c                                    |    2 
 drivers/gpu/drm/ttm/ttm_bo_vm.c                        |   12 
 fs/fs_parser.c                                         |    2 
 fs/hugetlbfs/inode.c                                   |   30 
 fs/ocfs2/alloc.c                                       |    3 
 fs/ocfs2/cluster/heartbeat.c                           |   12 
 fs/ocfs2/cluster/netdebug.c                            |    4 
 fs/ocfs2/cluster/tcp.c                                 |   27 
 fs/ocfs2/cluster/tcp.h                                 |    2 
 fs/ocfs2/dir.c                                         |    4 
 fs/ocfs2/dlm/dlmcommon.h                               |    8 
 fs/ocfs2/dlm/dlmdebug.c                                |  100 -
 fs/ocfs2/dlm/dlmmaster.c                               |    2 
 fs/ocfs2/dlm/dlmthread.c                               |    3 
 fs/ocfs2/dlmglue.c                                     |    2 
 fs/ocfs2/journal.c                                     |    2 
 fs/ocfs2/namei.c                                       |   15 
 fs/ocfs2/ocfs2_fs.h                                    |   18 
 fs/ocfs2/refcounttree.c                                |    2 
 fs/ocfs2/reservations.c                                |    3 
 fs/ocfs2/stackglue.c                                   |    2 
 fs/ocfs2/suballoc.c                                    |    5 
 fs/ocfs2/super.c                                       |   46 
 fs/pipe.c                                              |    2 
 fs/userfaultfd.c                                       |   64 -
 include/asm-generic/Kbuild                             |   52 +
 include/linux/cgroup-defs.h                            |    5 
 include/linux/fs.h                                     |    5 
 include/linux/gfp.h                                    |    6 
 include/linux/huge_mm.h                                |   10 
 include/linux/hugetlb.h                                |   76 +
 include/linux/hugetlb_cgroup.h                         |  175 +++
 include/linux/kasan.h                                  |    2 
 include/linux/kthread.h                                |    3 
 include/linux/memcontrol.h                             |   66 -
 include/linux/mempolicy.h                              |   29 
 include/linux/mm.h                                     |  243 +++-
 include/linux/mm_types.h                               |    7 
 include/linux/mmzone.h                                 |    6 
 include/linux/page_ref.h                               |    9 
 include/linux/pagemap.h                                |   29 
 include/linux/sched/signal.h                           |   18 
 include/linux/swap.h                                   |    1 
 include/linux/topology.h                               |   17 
 include/trace/events/mmap.h                            |   48 
 include/uapi/linux/mman.h                              |    5 
 kernel/cgroup/cgroup.c                                 |   17 
 kernel/fork.c                                          |    9 
 kernel/sysctl.c                                        |   31 
 lib/test_kasan.c                                       |   19 
 mm/Makefile                                            |    1 
 mm/compaction.c                                        |   31 
 mm/debug.c                                             |   54 -
 mm/filemap.c                                           |   77 -
 mm/gup.c                                               |  682 ++++++++++---
 mm/gup_benchmark.c                                     |   71 +
 mm/huge_memory.c                                       |   29 
 mm/hugetlb.c                                           |  866 ++++++++++++-----
 mm/hugetlb_cgroup.c                                    |  347 +++++-
 mm/internal.h                                          |   32 
 mm/kasan/common.c                                      |   26 
 mm/kasan/generic.c                                     |    9 
 mm/kasan/generic_report.c                              |   11 
 mm/kasan/kasan.h                                       |    2 
 mm/kasan/report.c                                      |    5 
 mm/kasan/tags.c                                        |    9 
 mm/kasan/tags_report.c                                 |   11 
 mm/khugepaged.c                                        |    4 
 mm/kmemleak.c                                          |    2 
 mm/list_lru.c                                          |   12 
 mm/mapping_dirty_helpers.c                             |   42 
 mm/memblock.c                                          |    2 
 mm/memcontrol.c                                        |  378 ++++---
 mm/memory-failure.c                                    |   29 
 mm/memory.c                                            |    4 
 mm/mempolicy.c                                         |   73 +
 mm/migrate.c                                           |   25 
 mm/mmap.c                                              |   32 
 mm/mremap.c                                            |   92 +
 mm/page-writeback.c                                    |   19 
 mm/page_alloc.c                                        |   82 -
 mm/page_counter.c                                      |   29 
 mm/page_ext.c                                          |    2 
 mm/rmap.c                                              |   39 
 mm/shuffle.c                                           |    2 
 mm/slab.h                                              |   32 
 mm/slab_common.c                                       |    2 
 mm/slub.c                                              |   27 
 mm/sparse.c                                            |   33 
 mm/swap.c                                              |    5 
 mm/swap_slots.c                                        |   12 
 mm/swap_state.c                                        |    2 
 mm/swapfile.c                                          |   10 
 mm/userfaultfd.c                                       |   11 
 mm/vmpressure.c                                        |    8 
 mm/vmscan.c                                            |  111 --
 mm/vmstat.c                                            |    2 
 scripts/spelling.txt                                   |   21 
 tools/accounting/getdelays.c                           |    2 
 tools/testing/selftests/vm/.gitignore                  |    1 
 tools/testing/selftests/vm/Makefile                    |    2 
 tools/testing/selftests/vm/charge_reserved_hugetlb.sh  |  575 +++++++++++
 tools/testing/selftests/vm/gup_benchmark.c             |   15 
 tools/testing/selftests/vm/hugetlb_reparenting_test.sh |  244 ++++
 tools/testing/selftests/vm/map_hugetlb.c               |   14 
 tools/testing/selftests/vm/mlock2-tests.c              |  233 ----
 tools/testing/selftests/vm/mremap_dontunmap.c          |  313 ++++++
 tools/testing/selftests/vm/run_vmtests                 |   37 
 tools/testing/selftests/vm/write_hugetlb_memory.sh     |   23 
 tools/testing/selftests/vm/write_to_hugetlbfs.c        |  242 ++++
 165 files changed, 5020 insertions(+), 2376 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-03-29  2:14 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-03-29  2:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

5 fixes, based on 83fd69c93340177dcd66fd26ce6441fb581c1dbf:


    Naohiro Aota <naohiro.aota@wdc.com>:
      mm/swapfile.c: move inode_lock out of claim_swapfile

    David Hildenbrand <david@redhat.com>:
      drivers/base/memory.c: indicate all memory blocks as removable

    Mina Almasry <almasrymina@google.com>:
      hugetlb_cgroup: fix illegal access to memory

    Roman Gushchin <guro@fb.com>:
      mm: fork: fix kernel_stack memcg stats for various stack implementations

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
      mm/sparse: fix kernel crash with pfn_section_valid check

 drivers/base/memory.c      |   23 +++--------------------
 include/linux/memcontrol.h |   12 ++++++++++++
 kernel/fork.c              |    4 ++--
 mm/hugetlb_cgroup.c        |    3 +--
 mm/memcontrol.c            |   38 ++++++++++++++++++++++++++++++++++++++
 mm/sparse.c                |    6 ++++++
 mm/swapfile.c              |   41 ++++++++++++++++++++---------------------
 7 files changed, 82 insertions(+), 45 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-03-22  1:19 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-03-22  1:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

10 fixes, based on c63c50fc2ec9afc4de21ef9ead2eac64b178cce1:


    Chunguang Xu <brookxu@tencent.com>:
      memcg: fix NULL pointer dereference in __mem_cgroup_usage_unregister_event

    Baoquan He <bhe@redhat.com>:
      mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case

    Qian Cai <cai@lca.pw>:
      page-flags: fix a crash at SetPageError(THP_SWAP)

    Chris Down <chris@chrisdown.name>:
      mm, memcg: fix corruption on 64-bit divisor in memory.high throttling
      mm, memcg: throttle allocators based on ancestral memory.high

    Michal Hocko <mhocko@suse.com>:
      mm: do not allow MADV_PAGEOUT for CoW pages

    Roman Penyaev <rpenyaev@suse.de>:
      epoll: fix possible lost wakeup on epoll_ctl() path

    Qian Cai <cai@lca.pw>:
      mm/mmu_notifier: silence PROVE_RCU_LIST warnings

    Vlastimil Babka <vbabka@suse.cz>:
      mm, slub: prevent kmalloc_node crashes and memory leaks

    Joerg Roedel <jroedel@suse.de>:
      x86/mm: split vmalloc_sync_all()

 arch/x86/mm/fault.c        |   26 ++++++++++-
 drivers/acpi/apei/ghes.c   |    2 
 fs/eventpoll.c             |    8 +--
 include/linux/page-flags.h |    2 
 include/linux/vmalloc.h    |    5 +-
 kernel/notifier.c          |    2 
 mm/madvise.c               |   12 +++--
 mm/memcontrol.c            |  105 ++++++++++++++++++++++++++++-----------------
 mm/mmu_notifier.c          |   27 +++++++----
 mm/nommu.c                 |   10 +++-
 mm/slub.c                  |   26 +++++++----
 mm/sparse.c                |    8 ++-
 mm/vmalloc.c               |   11 +++-
 13 files changed, 165 insertions(+), 79 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-03-06  6:27 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-03-06  6:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

7 fixes, based on 9f65ed5fe41ce08ed1cb1f6a950f9ec694c142ad:

    Mel Gorman <mgorman@techsingularity.net>:
      mm, numa: fix bad pmd by atomically check for pmd_trans_huge when marking page tables prot_numa

    Huang Ying <ying.huang@intel.com>:
      mm: fix possible PMD dirty bit lost in set_pmd_migration_entry()

    "Kirill A. Shutemov" <kirill@shutemov.name>:
      mm: avoid data corruption on CoW fault into PFN-mapped VMA

    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
      fat: fix uninit-memory access for partial initialized inode

    Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
      mm/z3fold.c: do not include rwlock.h directly

    Vlastimil Babka <vbabka@suse.cz>:
      mm, hotplug: fix page online with DEBUG_PAGEALLOC compiled but not enabled

    Miroslav Benes <mbenes@suse.cz>:
      arch/Kconfig: update HAVE_RELIABLE_STACKTRACE description

 arch/Kconfig        |    5 +++--
 fs/fat/inode.c      |   19 +++++++------------
 include/linux/mm.h  |    4 ++++
 mm/huge_memory.c    |    3 +--
 mm/memory.c         |   35 +++++++++++++++++++++++++++--------
 mm/memory_hotplug.c |    8 +++++++-
 mm/mprotect.c       |   38 ++++++++++++++++++++++++++++++++++++--
 mm/z3fold.c         |    1 -
 8 files changed, 85 insertions(+), 28 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-21 18:32   ` incoming Konstantin Ryabitsev
@ 2020-02-27  9:59     ` Vlastimil Babka
  0 siblings, 0 replies; 307+ messages in thread
From: Vlastimil Babka @ 2020-02-27  9:59 UTC (permalink / raw)
  To: Konstantin Ryabitsev, Linus Torvalds; +Cc: Andrew Morton, Linux-MM, mm-commits

On 2/21/20 7:32 PM, Konstantin Ryabitsev wrote:
> On Fri, Feb 21, 2020 at 10:21:19AM -0800, Linus Torvalds wrote:
>> On Thu, Feb 20, 2020 at 8:00 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>> >
>> > - A few y2038 fixes which missed the merge window whiole dependencies
>> >   in NFS were being sorted out.
>> >
>> > - A bunch of fixes.  Some minor, some not.
>> 
>> Hmm. Konstantin's nice lore script _used_ to pick up your patches, but
>> now they don't.
>> 
>> I'm not sure what changed. It worked with your big series of 118 patches.
>> 
>> It doesn't work with this smaller series of fixes.
>>
>> I think the difference is that you've done something bad to your patch
>> sending. That big series was properly threaded with each of the
>> patches being a reply to the 'incoming' message.
>> 
>> This series is not.
> 
> This is correct -- each patch is posted without an in-reply-to, so 
> public-inbox doesn't group them into a thread.
> 
> E.g.:
> https://lore.kernel.org/linux-mm/20200221040350.84HaG%25akpm@linux-foundation.org/
> 
>> 
>> Please, Andrew, can you make your email flow more consistent so that I
>> can actually use the nice new tool to download a patch series?
> 
> Andrew, I'll be happy to provide you with a helper tool if you can 
> describe me your workflow. E.g. if you have a quilt directory of patches 
> plus a series file, it could easily be a tiny wrapper like:
> 
> send-patches --base-commit 1234abcd --cover cover.txt patchdir/series

Once/if there is such tool, could it perhaps instead of mass e-mailing create
git commits, push them to korg repo and send a pull request?

Thanks,
Vlastimil

> -K
> 



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-21 18:21 ` incoming Linus Torvalds
  2020-02-21 18:32   ` incoming Konstantin Ryabitsev
@ 2020-02-21 19:33   ` Linus Torvalds
  1 sibling, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-02-21 19:33 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: Linux-MM, mm-commits

Side note: I've obviously picked it up the old-fashioned way, but I
had been looking forward to seeing if I could just automate this more.

            Linus

On Fri, Feb 21, 2020 at 10:21 AM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Please, Andrew, can you make your email flow more consistent so that I
> can actually use the nice new tool to download a patch series?
>
>             Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-21 18:21 ` incoming Linus Torvalds
@ 2020-02-21 18:32   ` Konstantin Ryabitsev
  2020-02-27  9:59     ` incoming Vlastimil Babka
  2020-02-21 19:33   ` incoming Linus Torvalds
  1 sibling, 1 reply; 307+ messages in thread
From: Konstantin Ryabitsev @ 2020-02-21 18:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Linux-MM, mm-commits

On Fri, Feb 21, 2020 at 10:21:19AM -0800, Linus Torvalds wrote:
> On Thu, Feb 20, 2020 at 8:00 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > - A few y2038 fixes which missed the merge window whiole dependencies
> >   in NFS were being sorted out.
> >
> > - A bunch of fixes.  Some minor, some not.
> 
> Hmm. Konstantin's nice lore script _used_ to pick up your patches, but
> now they don't.
> 
> I'm not sure what changed. It worked with your big series of 118 patches.
> 
> It doesn't work with this smaller series of fixes.
>
> I think the difference is that you've done something bad to your patch
> sending. That big series was properly threaded with each of the
> patches being a reply to the 'incoming' message.
> 
> This series is not.

This is correct -- each patch is posted without an in-reply-to, so 
public-inbox doesn't group them into a thread.

E.g.:
https://lore.kernel.org/linux-mm/20200221040350.84HaG%25akpm@linux-foundation.org/

> 
> Please, Andrew, can you make your email flow more consistent so that I
> can actually use the nice new tool to download a patch series?

Andrew, I'll be happy to provide you with a helper tool if you can 
describe me your workflow. E.g. if you have a quilt directory of patches 
plus a series file, it could easily be a tiny wrapper like:

send-patches --base-commit 1234abcd --cover cover.txt patchdir/series

-K


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-21  4:00 incoming Andrew Morton
  2020-02-21  4:03 ` incoming Andrew Morton
@ 2020-02-21 18:21 ` Linus Torvalds
  2020-02-21 18:32   ` incoming Konstantin Ryabitsev
  2020-02-21 19:33   ` incoming Linus Torvalds
  1 sibling, 2 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-02-21 18:21 UTC (permalink / raw)
  To: Andrew Morton, Konstantin Ryabitsev; +Cc: Linux-MM, mm-commits

On Thu, Feb 20, 2020 at 8:00 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> - A few y2038 fixes which missed the merge window whiole dependencies
>   in NFS were being sorted out.
>
> - A bunch of fixes.  Some minor, some not.

Hmm. Konstantin's nice lore script _used_ to pick up your patches, but
now they don't.

I'm not sure what changed. It worked with your big series of 118 patches.

It doesn't work with this smaller series of fixes.

I think the difference is that you've done something bad to your patch
sending. That big series was properly threaded with each of the
patches being a reply to the 'incoming' message.

This series is not.

Please, Andrew, can you make your email flow more consistent so that I
can actually use the nice new tool to download a patch series?

            Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-21  4:00 incoming Andrew Morton
@ 2020-02-21  4:03 ` Andrew Morton
  2020-02-21 18:21 ` incoming Linus Torvalds
  1 sibling, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-02-21  4:03 UTC (permalink / raw)
  To: Linus Torvalds, linux-mm, mm-commits

On Thu, 20 Feb 2020 20:00:30 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> - A few y2038 fixes which missed the merge window whiole dependencies
>   in NFS were being sorted out.
> 
> - A bunch of fixes.  Some minor, some not.

15 patches, based on ca7e1fd1026c5af6a533b4b5447e1d2f153e28f2



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-02-21  4:00 Andrew Morton
  2020-02-21  4:03 ` incoming Andrew Morton
  2020-02-21 18:21 ` incoming Linus Torvalds
  0 siblings, 2 replies; 307+ messages in thread
From: Andrew Morton @ 2020-02-21  4:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


- A few y2038 fixes which missed the merge window whiole dependencies
  in NFS were being sorted out.

- A bunch of fixes.  Some minor, some not.


Subsystems affected by this patch series:


    Arnd Bergmann <arnd@arndb.de>:
      y2038: remove ktime to/from timespec/timeval conversion
      y2038: remove unused time32 interfaces
      y2038: hide timeval/timespec/itimerval/itimerspec types

    Ioanna Alifieraki <ioanna-maria.alifieraki@canonical.com>:
      Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"

    Christian Borntraeger <borntraeger@de.ibm.com>:
      include/uapi/linux/swab.h: fix userspace breakage, use __BITS_PER_LONG for swap

    SeongJae Park <sjpark@amazon.de>:
      selftests/vm: add missed tests in run_vmtests

    Joe Perches <joe@perches.com>:
      get_maintainer: remove uses of P: for maintainer name

    Douglas Anderson <dianders@chromium.org>:
      scripts/get_maintainer.pl: deprioritize old Fixes: addresses

    Christoph Hellwig <hch@lst.de>:
      mm/swapfile.c: fix a comment in sys_swapon()

    Vasily Averin <vvs@virtuozzo.com>:
      mm/memcontrol.c: lost css_put in memcg_expand_shrinker_maps()

    Alexandru Ardelean <alexandru.ardelean@analog.com>:
      lib/string.c: update match_string() doc-strings with correct behavior

    Gavin Shan <gshan@redhat.com>:
      mm/vmscan.c: don't round up scan size for online memory cgroup

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/sparsemem: pfn_to_page is not valid yet on SPARSEMEM

    Alexander Potapenko <glider@google.com>:
      lib/stackdepot.c: fix global out-of-bounds in stack_slabs

    Randy Dunlap <rdunlap@infradead.org>:
      MAINTAINERS: use tabs for SAFESETID

 MAINTAINERS                            |    8 -
 include/linux/compat.h                 |   29 ------
 include/linux/ktime.h                  |   37 -------
 include/linux/time32.h                 |  154 ---------------------------------
 include/linux/timekeeping32.h          |   32 ------
 include/linux/types.h                  |    5 -
 include/uapi/asm-generic/posix_types.h |    2 
 include/uapi/linux/swab.h              |    4 
 include/uapi/linux/time.h              |   22 ++--
 ipc/sem.c                              |    6 -
 kernel/compat.c                        |   64 -------------
 kernel/time/time.c                     |   43 ---------
 lib/stackdepot.c                       |    8 +
 lib/string.c                           |   16 +++
 mm/memcontrol.c                        |    4 
 mm/sparse.c                            |    2 
 mm/swapfile.c                          |    2 
 mm/vmscan.c                            |    9 +
 scripts/get_maintainer.pl              |   32 ------
 tools/testing/selftests/vm/run_vmtests |   33 +++++++
 20 files changed, 93 insertions(+), 419 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-04  2:46   ` incoming Andrew Morton
@ 2020-02-04  3:11     ` Linus Torvalds
  0 siblings, 0 replies; 307+ messages in thread
From: Linus Torvalds @ 2020-02-04  3:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Tue, Feb 4, 2020 at 2:46 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Tue, 4 Feb 2020 02:27:48 +0000 Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > What's the base? You've changed your scripts or something, and that
> > information is no longer in your cover letter..
>
> Crap, sorry, geriatric.
>
> d4e9056daedca3891414fe3c91de3449a5dad0f2

Ok, I've tentatively applied it with the MIME decoding fixes I found,
and I'll guess I'll let it build and sit for a while before merging it
into my tree.

I didn't find anything else odd in there. But...

              Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-04  2:27 ` incoming Linus Torvalds
@ 2020-02-04  2:46   ` Andrew Morton
  2020-02-04  3:11     ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-02-04  2:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, Linux-MM

On Tue, 4 Feb 2020 02:27:48 +0000 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Feb 4, 2020 at 1:33 AM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > The rest of MM and the rest of everything else.
> 
> What's the base? You've changed your scripts or something, and that
> information is no longer in your cover letter..
> 

Crap, sorry, geriatric.

d4e9056daedca3891414fe3c91de3449a5dad0f2


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2020-02-04  1:33 incoming Andrew Morton
@ 2020-02-04  2:27 ` Linus Torvalds
  2020-02-04  2:46   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2020-02-04  2:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, Linux-MM

On Tue, Feb 4, 2020 at 1:33 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> The rest of MM and the rest of everything else.

What's the base? You've changed your scripts or something, and that
information is no longer in your cover letter..

               Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-02-04  1:33 Andrew Morton
  2020-02-04  2:27 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2020-02-04  1:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


The rest of MM and the rest of everything else.


Subsystems affected by this patch series:

  hotfixes
  mm/pagealloc
  mm/memory-hotplug
  ipc
  misc
  mm/cleanups
  mm/pagemap
  procfs
  lib
  cleanups
  arm

Subsystem: hotfixes

    Gang He <GHe@suse.com>:
      ocfs2: fix oops when writing cloned file

    David Hildenbrand <david@redhat.com>:
    Patch series "mm: fix max_pfn not falling on section boundary", v2:
      mm/page_alloc.c: fix uninitialized memmaps on a partially populated last section
      fs/proc/page.c: allow inspection of last section and fix end detection
      mm/page_alloc.c: initialize memmap of unavailable memory directly

Subsystem: mm/pagealloc

    David Hildenbrand <david@redhat.com>:
      mm/page_alloc: fix and rework pfn handling in memmap_init_zone()
      mm: factor out next_present_section_nr()

Subsystem: mm/memory-hotplug

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
    Patch series "mm/memory_hotplug: Shrink zones before removing memory", v6:
      mm/memmap_init: update variable name in memmap_init_zone

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: poison memmap in remove_pfn_range_from_zone()
      mm/memory_hotplug: we always have a zone in find_(smallest|biggest)_section_pfn
      mm/memory_hotplug: don't check for "all holes" in shrink_zone_span()
      mm/memory_hotplug: drop local variables in shrink_zone_span()
      mm/memory_hotplug: cleanup __remove_pages()
      mm/memory_hotplug: drop valid_start/valid_end from test_pages_in_a_zone()

Subsystem: ipc

    Manfred Spraul <manfred@colorfullife.com>:
      smp_mb__{before,after}_atomic(): update Documentation

    Davidlohr Bueso <dave@stgolabs.net>:
      ipc/mqueue.c: remove duplicated code

    Manfred Spraul <manfred@colorfullife.com>:
      ipc/mqueue.c: update/document memory barriers
      ipc/msg.c: update and document memory barriers
      ipc/sem.c: document and update memory barriers

    Lu Shuaibing <shuaibinglu@126.com>:
      ipc/msg.c: consolidate all xxxctl_down() functions
drivers/block/null_blk_main.c: fix layout

Subsystem: misc

    Andrew Morton <akpm@linux-foundation.org>:
      drivers/block/null_blk_main.c: fix layout
      drivers/block/null_blk_main.c: fix uninitialized var warnings

    Randy Dunlap <rdunlap@infradead.org>:
      pinctrl: fix pxa2xx.c build warnings

Subsystem: mm/cleanups

    Florian Westphal <fw@strlen.de>:
      mm: remove __krealloc

Subsystem: mm/pagemap

    Steven Price <steven.price@arm.com>:
    Patch series "Generic page walk and ptdump", v17:
      mm: add generic p?d_leaf() macros
      arc: mm: add p?d_leaf() definitions
      arm: mm: add p?d_leaf() definitions
      arm64: mm: add p?d_leaf() definitions
      mips: mm: add p?d_leaf() definitions
      powerpc: mm: add p?d_leaf() definitions
      riscv: mm: add p?d_leaf() definitions
      s390: mm: add p?d_leaf() definitions
      sparc: mm: add p?d_leaf() definitions
      x86: mm: add p?d_leaf() definitions
      mm: pagewalk: add p4d_entry() and pgd_entry()
      mm: pagewalk: allow walking without vma
      mm: pagewalk: don't lock PTEs for walk_page_range_novma()
      mm: pagewalk: fix termination condition in walk_pte_range()
      mm: pagewalk: add 'depth' parameter to pte_hole
      x86: mm: point to struct seq_file from struct pg_state
      x86: mm+efi: convert ptdump_walk_pgd_level() to take a mm_struct
      x86: mm: convert ptdump_walk_pgd_level_debugfs() to take an mm_struct
      mm: add generic ptdump
      x86: mm: convert dump_pagetables to use walk_page_range
      arm64: mm: convert mm/dump.c to use walk_page_range()
      arm64: mm: display non-present entries in ptdump
      mm: ptdump: reduce level numbers by 1 in note_page()
      x86: mm: avoid allocating struct mm_struct on the stack

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
    Patch series "Fixup page directory freeing", v4:
      powerpc/mmu_gather: enable RCU_TABLE_FREE even for !SMP case

    Peter Zijlstra <peterz@infradead.org>:
      mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush
      asm-generic/tlb: avoid potential double flush
      asm-gemeric/tlb: remove stray function declarations
      asm-generic/tlb: add missing CONFIG symbol
      asm-generic/tlb: rename HAVE_RCU_TABLE_FREE
      asm-generic/tlb: rename HAVE_MMU_GATHER_PAGE_SIZE
      asm-generic/tlb: rename HAVE_MMU_GATHER_NO_GATHER
      asm-generic/tlb: provide MMU_GATHER_TABLE_FREE

Subsystem: procfs

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: decouple proc from VFS with "struct proc_ops"
      proc: convert everything to "struct proc_ops"

Subsystem: lib

    Yury Norov <yury.norov@gmail.com>:
    Patch series "lib: rework bitmap_parse", v5:
      lib/string: add strnchrnul()
      bitops: more BITS_TO_* macros
      lib: add test for bitmap_parse()
      lib: make bitmap_parse_user a wrapper on bitmap_parse
      lib: rework bitmap_parse()
      lib: new testcases for bitmap_parse{_user}
      include/linux/cpumask.h: don't calculate length of the input string

Subsystem: cleanups

    Masahiro Yamada <masahiroy@kernel.org>:
      treewide: remove redundant IS_ERR() before error code check

Subsystem: arm

    Chen-Yu Tsai <wens@csie.org>:
      ARM: dma-api: fix max_pfn off-by-one error in __dma_supported()

 Documentation/memory-barriers.txt                     |   14 
 arch/Kconfig                                          |   17 
 arch/alpha/kernel/srm_env.c                           |   17 
 arch/arc/include/asm/pgtable.h                        |    1 
 arch/arm/Kconfig                                      |    2 
 arch/arm/include/asm/pgtable-2level.h                 |    1 
 arch/arm/include/asm/pgtable-3level.h                 |    1 
 arch/arm/include/asm/tlb.h                            |    6 
 arch/arm/kernel/atags_proc.c                          |    8 
 arch/arm/mm/alignment.c                               |   14 
 arch/arm/mm/dma-mapping.c                             |    2 
 arch/arm64/Kconfig                                    |    3 
 arch/arm64/Kconfig.debug                              |   19 
 arch/arm64/include/asm/pgtable.h                      |    2 
 arch/arm64/include/asm/ptdump.h                       |    8 
 arch/arm64/mm/Makefile                                |    4 
 arch/arm64/mm/dump.c                                  |  152 ++----
 arch/arm64/mm/mmu.c                                   |    4 
 arch/arm64/mm/ptdump_debugfs.c                        |    2 
 arch/ia64/kernel/salinfo.c                            |   24 -
 arch/m68k/kernel/bootinfo_proc.c                      |    8 
 arch/mips/include/asm/pgtable.h                       |    5 
 arch/mips/lasat/picvue_proc.c                         |   31 -
 arch/powerpc/Kconfig                                  |    7 
 arch/powerpc/include/asm/book3s/32/pgalloc.h          |    8 
 arch/powerpc/include/asm/book3s/64/pgalloc.h          |    2 
 arch/powerpc/include/asm/book3s/64/pgtable.h          |    3 
 arch/powerpc/include/asm/nohash/pgalloc.h             |    8 
 arch/powerpc/include/asm/tlb.h                        |   11 
 arch/powerpc/kernel/proc_powerpc.c                    |   10 
 arch/powerpc/kernel/rtas-proc.c                       |   70 +--
 arch/powerpc/kernel/rtas_flash.c                      |   34 -
 arch/powerpc/kernel/rtasd.c                           |   14 
 arch/powerpc/mm/book3s64/pgtable.c                    |    7 
 arch/powerpc/mm/numa.c                                |   12 
 arch/powerpc/platforms/pseries/lpar.c                 |   24 -
 arch/powerpc/platforms/pseries/lparcfg.c              |   14 
 arch/powerpc/platforms/pseries/reconfig.c             |    8 
 arch/powerpc/platforms/pseries/scanlog.c              |   15 
 arch/riscv/include/asm/pgtable-64.h                   |    7 
 arch/riscv/include/asm/pgtable.h                      |    7 
 arch/s390/Kconfig                                     |    4 
 arch/s390/include/asm/pgtable.h                       |    2 
 arch/sh/mm/alignment.c                                |   17 
 arch/sparc/Kconfig                                    |    3 
 arch/sparc/include/asm/pgtable_64.h                   |    2 
 arch/sparc/include/asm/tlb_64.h                       |   11 
 arch/sparc/kernel/led.c                               |   15 
 arch/um/drivers/mconsole_kern.c                       |    9 
 arch/um/kernel/exitcode.c                             |   15 
 arch/um/kernel/process.c                              |   15 
 arch/x86/Kconfig                                      |    3 
 arch/x86/Kconfig.debug                                |   20 
 arch/x86/include/asm/pgtable.h                        |   10 
 arch/x86/include/asm/tlb.h                            |    4 
 arch/x86/kernel/cpu/mtrr/if.c                         |   21 
 arch/x86/mm/Makefile                                  |    4 
 arch/x86/mm/debug_pagetables.c                        |   18 
 arch/x86/mm/dump_pagetables.c                         |  418 +++++-------------
 arch/x86/platform/efi/efi_32.c                        |    2 
 arch/x86/platform/efi/efi_64.c                        |    4 
 arch/x86/platform/uv/tlb_uv.c                         |   14 
 arch/xtensa/platforms/iss/simdisk.c                   |   10 
 crypto/af_alg.c                                       |    2 
 drivers/acpi/battery.c                                |   15 
 drivers/acpi/proc.c                                   |   15 
 drivers/acpi/scan.c                                   |    2 
 drivers/base/memory.c                                 |    9 
 drivers/block/null_blk_main.c                         |   58 +-
 drivers/char/hw_random/bcm2835-rng.c                  |    2 
 drivers/char/hw_random/omap-rng.c                     |    4 
 drivers/clk/clk.c                                     |    2 
 drivers/dma/mv_xor_v2.c                               |    2 
 drivers/firmware/efi/arm-runtime.c                    |    2 
 drivers/gpio/gpiolib-devres.c                         |    2 
 drivers/gpio/gpiolib-of.c                             |    8 
 drivers/gpio/gpiolib.c                                |    2 
 drivers/hwmon/dell-smm-hwmon.c                        |   15 
 drivers/i2c/busses/i2c-mv64xxx.c                      |    5 
 drivers/i2c/busses/i2c-synquacer.c                    |    2 
 drivers/ide/ide-proc.c                                |   19 
 drivers/input/input.c                                 |   28 -
 drivers/isdn/capi/kcapi_proc.c                        |    6 
 drivers/macintosh/via-pmu.c                           |   17 
 drivers/md/md.c                                       |   15 
 drivers/misc/sgi-gru/gruprocfs.c                      |   42 -
 drivers/mtd/ubi/build.c                               |    2 
 drivers/net/wireless/cisco/airo.c                     |  126 ++---
 drivers/net/wireless/intel/ipw2x00/libipw_module.c    |   15 
 drivers/net/wireless/intersil/hostap/hostap_hw.c      |    4 
 drivers/net/wireless/intersil/hostap/hostap_proc.c    |   14 
 drivers/net/wireless/intersil/hostap/hostap_wlan.h    |    2 
 drivers/net/wireless/ray_cs.c                         |   20 
 drivers/of/device.c                                   |    2 
 drivers/parisc/led.c                                  |   17 
 drivers/pci/controller/pci-tegra.c                    |    2 
 drivers/pci/proc.c                                    |   25 -
 drivers/phy/phy-core.c                                |    4 
 drivers/pinctrl/pxa/pinctrl-pxa2xx.c                  |    1 
 drivers/platform/x86/thinkpad_acpi.c                  |   15 
 drivers/platform/x86/toshiba_acpi.c                   |   60 +-
 drivers/pnp/isapnp/proc.c                             |    9 
 drivers/pnp/pnpbios/proc.c                            |   17 
 drivers/s390/block/dasd_proc.c                        |   15 
 drivers/s390/cio/blacklist.c                          |   14 
 drivers/s390/cio/css.c                                |   11 
 drivers/scsi/esas2r/esas2r_main.c                     |    9 
 drivers/scsi/scsi_devinfo.c                           |   15 
 drivers/scsi/scsi_proc.c                              |   29 -
 drivers/scsi/sg.c                                     |   30 -
 drivers/spi/spi-orion.c                               |    3 
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c |   14 
 drivers/tty/sysrq.c                                   |    8 
 drivers/usb/gadget/function/rndis.c                   |   17 
 drivers/video/fbdev/imxfb.c                           |    2 
 drivers/video/fbdev/via/viafbdev.c                    |  105 ++--
 drivers/zorro/proc.c                                  |    9 
 fs/cifs/cifs_debug.c                                  |  108 ++--
 fs/cifs/dfs_cache.c                                   |   13 
 fs/cifs/dfs_cache.h                                   |    2 
 fs/ext4/super.c                                       |    2 
 fs/f2fs/node.c                                        |    2 
 fs/fscache/internal.h                                 |    2 
 fs/fscache/object-list.c                              |   11 
 fs/fscache/proc.c                                     |    2 
 fs/jbd2/journal.c                                     |   13 
 fs/jfs/jfs_debug.c                                    |   14 
 fs/lockd/procfs.c                                     |   12 
 fs/nfsd/nfsctl.c                                      |   13 
 fs/nfsd/stats.c                                       |   12 
 fs/ocfs2/file.c                                       |   14 
 fs/ocfs2/suballoc.c                                   |    2 
 fs/proc/cpuinfo.c                                     |   12 
 fs/proc/generic.c                                     |   38 -
 fs/proc/inode.c                                       |   76 +--
 fs/proc/internal.h                                    |    5 
 fs/proc/kcore.c                                       |   13 
 fs/proc/kmsg.c                                        |   14 
 fs/proc/page.c                                        |   54 +-
 fs/proc/proc_net.c                                    |   32 -
 fs/proc/proc_sysctl.c                                 |    2 
 fs/proc/root.c                                        |    2 
 fs/proc/stat.c                                        |   12 
 fs/proc/task_mmu.c                                    |    4 
 fs/proc/vmcore.c                                      |   10 
 fs/sysfs/group.c                                      |    2 
 include/asm-generic/pgtable.h                         |   20 
 include/asm-generic/tlb.h                             |  138 +++--
 include/linux/bitmap.h                                |    8 
 include/linux/bitops.h                                |    4 
 include/linux/cpumask.h                               |    4 
 include/linux/memory_hotplug.h                        |    4 
 include/linux/mm.h                                    |    6 
 include/linux/mmzone.h                                |   10 
 include/linux/pagewalk.h                              |   49 +-
 include/linux/proc_fs.h                               |   23 
 include/linux/ptdump.h                                |   24 -
 include/linux/seq_file.h                              |   13 
 include/linux/slab.h                                  |    1 
 include/linux/string.h                                |    1 
 include/linux/sunrpc/stats.h                          |    4 
 ipc/mqueue.c                                          |  123 ++++-
 ipc/msg.c                                             |   62 +-
 ipc/sem.c                                             |   66 +-
 ipc/util.c                                            |   14 
 kernel/configs.c                                      |    9 
 kernel/irq/proc.c                                     |   42 -
 kernel/kallsyms.c                                     |   12 
 kernel/latencytop.c                                   |   14 
 kernel/locking/lockdep_proc.c                         |   15 
 kernel/module.c                                       |   12 
 kernel/profile.c                                      |   24 -
 kernel/sched/psi.c                                    |   48 +-
 lib/bitmap.c                                          |  195 ++++----
 lib/string.c                                          |   17 
 lib/test_bitmap.c                                     |  105 ++++
 mm/Kconfig.debug                                      |   21 
 mm/Makefile                                           |    1 
 mm/gup.c                                              |    2 
 mm/hmm.c                                              |   66 +-
 mm/memory_hotplug.c                                   |  104 +---
 mm/memremap.c                                         |    2 
 mm/migrate.c                                          |    5 
 mm/mincore.c                                          |    1 
 mm/mmu_gather.c                                       |  158 ++++--
 mm/page_alloc.c                                       |   75 +--
 mm/pagewalk.c                                         |  167 +++++--
 mm/ptdump.c                                           |  159 ++++++
 mm/slab_common.c                                      |   37 -
 mm/sparse.c                                           |   10 
 mm/swapfile.c                                         |   14 
 net/atm/mpoa_proc.c                                   |   17 
 net/atm/proc.c                                        |    8 
 net/core/dev.c                                        |    2 
 net/core/filter.c                                     |    2 
 net/core/pktgen.c                                     |   44 -
 net/ipv4/ipconfig.c                                   |   10 
 net/ipv4/netfilter/ipt_CLUSTERIP.c                    |   16 
 net/ipv4/route.c                                      |   24 -
 net/netfilter/xt_recent.c                             |   17 
 net/sunrpc/auth_gss/svcauth_gss.c                     |   10 
 net/sunrpc/cache.c                                    |   45 -
 net/sunrpc/stats.c                                    |   21 
 net/xfrm/xfrm_policy.c                                |    2 
 samples/kfifo/bytestream-example.c                    |   11 
 samples/kfifo/inttype-example.c                       |   11 
 samples/kfifo/record-example.c                        |   11 
 scripts/coccinelle/free/devm_free.cocci               |    4 
 sound/core/info.c                                     |   34 -
 sound/soc/codecs/ak4104.c                             |    3 
 sound/soc/codecs/cs4270.c                             |    3 
 sound/soc/codecs/tlv320aic32x4.c                      |    6 
 sound/soc/sunxi/sun4i-spdif.c                         |    2 
 tools/include/linux/bitops.h                          |    9 
 214 files changed, 2589 insertions(+), 2227 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-01-31  6:10 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-01-31  6:10 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


Most of -mm and quite a number of other subsystems.

MM is fairly quiet this time.  Holidays, I assume.



119 patches, based on 39bed42de2e7d74686a2d5a45638d6a5d7e7d473:

Subsystems affected by this patch series:

  hotfixes
  scripts
  ocfs2
  mm/slub
  mm/kmemleak
  mm/debug
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/tracing
  mm/kasan
  mm/initialization
  mm/pagealloc
  mm/vmscan
  mm/tools
  mm/memblock
  mm/oom-kill
  mm/hugetlb
  mm/migration
  mm/mmap
  mm/memory-hotplug
  mm/zswap
  mm/cleanups
  mm/zram
  misc
  lib
  binfmt
  init
  reiserfs
  exec
  dma-mapping
  kcov

Subsystem: hotfixes

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      lib/test_bitmap: correct test data offsets for 32-bit

    "Theodore Ts'o" <tytso@mit.edu>:
      memcg: fix a crash in wb_workfn when a device disappears

    Dan Carpenter <dan.carpenter@oracle.com>:
      mm/mempolicy.c: fix out of bounds write in mpol_parse_str()

    Pingfan Liu <kernelfans@gmail.com>:
      mm/sparse.c: reset section's mem_map when fully deactivated

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/migrate.c: also overwrite error when it is bigger than zero

    Dan Williams <dan.j.williams@intel.com>:
      mm/memory_hotplug: fix remove_memory() lockdep splat

    Wei Yang <richardw.yang@linux.intel.com>:
      mm: thp: don't need care deferred split queue in memcg charge move path

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: move_pages: report the number of non-attempted pages

Subsystem: scripts

    Xiong <xndchn@gmail.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

    Luca Ceresoli <luca@lucaceresoli.net>:
      scripts/spelling.txt: add "issus" typo

Subsystem: ocfs2

    Aditya Pakki <pakki001@umn.edu>:
      fs: ocfs: remove unnecessary assertion in dlm_migrate_lockres

    zhengbin <zhengbin13@huawei.com>:
      ocfs2: remove unneeded semicolons

    Masahiro Yamada <masahiroy@kernel.org>:
      ocfs2: make local header paths relative to C files

    Colin Ian King <colin.king@canonical.com>:
      ocfs2/dlm: remove redundant assignment to ret

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      ocfs2/dlm: move BITS_TO_BYTES() to bitops.h for wider use

    wangyan <wangyan122@huawei.com>:
      ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans()
      ocfs2: use ocfs2_update_inode_fsync_trans() to access t_tid in handle->h_transaction

Subsystem: mm/slub

    Yu Zhao <yuzhao@google.com>:
      mm/slub.c: avoid slub allocation while holding list_lock

Subsystem: mm/kmemleak

    He Zhe <zhe.he@windriver.com>:
      mm/kmemleak: turn kmemleak_lock and object->lock to raw_spinlock_t

Subsystem: mm/debug

    Vlastimil Babka <vbabka@suse.cz>:
      mm/debug.c: always print flags in dump_page()

Subsystem: mm/pagecache

    Ira Weiny <ira.weiny@intel.com>:
      mm/filemap.c: clean up filemap_write_and_wait()

Subsystem: mm/gup

    Qiujun Huang <hqjagain@gmail.com>:
      mm: fix gup_pud_range

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/gup.c: use is_vm_hugetlb_page() to check whether to follow huge

    John Hubbard <jhubbard@nvidia.com>:
    Patch series "mm/gup: prereqs to track dma-pinned pages: FOLL_PIN", v12:
      mm/gup: factor out duplicate code from four routines
      mm/gup: move try_get_compound_head() to top, fix minor issues

    Dan Williams <dan.j.williams@intel.com>:
      mm: Cleanup __put_devmap_managed_page() vs ->page_free()

    John Hubbard <jhubbard@nvidia.com>:
      mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages
      goldish_pipe: rename local pin_user_pages() routine
      mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM
      vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call
      mm/gup: allow FOLL_FORCE for get_user_pages_fast()
      IB/umem: use get_user_pages_fast() to pin DMA pages
      media/v4l2-core: set pages dirty upon releasing DMA buffers
      mm/gup: introduce pin_user_pages*() and FOLL_PIN
      goldish_pipe: convert to pin_user_pages() and put_user_page()
      IB/{core,hw,umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP
      mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()
      drm/via: set FOLL_PIN via pin_user_pages_fast()
      fs/io_uring: set FOLL_PIN via pin_user_pages()
      net/xdp: set FOLL_PIN via pin_user_pages()
      media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion
      vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion
      powerpc: book3s64: convert to pin_user_pages() and put_user_page()
      mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"
      mm, tree-wide: rename put_user_page*() to unpin_user_page*()

Subsystem: mm/swap

    Vasily Averin <vvs@virtuozzo.com>:
      mm/swapfile.c: swap_next should increase position index

Subsystem: mm/memcg

    Kaitao Cheng <pilgrimtao@gmail.com>:
      mm/memcontrol.c: cleanup some useless code

Subsystem: mm/pagemap

    Li Xinhai <lixinhai.lxh@gmail.com>:
      mm/page_vma_mapped.c: explicitly compare pfn for normal, hugetlbfs and THP page

Subsystem: mm/tracing

    Junyong Sun <sunjy516@gmail.com>:
      mm, tracing: print symbol name for kmem_alloc_node call_site events

Subsystem: mm/kasan

    "Gustavo A. R. Silva" <gustavo@embeddedor.com>:
      lib/test_kasan.c: fix memory leak in kmalloc_oob_krealloc_more()

Subsystem: mm/initialization

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      mm/early_ioremap.c: use %pa to print resource_size_t variables

Subsystem: mm/pagealloc

    "Kirill A. Shutemov" <kirill@shutemov.name>:
      mm/page_alloc: skip non present sections on zone initialization

    David Hildenbrand <david@redhat.com>:
      mm: remove the memory isolate notifier
      mm: remove "count" parameter from has_unmovable_pages()

Subsystem: mm/vmscan

    Liu Song <liu.song11@zte.com.cn>:
      mm/vmscan.c: remove unused return value of shrink_node

    Alex Shi <alex.shi@linux.alibaba.com>:
      mm/vmscan: remove prefetch_prev_lru_page
      mm/vmscan: remove unused RECLAIM_OFF/RECLAIM_ZONE

Subsystem: mm/tools

    Daniel Wagner <dwagner@suse.de>:
      tools/vm/slabinfo: fix sanity checks enabling

Subsystem: mm/memblock

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/memblock: define memblock_physmem_add()
      memblock: Use __func__ in remaining memblock_dbg() call sites

Subsystem: mm/oom-kill

    David Rientjes <rientjes@google.com>:
      mm, oom: dump stack of victim when reaping failed

Subsystem: mm/hugetlb

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/huge_memory.c: use head to check huge zero page
      mm/huge_memory.c: use head to emphasize the purpose of page
      mm/huge_memory.c: reduce critical section protected by split_queue_lock

Subsystem: mm/migration

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/migrate: remove useless mask of start address
      mm/migrate: clean up some minor coding style
      mm/migrate: add stable check in migrate_vma_insert_page()

    David Rientjes <rientjes@google.com>:
      mm, thp: fix defrag setting if newline is not used

Subsystem: mm/mmap

    Miaohe Lin <linmiaohe@huawei.com>:
      mm/mmap.c: get rid of odd jump labels in find_mergeable_anon_vma()

Subsystem: mm/memory-hotplug

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/memory_hotplug: pass in nid to online_pages()":
      mm/memory_hotplug: pass in nid to online_pages()

    Qian Cai <cai@lca.pw>:
      mm/hotplug: silence a lockdep splat with printk()
      mm/page_isolation: fix potential warning from user

Subsystem: mm/zswap

    Vitaly Wool <vitaly.wool@konsulko.com>:
      mm/zswap.c: add allocation hysteresis if pool limit is hit

    Dan Carpenter <dan.carpenter@oracle.com>:
      zswap: potential NULL dereference on error in init_zswap()

Subsystem: mm/cleanups

    Yu Zhao <yuzhao@google.com>:
      include/linux/mm.h: clean up obsolete check on space in page->flags

    Wei Yang <richardw.yang@linux.intel.com>:
      include/linux/mm.h: remove dead code totalram_pages_set()

    Anshuman Khandual <anshuman.khandual@arm.com>:
      include/linux/memory.h: drop fields 'hw' and 'phys_callback' from struct memory_block

    Hao Lee <haolee.swjtu@gmail.com>:
      mm: fix comments related to node reclaim

Subsystem: mm/zram

    Taejoon Song <taejoon.song@lge.com>:
      zram: try to avoid worst-case scenario on same element pages

    Colin Ian King <colin.king@canonical.com>:
      drivers/block/zram/zram_drv.c: fix error return codes not being returned in writeback_store

Subsystem: misc

    Akinobu Mita <akinobu.mita@gmail.com>:
    Patch series "add header file for kelvin to/from Celsius conversion:
      include/linux/units.h: add helpers for kelvin to/from Celsius conversion
      ACPI: thermal: switch to use <linux/units.h> helpers
      platform/x86: asus-wmi: switch to use <linux/units.h> helpers
      platform/x86: intel_menlow: switch to use <linux/units.h> helpers
      thermal: int340x: switch to use <linux/units.h> helpers
      thermal: intel_pch: switch to use <linux/units.h> helpers
      nvme: hwmon: switch to use <linux/units.h> helpers
      thermal: remove kelvin to/from Celsius conversion helpers from <linux/thermal.h>
      iwlegacy: use <linux/units.h> helpers
      iwlwifi: use <linux/units.h> helpers
      thermal: armada: remove unused TO_MCELSIUS macro
      iio: adc: qcom-vadc-common: use <linux/units.h> helpers

Subsystem: lib

    Mikhail Zaslonko <zaslonko@linux.ibm.com>:
    Patch series "S390 hardware support for kernel zlib", v3:
      lib/zlib: add s390 hardware support for kernel zlib_deflate
      s390/boot: rename HEAP_SIZE due to name collision
      lib/zlib: add s390 hardware support for kernel zlib_inflate
      s390/boot: add dfltcc= kernel command line parameter
      lib/zlib: add zlib_deflate_dfltcc_enabled() function
      btrfs: use larger zlib buffer for s390 hardware compression

    Nathan Chancellor <natechancellor@gmail.com>:
      lib/scatterlist.c: adjust indentation in __sg_alloc_table

    Yury Norov <yury.norov@gmail.com>:
      uapi: rename ext2_swab() to swab() and share globally in swab.h
      lib/find_bit.c: join _find_next_bit{_le}
      lib/find_bit.c: uninline helper _find_next_bit()

Subsystem: binfmt

    Alexey Dobriyan <adobriyan@gmail.com>:
      fs/binfmt_elf.c: smaller code generation around auxv vector fill
      fs/binfmt_elf.c: fix ->start_code calculation
      fs/binfmt_elf.c: don't copy ELF header around
      fs/binfmt_elf.c: better codegen around current->mm
      fs/binfmt_elf.c: make BAD_ADDR() unlikely
      fs/binfmt_elf.c: coredump: allocate core ELF header on stack
      fs/binfmt_elf.c: coredump: delete duplicated overflow check
      fs/binfmt_elf.c: coredump: allow process with empty address space to coredump

Subsystem: init

    Arvind Sankar <nivedita@alum.mit.edu>:
      init/main.c: log arguments and environment passed to init
      init/main.c: remove unnecessary repair_env_string in do_initcall_level
    Patch series "init/main.c: minor cleanup/bugfix of envvar handling", v2:
      init/main.c: fix quoted value handling in unknown_bootoption

    Christophe Leroy <christophe.leroy@c-s.fr>:
      init/main.c: fix misleading "This architecture does not have kernel memory protection" message

Subsystem: reiserfs

    Yunfeng Ye <yeyunfeng@huawei.com>:
      reiserfs: prevent NULL pointer dereference in reiserfs_insert_item()

Subsystem: exec

    Alexey Dobriyan <adobriyan@gmail.com>:
      execve: warn if process starts with executable stack

Subsystem: dma-mapping

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      include/linux/io-mapping.h-mapping: use PHYS_PFN() macro in io_mapping_map_atomic_wc()

Subsystem: kcov

    Dmitry Vyukov <dvyukov@google.com>:
      kcov: ignore fault-inject and stacktrace

 Documentation/admin-guide/kernel-parameters.txt              |   12 
 Documentation/core-api/index.rst                             |    1 
 Documentation/core-api/pin_user_pages.rst                    |  234 +++++
 Documentation/vm/zswap.rst                                   |   13 
 arch/powerpc/mm/book3s64/iommu_api.c                         |   14 
 arch/s390/boot/compressed/decompressor.c                     |    8 
 arch/s390/boot/ipl_parm.c                                    |   14 
 arch/s390/include/asm/setup.h                                |    7 
 arch/s390/kernel/setup.c                                     |   14 
 drivers/acpi/thermal.c                                       |   34 
 drivers/base/memory.c                                        |   25 
 drivers/block/zram/zram_drv.c                                |   10 
 drivers/gpu/drm/via/via_dmablit.c                            |    6 
 drivers/iio/adc/qcom-vadc-common.c                           |    6 
 drivers/iio/adc/qcom-vadc-common.h                           |    1 
 drivers/infiniband/core/umem.c                               |   21 
 drivers/infiniband/core/umem_odp.c                           |   13 
 drivers/infiniband/hw/hfi1/user_pages.c                      |    4 
 drivers/infiniband/hw/mthca/mthca_memfree.c                  |    8 
 drivers/infiniband/hw/qib/qib_user_pages.c                   |    4 
 drivers/infiniband/hw/qib/qib_user_sdma.c                    |    8 
 drivers/infiniband/hw/usnic/usnic_uiom.c                     |    4 
 drivers/infiniband/sw/siw/siw_mem.c                          |    4 
 drivers/media/v4l2-core/videobuf-dma-sg.c                    |   20 
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h             |    1 
 drivers/net/wireless/intel/iwlegacy/4965-mac.c               |    3 
 drivers/net/wireless/intel/iwlegacy/4965.c                   |   17 
 drivers/net/wireless/intel/iwlegacy/common.h                 |    3 
 drivers/net/wireless/intel/iwlwifi/dvm/dev.h                 |    5 
 drivers/net/wireless/intel/iwlwifi/dvm/devices.c             |    6 
 drivers/nvdimm/pmem.c                                        |    6 
 drivers/nvme/host/hwmon.c                                    |   13 
 drivers/platform/goldfish/goldfish_pipe.c                    |   39 
 drivers/platform/x86/asus-wmi.c                              |    7 
 drivers/platform/x86/intel_menlow.c                          |    9 
 drivers/thermal/armada_thermal.c                             |    2 
 drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c |    7 
 drivers/thermal/intel/intel_pch_thermal.c                    |    3 
 drivers/vfio/vfio_iommu_type1.c                              |   39 
 fs/binfmt_elf.c                                              |  154 +--
 fs/btrfs/compression.c                                       |    2 
 fs/btrfs/zlib.c                                              |  135 ++
 fs/exec.c                                                    |    5 
 fs/fs-writeback.c                                            |    2 
 fs/io_uring.c                                                |    6 
 fs/ocfs2/cluster/quorum.c                                    |    2 
 fs/ocfs2/dlm/Makefile                                        |    2 
 fs/ocfs2/dlm/dlmast.c                                        |    8 
 fs/ocfs2/dlm/dlmcommon.h                                     |    4 
 fs/ocfs2/dlm/dlmconvert.c                                    |    8 
 fs/ocfs2/dlm/dlmdebug.c                                      |    8 
 fs/ocfs2/dlm/dlmdomain.c                                     |    8 
 fs/ocfs2/dlm/dlmlock.c                                       |    8 
 fs/ocfs2/dlm/dlmmaster.c                                     |   10 
 fs/ocfs2/dlm/dlmrecovery.c                                   |   10 
 fs/ocfs2/dlm/dlmthread.c                                     |    8 
 fs/ocfs2/dlm/dlmunlock.c                                     |    8 
 fs/ocfs2/dlmfs/Makefile                                      |    2 
 fs/ocfs2/dlmfs/dlmfs.c                                       |    4 
 fs/ocfs2/dlmfs/userdlm.c                                     |    6 
 fs/ocfs2/dlmglue.c                                           |    2 
 fs/ocfs2/journal.h                                           |    8 
 fs/ocfs2/namei.c                                             |    3 
 fs/reiserfs/stree.c                                          |    3 
 include/linux/backing-dev.h                                  |   10 
 include/linux/bitops.h                                       |    1 
 include/linux/fs.h                                           |    6 
 include/linux/io-mapping.h                                   |    5 
 include/linux/memblock.h                                     |    7 
 include/linux/memory.h                                       |   29 
 include/linux/memory_hotplug.h                               |    3 
 include/linux/mm.h                                           |  116 +-
 include/linux/mmzone.h                                       |    2 
 include/linux/page-isolation.h                               |    8 
 include/linux/swab.h                                         |    1 
 include/linux/thermal.h                                      |   11 
 include/linux/units.h                                        |   84 +
 include/linux/zlib.h                                         |    6 
 include/trace/events/kmem.h                                  |    4 
 include/trace/events/writeback.h                             |   37 
 include/uapi/linux/swab.h                                    |   10 
 include/uapi/linux/sysctl.h                                  |    2 
 init/main.c                                                  |   36 
 kernel/Makefile                                              |    1 
 lib/Kconfig                                                  |    7 
 lib/Makefile                                                 |    2 
 lib/decompress_inflate.c                                     |   13 
 lib/find_bit.c                                               |   82 -
 lib/scatterlist.c                                            |    2 
 lib/test_bitmap.c                                            |    9 
 lib/test_kasan.c                                             |    1 
 lib/zlib_deflate/deflate.c                                   |   85 +
 lib/zlib_deflate/deflate_syms.c                              |    1 
 lib/zlib_deflate/deftree.c                                   |   54 -
 lib/zlib_deflate/defutil.h                                   |  134 ++
 lib/zlib_dfltcc/Makefile                                     |   13 
 lib/zlib_dfltcc/dfltcc.c                                     |   57 +
 lib/zlib_dfltcc/dfltcc.h                                     |  155 +++
 lib/zlib_dfltcc/dfltcc_deflate.c                             |  280 ++++++
 lib/zlib_dfltcc/dfltcc_inflate.c                             |  149 +++
 lib/zlib_dfltcc/dfltcc_syms.c                                |   17 
 lib/zlib_dfltcc/dfltcc_util.h                                |  123 ++
 lib/zlib_inflate/inflate.c                                   |   32 
 lib/zlib_inflate/inflate.h                                   |    8 
 lib/zlib_inflate/infutil.h                                   |   18 
 mm/Makefile                                                  |    1 
 mm/backing-dev.c                                             |    1 
 mm/debug.c                                                   |   18 
 mm/early_ioremap.c                                           |    8 
 mm/filemap.c                                                 |   34 
 mm/gup.c                                                     |  503 ++++++-----
 mm/gup_benchmark.c                                           |    9 
 mm/huge_memory.c                                             |   44 
 mm/kmemleak.c                                                |  112 +-
 mm/memblock.c                                                |   22 
 mm/memcontrol.c                                              |   25 
 mm/memory_hotplug.c                                          |   24 
 mm/mempolicy.c                                               |    6 
 mm/memremap.c                                                |   95 --
 mm/migrate.c                                                 |   77 +
 mm/mmap.c                                                    |   30 
 mm/oom_kill.c                                                |    2 
 mm/page_alloc.c                                              |   83 +
 mm/page_isolation.c                                          |   69 -
 mm/page_vma_mapped.c                                         |   12 
 mm/process_vm_access.c                                       |   32 
 mm/slub.c                                                    |   88 +
 mm/sparse.c                                                  |    2 
 mm/swap.c                                                    |   27 
 mm/swapfile.c                                                |    2 
 mm/vmscan.c                                                  |   24 
 mm/zswap.c                                                   |   88 +
 net/xdp/xdp_umem.c                                           |    4 
 scripts/spelling.txt                                         |   14 
 tools/testing/selftests/vm/gup_benchmark.c                   |    6 
 tools/vm/slabinfo.c                                          |    4 
 136 files changed, 2790 insertions(+), 1358 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-01-14  0:28 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-01-14  0:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits


11 MM fixes, based on b3a987b0264d3ddbb24293ebff10eddfc472f653:


    Vlastimil Babka <vbabka@suse.cz>:
      mm, thp: tweak reclaim/compaction effort of local-only and all-node allocations

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: don't free usage map when removing a re-added early section

    "Kirill A. Shutemov" <kirill@shutemov.name>:
    Patch series "Fix two above-47bit hint address vs. THP bugs":
      mm/huge_memory.c: thp: fix conflict of above-47bit hint address and PMD alignment
      mm/shmem.c: thp, shmem: fix conflict of above-47bit hint address and PMD alignment

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: fix percpu slab vmstats flushing

    Vlastimil Babka <vbabka@suse.cz>:
      mm, debug_pagealloc: don't rely on static keys too early

    Wen Yang <wenyang@linux.alibaba.com>:
    Patch series "use div64_ul() instead of div_u64() if the divisor is:
      mm/page-writeback.c: avoid potential division by zero in wb_min_max_ratio()
      mm/page-writeback.c: use div64_ul() for u64-by-unsigned-long divide
      mm/page-writeback.c: improve arithmetic divisions

    Adrian Huang <ahuang12@lenovo.com>:
      mm: memcg/slab: call flush_memcg_workqueue() only if memcg workqueue is valid

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: khugepaged: add trace status description for SCAN_PAGE_HAS_PRIVATE

 include/linux/mm.h                 |   18 +++++++++-
 include/linux/mmzone.h             |    5 +--
 include/trace/events/huge_memory.h |    3 +
 init/main.c                        |    1 
 mm/huge_memory.c                   |   38 ++++++++++++++---------
 mm/memcontrol.c                    |   37 +++++-----------------
 mm/mempolicy.c                     |   10 ++++--
 mm/page-writeback.c                |   10 +++---
 mm/page_alloc.c                    |   61 ++++++++++---------------------------
 mm/shmem.c                         |    7 ++--
 mm/slab.c                          |    4 +-
 mm/slab_common.c                   |    3 +
 mm/slub.c                          |    2 -
 mm/sparse.c                        |    9 ++++-
 mm/vmalloc.c                       |    4 +-
 15 files changed, 102 insertions(+), 110 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2020-01-04 20:55 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2020-01-04 20:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


17 fixes, base on 5613970af3f5f8372c596b138bd64f3918513515:


    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: shrink zones when offlining memory

    Chanho Min <chanho.min@lge.com>:
      mm/zsmalloc.c: fix the migrated zspage statistics.

    Andrey Konovalov <andreyknvl@google.com>:
      kcov: fix struct layout for kcov_remote_arg

    Shakeel Butt <shakeelb@google.com>:
      memcg: account security cred as well to kmemcg

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: move_pages: return valid node id in status if the page is already on the target node

    Eric Biggers <ebiggers@google.com>:
      fs/direct-io.c: include fs/internal.h for missing prototype
      fs/nsfs.c: include headers for missing declarations
      fs/namespace.c: make to_mnt_ns() static

    Nick Desaulniers <ndesaulniers@google.com>:
      hexagon: parenthesize registers in asm predicates
      hexagon: work around compiler crash

    Randy Dunlap <rdunlap@infradead.org>:
      fs/posix_acl.c: fix kernel-doc warnings

    Ilya Dryomov <idryomov@gmail.com>:
      mm/oom: fix pgtables units mismatch in Killed process message

    Navid Emamdoost <navid.emamdoost@gmail.com>:
      mm/gup: fix memory leak in __gup_benchmark_ioctl

    Waiman Long <longman@redhat.com>:
      mm/hugetlb: defer freeing of huge pages if in non-task context

    Kai Li <li.kai4@h3c.com>:
      ocfs2: call journal flush to mark journal as empty after journal recovery when mount

    Gang He <GHe@suse.com>:
      ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less

    Nick Desaulniers <ndesaulniers@google.com>:
      hexagon: define ioremap_uc

 Documentation/dev-tools/kcov.rst    |   10 +++----
 arch/arm64/mm/mmu.c                 |    4 --
 arch/hexagon/include/asm/atomic.h   |    8 ++---
 arch/hexagon/include/asm/bitops.h   |    8 ++---
 arch/hexagon/include/asm/cmpxchg.h  |    2 -
 arch/hexagon/include/asm/futex.h    |    6 ++--
 arch/hexagon/include/asm/io.h       |    1 
 arch/hexagon/include/asm/spinlock.h |   20 +++++++-------
 arch/hexagon/kernel/stacktrace.c    |    4 --
 arch/hexagon/kernel/vm_entry.S      |    2 -
 arch/ia64/mm/init.c                 |    4 --
 arch/powerpc/mm/mem.c               |    3 --
 arch/s390/mm/init.c                 |    4 --
 arch/sh/mm/init.c                   |    4 --
 arch/x86/mm/init_32.c               |    4 --
 arch/x86/mm/init_64.c               |    4 --
 fs/direct-io.c                      |    2 +
 fs/namespace.c                      |    2 -
 fs/nsfs.c                           |    3 ++
 fs/ocfs2/dlmglue.c                  |    1 
 fs/ocfs2/journal.c                  |    8 +++++
 fs/posix_acl.c                      |    7 +++-
 include/linux/memory_hotplug.h      |    7 +++-
 include/uapi/linux/kcov.h           |   10 +++----
 kernel/cred.c                       |    6 ++--
 mm/gup_benchmark.c                  |    8 ++++-
 mm/hugetlb.c                        |   51 +++++++++++++++++++++++++++++++++++-
 mm/memory_hotplug.c                 |   31 +++++++++++----------
 mm/memremap.c                       |    2 -
 mm/migrate.c                        |   23 ++++++++++++----
 mm/oom_kill.c                       |    2 -
 mm/zsmalloc.c                       |    5 +++
 32 files changed, 166 insertions(+), 90 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-12-18  4:50 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-12-18  4:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, mm-commits

6 fixes based on 2187f215ebaac73ddbd814696d7c7fa34f0c3de0:

    Andrey Ryabinin <aryabinin@virtuozzo.com>:
      kasan: fix crashes on access to memory mapped by vm_map_ram()

    Daniel Axtens <dja@axtens.net>:
      mm/memory.c: add apply_to_existing_page_range() helper
      kasan: use apply_to_existing_page_range() for releasing vmalloc shadow
      kasan: don't assume percpu shadow allocations will succeed

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: vmscan: protect shrinker idr replace with CONFIG_MEMCG

    Changbin Du <changbin.du@gmail.com>:
      lib/Kconfig.debug: fix some messed up configurations

 include/linux/kasan.h |   15 +++--
 include/linux/mm.h    |    3 +
 lib/Kconfig.debug     |  100 ++++++++++++++++++------------------
 mm/kasan/common.c     |   36 ++++++++-----
 mm/memory.c           |  136 ++++++++++++++++++++++++++++++++++----------------
 mm/vmalloc.c          |  133 ++++++++++++++++++++++++++++--------------------
 mm/vmscan.c           |    2 
 7 files changed, 260 insertions(+), 165 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-12-05  0:48 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-12-05  0:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


Most of the rest of MM and various other things.  Some Kconfig rework
still awaits merges of dependent trees from linux-next.


86 patches, based on 63de37476ebd1e9bab6a9e17186dc5aa1da9ea99.

Subsystems affected by this patch series:

  mm/hotfixes
  mm/memcg
  mm/vmstat
  mm/thp
  procfs
  sysctl
  misc
  notifiers
  core-kernel
  bitops
  lib
  checkpatch
  epoll
  binfmt
  init
  rapidio
  uaccess
  kcov
  ubsan
  ipc
  bitmap
  mm/pagemap

Subsystem: mm/hotfixes

    zhong jiang <zhongjiang@huawei.com>:
      mm/kasan/common.c: fix compile error

Subsystem: mm/memcg

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: wait for !root kmem_cache refcnt killing on root kmem_cache destruction

Subsystem: mm/vmstat

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      mm/vmstat: add helpers to get vmstat item names for each enum type
      mm/memcontrol: use vmstat names for printing statistics

Subsystem: mm/thp

    Yu Zhao <yuzhao@google.com>:
      mm/memory.c: replace is_zero_pfn with is_huge_zero_pmd for thp

Subsystem: procfs

    Alexey Dobriyan <adobriyan@gmail.com>:
      proc: change ->nlink under proc_subdir_lock
      fs/proc/generic.c: delete useless "len" variable
      fs/proc/internal.h: shuffle "struct pde_opener"

    Miaohe Lin <linmiaohe@huawei.com>:
      include/linux/proc_fs.h: fix confusing macro arg name

    Krzysztof Kozlowski <krzk@kernel.org>:
      fs/proc/Kconfig: fix indentation

Subsystem: sysctl

    Alessio Balsini <balsini@android.com>:
      include/linux/sysctl.h: inline braces for ctl_table and ctl_table_header

Subsystem: misc

    Stephen Boyd <swboyd@chromium.org>:
      .gitattributes: use 'dts' diff driver for dts files

    Rikard Falkeborn <rikard.falkeborn@gmail.com>:
      linux/build_bug.h: change type to int

    Masahiro Yamada <yamada.masahiro@socionext.com>:
      linux/scc.h: make uapi linux/scc.h self-contained

    Krzysztof Kozlowski <krzk@kernel.org>:
      arch/Kconfig: fix indentation

    Joe Perches <joe@perches.com>:
      scripts/get_maintainer.pl: add signatures from Fixes: <badcommit> lines in commit message

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      kernel.h: update comment about simple_strto<foo>() functions
      auxdisplay: charlcd: deduplicate simple_strtoul()

Subsystem: notifiers

    Xiaoming Ni <nixiaoming@huawei.com>:
      kernel/notifier.c: intercept duplicate registrations to avoid infinite loops
      kernel/notifier.c: remove notifier_chain_cond_register()
      kernel/notifier.c: remove blocking_notifier_chain_cond_register()

Subsystem: core-kernel

    Nathan Chancellor <natechancellor@gmail.com>:
      kernel/profile.c: use cpumask_available to check for NULL cpumask

    Joe Perches <joe@perches.com>:
      kernel/sys.c: avoid copying possible padding bytes in copy_to_user

Subsystem: bitops

    William Breathitt Gray <vilhelm.gray@gmail.com>:
      bitops: introduce the for_each_set_clump8 macro
      lib/test_bitmap.c: add for_each_set_clump8 test cases
      gpio: 104-dio-48e: utilize for_each_set_clump8 macro
      gpio: 104-idi-48: utilize for_each_set_clump8 macro
      gpio: gpio-mm: utilize for_each_set_clump8 macro
      gpio: ws16c48: utilize for_each_set_clump8 macro
      gpio: pci-idio-16: utilize for_each_set_clump8 macro
      gpio: pcie-idio-24: utilize for_each_set_clump8 macro
      gpio: uniphier: utilize for_each_set_clump8 macro
      gpio: 74x164: utilize the for_each_set_clump8 macro
      thermal: intel: intel_soc_dts_iosf: Utilize for_each_set_clump8 macro
      gpio: pisosr: utilize the for_each_set_clump8 macro
      gpio: max3191x: utilize the for_each_set_clump8 macro
      gpio: pca953x: utilize the for_each_set_clump8 macro

Subsystem: lib

    Wei Yang <richardw.yang@linux.intel.com>:
      lib/rbtree: set successor's parent unconditionally
      lib/rbtree: get successor's color directly

    Laura Abbott <labbott@redhat.com>:
      lib/test_meminit.c: add bulk alloc/free tests

    Trent Piepho <tpiepho@gmail.com>:
      lib/math/rational.c: fix possible incorrect result from rational fractions helper

    Huang Shijie <sjhuang@iluvatar.ai>:
      lib/genalloc.c: export symbol addr_in_gen_pool
      lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: improve ignoring CamelCase SI style variants like mA
      checkpatch: reduce is_maintained_obsolete lookup runtime

Subsystem: epoll

    Jason Baron <jbaron@akamai.com>:
      epoll: simplify ep_poll_safewake() for CONFIG_DEBUG_LOCK_ALLOC

    Heiher <r@hev.cc>:
      fs/epoll: remove unnecessary wakeups of nested epoll
      selftests: add epoll selftests

Subsystem: binfmt

    Alexey Dobriyan <adobriyan@gmail.com>:
      fs/binfmt_elf.c: delete unused "interp_map_addr" argument
      fs/binfmt_elf.c: extract elf_read() function

Subsystem: init

    Krzysztof Kozlowski <krzk@kernel.org>:
      init/Kconfig: fix indentation

Subsystem: rapidio

    "Ben Dooks (Codethink)" <ben.dooks@codethink.co.uk>:
      drivers/rapidio/rio-driver.c: fix missing include of  <linux/rio_drv.h>
      drivers/rapidio/rio-access.c: fix missing include of <linux/rio_drv.h>

Subsystem: uaccess

    Daniel Vetter <daniel.vetter@ffwll.ch>:
      drm: limit to INT_MAX in create_blob ioctl

    Kees Cook <keescook@chromium.org>:
      uaccess: disallow > INT_MAX copy sizes

Subsystem: kcov

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series " kcov: collect coverage from usb and vhost", v3:
      kcov: remote coverage support
      usb, kcov: collect coverage from hub_event
      vhost, kcov: collect coverage from vhost_worker

Subsystem: ubsan

    Julien Grall <julien.grall@arm.com>:
      lib/ubsan: don't serialize UBSAN report

Subsystem: ipc

    Masahiro Yamada <yamada.masahiro@socionext.com>:
      arch: ipcbuf.h: make uapi asm/ipcbuf.h self-contained
      arch: msgbuf.h: make uapi asm/msgbuf.h self-contained
      arch: sembuf.h: make uapi asm/sembuf.h self-contained

Subsystem: bitmap

    Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
    Patch series "gpio: pca953x: Convert to bitmap (extended) API", v2:
      lib/test_bitmap: force argument of bitmap_parselist_user() to proper address space
      lib/test_bitmap: undefine macros after use
      lib/test_bitmap: name EXP_BYTES properly
      lib/test_bitmap: rename exp to exp1 to avoid ambiguous name
      lib/test_bitmap: move exp1 and exp2 upper for others to use
      lib/test_bitmap: fix comment about this file
      lib/bitmap: introduce bitmap_replace() helper
      gpio: pca953x: remove redundant variable and check in IRQ handler
      gpio: pca953x: use input from regs structure in pca953x_irq_pending()
      gpio: pca953x: convert to use bitmap API
      gpio: pca953x: tighten up indentation

Subsystem: mm/pagemap

    Mike Rapoport <rppt@linux.ibm.com>:
    Patch series "mm: remove __ARCH_HAS_4LEVEL_HACK", v13:
      alpha: use pgtable-nopud instead of 4level-fixup
      arm: nommu: use pgtable-nopud instead of 4level-fixup
      c6x: use pgtable-nopud instead of 4level-fixup
      m68k: nommu: use pgtable-nopud instead of 4level-fixup
      m68k: mm: use pgtable-nopXd instead of 4level-fixup
      microblaze: use pgtable-nopmd instead of 4level-fixup
      nds32: use pgtable-nopmd instead of 4level-fixup
      parisc: use pgtable-nopXd instead of 4level-fixup

    Helge Deller <deller@gmx.de>:
      parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup

    Mike Rapoport <rppt@linux.ibm.com>:
      sparc32: use pgtable-nopud instead of 4level-fixup
      um: remove unused pxx_offset_proc() and addr_pte() functions
      um: add support for folded p4d page tables
      mm: remove __ARCH_HAS_4LEVEL_HACK and include/asm-generic/4level-fixup.h

 .gitattributes                                                |    2 
 Documentation/core-api/genalloc.rst                           |    2 
 Documentation/dev-tools/kcov.rst                              |  129 
 arch/Kconfig                                                  |   22 
 arch/alpha/include/asm/mmzone.h                               |    1 
 arch/alpha/include/asm/pgalloc.h                              |    4 
 arch/alpha/include/asm/pgtable.h                              |   24 
 arch/alpha/mm/init.c                                          |   12 
 arch/arm/include/asm/pgtable.h                                |    2 
 arch/arm/mm/dma-mapping.c                                     |    2 
 arch/c6x/include/asm/pgtable.h                                |    2 
 arch/m68k/include/asm/mcf_pgalloc.h                           |    7 
 arch/m68k/include/asm/mcf_pgtable.h                           |   28 
 arch/m68k/include/asm/mmu_context.h                           |   12 
 arch/m68k/include/asm/motorola_pgalloc.h                      |    4 
 arch/m68k/include/asm/motorola_pgtable.h                      |   32 
 arch/m68k/include/asm/page.h                                  |    9 
 arch/m68k/include/asm/pgtable_mm.h                            |   11 
 arch/m68k/include/asm/pgtable_no.h                            |    2 
 arch/m68k/include/asm/sun3_pgalloc.h                          |    5 
 arch/m68k/include/asm/sun3_pgtable.h                          |   18 
 arch/m68k/kernel/sys_m68k.c                                   |   10 
 arch/m68k/mm/init.c                                           |    6 
 arch/m68k/mm/kmap.c                                           |   39 
 arch/m68k/mm/mcfmmu.c                                         |   16 
 arch/m68k/mm/motorola.c                                       |   17 
 arch/m68k/sun3x/dvma.c                                        |    7 
 arch/microblaze/include/asm/page.h                            |    3 
 arch/microblaze/include/asm/pgalloc.h                         |   16 
 arch/microblaze/include/asm/pgtable.h                         |   32 
 arch/microblaze/kernel/signal.c                               |   10 
 arch/microblaze/mm/init.c                                     |    7 
 arch/microblaze/mm/pgtable.c                                  |   13 
 arch/mips/include/uapi/asm/msgbuf.h                           |    1 
 arch/mips/include/uapi/asm/sembuf.h                           |    2 
 arch/nds32/include/asm/page.h                                 |    3 
 arch/nds32/include/asm/pgalloc.h                              |    3 
 arch/nds32/include/asm/pgtable.h                              |   12 
 arch/nds32/include/asm/tlb.h                                  |    1 
 arch/nds32/kernel/pm.c                                        |    4 
 arch/nds32/mm/fault.c                                         |   16 
 arch/nds32/mm/init.c                                          |   11 
 arch/nds32/mm/mm-nds32.c                                      |    6 
 arch/nds32/mm/proc.c                                          |   26 
 arch/parisc/include/asm/page.h                                |   30 
 arch/parisc/include/asm/pgalloc.h                             |   41 
 arch/parisc/include/asm/pgtable.h                             |   52 
 arch/parisc/include/asm/tlb.h                                 |    2 
 arch/parisc/include/uapi/asm/msgbuf.h                         |    1 
 arch/parisc/include/uapi/asm/sembuf.h                         |    1 
 arch/parisc/kernel/cache.c                                    |   13 
 arch/parisc/kernel/pci-dma.c                                  |    9 
 arch/parisc/mm/fixmap.c                                       |   10 
 arch/parisc/mm/hugetlbpage.c                                  |   18 
 arch/powerpc/include/uapi/asm/msgbuf.h                        |    2 
 arch/powerpc/include/uapi/asm/sembuf.h                        |    2 
 arch/s390/include/uapi/asm/ipcbuf.h                           |    2 
 arch/sparc/include/asm/pgalloc_32.h                           |    6 
 arch/sparc/include/asm/pgtable_32.h                           |   28 
 arch/sparc/include/uapi/asm/ipcbuf.h                          |    2 
 arch/sparc/include/uapi/asm/msgbuf.h                          |    2 
 arch/sparc/include/uapi/asm/sembuf.h                          |    2 
 arch/sparc/mm/fault_32.c                                      |   11 
 arch/sparc/mm/highmem.c                                       |    6 
 arch/sparc/mm/io-unit.c                                       |    6 
 arch/sparc/mm/iommu.c                                         |    6 
 arch/sparc/mm/srmmu.c                                         |   51 
 arch/um/include/asm/pgtable-2level.h                          |    1 
 arch/um/include/asm/pgtable-3level.h                          |    1 
 arch/um/include/asm/pgtable.h                                 |    3 
 arch/um/kernel/mem.c                                          |    8 
 arch/um/kernel/skas/mmu.c                                     |   12 
 arch/um/kernel/skas/uaccess.c                                 |    7 
 arch/um/kernel/tlb.c                                          |   85 
 arch/um/kernel/trap.c                                         |    4 
 arch/x86/include/uapi/asm/msgbuf.h                            |    3 
 arch/x86/include/uapi/asm/sembuf.h                            |    2 
 arch/xtensa/include/uapi/asm/ipcbuf.h                         |    2 
 arch/xtensa/include/uapi/asm/msgbuf.h                         |    2 
 arch/xtensa/include/uapi/asm/sembuf.h                         |    1 
 drivers/auxdisplay/charlcd.c                                  |   34 
 drivers/base/node.c                                           |    9 
 drivers/gpio/gpio-104-dio-48e.c                               |   75 
 drivers/gpio/gpio-104-idi-48.c                                |   36 
 drivers/gpio/gpio-74x164.c                                    |   19 
 drivers/gpio/gpio-gpio-mm.c                                   |   75 
 drivers/gpio/gpio-max3191x.c                                  |   19 
 drivers/gpio/gpio-pca953x.c                                   |  209 
 drivers/gpio/gpio-pci-idio-16.c                               |   75 
 drivers/gpio/gpio-pcie-idio-24.c                              |  111 
 drivers/gpio/gpio-pisosr.c                                    |   12 
 drivers/gpio/gpio-uniphier.c                                  |   13 
 drivers/gpio/gpio-ws16c48.c                                   |   73 
 drivers/gpu/drm/drm_property.c                                |    2 
 drivers/misc/sram-exec.c                                      |    2 
 drivers/rapidio/rio-access.c                                  |    2 
 drivers/rapidio/rio-driver.c                                  |    1 
 drivers/thermal/intel/intel_soc_dts_iosf.c                    |   31 
 drivers/thermal/intel/intel_soc_dts_iosf.h                    |    2 
 drivers/usb/core/hub.c                                        |    5 
 drivers/vhost/vhost.c                                         |    6 
 drivers/vhost/vhost.h                                         |    1 
 fs/binfmt_elf.c                                               |   56 
 fs/eventpoll.c                                                |   52 
 fs/proc/Kconfig                                               |    8 
 fs/proc/generic.c                                             |   37 
 fs/proc/internal.h                                            |    2 
 include/asm-generic/4level-fixup.h                            |   39 
 include/asm-generic/bitops/find.h                             |   17 
 include/linux/bitmap.h                                        |   51 
 include/linux/bitops.h                                        |   12 
 include/linux/build_bug.h                                     |    4 
 include/linux/genalloc.h                                      |    2 
 include/linux/kcov.h                                          |   23 
 include/linux/kernel.h                                        |   19 
 include/linux/mm.h                                            |   10 
 include/linux/notifier.h                                      |    4 
 include/linux/proc_fs.h                                       |    4 
 include/linux/rbtree_augmented.h                              |    6 
 include/linux/sched.h                                         |    8 
 include/linux/sysctl.h                                        |    6 
 include/linux/thread_info.h                                   |    2 
 include/linux/vmstat.h                                        |   54 
 include/uapi/asm-generic/ipcbuf.h                             |    2 
 include/uapi/asm-generic/msgbuf.h                             |    2 
 include/uapi/asm-generic/sembuf.h                             |    1 
 include/uapi/linux/kcov.h                                     |   28 
 include/uapi/linux/scc.h                                      |    1 
 init/Kconfig                                                  |   78 
 kernel/dma/remap.c                                            |    2 
 kernel/kcov.c                                                 |  547 +
 kernel/notifier.c                                             |   45 
 kernel/profile.c                                              |    6 
 kernel/sys.c                                                  |    4 
 lib/bitmap.c                                                  |   12 
 lib/find_bit.c                                                |   14 
 lib/genalloc.c                                                |    7 
 lib/math/rational.c                                           |   63 
 lib/test_bitmap.c                                             |  206 
 lib/test_meminit.c                                            |   20 
 lib/ubsan.c                                                   |   64 
 mm/kasan/common.c                                             |    1 
 mm/memcontrol.c                                               |   52 
 mm/memory.c                                                   |   10 
 mm/slab_common.c                                              |   12 
 mm/vmstat.c                                                   |   60 
 net/sunrpc/rpc_pipe.c                                         |    2 
 scripts/checkpatch.pl                                         |   13 
 scripts/get_maintainer.pl                                     |   38 
 tools/testing/selftests/Makefile                              |    1 
 tools/testing/selftests/filesystems/epoll/.gitignore          |    1 
 tools/testing/selftests/filesystems/epoll/Makefile            |    7 
 tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 3074 ++++++++++
 usr/include/Makefile                                          |    4 
 154 files changed, 5270 insertions(+), 1360 deletions(-)





^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-12-01 21:07 ` incoming Linus Torvalds
@ 2019-12-02  8:21   ` Steven Price
  0 siblings, 0 replies; 307+ messages in thread
From: Steven Price @ 2019-12-02  8:21 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, mm-commits, Linux-MM

On Sun, Dec 01, 2019 at 09:07:47PM +0000, Linus Torvalds wrote:
> On Sat, Nov 30, 2019 at 5:47 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> >     Steven Price <steven.price@arm.com>:
> >     Patch series "Generic page walk and ptdump", v15:
> >       mm: add generic p?d_leaf() macros
> >       arc: mm: add p?d_leaf() definitions
> >       arm: mm: add p?d_leaf() definitions
> >       arm64: mm: add p?d_leaf() definitions
> >       mips: mm: add p?d_leaf() definitions
> >       powerpc: mm: add p?d_leaf() definitions
> >       riscv: mm: add p?d_leaf() definitions
> >       s390: mm: add p?d_leaf() definitions
> >       sparc: mm: add p?d_leaf() definitions
> >       x86: mm: add p?d_leaf() definitions
> >       mm: pagewalk: add p4d_entry() and pgd_entry()
> >       mm: pagewalk: allow walking without vma
> >       mm: pagewalk: add test_p?d callbacks
> >       mm: pagewalk: add 'depth' parameter to pte_hole
> >       x86: mm: point to struct seq_file from struct pg_state
> >       x86: mm+efi: convert ptdump_walk_pgd_level() to take a mm_struct
> >       x86: mm: convert ptdump_walk_pgd_level_debugfs() to take an mm_struct
> >       x86: mm: convert ptdump_walk_pgd_level_core() to take an mm_struct
> >       mm: add generic ptdump
> >       x86: mm: convert dump_pagetables to use walk_page_range
> >       arm64: mm: convert mm/dump.c to use walk_page_range()
> >       arm64: mm: display non-present entries in ptdump
> >       mm: ptdump: reduce level numbers by 1 in note_page()
> 
> I've dropped these, and since they clearly weren't ready I don't want
> to see them re-sent for 5.5.

Sorry about this, I'll try to track down the cause of this and hopefully
resubmit for 5.6.

Thanks,

Steve

> If somebody figures out the bug, trying again for 5.6 sounds fine.
> 
>                Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-12-01  1:47 incoming Andrew Morton
  2019-12-01  5:17 ` incoming James Bottomley
@ 2019-12-01 21:07 ` Linus Torvalds
  2019-12-02  8:21   ` incoming Steven Price
  1 sibling, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2019-12-01 21:07 UTC (permalink / raw)
  To: Andrew Morton, Steven Price; +Cc: mm-commits, Linux-MM

On Sat, Nov 30, 2019 at 5:47 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
>     Steven Price <steven.price@arm.com>:
>     Patch series "Generic page walk and ptdump", v15:
>       mm: add generic p?d_leaf() macros
>       arc: mm: add p?d_leaf() definitions
>       arm: mm: add p?d_leaf() definitions
>       arm64: mm: add p?d_leaf() definitions
>       mips: mm: add p?d_leaf() definitions
>       powerpc: mm: add p?d_leaf() definitions
>       riscv: mm: add p?d_leaf() definitions
>       s390: mm: add p?d_leaf() definitions
>       sparc: mm: add p?d_leaf() definitions
>       x86: mm: add p?d_leaf() definitions
>       mm: pagewalk: add p4d_entry() and pgd_entry()
>       mm: pagewalk: allow walking without vma
>       mm: pagewalk: add test_p?d callbacks
>       mm: pagewalk: add 'depth' parameter to pte_hole
>       x86: mm: point to struct seq_file from struct pg_state
>       x86: mm+efi: convert ptdump_walk_pgd_level() to take a mm_struct
>       x86: mm: convert ptdump_walk_pgd_level_debugfs() to take an mm_struct
>       x86: mm: convert ptdump_walk_pgd_level_core() to take an mm_struct
>       mm: add generic ptdump
>       x86: mm: convert dump_pagetables to use walk_page_range
>       arm64: mm: convert mm/dump.c to use walk_page_range()
>       arm64: mm: display non-present entries in ptdump
>       mm: ptdump: reduce level numbers by 1 in note_page()

I've dropped these, and since they clearly weren't ready I don't want
to see them re-sent for 5.5.

If somebody figures out the bug, trying again for 5.6 sounds fine.

               Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-12-01  1:47 incoming Andrew Morton
@ 2019-12-01  5:17 ` James Bottomley
  2019-12-01 21:07 ` incoming Linus Torvalds
  1 sibling, 0 replies; 307+ messages in thread
From: James Bottomley @ 2019-12-01  5:17 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: mm-commits, linux-mm

On Sat, 2019-11-30 at 17:47 -0800, Andrew Morton wrote:
> - a small number of updates to scripts/, ocfs2 and fs/buffer.c
> 
> - most of MM.  I still have quite a lot of material (mostly not MM)
>   staged after linux-next due to -next dependencies.  I'll send thos
>   across next week as the preprequisites get merged up.
> 
> 158 patches, based on 32ef9553635ab1236c33951a8bd9b5af1c3b1646.

Hey, Andrew, would it be at all possible for you to thread these
patches under something like this incoming message?  The selfish reason
I'm asking is so I can mark the thread as read instead of having to do
it individually for 158 messages ... my thumb would thank you for this.

Regards,

James



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-12-01  1:47 Andrew Morton
  2019-12-01  5:17 ` incoming James Bottomley
  2019-12-01 21:07 ` incoming Linus Torvalds
  0 siblings, 2 replies; 307+ messages in thread
From: Andrew Morton @ 2019-12-01  1:47 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- a small number of updates to scripts/, ocfs2 and fs/buffer.c

- most of MM.  I still have quite a lot of material (mostly not MM)
  staged after linux-next due to -next dependencies.  I'll send thos
  across next week as the preprequisites get merged up.

158 patches, based on 32ef9553635ab1236c33951a8bd9b5af1c3b1646.

Subsystems affected by this patch series:

  scripts
  ocfs2
  vfs
  mm/slab
  mm/slub
  mm/pagecache
  mm/gup
  mm/swap
  mm/memcg
  mm/pagemap
  mm/memfd
  mm/memory-failure
  mm/memory-hotplug
  mm/sparsemem
  mm/vmalloc
  mm/kasan
  mm/pagealloc
  mm/vmscan
  mm/proc
  mm/z3fold
  mm/mempolicy
  mm/memblock
  mm/hugetlbfs
  mm/hugetlb
  mm/migration
  mm/thp
  mm/cma
  mm/autonuma
  mm/page-poison
  mm/mmap
  mm/madvise
  mm/userfaultfd
  mm/shmem
  mm/cleanups
  mm/support

Subsystem: scripts

    Colin Ian King <colin.king@canonical.com>:
      scripts/spelling.txt: add more spellings to spelling.txt

Subsystem: ocfs2

    Ding Xiang <dingxiang@cmss.chinamobile.com>:
      ocfs2: fix passing zero to 'PTR_ERR' warning

Subsystem: vfs

    Saurav Girepunje <saurav.girepunje@gmail.com>:
      fs/buffer.c: fix use true/false for bool type

    Ben Dooks <ben.dooks@codethink.co.uk>:
      fs/buffer.c: include internal.h for missing declarations

Subsystem: mm/slab

    Pengfei Li <lpf.vector@gmail.com>:
    Patch series "mm, slab: Make kmalloc_info[] contain all types of names", v6:
      mm, slab: make kmalloc_info[] contain all types of names
      mm, slab: remove unused kmalloc_size()
      mm, slab_common: use enum kmalloc_cache_type to iterate over kmalloc caches

Subsystem: mm/slub

    Miles Chen <miles.chen@mediatek.com>:
      mm: slub: print the offset of fault addresses

    Yu Zhao <yuzhao@google.com>:
      mm/slub.c: update comments
      mm/slub.c: clean up validate_slab()

Subsystem: mm/pagecache

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      mm/filemap.c: remove redundant cache invalidation after async direct-io write
      fs/direct-io.c: keep dio_warn_stale_pagecache() when CONFIG_BLOCK=n
      mm/filemap.c: warn if stale pagecache is left after direct write

Subsystem: mm/gup

    zhong jiang <zhongjiang@huawei.com>:
      mm/gup.c: allow CMA migration to propagate errors back to caller

    Liu Xiang <liuxiang_1999@126.com>:
      mm/gup.c: fix comments of __get_user_pages() and get_user_pages_remote()

Subsystem: mm/swap

    Naohiro Aota <naohiro.aota@wdc.com>:
      mm, swap: disallow swapon() on zoned block devices

    Fengguang Wu <fengguang.wu@intel.com>:
      mm/swap.c: trivial mark_page_accessed() cleanup

Subsystem: mm/memcg

    Yafang Shao <laoar.shao@gmail.com>:
      mm, memcg: clean up reclaim iter array

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: remove dead code from memory_max_write()
      mm: memcontrol: try harder to set a new memory.high

    Hao Lee <haolee.swjtu@gmail.com>:
      include/linux/memcontrol.h: fix comments based on per-node memcg

    Shakeel Butt <shakeelb@google.com>:
      mm: vmscan: memcontrol: remove mem_cgroup_select_victim_node()

    Chris Down <chris@chrisdown.name>:
      Documentation/admin-guide/cgroup-v2.rst: document why inactive_X + active_X may not equal X

Subsystem: mm/pagemap

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: drop mmap_sem before calling balance_dirty_pages() in write fault

    "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>:
      shmem: pin the file in shmem_fault() if mmap_sem is dropped

    "Joel Fernandes (Google)" <joel@joelfernandes.org>:
      mm: emit tracepoint when RSS changes
      rss_stat: add support to detect RSS updates of external mm

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/mmap.c: remove a never-triggered warning in __vma_adjust()

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      mm/swap.c: piggyback lru_add_drain_all() calls

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/mmap.c: prev could be retrieved from vma->vm_prev
      mm/mmap.c: __vma_unlink_prev() is not necessary now
      mm/mmap.c: extract __vma_unlink_list() as counterpart for __vma_link_list()
      mm/mmap.c: rb_parent is not necessary in __vma_link_list()
      mm/rmap.c: don't reuse anon_vma if we just want a copy
      mm/rmap.c: reuse mergeable anon_vma as parent when fork

    Gaowei Pu <pugaowei@gmail.com>:
      mm/mmap.c: use IS_ERR_VALUE to check return value of get_unmapped_area

    Vineet Gupta <Vineet.Gupta1@synopsys.com>:
    Patch series "elide extraneous generated code for folded p4d/pud/pmd", v3:
      ARC: mm: remove __ARCH_USE_5LEVEL_HACK
      asm-generic/tlb: stub out pud_free_tlb() if nopud ...
      asm-generic/tlb: stub out p4d_free_tlb() if nop4d ...
      asm-generic/tlb: stub out pmd_free_tlb() if nopmd
      asm-generic/mm: stub out p{4,u}d_clear_bad() if __PAGETABLE_P{4,U}D_FOLDED

    Miles Chen <miles.chen@mediatek.com>:
      mm/rmap.c: fix outdated comment in page_get_anon_vma()

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/rmap.c: use VM_BUG_ON_PAGE() in __page_check_anon_rmap()

    Thomas Hellstrom <thellstrom@vmware.com>:
      mm: move the backup x_devmap() functions to asm-generic/pgtable.h
      mm/memory.c: fix a huge pud insertion race during faulting

    Steven Price <steven.price@arm.com>:
    Patch series "Generic page walk and ptdump", v15:
      mm: add generic p?d_leaf() macros
      arc: mm: add p?d_leaf() definitions
      arm: mm: add p?d_leaf() definitions
      arm64: mm: add p?d_leaf() definitions
      mips: mm: add p?d_leaf() definitions
      powerpc: mm: add p?d_leaf() definitions
      riscv: mm: add p?d_leaf() definitions
      s390: mm: add p?d_leaf() definitions
      sparc: mm: add p?d_leaf() definitions
      x86: mm: add p?d_leaf() definitions
      mm: pagewalk: add p4d_entry() and pgd_entry()
      mm: pagewalk: allow walking without vma
      mm: pagewalk: add test_p?d callbacks
      mm: pagewalk: add 'depth' parameter to pte_hole
      x86: mm: point to struct seq_file from struct pg_state
      x86: mm+efi: convert ptdump_walk_pgd_level() to take a mm_struct
      x86: mm: convert ptdump_walk_pgd_level_debugfs() to take an mm_struct
      x86: mm: convert ptdump_walk_pgd_level_core() to take an mm_struct
      mm: add generic ptdump
      x86: mm: convert dump_pagetables to use walk_page_range
      arm64: mm: convert mm/dump.c to use walk_page_range()
      arm64: mm: display non-present entries in ptdump
      mm: ptdump: reduce level numbers by 1 in note_page()

Subsystem: mm/memfd

    Nicolas Geoffray <ngeoffray@google.com>:
      mm, memfd: fix COW issue on MAP_PRIVATE and F_SEAL_FUTURE_WRITE mappings

    "Joel Fernandes (Google)" <joel@joelfernandes.org>:
      memfd: add test for COW on MAP_PRIVATE and F_SEAL_FUTURE_WRITE mappings

Subsystem: mm/memory-failure

    Jane Chu <jane.chu@oracle.com>:
      mm/memory-failure.c clean up around tk pre-allocation

    Naoya Horiguchi <nao.horiguchi@gmail.com>:
      mm, soft-offline: convert parameter to pfn

    Yunfeng Ye <yeyunfeng@huawei.com>:
      mm/memory-failure.c: use page_shift() in add_to_kill()

Subsystem: mm/memory-hotplug

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/hotplug: reorder memblock_[free|remove]() calls in try_remove_memory()

    Alastair D'Silva <alastair@d-silva.org>:
      mm/memory_hotplug.c: add a bounds check to __add_pages()

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/memory_hotplug: Export generic_online_page()":
      mm/memory_hotplug: export generic_online_page()
      hv_balloon: use generic_online_page()
      mm/memory_hotplug: remove __online_page_free() and __online_page_increment_counters()
    Patch series "mm: Memory offlining + page isolation cleanups", v2:
      mm/page_alloc.c: don't set pages PageReserved() when offlining
      mm/page_isolation.c: convert SKIP_HWPOISON to MEMORY_OFFLINE

    "Ben Dooks (Codethink)" <ben.dooks@codethink.co.uk>:
      include/linux/memory_hotplug.h: move definitions of {set,clear}_zone_contiguous

    David Hildenbrand <david@redhat.com>:
      drivers/base/memory.c: drop the mem_sysfs_mutex
      mm/memory_hotplug.c: don't allow to online/offline memory blocks with holes

Subsystem: mm/sparsemem

    Vincent Whitchurch <vincent.whitchurch@axis.com>:
      mm/sparse: consistently do not zero memmap

    Ilya Leoshkevich <iii@linux.ibm.com>:
      mm/sparse.c: mark populate_section_memmap as __meminit

    Michal Hocko <mhocko@suse.com>:
      mm/sparse.c: do not waste pre allocated memmap space

Subsystem: mm/vmalloc

    Liu Xiang <liuxiang_1999@126.com>:
      mm/vmalloc.c: remove unnecessary highmem_mask from parameter of gfpflags_allow_blocking()

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: remove preempt_disable/enable when doing preloading
      mm/vmalloc: respect passed gfp_mask when doing preloading
      mm/vmalloc: add more comments to the adjust_va_to_fit_type()

    Anders Roxell <anders.roxell@linaro.org>:
      selftests: vm: add fragment CONFIG_TEST_VMALLOC

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: rework vmap_area_lock

Subsystem: mm/kasan

    Daniel Axtens <dja@axtens.net>:
    Patch series "kasan: support backing vmalloc space with real shadow:
      kasan: support backing vmalloc space with real shadow memory
      kasan: add test for vmalloc
      fork: support VMAP_STACK with KASAN_VMALLOC
      x86/kasan: support KASAN_VMALLOC

Subsystem: mm/pagealloc

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/page_alloc: add alloc_contig_pages()

    Mel Gorman <mgorman@techsingularity.net>:
      mm, pcp: share common code between memory hotplug and percpu sysctl handler
      mm, pcpu: make zone pcp updates and reset internal to the mm

    Hao Lee <haolee.swjtu@gmail.com>:
      include/linux/mmzone.h: fix comment for ISOLATE_UNMAPPED macro

    lijiazi <jqqlijiazi@gmail.com>:
      mm/page_alloc.c: print reserved_highatomic info

Subsystem: mm/vmscan

    Andrey Ryabinin <aryabinin@virtuozzo.com>:
      mm/vmscan: remove unused lru_pages argument

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/vmscan.c: remove unused scan_control parameter from pageout()

    Johannes Weiner <hannes@cmpxchg.org>:
    Patch series "mm: vmscan: cgroup-related cleanups":
      mm: vmscan: simplify lruvec_lru_size()
      mm: clean up and clarify lruvec lookup procedure
      mm: vmscan: move inactive_list_is_low() swap check to the caller
      mm: vmscan: naming fixes: global_reclaim() and sane_reclaim()
      mm: vmscan: replace shrink_node() loop with a retry jump
      mm: vmscan: turn shrink_node_memcg() into shrink_lruvec()
      mm: vmscan: split shrink_node() into node part and memcgs part
      mm: vmscan: harmonize writeback congestion tracking for nodes & memcgs
    Patch series "mm: fix page aging across multiple cgroups":
      mm: vmscan: move file exhaustion detection to the node level
      mm: vmscan: detect file thrashing at the reclaim root
      mm: vmscan: enforce inactive:active ratio at the reclaim root

    Xianting Tian <xianting_tian@126.com>:
      mm/vmscan.c: fix typo in comment

Subsystem: mm/proc

    Johannes Weiner <hannes@cmpxchg.org>:
      kernel: sysctl: make drop_caches write-only

Subsystem: mm/z3fold

    Vitaly Wool <vitaly.wool@konsulko.com>:
      mm/z3fold.c: add inter-page compaction

Subsystem: mm/mempolicy

    Li Xinhai <lixinhai.lxh@gmail.com>:
    Patch series "mm: Fix checking unmapped holes for mbind", v4:
      mm/mempolicy.c: check range first in queue_pages_test_walk
      mm/mempolicy.c: fix checking unmapped holes for mbind

Subsystem: mm/memblock

    Cao jin <caoj.fnst@cn.fujitsu.com>:
      mm/memblock.c: cleanup doc
      mm/memblock: correct doc for function

    Yunfeng Ye <yeyunfeng@huawei.com>:
      mm: support memblock alloc on the exact node for sparse_buffer_init()

Subsystem: mm/hugetlbfs

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlbfs: hugetlb_fault_mutex_hash() cleanup
      mm/hugetlbfs: fix error handling when setting up mounts
    Patch series "hugetlbfs: convert macros to static inline, fix sparse warning":
      powerpc/mm: remove pmd_huge/pud_huge stubs and include hugetlb.h
      hugetlbfs: convert macros to static inline, fix sparse warning

    Piotr Sarna <p.sarna@tlen.pl>:
      hugetlbfs: add O_TMPFILE support

    Waiman Long <longman@redhat.com>:
      hugetlbfs: take read_lock on i_mmap for PMD sharing

Subsystem: mm/hugetlb

    Mina Almasry <almasrymina@google.com>:
      hugetlb: region_chg provides only cache entry
      hugetlb: remove duplicated code

    Wei Yang <richardw.yang@linux.intel.com>:
      hugetlb: remove unused hstate in hugetlb_fault_mutex_hash()

    Zhigang Lu <tonnylu@tencent.com>:
      mm/hugetlb: avoid looping to the same hugepage if !pages and !vmas

    zhong jiang <zhongjiang@huawei.com>:
      mm/huge_memory.c: split_huge_pages_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Subsystem: mm/migration

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm/migrate.c: handle freed page at the first place

Subsystem: mm/thp

    "Kirill A. Shutemov" <kirill@shutemov.name>:
      mm, thp: do not queue fully unmapped pages for deferred split

    Song Liu <songliubraving@fb.com>:
      mm/thp: flush file for !is_shmem PageDirty() case in collapse_file()

Subsystem: mm/cma

    Yunfeng Ye <yeyunfeng@huawei.com>:
      mm/cma.c: switch to bitmap_zalloc() for cma bitmap allocation

    zhong jiang <zhongjiang@huawei.com>:
      mm/cma_debug.c: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops

Subsystem: mm/autonuma

    Huang Ying <ying.huang@intel.com>:
      autonuma: fix watermark checking in migrate_balanced_pgdat()
      autonuma: reduce cache footprint when scanning page tables

Subsystem: mm/page-poison

    zhong jiang <zhongjiang@huawei.com>:
      mm/hwpoison-inject: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops

Subsystem: mm/mmap

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/mmap.c: make vma_merge() comment more easy to understand

Subsystem: mm/madvise

    Yunfeng Ye <yeyunfeng@huawei.com>:
      mm/madvise.c: replace with page_size() in madvise_inject_error()

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/madvise.c: use PAGE_ALIGN[ED] for range checking

Subsystem: mm/userfaultfd

    Wei Yang <richardw.yang@linux.intel.com>:
      userfaultfd: use vma_pagesize for all huge page size calculation
      userfaultfd: remove unnecessary WARN_ON() in __mcopy_atomic_hugetlb()
      userfaultfd: wrap the common dst_vma check into an inlined function

    Andrea Arcangeli <aarcange@redhat.com>:
      fs/userfaultfd.c: wp: clear VM_UFFD_MISSING or VM_UFFD_WP during userfaultfd_register()

    Mike Rapoport <rppt@linux.ibm.com>:
      userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK

Subsystem: mm/shmem

    Colin Ian King <colin.king@canonical.com>:
      mm/shmem.c: make array 'values' static const, makes object smaller

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: shmem: use proper gfp flags for shmem_writepage()

    Chen Jun <chenjun102@huawei.com>:
      mm/shmem.c: cast the type of unmap_start to u64

Subsystem: mm/cleanups

    Hao Lee <haolee.swjtu@gmail.com>:
      mm: fix struct member name in function comments

    Wei Yang <richardw.yang@linux.intel.com>:
      mm: fix typos in comments when calling __SetPageUptodate()

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm/memory_hotplug.c: remove __online_page_set_limits()

    Krzysztof Kozlowski <krzk@kernel.org>:
      mm/Kconfig: fix indentation

    Randy Dunlap <rdunlap@infradead.org>:
      mm/Kconfig: fix trivial help text punctuation

Subsystem: mm/support

    Minchan Kim <minchan@google.com>:
      mm/page_io.c: annotate refault stalls from swap_readpage

 Documentation/admin-guide/cgroup-v2.rst          |    7 
 Documentation/dev-tools/kasan.rst                |   63 +
 arch/Kconfig                                     |    9 
 arch/arc/include/asm/pgtable.h                   |    2 
 arch/arc/mm/fault.c                              |   10 
 arch/arc/mm/highmem.c                            |    4 
 arch/arm/include/asm/pgtable-2level.h            |    1 
 arch/arm/include/asm/pgtable-3level.h            |    1 
 arch/arm64/Kconfig                               |    1 
 arch/arm64/Kconfig.debug                         |   19 
 arch/arm64/include/asm/pgtable.h                 |    2 
 arch/arm64/include/asm/ptdump.h                  |    8 
 arch/arm64/mm/Makefile                           |    4 
 arch/arm64/mm/dump.c                             |  148 +---
 arch/arm64/mm/mmu.c                              |    4 
 arch/arm64/mm/ptdump_debugfs.c                   |    2 
 arch/mips/include/asm/pgtable.h                  |    5 
 arch/powerpc/include/asm/book3s/64/pgtable-4k.h  |    3 
 arch/powerpc/include/asm/book3s/64/pgtable-64k.h |    3 
 arch/powerpc/include/asm/book3s/64/pgtable.h     |   30 
 arch/powerpc/mm/book3s64/radix_pgtable.c         |    1 
 arch/riscv/include/asm/pgtable-64.h              |    7 
 arch/riscv/include/asm/pgtable.h                 |    7 
 arch/s390/include/asm/pgtable.h                  |    2 
 arch/sparc/include/asm/pgtable_64.h              |    2 
 arch/x86/Kconfig                                 |    2 
 arch/x86/Kconfig.debug                           |   20 
 arch/x86/include/asm/pgtable.h                   |   10 
 arch/x86/mm/Makefile                             |    4 
 arch/x86/mm/debug_pagetables.c                   |    8 
 arch/x86/mm/dump_pagetables.c                    |  431 +++---------
 arch/x86/mm/kasan_init_64.c                      |   61 +
 arch/x86/platform/efi/efi_32.c                   |    2 
 arch/x86/platform/efi/efi_64.c                   |    4 
 drivers/base/memory.c                            |   40 -
 drivers/firmware/efi/arm-runtime.c               |    2 
 drivers/hv/hv_balloon.c                          |    4 
 drivers/xen/balloon.c                            |    1 
 fs/buffer.c                                      |    6 
 fs/direct-io.c                                   |   21 
 fs/hugetlbfs/inode.c                             |   67 +
 fs/ocfs2/acl.c                                   |    4 
 fs/proc/task_mmu.c                               |    4 
 fs/userfaultfd.c                                 |   21 
 include/asm-generic/4level-fixup.h               |    1 
 include/asm-generic/5level-fixup.h               |    1 
 include/asm-generic/pgtable-nop4d.h              |    2 
 include/asm-generic/pgtable-nopmd.h              |    2 
 include/asm-generic/pgtable-nopud.h              |    2 
 include/asm-generic/pgtable.h                    |   71 ++
 include/asm-generic/tlb.h                        |    4 
 include/linux/fs.h                               |    6 
 include/linux/gfp.h                              |    2 
 include/linux/hugetlb.h                          |  142 +++-
 include/linux/kasan.h                            |   31 
 include/linux/memblock.h                         |    3 
 include/linux/memcontrol.h                       |   51 -
 include/linux/memory_hotplug.h                   |   11 
 include/linux/mm.h                               |   42 -
 include/linux/mmzone.h                           |   34 
 include/linux/moduleloader.h                     |    2 
 include/linux/page-isolation.h                   |    4 
 include/linux/pagewalk.h                         |   42 -
 include/linux/ptdump.h                           |   22 
 include/linux/slab.h                             |   20 
 include/linux/string.h                           |    2 
 include/linux/swap.h                             |    2 
 include/linux/vmalloc.h                          |   12 
 include/trace/events/kmem.h                      |   53 +
 kernel/events/uprobes.c                          |    2 
 kernel/fork.c                                    |    4 
 kernel/sysctl.c                                  |    2 
 lib/Kconfig.kasan                                |   16 
 lib/test_kasan.c                                 |   26 
 lib/vsprintf.c                                   |   40 -
 mm/Kconfig                                       |   40 -
 mm/Kconfig.debug                                 |   21 
 mm/Makefile                                      |    1 
 mm/cma.c                                         |    6 
 mm/cma_debug.c                                   |   10 
 mm/filemap.c                                     |   56 -
 mm/gup.c                                         |   40 -
 mm/hmm.c                                         |    8 
 mm/huge_memory.c                                 |    2 
 mm/hugetlb.c                                     |  298 ++------
 mm/hwpoison-inject.c                             |    4 
 mm/internal.h                                    |   27 
 mm/kasan/common.c                                |  233 ++++++
 mm/kasan/generic_report.c                        |    3 
 mm/kasan/kasan.h                                 |    1 
 mm/khugepaged.c                                  |   18 
 mm/madvise.c                                     |   14 
 mm/memblock.c                                    |  113 ++-
 mm/memcontrol.c                                  |  167 ----
 mm/memory-failure.c                              |   61 -
 mm/memory.c                                      |   56 +
 mm/memory_hotplug.c                              |   86 +-
 mm/mempolicy.c                                   |   59 +
 mm/migrate.c                                     |   21 
 mm/mincore.c                                     |    1 
 mm/mmap.c                                        |   75 --
 mm/mprotect.c                                    |    8 
 mm/mremap.c                                      |    4 
 mm/nommu.c                                       |   10 
 mm/page_alloc.c                                  |  137 +++
 mm/page_io.c                                     |   15 
 mm/page_isolation.c                              |   12 
 mm/pagewalk.c                                    |  126 ++-
 mm/pgtable-generic.c                             |    9 
 mm/ptdump.c                                      |  167 ++++
 mm/rmap.c                                        |   65 +
 mm/shmem.c                                       |   29 
 mm/slab.c                                        |    7 
 mm/slab.h                                        |    6 
 mm/slab_common.c                                 |  101 +-
 mm/slub.c                                        |   36 -
 mm/sparse.c                                      |   22 
 mm/swap.c                                        |   29 
 mm/swapfile.c                                    |    7 
 mm/userfaultfd.c                                 |   77 +-
 mm/util.c                                        |   22 
 mm/vmalloc.c                                     |  196 +++--
 mm/vmscan.c                                      |  798 +++++++++++------------
 mm/workingset.c                                  |   75 +-
 mm/z3fold.c                                      |  375 ++++++++--
 scripts/spelling.txt                             |   28 
 tools/testing/selftests/memfd/memfd_test.c       |   36 +
 tools/testing/selftests/vm/config                |    1 
 128 files changed, 3409 insertions(+), 2121 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-11-22  1:53 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-11-22  1:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


4 fixes, based on 81429eb8d9ca40b0c65bb739d29fa856c5d5e958:

    Vincent Whitchurch <vincent.whitchurch@axis.com>:
      mm/sparse: consistently do not zero memmap

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()"

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: don't access uninitialized memmaps in shrink_zone_span()

    Andrey Ryabinin <aryabinin@virtuozzo.com>:
      mm/ksm.c: don't WARN if page is still mapped in remove_stable_node()

 fs/ocfs2/xattr.c    |   56 ++++++++++++++++++++++++++++++----------------------
 mm/ksm.c            |   14 ++++++-------
 mm/memory_hotplug.c |   16 ++++++++++++--
 mm/sparse.c         |    2 -
 4 files changed, 54 insertions(+), 34 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-11-16  1:34 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-11-16  1:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


11 fixes, based on 875fef493f21e54d20d71a581687990aaa50268c:

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: mempolicy: fix the wrong return value and potential pages leak of mbind

    zhong jiang <zhongjiang@huawei.com>:
      mm: fix trying to reclaim unevictable lru page when calling madvise_pageout

    Lasse Collin <lasse.collin@tukaani.org>:
      lib/xz: fix XZ_DYNALLOC to avoid useless memory reallocations

    Roman Gushchin <guro@fb.com>:
      mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm()
      mm: hugetlb: switch to css_tryget() in hugetlb_cgroup_charge_cgroup()

    Laura Abbott <labbott@redhat.com>:
      mm: slub: really fix slab walking for init_on_free

    Song Liu <songliubraving@fb.com>:
      mm,thp: recheck each page before collapsing file THP

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: fix try_offline_node()

    Vinayak Menon <vinmenon@codeaurora.org>:
      mm/page_io.c: do not free shared swap slots

    Ralph Campbell <rcampbell@nvidia.com>:
      mm/debug.c: __dump_page() prints an extra line
      mm/debug.c: PageAnon() is true for PageKsm() pages

 drivers/base/memory.c  |   36 ++++++++++++++++++++++++++++++++++++
 include/linux/memory.h |    1 +
 lib/xz/xz_dec_lzma2.c  |    1 +
 mm/debug.c             |   33 ++++++++++++++++++---------------
 mm/hugetlb_cgroup.c    |    2 +-
 mm/khugepaged.c        |   28 ++++++++++++++++------------
 mm/madvise.c           |   16 ++++++++++++----
 mm/memcontrol.c        |    2 +-
 mm/memory_hotplug.c    |   47 +++++++++++++++++++++++++++++------------------
 mm/mempolicy.c         |   14 +++++++++-----
 mm/page_io.c           |    6 +++---
 mm/slub.c              |   39 +++++++++------------------------------
 12 files changed, 136 insertions(+), 89 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-11-06  5:16 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-11-06  5:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

17 fixes, based on 26bc672134241a080a83b2ab9aa8abede8d30e1c:

    Shakeel Butt <shakeelb@google.com>:
      mm: memcontrol: fix NULL-ptr deref in percpu stats flush

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup_benchmark: fix MAP_HUGETLB case

    Mel Gorman <mgorman@techsingularity.net>:
      mm, meminit: recalculate pcpu batch and high limits after init completes

    Yang Shi <yang.shi@linux.alibaba.com>:
      mm: thp: handle page cache THP correctly in PageTransCompoundMap

    Shuning Zhang <sunny.s.zhang@oracle.com>:
      ocfs2: protect extent tree in ocfs2_prepare_inode_for_write()

    Jason Gunthorpe <jgg@mellanox.com>:
      mm/mmu_notifiers: use the right return code for WARN_ON

    Michal Hocko <mhocko@suse.com>:
      mm, vmstat: hide /proc/pagetypeinfo from normal users
      mm, vmstat: reduce zone->lock holding time by /proc/pagetypeinfo

    Ville Syrjälä <ville.syrjala@linux.intel.com>:
      mm/khugepaged: fix might_sleep() warn with CONFIG_HIGHPTE=y

    Johannes Weiner <hannes@cmpxchg.org>:
      mm/page_alloc.c: ratelimit allocation failure warnings more aggressively

    Vitaly Wool <vitaly.wool@konsulko.com>:
      zswap: add Vitaly to the maintainers list

    Kevin Hao <haokexin@gmail.com>:
      dump_stack: avoid the livelock of the dump_lock

    Song Liu <songliubraving@fb.com>:
      MAINTAINERS: update information for "MEMORY MANAGEMENT"

    Roman Gushchin <guro@fb.com>:
      mm: slab: make page_cgroup_ino() to recognize non-compound slab pages properly

    Ilya Leoshkevich <iii@linux.ibm.com>:
      scripts/gdb: fix debugging modules compiled with hot/cold partitioning

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: fix updating the node span

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: memcontrol: fix network errors from failing __GFP_ATOMIC charges

 MAINTAINERS                                |    5 +
 fs/ocfs2/file.c                            |  125 ++++++++++++++++++++++-------
 include/linux/mm.h                         |    5 -
 include/linux/mm_types.h                   |    5 +
 include/linux/page-flags.h                 |   20 ++++
 lib/dump_stack.c                           |    7 +
 mm/khugepaged.c                            |    7 -
 mm/memcontrol.c                            |   23 +++--
 mm/memory_hotplug.c                        |    8 +
 mm/mmu_notifier.c                          |    2 
 mm/page_alloc.c                            |   17 ++-
 mm/slab.h                                  |    4 
 mm/vmstat.c                                |   25 ++++-
 scripts/gdb/linux/symbols.py               |    3 
 tools/testing/selftests/vm/gup_benchmark.c |    2 
 15 files changed, 197 insertions(+), 61 deletions(-)




^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-10-19  3:19 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-10-19  3:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


Rather a lot of fixes, almost all affecting mm/.


26 patches, based on b9959c7a347d6adbb558fba7e36e9fef3cba3b07:

    David Hildenbrand <david@redhat.com>:
      drivers/base/memory.c: don't access uninitialized memmaps in soft_offline_page_store()
      fs/proc/page.c: don't access uninitialized memmaps in fs/proc/page.c
      mm/memory-failure.c: don't access uninitialized memmaps in memory_failure()

    Joel Colledge <joel.colledge@linbit.com>:
      scripts/gdb: fix lx-dmesg when CONFIG_PRINTK_CALLER is set

    Qian Cai <cai@lca.pw>:
      mm/page_owner: don't access uninitialized memmaps when reading /proc/pagetypeinfo

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: don't access uninitialized memmaps in shrink_pgdat_span()

    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>:
    Patch series "mm/memory_hotplug: Shrink zones before removing memory", v6:
      mm/memunmap: don't access uninitialized memmap in memunmap_pages()

    Roman Gushchin <guro@fb.com>:
      mm: memcg/slab: fix panic in __free_slab() caused by premature memcg pointer release

    Chengguang Xu <cgxu519@mykernel.net>:
      ocfs2: fix error handling in ocfs2_setattr()

    John Hubbard <jhubbard@nvidia.com>:
      mm/gup_benchmark: add a missing "w" to getopt string
      mm/gup: fix a misnamed "write" argument, and a related bug

    Honglei Wang <honglei.wang@oracle.com>:
      mm: memcg: get number of pages on the LRU list in memcgroup base on lru_zone_size

    Mike Rapoport <rppt@linux.ibm.com>:
      mm: memblock: do not enforce current limit for memblock_phys* family

    David Hildenbrand <david@redhat.com>:
      hugetlbfs: don't access uninitialized memmaps in pfn_range_valid_gigantic()

    Yi Li <yilikernel@gmail.com>:
      ocfs2: fix panic due to ocfs2_wq is null

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      mm/memcontrol: update lruvec counters in mem_cgroup_move_account

    Chenwandun <chenwandun@huawei.com>:
      zram: fix race between backing_dev_show and backing_dev_store

    Ben Dooks <ben.dooks@codethink.co.uk>:
      mm: include <linux/huge_mm.h> for is_vma_temporary_stack
      mm/filemap.c: include <linux/ramfs.h> for generic_file_vm_ops definition

    "Ben Dooks (Codethink)" <ben.dooks@codethink.co.uk>:
      mm/init-mm.c: include <linux/mman.h> for vm_committed_as_batch

    "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>:
    Patch series "Fixes for THP in page cache", v2:
      proc/meminfo: fix output alignment
      mm/thp: fix node page state in split_huge_page_to_list()

    William Kucharski <william.kucharski@oracle.com>:
      mm/vmscan.c: support removing arbitrary sized pages from mapping

    "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>:
      mm/thp: allow dropping THP from page cache

    Song Liu <songliubraving@fb.com>:
      kernel/events/uprobes.c: only do FOLL_SPLIT_PMD for uprobe register

    Ilya Leoshkevich <iii@linux.ibm.com>:
      scripts/gdb: fix debugging modules on s390

 drivers/base/memory.c                      |    3 +
 drivers/block/zram/zram_drv.c              |    5 +
 fs/ocfs2/file.c                            |    2 
 fs/ocfs2/journal.c                         |    3 -
 fs/ocfs2/localalloc.c                      |    3 -
 fs/proc/meminfo.c                          |    4 -
 fs/proc/page.c                             |   28 ++++++----
 kernel/events/uprobes.c                    |   13 ++++-
 mm/filemap.c                               |    1 
 mm/gup.c                                   |   14 +++--
 mm/huge_memory.c                           |    9 ++-
 mm/hugetlb.c                               |    5 -
 mm/init-mm.c                               |    1 
 mm/memblock.c                              |    6 +-
 mm/memcontrol.c                            |   18 ++++---
 mm/memory-failure.c                        |   14 +++--
 mm/memory_hotplug.c                        |   74 ++++++-----------------------
 mm/memremap.c                              |   11 ++--
 mm/page_owner.c                            |    5 +
 mm/rmap.c                                  |    1 
 mm/slab_common.c                           |    9 +--
 mm/truncate.c                              |   12 ++++
 mm/vmscan.c                                |   14 ++---
 scripts/gdb/linux/dmesg.py                 |   16 ++++--
 scripts/gdb/linux/symbols.py               |    8 ++-
 scripts/gdb/linux/utils.py                 |   25 +++++----
 tools/testing/selftests/vm/gup_benchmark.c |    2 
 27 files changed, 166 insertions(+), 140 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-10-14 21:11 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-10-14 21:11 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


The usual shower of hotfixes and some followups to the recently merged
page_owner enhancements.

16 patches, based on 2abd839aa7e615f2bbc50c8ba7deb9e40d186768.

Subsystems affected by this patch series:


    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "followups to debug_pagealloc improvements through page_owner", v3:
      mm, page_owner: fix off-by-one error in __set_page_owner_handle()
      mm, page_owner: decouple freeing stack trace from debug_pagealloc
      mm, page_owner: rename flag indicating that page is allocated

    Qian Cai <cai@lca.pw>:
      mm/slub: fix a deadlock in show_slab_objects()

    Eric Biggers <ebiggers@google.com>:
      lib/generic-radix-tree.c: add kmemleak annotations

    Alexander Potapenko <glider@google.com>:
      mm/slub.c: init_on_free=1 should wipe freelist ptr for bulk allocations
      lib/test_meminit: add a kmem_cache_alloc_bulk() test

    David Rientjes <rientjes@google.com>:
      mm, hugetlb: allow hugepage allocations to reclaim as needed

    Vlastimil Babka <vbabka@suse.cz>:
      mm, compaction: fix wrong pfn handling in __reset_isolation_pfn()

    Randy Dunlap <rdunlap@infradead.org>:
      fs/direct-io.c: fix kernel-doc warning
      fs/libfs.c: fix kernel-doc warning
      fs/fs-writeback.c: fix kernel-doc warning
      bitmap.h: fix kernel-doc warning and typo
      xarray.h: fix kernel-doc warning
      mm/slab.c: fix kernel-doc warning for __ksize()

    Jane Chu <jane.chu@oracle.com>:
      mm/memory-failure: poison read receives SIGKILL instead of SIGBUS if mmaped more than once

 Documentation/dev-tools/kasan.rst |    3 ++
 fs/direct-io.c                    |    3 --
 fs/fs-writeback.c                 |    2 -
 fs/libfs.c                        |    3 --
 include/linux/bitmap.h            |    3 +-
 include/linux/page_ext.h          |   10 ++++++
 include/linux/xarray.h            |    4 +-
 lib/generic-radix-tree.c          |   32 +++++++++++++++++-----
 lib/test_meminit.c                |   27 ++++++++++++++++++
 mm/compaction.c                   |    7 ++--
 mm/memory-failure.c               |   22 ++++++++-------
 mm/page_alloc.c                   |    6 ++--
 mm/page_ext.c                     |   23 ++++++---------
 mm/page_owner.c                   |   55 +++++++++++++-------------------------
 mm/slab.c                         |    3 ++
 mm/slub.c                         |   35 ++++++++++++++++++------
 16 files changed, 152 insertions(+), 86 deletions(-)







^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-10-07  0:57 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-10-07  0:57 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


The usual shower of hotfixes.

Chris's memcg patches aren't actually fixes - they're mature but a few
niggling review issues were late to arrive.

The ocfs2 fixes are quite old - those took some time to get
reviewer attention.

18 patches, based on 4ea655343ce4180fe9b2c7ec8cb8ef9884a47901.


Subsystems affected by this patch series:

  ocfs2
  hotfixes
  mm/memcg
  mm/slab-generic

Subsystem: ocfs2

    Jia Guo <guojia12@huawei.com>:
      ocfs2: clear zero in unaligned direct IO

    Jia-Ju Bai <baijiaju1990@gmail.com>:
      fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()
      fs: ocfs2: fix a possible null-pointer dereference in ocfs2_write_end_nolock()
      fs: ocfs2: fix a possible null-pointer dereference in ocfs2_info_scan_inode_alloc()

Subsystem: hotfixes

    Will Deacon <will@kernel.org>:
      panic: ensure preemption is disabled during panic()

    Anshuman Khandual <anshuman.khandual@arm.com>:
      mm/memremap: drop unused SECTION_SIZE and SECTION_MASK

    Tejun Heo <tj@kernel.org>:
      writeback: fix use-after-free in finish_writeback_work()

    Yi Wang <wang.yi59@zte.com.cn>:
      mm: fix -Wmissing-prototypes warnings

    Baoquan He <bhe@redhat.com>:
      memcg: only record foreign writebacks with dirty pages when memcg is not disabled

    Michal Hocko <mhocko@suse.com>:
      kernel/sysctl.c: do not override max_threads provided by userspace

    Vitaly Wool <vitalywool@gmail.com>:
      mm/z3fold.c: claim page in the beginning of free

    Qian Cai <cai@lca.pw>:
      mm/page_alloc.c: fix a crash in free_pages_prepare()

    Dan Carpenter <dan.carpenter@oracle.com>:
      mm/vmpressure.c: fix a signedness bug in vmpressure_register_event()

Subsystem: mm/memcg

    Chris Down <chris@chrisdown.name>:
      mm, memcg: proportional memory.{low,min} reclaim
      mm, memcg: make memory.emin the baseline for utilisation determination
      mm, memcg: make scan aggression always exclude protection

Subsystem: mm/slab-generic

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "guarantee natural alignment for kmalloc()", v2:
      mm, sl[ou]b: improve memory accounting
      mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two)

 Documentation/admin-guide/cgroup-v2.rst      |   20 +-
 Documentation/core-api/memory-allocation.rst |    4 
 fs/fs-writeback.c                            |    9 -
 fs/ocfs2/aops.c                              |   25 +++
 fs/ocfs2/ioctl.c                             |    2 
 fs/ocfs2/xattr.c                             |   56 +++----
 include/linux/memcontrol.h                   |   67 ++++++---
 include/linux/slab.h                         |    4 
 kernel/fork.c                                |    4 
 kernel/panic.c                               |    1 
 mm/memcontrol.c                              |    5 
 mm/memremap.c                                |    2 
 mm/page_alloc.c                              |    8 -
 mm/shuffle.c                                 |    2 
 mm/slab_common.c                             |   19 ++
 mm/slob.c                                    |   62 ++++++--
 mm/slub.c                                    |   14 +
 mm/sparse.c                                  |    2 
 mm/vmpressure.c                              |   20 +-
 mm/vmscan.c                                  |  198 +++++++++++++++++----------
 mm/z3fold.c                                  |   10 +
 21 files changed, 363 insertions(+), 171 deletions(-)





^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-09-25 23:45 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-09-25 23:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- almost all of the rest of -mm

- various other subsystems

76 patches, based on 351c8a09b00b5c51c8f58b016fffe51f87e2d820:

Subsystems affected by this patch series:

  memcg
  misc
  core-kernel
  lib
  checkpatch
  reiserfs
  fat
  fork
  cpumask
  kexec
  uaccess
  kconfig
  kgdb
  bug
  ipc
  lzo
  kasan
  madvise
  cleanups
  pagemap

Subsystem: memcg

    Michal Hocko <mhocko@suse.com>:
      memcg, kmem: do not fail __GFP_NOFAIL charges

Subsystem: misc

    Masahiro Yamada <yamada.masahiro@socionext.com>:
      linux/coff.h: add include guard

Subsystem: core-kernel

    Valdis Kletnieks <valdis.kletnieks@vt.edu>:
      kernel/elfcore.c: include proper prototypes

Subsystem: lib

    Michel Lespinasse <walken@google.com>:
      rbtree: avoid generating code twice for the cached versions (tools copy)
    Patch series "make RB_DECLARE_CALLBACKS more generic", v3:
      augmented rbtree: add comments for RB_DECLARE_CALLBACKS macro
      augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro
      augmented rbtree: rework the RB_DECLARE_CALLBACKS macro definition

    Joe Perches <joe@perches.com>:
      kernel-doc: core-api: include string.h into core-api

    Qian Cai <cai@lca.pw>:
      include/trace/events/writeback.h: fix -Wstringop-truncation warnings

    Kees Cook <keescook@chromium.org>:
      strscpy: reject buffer sizes larger than INT_MAX

    Valdis Kletnieks <valdis.kletnieks@vt.edu>:
      lib/generic-radix-tree.c: make 2 functions static inline
      lib/extable.c: add missing prototypes

    Stephen Boyd <swboyd@chromium.org>:
      lib/hexdump: make print_hex_dump_bytes() a nop on !DEBUG builds

Subsystem: checkpatch

    Joe Perches <joe@perches.com>:
      checkpatch: don't interpret stack dumps as commit IDs
      checkpatch: improve SPDX license checking

    Matteo Croce <mcroce@redhat.com>:
      checkpatch.pl: warn on invalid commit id

    Brendan Jackman <brendan.jackman@bluwireless.co.uk>:
      checkpatch: exclude sizeof sub-expressions from MACRO_ARG_REUSE

    Joe Perches <joe@perches.com>:
      checkpatch: prefer __section over __attribute__((section(...)))
      checkpatch: allow consecutive close braces

    Sean Christopherson <sean.j.christopherson@intel.com>:
      checkpatch: remove obsolete period from "ambiguous SHA1" query

    Joe Perches <joe@perches.com>:
      checkpatch: make git output use LANGUAGE=en_US.utf8

Subsystem: reiserfs

    Jia-Ju Bai <baijiaju1990@gmail.com>:
      fs: reiserfs: remove unnecessary check of bh in remove_from_transaction()

    zhengbin <zhengbin13@huawei.com>:
      fs/reiserfs/journal.c: remove set but not used variables
      fs/reiserfs/stree.c: remove set but not used variables
      fs/reiserfs/lbalance.c: remove set but not used variables
      fs/reiserfs/objectid.c: remove set but not used variables
      fs/reiserfs/prints.c: remove set but not used variables
      fs/reiserfs/fix_node.c: remove set but not used variables
      fs/reiserfs/do_balan.c: remove set but not used variables

    Jason Yan <yanaijie@huawei.com>:
      fs/reiserfs/journal.c: remove set but not used variable
      fs/reiserfs/do_balan.c: remove set but not used variable

Subsystem: fat

    Markus Elfring <elfring@users.sourceforge.net>:
      fat: delete an unnecessary check before brelse()

Subsystem: fork

    Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>:
      fork: improve error message for corrupted page tables

Subsystem: cpumask

    Alexey Dobriyan <adobriyan@gmail.com>:
      cpumask: nicer for_each_cpumask_and() signature

Subsystem: kexec

    Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>:
      kexec: bail out upon SIGKILL when allocating memory.

    Vasily Gorbik <gor@linux.ibm.com>:
      kexec: restore arch_kexec_kernel_image_probe declaration

Subsystem: uaccess

    Kees Cook <keescook@chromium.org>:
      uaccess: add missing __must_check attributes

Subsystem: kconfig

    Masahiro Yamada <yamada.masahiro@socionext.com>:
      compiler: enable CONFIG_OPTIMIZE_INLINING forcibly

Subsystem: kgdb

    Douglas Anderson <dianders@chromium.org>:
      kgdb: don't use a notifier to enter kgdb at panic; call directly
      scripts/gdb: handle split debug

Subsystem: bug

    Kees Cook <keescook@chromium.org>:
    Patch series "Clean up WARN() "cut here" handling", v2:
      bug: refactor away warn_slowpath_fmt_taint()
      bug: rename __WARN_printf_taint() to __WARN_printf()
      bug: consolidate warn_slowpath_fmt() usage
      bug: lift "cut here" out of __warn()
      bug: clean up helper macros to remove __WARN_TAINT()
      bug: consolidate __WARN_FLAGS usage
      bug: move WARN_ON() "cut here" into exception handler

Subsystem: ipc

    Markus Elfring <elfring@users.sourceforge.net>:
      ipc/mqueue.c: delete an unnecessary check before the macro call dev_kfree_skb()
      ipc/mqueue: improve exception handling in do_mq_notify()

    "Joel Fernandes (Google)" <joel@joelfernandes.org>:
      ipc/sem.c: convert to use built-in RCU list checking

Subsystem: lzo

    Dave Rodgman <dave.rodgman@arm.com>:
      lib/lzo/lzo1x_compress.c: fix alignment bug in lzo-rle

Subsystem: kasan

    Andrey Konovalov <andreyknvl@google.com>:
    Patch series "arm64: untag user pointers passed to the kernel", v19:
      lib: untag user pointers in strn*_user
      mm: untag user pointers passed to memory syscalls
      mm: untag user pointers in mm/gup.c
      mm: untag user pointers in get_vaddr_frames
      fs/namespace: untag user pointers in copy_mount_options
      userfaultfd: untag user pointers
      drm/amdgpu: untag user pointers
      drm/radeon: untag user pointers in radeon_gem_userptr_ioctl
      media/v4l2-core: untag user pointers in videobuf_dma_contig_user_get
      tee/shm: untag user pointers in tee_shm_register
      vfio/type1: untag user pointers in vaddr_get_pfn

    Catalin Marinas <catalin.marinas@arm.com>:
      mm: untag user pointers in mmap/munmap/mremap/brk

Subsystem: madvise

    Minchan Kim <minchan@kernel.org>:
    Patch series "Introduce MADV_COLD and MADV_PAGEOUT", v7:
      mm: introduce MADV_COLD
      mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM
      mm: introduce MADV_PAGEOUT
      mm: factor out common parts between MADV_COLD and MADV_PAGEOUT

Subsystem: cleanups

    Mike Rapoport <rppt@linux.ibm.com>:
      hexagon: drop empty and unused free_initrd_mem

    Denis Efremov <efremov@linux.com>:
      checkpatch: check for nested (un)?likely() calls
      xen/events: remove unlikely() from WARN() condition
      fs: remove unlikely() from WARN_ON() condition
      wimax/i2400m: remove unlikely() from WARN*() condition
      xfs: remove unlikely() from WARN_ON() condition
      IB/hfi1: remove unlikely() from IS_ERR*() condition
      ntfs: remove (un)?likely() from IS_ERR() conditions

Subsystem: pagemap

    Mark Rutland <mark.rutland@arm.com>:
      mm: treewide: clarify pgtable_page_{ctor,dtor}() naming

 Documentation/core-api/kernel-api.rst            |    3 
 Documentation/vm/split_page_table_lock.rst       |   10 
 arch/alpha/include/uapi/asm/mman.h               |    3 
 arch/arc/include/asm/pgalloc.h                   |    4 
 arch/arm/include/asm/tlb.h                       |    2 
 arch/arm/mm/mmu.c                                |    2 
 arch/arm64/include/asm/tlb.h                     |    2 
 arch/arm64/mm/mmu.c                              |    2 
 arch/csky/include/asm/pgalloc.h                  |    2 
 arch/hexagon/include/asm/pgalloc.h               |    2 
 arch/hexagon/mm/init.c                           |   13 
 arch/m68k/include/asm/mcf_pgalloc.h              |    6 
 arch/m68k/include/asm/motorola_pgalloc.h         |    6 
 arch/m68k/include/asm/sun3_pgalloc.h             |    2 
 arch/mips/include/asm/pgalloc.h                  |    2 
 arch/mips/include/uapi/asm/mman.h                |    3 
 arch/nios2/include/asm/pgalloc.h                 |    2 
 arch/openrisc/include/asm/pgalloc.h              |    6 
 arch/parisc/include/uapi/asm/mman.h              |    3 
 arch/powerpc/mm/pgtable-frag.c                   |    6 
 arch/riscv/include/asm/pgalloc.h                 |    2 
 arch/s390/mm/pgalloc.c                           |    6 
 arch/sh/include/asm/pgalloc.h                    |    2 
 arch/sparc/include/asm/pgtable_64.h              |    5 
 arch/sparc/mm/init_64.c                          |    4 
 arch/sparc/mm/srmmu.c                            |    4 
 arch/um/include/asm/pgalloc.h                    |    2 
 arch/unicore32/include/asm/tlb.h                 |    2 
 arch/x86/mm/pat_rbtree.c                         |   19 
 arch/x86/mm/pgtable.c                            |    2 
 arch/xtensa/include/asm/pgalloc.h                |    4 
 arch/xtensa/include/uapi/asm/mman.h              |    3 
 drivers/block/drbd/drbd_interval.c               |   29 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c |    2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c          |    2 
 drivers/gpu/drm/radeon/radeon_gem.c              |    2 
 drivers/infiniband/hw/hfi1/verbs.c               |    2 
 drivers/media/v4l2-core/videobuf-dma-contig.c    |    9 
 drivers/net/wimax/i2400m/tx.c                    |    3 
 drivers/tee/tee_shm.c                            |    1 
 drivers/vfio/vfio_iommu_type1.c                  |    2 
 drivers/xen/events/events_base.c                 |    2 
 fs/fat/dir.c                                     |    4 
 fs/namespace.c                                   |    2 
 fs/ntfs/mft.c                                    |   12 
 fs/ntfs/namei.c                                  |    2 
 fs/ntfs/runlist.c                                |    2 
 fs/ntfs/super.c                                  |    2 
 fs/open.c                                        |    2 
 fs/reiserfs/do_balan.c                           |   15 
 fs/reiserfs/fix_node.c                           |    6 
 fs/reiserfs/journal.c                            |   22 
 fs/reiserfs/lbalance.c                           |    3 
 fs/reiserfs/objectid.c                           |    3 
 fs/reiserfs/prints.c                             |    3 
 fs/reiserfs/stree.c                              |    4 
 fs/userfaultfd.c                                 |   22 
 fs/xfs/xfs_buf.c                                 |    4 
 include/asm-generic/bug.h                        |   71 +-
 include/asm-generic/pgalloc.h                    |    8 
 include/linux/cpumask.h                          |   14 
 include/linux/interval_tree_generic.h            |   22 
 include/linux/kexec.h                            |    2 
 include/linux/kgdb.h                             |    2 
 include/linux/mm.h                               |    4 
 include/linux/mm_types_task.h                    |    4 
 include/linux/printk.h                           |   22 
 include/linux/rbtree_augmented.h                 |  114 +++-
 include/linux/string.h                           |    5 
 include/linux/swap.h                             |    2 
 include/linux/thread_info.h                      |    2 
 include/linux/uaccess.h                          |   21 
 include/trace/events/writeback.h                 |   38 -
 include/uapi/asm-generic/mman-common.h           |    3 
 include/uapi/linux/coff.h                        |    5 
 ipc/mqueue.c                                     |   22 
 ipc/sem.c                                        |    3 
 kernel/debug/debug_core.c                        |   31 -
 kernel/elfcore.c                                 |    1 
 kernel/fork.c                                    |   16 
 kernel/kexec_core.c                              |    2 
 kernel/panic.c                                   |   48 -
 lib/Kconfig.debug                                |    4 
 lib/bug.c                                        |   11 
 lib/extable.c                                    |    1 
 lib/generic-radix-tree.c                         |    4 
 lib/hexdump.c                                    |   21 
 lib/lzo/lzo1x_compress.c                         |   14 
 lib/rbtree_test.c                                |   37 -
 lib/string.c                                     |   12 
 lib/strncpy_from_user.c                          |    3 
 lib/strnlen_user.c                               |    3 
 mm/frame_vector.c                                |    2 
 mm/gup.c                                         |    4 
 mm/internal.h                                    |    2 
 mm/madvise.c                                     |  562 ++++++++++++++++-------
 mm/memcontrol.c                                  |   10 
 mm/mempolicy.c                                   |    3 
 mm/migrate.c                                     |    2 
 mm/mincore.c                                     |    2 
 mm/mlock.c                                       |    4 
 mm/mmap.c                                        |   34 -
 mm/mprotect.c                                    |    2 
 mm/mremap.c                                      |   13 
 mm/msync.c                                       |    2 
 mm/oom_kill.c                                    |    2 
 mm/swap.c                                        |   42 +
 mm/vmalloc.c                                     |    5 
 mm/vmscan.c                                      |   62 ++
 scripts/checkpatch.pl                            |   69 ++
 scripts/gdb/linux/symbols.py                     |    4 
 tools/include/linux/rbtree.h                     |   71 +-
 tools/include/linux/rbtree_augmented.h           |  145 +++--
 tools/lib/rbtree.c                               |   37 -
 114 files changed, 1195 insertions(+), 754 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-09-24 15:34       ` incoming Linus Torvalds
@ 2019-09-25  6:36         ` Michal Hocko
  0 siblings, 0 replies; 307+ messages in thread
From: Michal Hocko @ 2019-09-25  6:36 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, David Rientjes, Vlastimil Babka, Andrea Arcangeli,
	mm-commits, Linux-MM

On Tue 24-09-19 08:34:20, Linus Torvalds wrote:
> On Tue, Sep 24, 2019 at 12:48 AM Michal Hocko <mhocko@kernel.org> wrote:
> >
> > The patch proposed by David is really non trivial wrt. potential side
> > effects.
> 
> The thing is, that's not an argument when we know that the current
> state is garbage and has a lot of these non-trivial side effects that
> are bad.
> 
> So the patch by David _fixes_ a non-trivial bad side effect.
> 
> You can't then say "there may be other non-trivial side effects that I
> don't even know about" as an argument for saying it's bad. David at
> least has numbers and an argument for his patch.

All I am saying is that I am not able to wrap my head around this patch
to provide a competent Ack. I also believe that the fix is targetting a
wrong layer of the problem as explained in my review feedback. Appart
from reclaim/compaction interaction mentioned by Vlastimil, it seems
that it is an overly eager fallback to a remote node in the fast path
that is causing a large part of the problem as well. Kcompactd is not
eager enough to keep high order allocations ready for the fast path.
This is not specific to THP we have many other high order allocations
which are going to follow the same pattern, likely not visible in any
counters but still having performance implications.

Let's discuss technical details in the respective email thread

-- 
Michal Hocko
SUSE Labs


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-09-24  7:48     ` incoming Michal Hocko
  2019-09-24 15:34       ` incoming Linus Torvalds
@ 2019-09-24 19:55       ` Vlastimil Babka
  1 sibling, 0 replies; 307+ messages in thread
From: Vlastimil Babka @ 2019-09-24 19:55 UTC (permalink / raw)
  To: Michal Hocko, Andrew Morton
  Cc: Linus Torvalds, David Rientjes, Andrea Arcangeli, mm-commits, Linux-MM

On 9/24/19 9:48 AM, Michal Hocko wrote:
> On Mon 23-09-19 21:31:53, Andrew Morton wrote:
>> On Mon, 23 Sep 2019 17:55:24 -0700 Linus Torvalds
>> <torvalds@linux-foundation.org> wrote:
>> 
>>> On Mon, Sep 23, 2019 at 3:31 PM Andrew Morton
>>> <akpm@linux-foundation.org> wrote:
>>>> 
>>>> - almost all of -mm, as below.
>>> 
>>> I was hoping that we could at least test the THP locality thing?
>>> Is it in your queue at all, or am I supposed to just do it
>>> myself?
>>> 
>> 
>> Confused.  I saw a privately emailed patch from David which nobody 
>> seems to have tested yet.  I parked that for consideration after
>> -rc1. Or are you referring to something else?
>> 
>> This thing keeps stalling.  It would be nice to push this along and
>> get something nailed down which we can at least get into 5.4-rc,
>> perhaps with a backport-this tag?
> 
> The patch proposed by David is really non trivial wrt. potential
> side effects. I have provided my review feedback [1] and it didn't
> get any reaction. I really believe that we need to debug this
> properly. A reproducer would be useful for others to work on that.
> 
> There is a more fundamental problem here and we need to address it 
> rather than to duck tape it and whack a mole afterwards.

I believe we found a problem when investigating over-reclaim in this
thread [1] where it seems madvised THP allocation attempt can result in
4MB reclaimed, if there is a small zone such as ZONE_DMA on the node. As
it happens, the patch "[patch 090/134] mm, reclaim: make
should_continue_reclaim perform dryrun detection" in Andrew's pile
should change this 4MB to 32 pages reclaimed (as a side-effect), but
that has to be tested. I'm also working on a patch to not reclaim even
those few pages. Of course there might be more fundamental issues with
reclaim/compaction interaction, but this one seems to become hopefully
clear now.

[1]
https://lore.kernel.org/linux-mm/4b4ba042-3741-7b16-2292-198c569da2aa@profihost.ag/

> [1] http://lkml.kernel.org/r/20190909193020.GD2063@dhcp22.suse.cz
> 



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-09-24  7:48     ` incoming Michal Hocko
@ 2019-09-24 15:34       ` Linus Torvalds
  2019-09-25  6:36         ` incoming Michal Hocko
  2019-09-24 19:55       ` incoming Vlastimil Babka
  1 sibling, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2019-09-24 15:34 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Andrew Morton, David Rientjes, Vlastimil Babka, Andrea Arcangeli,
	mm-commits, Linux-MM

On Tue, Sep 24, 2019 at 12:48 AM Michal Hocko <mhocko@kernel.org> wrote:
>
> The patch proposed by David is really non trivial wrt. potential side
> effects.

The thing is, that's not an argument when we know that the current
state is garbage and has a lot of these non-trivial side effects that
are bad.

So the patch by David _fixes_ a non-trivial bad side effect.

You can't then say "there may be other non-trivial side effects that I
don't even know about" as an argument for saying it's bad. David at
least has numbers and an argument for his patch.

              Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-09-24  4:31   ` incoming Andrew Morton
@ 2019-09-24  7:48     ` Michal Hocko
  2019-09-24 15:34       ` incoming Linus Torvalds
  2019-09-24 19:55       ` incoming Vlastimil Babka
  0 siblings, 2 replies; 307+ messages in thread
From: Michal Hocko @ 2019-09-24  7:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, David Rientjes, Vlastimil Babka,
	Andrea Arcangeli, mm-commits, Linux-MM

On Mon 23-09-19 21:31:53, Andrew Morton wrote:
> On Mon, 23 Sep 2019 17:55:24 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> > On Mon, Sep 23, 2019 at 3:31 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> > >
> > > - almost all of -mm, as below.
> > 
> > I was hoping that we could at least test the THP locality thing? Is it
> > in your queue at all, or am I supposed to just do it myself?
> > 
> 
> Confused.  I saw a privately emailed patch from David which nobody
> seems to have tested yet.  I parked that for consideration after -rc1. 
> Or are you referring to something else?
> 
> This thing keeps stalling.  It would be nice to push this along and get
> something nailed down which we can at least get into 5.4-rc, perhaps
> with a backport-this tag?

The patch proposed by David is really non trivial wrt. potential side
effects. I have provided my review feedback [1] and it didn't get
any reaction. I really believe that we need to debug this properly. A
reproducer would be useful for others to work on that.

There is a more fundamental problem here and we need to address it
rather than to duck tape it and whack a mole afterwards.

[1] http://lkml.kernel.org/r/20190909193020.GD2063@dhcp22.suse.cz
-- 
Michal Hocko
SUSE Labs


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-09-24  0:55 ` incoming Linus Torvalds
@ 2019-09-24  4:31   ` Andrew Morton
  2019-09-24  7:48     ` incoming Michal Hocko
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2019-09-24  4:31 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: David Rientjes, Vlastimil Babka, Michal Hocko, Andrea Arcangeli,
	mm-commits, Linux-MM

On Mon, 23 Sep 2019 17:55:24 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Mon, Sep 23, 2019 at 3:31 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > - almost all of -mm, as below.
> 
> I was hoping that we could at least test the THP locality thing? Is it
> in your queue at all, or am I supposed to just do it myself?
> 

Confused.  I saw a privately emailed patch from David which nobody
seems to have tested yet.  I parked that for consideration after -rc1. 
Or are you referring to something else?

This thing keeps stalling.  It would be nice to push this along and get
something nailed down which we can at least get into 5.4-rc, perhaps
with a backport-this tag?


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-09-23 22:31 incoming Andrew Morton
@ 2019-09-24  0:55 ` Linus Torvalds
  2019-09-24  4:31   ` incoming Andrew Morton
  0 siblings, 1 reply; 307+ messages in thread
From: Linus Torvalds @ 2019-09-24  0:55 UTC (permalink / raw)
  To: Andrew Morton, David Rientjes, Vlastimil Babka, Michal Hocko,
	Andrea Arcangeli
  Cc: mm-commits, Linux-MM

On Mon, Sep 23, 2019 at 3:31 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> - almost all of -mm, as below.

I was hoping that we could at least test the THP locality thing? Is it
in your queue at all, or am I supposed to just do it myself?

                    Linus


^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-09-23 22:31 Andrew Morton
  2019-09-24  0:55 ` incoming Linus Torvalds
  0 siblings, 1 reply; 307+ messages in thread
From: Andrew Morton @ 2019-09-23 22:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm


- a few hot fixes

- ocfs2 updates

- almost all of -mm, as below.


134 patches, based on 619e17cf75dd58905aa67ccd494a6ba5f19d6cc6:


Subsystems affected by this patch series:

  hotfixes
  ocfs2
  slab-generic
  slab
  slub
  kmemleak
  kasan
  cleanups
  debug
  pagecache
  memcg
  gup
  pagemap
  memory-hotplug
  sparsemem
  vmalloc
  initialization
  z3fold
  compaction
  mempolicy
  oom-kill
  hugetlb
  migration
  thp
  mmap
  madvise
  shmem
  zswap
  zsmalloc

Subsystem: hotfixes

    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
      fat: work around race with userspace's read via blockdev while mounting

    Vitaly Wool <vitalywool@gmail.com>:
      Revert "mm/z3fold.c: fix race between migration and destruction"

    Arnd Bergmann <arnd@arndb.de>:
      mm: add dummy can_do_mlock() helper

    Vitaly Wool <vitalywool@gmail.com>:
      z3fold: fix retry mechanism in page reclaim

    Greg Thelen <gthelen@google.com>:
      kbuild: clean compressed initramfs image

Subsystem: ocfs2

    Joseph Qi <joseph.qi@linux.alibaba.com>:
      ocfs2: use jbd2_inode dirty range scoping
      jbd2: remove jbd2_journal_inode_add_[write|wait]

    Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
      ocfs2: further debugfs cleanups

    Guozhonghua <guozhonghua@h3c.com>:
      ocfs2: remove unused ocfs2_calc_tree_trunc_credits()
      ocfs2: remove unused ocfs2_orphan_scan_exit() declaration

    zhengbin <zhengbin13@huawei.com>:
      fs/ocfs2/namei.c: remove set but not used variables
      fs/ocfs2/file.c: remove set but not used variables
      fs/ocfs2/dir.c: remove set but not used variables

    Markus Elfring <elfring@users.sourceforge.net>:
      ocfs2: delete unnecessary checks before brelse()

    Changwei Ge <gechangwei@live.cn>:
      ocfs2: wait for recovering done after direct unlock request
      ocfs2: checkpoint appending truncate log transaction before flushing

    Colin Ian King <colin.king@canonical.com>:
      ocfs2: fix spelling mistake "ambigous" -> "ambiguous"

Subsystem: slab-generic

    Waiman Long <longman@redhat.com>:
      mm, slab: extend slab/shrink to shrink all memcg caches

Subsystem: slab

    Waiman Long <longman@redhat.com>:
      mm, slab: move memcg_cache_params structure to mm/slab.h

Subsystem: slub

    Qian Cai <cai@lca.pw>:
      mm/slub.c: fix -Wunused-function compiler warnings

Subsystem: kmemleak

    Nicolas Boichat <drinkcat@chromium.org>:
      kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K

    Catalin Marinas <catalin.marinas@arm.com>:
    Patch series "mm: kmemleak: Use a memory pool for kmemleak object:
      mm: kmemleak: make the tool tolerant to struct scan_area allocation failures
      mm: kmemleak: simple memory allocation pool for kmemleak objects
      mm: kmemleak: use the memory pool for early allocations

    Qian Cai <cai@lca.pw>:
      mm/kmemleak.c: record the current memory pool size
      mm/kmemleak: increase the max mem pool to 1M

Subsystem: kasan

    Walter Wu <walter-zh.wu@mediatek.com>:
      kasan: add memory corruption identification for software tag-based mode

    Mark Rutland <mark.rutland@arm.com>:
      lib/test_kasan.c: add roundtrip tests

Subsystem: cleanups

    Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
      mm/page_poison.c: fix a typo in a comment

    YueHaibing <yuehaibing@huawei.com>:
      mm/rmap.c: remove set but not used variable 'cstart'

    Matthew Wilcox (Oracle) <willy@infradead.org>:
    Patch series "Make working with compound pages easier", v2:
      mm: introduce page_size()

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: introduce page_shift()

    Matthew Wilcox (Oracle) <willy@infradead.org>:
      mm: introduce compound_nr()

    Yu Zhao <yuzhao@google.com>:
      mm: replace list_move_tail() with add_page_to_lru_list_tail()

Subsystem: debug

    Vlastimil Babka <vbabka@suse.cz>:
    Patch series "debug_pagealloc improvements through page_owner", v2:
      mm, page_owner: record page owner for each subpage
      mm, page_owner: keep owner info when freeing the page
      mm, page_owner, debug_pagealloc: save and dump freeing stack trace

Subsystem: pagecache

    Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
      mm/filemap.c: don't initiate writeback if mapping has no dirty pages
      mm/filemap.c: rewrite mapping_needs_writeback in less fancy manner

    "Matthew Wilcox (Oracle)" <willy@infradead.org>:
      mm: page cache: store only head pages in i_pages

Subsystem: memcg

    Chris Down <chris@chrisdown.name>:
      mm, memcg: throttle allocators when failing reclaim over memory.high

    Roman Gushchin <guro@fb.com>:
      mm: memcontrol: switch to rcu protection in drain_all_stock()

    Johannes Weiner <hannes@cmpxchg.org>:
      mm: vmscan: do not share cgroup iteration between reclaimers

Subsystem: gup

    [11~From: John Hubbard <jhubbard@nvidia.com>:
    Patch series "mm/gup: add make_dirty arg to put_user_pages_dirty_lock()",:
      mm/gup: add make_dirty arg to put_user_pages_dirty_lock()

    John Hubbard <jhubbard@nvidia.com>:
      drivers/gpu/drm/via: convert put_page() to put_user_page*()
      net/xdp: convert put_page() to put_user_page*()

Subsystem: pagemap

    Wei Yang <richardw.yang@linux.intel.com>:
      mm: remove redundant assignment of entry

    Minchan Kim <minchan@kernel.org>:
      mm: release the spinlock on zap_pte_range

    Nicholas Piggin <npiggin@gmail.com>:
    Patch series "mm: remove quicklist page table caches":
      mm: remove quicklist page table caches

    Mike Rapoport <rppt@linux.ibm.com>:
      ia64: switch to generic version of pte allocation
      sh: switch to generic version of pte allocation
      microblaze: switch to generic version of pte allocation
      mm: consolidate pgtable_cache_init() and pgd_cache_init()

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm: do not hash address in print_bad_pte()

Subsystem: memory-hotplug

    David Hildenbrand <david@redhat.com>:
      mm/memory_hotplug: remove move_pfn_range()
      drivers/base/node.c: simplify unregister_memory_block_under_nodes()
      drivers/base/memory.c: fixup documentation of removable/phys_index/block_size_bytes
      driver/base/memory.c: validate memory block size early
      drivers/base/memory.c: don't store end_section_nr in memory blocks

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/memory_hotplug.c: prevent memory leak when reusing pgdat

    David Hildenbrand <david@redhat.com>:
    Patch series "mm/memory_hotplug: online_pages() cleanups", v2:
      mm/memory_hotplug.c: use PFN_UP / PFN_DOWN in walk_system_ram_range()
      mm/memory_hotplug: drop PageReserved() check in online_pages_range()
      mm/memory_hotplug: simplify online_pages_range()
      mm/memory_hotplug: make sure the pfn is aligned to the order when onlining
      mm/memory_hotplug: online_pages cannot be 0 in online_pages()

    Alastair D'Silva <alastair@d-silva.org>:
    Patch series "Add bounds check for Hotplugged memory", v3:
      mm/memory_hotplug.c: add a bounds check to check_hotplug_memory_range()
      mm/memremap.c: add a bounds check in devm_memremap_pages()

    Souptick Joarder <jrdr.linux@gmail.com>:
      mm/memory_hotplug.c: s/is/if

Subsystem: sparsemem

    Lecopzer Chen <lecopzer.chen@mediatek.com>:
      mm/sparse.c: fix memory leak of sparsemap_buf in aligned memory
      mm/sparse.c: fix ALIGN() without power of 2 in sparse_buffer_alloc()

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/sparse.c: use __nr_to_section(section_nr) to get mem_section

    Alastair D'Silva <alastair@d-silva.org>:
      mm/sparse.c: don't manually decrement num_poisoned_pages

    "Alastair D'Silva" <alastair@d-silva.org>:
      mm/sparse.c: remove NULL check in clear_hwpoisoned_pages()

Subsystem: vmalloc

    "Uladzislau Rezki (Sony)" <urezki@gmail.com>:
      mm/vmalloc: do not keep unpurged areas in the busy tree

    Pengfei Li <lpf.vector@gmail.com>:
      mm/vmalloc: modify struct vmap_area to reduce its size

    Austin Kim <austindh.kim@gmail.com>:
      mm/vmalloc.c: move 'area->pages' after if statement

Subsystem: initialization

    Mike Rapoport <rppt@linux.ibm.com>:
      mm: use CPU_BITS_NONE to initialize init_mm.cpu_bitmask

    Qian Cai <cai@lca.pw>:
      mm: silence -Woverride-init/initializer-overrides

Subsystem: z3fold

    Vitaly Wool <vitalywool@gmail.com>:
      z3fold: fix memory leak in kmem cache

Subsystem: compaction

    Yafang Shao <laoar.shao@gmail.com>:
      mm/compaction.c: clear total_{migrate,free}_scanned before scanning a new zone

    Pengfei Li <lpf.vector@gmail.com>:
      mm/compaction.c: remove unnecessary zone parameter in isolate_migratepages()

Subsystem: mempolicy

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      mm/mempolicy.c: remove unnecessary nodemask check in kernel_migrate_pages()

Subsystem: oom-kill

    Joel Savitz <jsavitz@redhat.com>:
      mm/oom_kill.c: add task UID to info message on an oom kill

    Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>:
      memcg, oom: don't require __GFP_FS when invoking memcg OOM killer

    Edward Chron <echron@arista.com>:
      mm/oom: add oom_score_adj and pgtables to Killed process message

    Yi Wang <wang.yi59@zte.com.cn>:
      mm/oom_kill.c: fix oom_cpuset_eligible() comment

    Michal Hocko <mhocko@suse.com>:
      mm, oom: consider present pages for the node size

    Qian Cai <cai@lca.pw>:
      mm/memcontrol.c: fix a -Wunused-function warning

    Michal Hocko <mhocko@suse.com>:
      memcg, kmem: deprecate kmem.limit_in_bytes

Subsystem: hugetlb

    Hillf Danton <hdanton@sina.com>:
    Patch series "address hugetlb page allocation stalls", v2:
      mm, reclaim: make should_continue_reclaim perform dryrun detection

    Vlastimil Babka <vbabka@suse.cz>:
      mm, reclaim: cleanup should_continue_reclaim()
      mm, compaction: raise compaction priority after it withdrawns

    Mike Kravetz <mike.kravetz@oracle.com>:
      hugetlbfs: don't retry when pool page allocations start to fail

Subsystem: migration

    Pingfan Liu <kernelfans@gmail.com>:
      mm/migrate.c: clean up useless code in migrate_vma_collect_pmd()

Subsystem: thp

    Kefeng Wang <wangkefeng.wang@huawei.com>:
      thp: update split_huge_page_pmd() comment

    Song Liu <songliubraving@fb.com>:
    Patch series "Enable THP for text section of non-shmem files", v10;:
      filemap: check compound_head(page)->mapping in filemap_fault()
      filemap: check compound_head(page)->mapping in pagecache_get_page()
      filemap: update offset check in filemap_fault()
      mm,thp: stats for file backed THP
      khugepaged: rename collapse_shmem() and khugepaged_scan_shmem()
      mm,thp: add read-only THP support for (non-shmem) FS
      mm,thp: avoid writes to file with THP in pagecache

    Yang Shi <yang.shi@linux.alibaba.com>:
    Patch series "Make deferred split shrinker memcg aware", v6:
      mm: thp: extract split_queue_* into a struct
      mm: move mem_cgroup_uncharge out of __page_cache_release()
      mm: shrinker: make shrinker not depend on memcg kmem
      mm: thp: make deferred split shrinker memcg aware

    Song Liu <songliubraving@fb.com>:
    Patch series "THP aware uprobe", v13:
      mm: move memcmp_pages() and pages_identical()
      uprobe: use original page when all uprobes are removed
      mm, thp: introduce FOLL_SPLIT_PMD
      uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT
      khugepaged: enable collapse pmd for pte-mapped THP
      uprobe: collapse THP pmd after removing all uprobes

Subsystem: mmap

    Alexandre Ghiti <alex@ghiti.fr>:
    Patch series "Provide generic top-down mmap layout functions", v6:
      mm, fs: move randomize_stack_top from fs to mm
      arm64: make use of is_compat_task instead of hardcoding this test
      arm64: consider stack randomization for mmap base only when necessary
      arm64, mm: move generic mmap layout functions to mm
      arm64, mm: make randomization selected by generic topdown mmap layout
      arm: properly account for stack randomization and stack guard gap
      arm: use STACK_TOP when computing mmap base address
      arm: use generic mmap top-down layout and brk randomization
      mips: properly account for stack randomization and stack guard gap
      mips: use STACK_TOP when computing mmap base address
      mips: adjust brk randomization offset to fit generic version
      mips: replace arch specific way to determine 32bit task with generic version
      mips: use generic mmap top-down layout and brk randomization
      riscv: make mmap allocation top-down by default

    Wei Yang <richardw.yang@linux.intel.com>:
      mm/mmap.c: refine find_vma_prev() with rb_last()

    Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>:
      mm: mmap: increase sockets maximum memory size pgoff for 32bits

Subsystem: madvise

    Mike Rapoport <rppt@linux.ibm.com>:
      mm/madvise: reduce code duplication in error handling paths

Subsystem: shmem

    Miles Chen <miles.chen@mediatek.com>:
      shmem: fix obsolete comment in shmem_getpage_gfp()

Subsystem: zswap

    Hui Zhu <teawaterz@linux.alibaba.com>:
      zpool: add malloc_support_movable to zpool_driver
      zswap: use movable memory if zpool support allocate movable memory

    Vitaly Wool <vitalywool@gmail.com>:
      zswap: do not map same object twice

Subsystem: zsmalloc

    Qian Cai <cai@lca.pw>:
      mm/zsmalloc.c: fix a -Wunused-function warning

 Documentation/ABI/testing/sysfs-kernel-slab     |   13 
 Documentation/admin-guide/cgroup-v1/memory.rst  |    4 
 Documentation/admin-guide/kernel-parameters.txt |    2 
 arch/Kconfig                                    |   11 
 arch/alpha/include/asm/pgalloc.h                |    2 
 arch/alpha/include/asm/pgtable.h                |    5 
 arch/arc/include/asm/pgalloc.h                  |    1 
 arch/arc/include/asm/pgtable.h                  |    5 
 arch/arm/Kconfig                                |    1 
 arch/arm/include/asm/pgalloc.h                  |    2 
 arch/arm/include/asm/pgtable-nommu.h            |    5 
 arch/arm/include/asm/pgtable.h                  |    2 
 arch/arm/include/asm/processor.h                |    2 
 arch/arm/kernel/process.c                       |    5 
 arch/arm/mm/flush.c                             |    7 
 arch/arm/mm/mmap.c                              |   80 -----
 arch/arm64/Kconfig                              |    2 
 arch/arm64/include/asm/pgalloc.h                |    2 
 arch/arm64/include/asm/pgtable.h                |    2 
 arch/arm64/include/asm/processor.h              |    2 
 arch/arm64/kernel/process.c                     |    8 
 arch/arm64/mm/flush.c                           |    3 
 arch/arm64/mm/mmap.c                            |   84 -----
 arch/arm64/mm/pgd.c                             |    2 
 arch/c6x/include/asm/pgtable.h                  |    5 
 arch/csky/include/asm/pgalloc.h                 |    2 
 arch/csky/include/asm/pgtable.h                 |    5 
 arch/h8300/include/asm/pgtable.h                |    6 
 arch/hexagon/include/asm/pgalloc.h              |    2 
 arch/hexagon/include/asm/pgtable.h              |    3 
 arch/hexagon/mm/Makefile                        |    2 
 arch/hexagon/mm/pgalloc.c                       |   10 
 arch/ia64/Kconfig                               |    4 
 arch/ia64/include/asm/pgalloc.h                 |   64 ----
 arch/ia64/include/asm/pgtable.h                 |    5 
 arch/ia64/mm/init.c                             |    2 
 arch/m68k/include/asm/pgtable_mm.h              |    7 
 arch/m68k/include/asm/pgtable_no.h              |    7 
 arch/microblaze/include/asm/pgalloc.h           |  128 --------
 arch/microblaze/include/asm/pgtable.h           |    7 
 arch/microblaze/mm/pgtable.c                    |    4 
 arch/mips/Kconfig                               |    2 
 arch/mips/include/asm/pgalloc.h                 |    2 
 arch/mips/include/asm/pgtable.h                 |    5 
 arch/mips/include/asm/processor.h               |    5 
 arch/mips/mm/mmap.c                             |  124 +-------
 arch/nds32/include/asm/pgalloc.h                |    2 
 arch/nds32/include/asm/pgtable.h                |    2 
 arch/nios2/include/asm/pgalloc.h                |    2 
 arch/nios2/include/asm/pgtable.h                |    2 
 arch/openrisc/include/asm/pgalloc.h             |    2 
 arch/openrisc/include/asm/pgtable.h             |    5 
 arch/parisc/include/asm/pgalloc.h               |    2 
 arch/parisc/include/asm/pgtable.h               |    2 
 arch/powerpc/include/asm/pgalloc.h              |    2 
 arch/powerpc/include/asm/pgtable.h              |    1 
 arch/powerpc/mm/book3s64/hash_utils.c           |    2 
 arch/powerpc/mm/book3s64/iommu_api.c            |    7 
 arch/powerpc/mm/hugetlbpage.c                   |    2 
 arch/riscv/Kconfig                              |   12 
 arch/riscv/include/asm/pgalloc.h                |    4 
 arch/riscv/include/asm/pgtable.h                |    5 
 arch/s390/include/asm/pgtable.h                 |    6 
 arch/sh/include/asm/pgalloc.h                   |   56 ---
 arch/sh/include/asm/pgtable.h                   |    5 
 arch/sh/mm/Kconfig                              |    3 
 arch/sh/mm/nommu.c                              |    4 
 arch/sparc/include/asm/pgalloc_32.h             |    2 
 arch/sparc/include/asm/pgalloc_64.h             |    2 
 arch/sparc/include/asm/pgtable_32.h             |    5 
 arch/sparc/include/asm/pgtable_64.h             |    1 
 arch/sparc/mm/init_32.c                         |    1 
 arch/um/include/asm/pgalloc.h                   |    2 
 arch/um/include/asm/pgtable.h                   |    2 
 arch/unicore32/include/asm/pgalloc.h            |    2 
 arch/unicore32/include/asm/pgtable.h            |    2 
 arch/x86/include/asm/pgtable_32.h               |    2 
 arch/x86/include/asm/pgtable_64.h               |    3 
 arch/x86/mm/pgtable.c                           |    6 
 arch/xtensa/include/asm/pgtable.h               |    1 
 arch/xtensa/include/asm/tlbflush.h              |    3 
 drivers/base/memory.c                           |   44 +-
 drivers/base/node.c                             |   55 +--
 drivers/crypto/chelsio/chtls/chtls_io.c         |    5 
 drivers/gpu/drm/via/via_dmablit.c               |   10 
 drivers/infiniband/core/umem.c                  |    5 
 drivers/infiniband/hw/hfi1/user_pages.c         |    5 
 drivers/infiniband/hw/qib/qib_user_pages.c      |    5 
 drivers/infiniband/hw/usnic/usnic_uiom.c        |    5 
 drivers/infiniband/sw/siw/siw_mem.c             |   10 
 drivers/staging/android/ion/ion_system_heap.c   |    4 
 drivers/target/tcm_fc/tfc_io.c                  |    3 
 drivers/vfio/vfio_iommu_spapr_tce.c             |    8 
 fs/binfmt_elf.c                                 |   20 -
 fs/fat/dir.c                                    |   13 
 fs/fat/fatent.c                                 |    3 
 fs/inode.c                                      |    3 
 fs/io_uring.c                                   |    2 
 fs/jbd2/journal.c                               |    2 
 fs/jbd2/transaction.c                           |   12 
 fs/ocfs2/alloc.c                                |   20 +
 fs/ocfs2/aops.c                                 |   13 
 fs/ocfs2/blockcheck.c                           |   26 -
 fs/ocfs2/cluster/heartbeat.c                    |  109 +------
 fs/ocfs2/dir.c                                  |    3 
 fs/ocfs2/dlm/dlmcommon.h                        |    1 
 fs/ocfs2/dlm/dlmdebug.c                         |   55 ---
 fs/ocfs2/dlm/dlmdebug.h                         |   16 -
 fs/ocfs2/dlm/dlmdomain.c                        |    7 
 fs/ocfs2/dlm/dlmunlock.c                        |   23 +
 fs/ocfs2/dlmglue.c                              |   29 -
 fs/ocfs2/extent_map.c                           |    3 
 fs/ocfs2/file.c                                 |   13 
 fs/ocfs2/inode.c                                |    2 
 fs/ocfs2/journal.h                              |   42 --
 fs/ocfs2/namei.c                                |    2 
 fs/ocfs2/ocfs2.h                                |    3 
 fs/ocfs2/super.c                                |   10 
 fs/open.c                                       |    8 
 fs/proc/meminfo.c                               |    8 
 fs/proc/task_mmu.c                              |    6 
 include/asm-generic/pgalloc.h                   |    5 
 include/asm-generic/pgtable.h                   |    7 
 include/linux/compaction.h                      |   22 +
 include/linux/fs.h                              |   32 ++
 include/linux/huge_mm.h                         |    9 
 include/linux/hugetlb.h                         |    2 
 include/linux/jbd2.h                            |    2 
 include/linux/khugepaged.h                      |   12 
 include/linux/memcontrol.h                      |   23 -
 include/linux/memory.h                          |    7 
 include/linux/memory_hotplug.h                  |    1 
 include/linux/mm.h                              |   37 ++
 include/linux/mm_types.h                        |    1 
 include/linux/mmzone.h                          |   14 
 include/linux/page_ext.h                        |    1 
 include/linux/pagemap.h                         |   10 
 include/linux/quicklist.h                       |   94 ------
 include/linux/shrinker.h                        |    7 
 include/linux/slab.h                            |   62 ----
 include/linux/vmalloc.h                         |   20 -
 include/linux/zpool.h                           |    3 
 init/main.c                                     |    6 
 kernel/events/uprobes.c                         |   81 ++++-
 kernel/resource.c                               |    4 
 kernel/sched/idle.c                             |    1 
 kernel/sysctl.c                                 |    6 
 lib/Kconfig.debug                               |   15 
 lib/Kconfig.kasan                               |    8 
 lib/iov_iter.c                                  |    2 
 lib/show_mem.c                                  |    5 
 lib/test_kasan.c                                |   41 ++
 mm/Kconfig                                      |   16 -
 mm/Kconfig.debug                                |    4 
 mm/Makefile                                     |    4 
 mm/compaction.c                                 |   50 +--
 mm/filemap.c                                    |  168 ++++------
 mm/gup.c                                        |  125 +++-----
 mm/huge_memory.c                                |  129 ++++++--
 mm/hugetlb.c                                    |   89 +++++
 mm/hugetlb_cgroup.c                             |    2 
 mm/init-mm.c                                    |    2 
 mm/kasan/common.c                               |   32 +-
 mm/kasan/kasan.h                                |   14 
 mm/kasan/report.c                               |   44 ++
 mm/kasan/tags_report.c                          |   24 +
 mm/khugepaged.c                                 |  372 ++++++++++++++++++++----
 mm/kmemleak.c                                   |  338 +++++----------------
 mm/ksm.c                                        |   18 -
 mm/madvise.c                                    |   52 +--
 mm/memcontrol.c                                 |  188 ++++++++++--
 mm/memfd.c                                      |    2 
 mm/memory.c                                     |   21 +
 mm/memory_hotplug.c                             |  120 ++++---
 mm/mempolicy.c                                  |    4 
 mm/memremap.c                                   |    5 
 mm/migrate.c                                    |   13 
 mm/mmap.c                                       |   12 
 mm/mmu_gather.c                                 |    2 
 mm/nommu.c                                      |    2 
 mm/oom_kill.c                                   |   30 +
 mm/page_alloc.c                                 |   27 +
 mm/page_owner.c                                 |  127 +++++---
 mm/page_poison.c                                |    2 
 mm/page_vma_mapped.c                            |    3 
 mm/quicklist.c                                  |  103 ------
 mm/rmap.c                                       |   25 -
 mm/shmem.c                                      |   12 
 mm/slab.h                                       |   64 ++++
 mm/slab_common.c                                |   37 ++
 mm/slob.c                                       |    2 
 mm/slub.c                                       |   22 -
 mm/sparse.c                                     |   25 +
 mm/swap.c                                       |   16 -
 mm/swap_state.c                                 |    6 
 mm/util.c                                       |  126 +++++++-
 mm/vmalloc.c                                    |   84 +++--
 mm/vmscan.c                                     |  163 ++++------
 mm/vmstat.c                                     |    2 
 mm/z3fold.c                                     |  154 ++-------
 mm/zpool.c                                      |   16 +
 mm/zsmalloc.c                                   |   23 -
 mm/zswap.c                                      |   15 
 net/xdp/xdp_umem.c                              |    9 
 net/xdp/xsk.c                                   |    2 
 usr/Makefile                                    |    3 
 206 files changed, 2385 insertions(+), 2533 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-08-30 23:04 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-08-30 23:04 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

7 fixes, based on 846d2db3e00048da3f650e0cfb0b8d67669cec3e:


    Roman Gushchin <guro@fb.com>:
      mm: memcontrol: flush percpu slab vmstats on kmem offlining

    Andrew Morton <akpm@linux-foundation.org>:
      mm/zsmalloc.c: fix build when CONFIG_COMPACTION=n

    Roman Gushchin <guro@fb.com>:
      mm, memcg: partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones"

    "Gustavo A. R. Silva" <gustavo@embeddedor.com>:
      mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate

    Dmitry Safonov <dima@arista.com>:
      mailmap: add aliases for Dmitry Safonov

    Michal Hocko <mhocko@suse.com>:
      mm, memcg: do not set reclaim_state on soft limit reclaim

    Shakeel Butt <shakeelb@google.com>:
      mm: memcontrol: fix percpu vmstats and vmevents flush

 .mailmap               |    3 ++
 include/linux/mmzone.h |    5 ++--
 mm/memcontrol.c        |   53 ++++++++++++++++++++++++++++++++-----------------
 mm/vmscan.c            |    5 ++--
 mm/z3fold.c            |    1 
 mm/zsmalloc.c          |    2 +
 6 files changed, 47 insertions(+), 22 deletions(-)



^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2019-08-25  0:54 Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2019-08-25  0:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, linux-mm

11 fixes, based on 361469211f876e67d7ca3d3d29e6d1c3e313d0f1:

    Henry Burns <henryburns@google.com>:
      mm/z3fold.c: fix race between migration and destruction

    David Rientjes <rientjes@google.com>:
      mm, page_alloc: move_freepages should not examine struct page of reserved memory

    Qian Cai <cai@lca.pw>:
      parisc: fix compilation errrors

    Roman Gushchin <guro@fb.com>:
      mm: memcontrol: flush percpu vmstats before releasing memcg
      mm: memcontrol: flush percpu vmevents before releasing memcg

    Jason Xing <kerneljasonxing@linux.alibaba.com>:
      psi: get poll_work to run when calling poll syscall next time

    Oleg Nesterov <oleg@redhat.com>:
      userfaultfd_release: always remove uffd flags and clear vm_userfaultfd_ctx

    Vlastimil Babka <vbabka@suse.cz>:
      mm, page_owner: handle THP splits correctly

    Henry Burns <henryburns@google.com>:
      mm/zsmalloc.c: migration can leave pages in ZS_EMPTY indefinitely
      mm/zsmalloc.c: fix race condition in zs_destroy_pool

    Andrey Ryabinin <aryabinin@virtuozzo.com>:
      mm/kasan: fix false positive invalid-free reports with CONFIG_KASAN_SW_TAGS=y



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-07-17 16:13   ` incoming Linus Torvalds
  2019-07-17 17:09     ` incoming Christian Brauner
@ 2019-07-17 18:13     ` Vlastimil Babka
  1 sibling, 0 replies; 307+ messages in thread
From: Vlastimil Babka @ 2019-07-17 18:13 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux List Kernel Mailing, linux-mm, Jonathan Corbet, Thorsten Leemhuis

On 7/17/19 6:13 PM, Linus Torvalds wrote:
> On Wed, Jul 17, 2019 at 1:47 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>>
>> So I've tried now to provide an example what I had in mind, below.
> 
> I'll take it as a trial. I added one-line notes about coda and the
> PTRACE_GET_SYSCALL_INFO interface too.

Thanks.

> I do hope that eventually I'll just get pull requests,

Very much agree, that was also discussed at length in the LSF/MM mm
process session I've linked.

> and they'll
> have more of a "theme" than this all (*)

I'll check if the first patch bomb would be more amenable to that, as I
plan to fill in the mm part for 5.3 on LinuxChanges wiki, but for a
merge commit it's too late.

>            Linus
> 
> (*) Although in many ways, the theme for Andrew is "falls through the
> cracks otherwise" so I'm not really complaining. This has been working
> for years and years.

Nevermind the misc stuff that much, but I think mm itself is more
important and deserves what other subsystems have.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-07-17 16:13   ` incoming Linus Torvalds
@ 2019-07-17 17:09     ` Christian Brauner
  2019-07-17 18:13     ` incoming Vlastimil Babka
  1 sibling, 0 replies; 307+ messages in thread
From: Christian Brauner @ 2019-07-17 17:09 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Vlastimil Babka, Linux List Kernel Mailing, linux-mm,
	Jonathan Corbet, Thorsten Leemhuis

On Wed, Jul 17, 2019 at 09:13:26AM -0700, Linus Torvalds wrote:
> On Wed, Jul 17, 2019 at 1:47 AM Vlastimil Babka <vbabka@suse.cz> wrote:
> >
> > So I've tried now to provide an example what I had in mind, below.
> 
> I'll take it as a trial. I added one-line notes about coda and the
> PTRACE_GET_SYSCALL_INFO interface too.
> 
> I do hope that eventually I'll just get pull requests, and they'll
> have more of a "theme" than this all (*)
> 
>            Linus
> 
> (*) Although in many ways, the theme for Andrew is "falls through the
> cracks otherwise" so I'm not really complaining. This has been working

I put all pid{fd}/clone{3} which is mostly related to pid.c, exit.c,
fork.c into my tree and try to give it a consistent theme for the prs I
sent. And that at least from my perspective that worked and was pretty
easy to coordinate with Andrew. That should hopefully make it a little
easier to theme the -mm tree overall going forward.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-07-17  8:47 ` incoming Vlastimil Babka
  2019-07-17  8:57   ` incoming Bhaskar Chowdhury
@ 2019-07-17 16:13   ` Linus Torvalds
  2019-07-17 17:09     ` incoming Christian Brauner
  2019-07-17 18:13     ` incoming Vlastimil Babka
  1 sibling, 2 replies; 307+ messages in thread
From: Linus Torvalds @ 2019-07-17 16:13 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Linux List Kernel Mailing, linux-mm, Jonathan Corbet, Thorsten Leemhuis

On Wed, Jul 17, 2019 at 1:47 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> So I've tried now to provide an example what I had in mind, below.

I'll take it as a trial. I added one-line notes about coda and the
PTRACE_GET_SYSCALL_INFO interface too.

I do hope that eventually I'll just get pull requests, and they'll
have more of a "theme" than this all (*)

           Linus

(*) Although in many ways, the theme for Andrew is "falls through the
cracks otherwise" so I'm not really complaining. This has been working
for years and years.


^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2019-07-17  8:47 ` incoming Vlastimil Babka
@ 2019-07-17  8:57   ` Bhaskar Chowdhury
  2019-07-17 16:13   ` incoming Linus Torvalds
  1 sibling, 0 replies; 307+ messages in thread
From: Bhaskar Chowdhury @ 2019-07-17  8:57 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: linux-kernel, Linus Torvalds, linux-mm, Jonathan Corbet,
	Thorsten Leemhuis

[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]



Cool !! 

On 10:47 Wed 17 Jul , Vlastimil Babka wrote:
>On 7/17/19 1:25 AM, Andrew Morton wrote:
>>
>> Most of the rest of MM and just about all of the rest of everything
>> else.
>
>Hi,
>
>as I've mentioned at LSF/MM [1], I think it would be nice if mm pull
>requests had summaries similar to other subsystems. I see they are now
>more structured (thanks!), but they are now probably hitting the limit
>of what scripting can do to produce a high-level summary for human
>readers (unless patch authors themselves provide a blurb that can be
>extracted later?).
>
>So I've tried now to provide an example what I had in mind, below. Maybe
>it's too concise - if there were "larger" features in this pull request,
>they would probably benefit from more details. I'm CCing the known (to
>me) consumers of these mails to judge :) Note I've only covered mm, and
>core stuff that I think will be interesting to wide audience (change in
>LIST_POISON2 value? I'm sure as hell glad to know about that one :)
>
>Feel free to include this in the merge commit, if you find it useful.
>
>Thanks,
>Vlastimil
>
>[1] https://lwn.net/Articles/787705/
>
>-----
>
>- z3fold fixes and enhancements by Henry Burns and Vitaly Wool
>- more accurate reclaimed slab caches calculations by Yafang Shao
>- fix MAP_UNINITIALIZED UAPI symbol to not depend on config, by
>Christoph Hellwig
>- !CONFIG_MMU fixes by Christoph Hellwig
>- new novmcoredd parameter to omit device dumps from vmcore, by Kairui Song
>- new test_meminit module for testing heap and pagealloc initialization,
>by Alexander Potapenko
>- ioremap improvements for huge mappings, by Anshuman Khandual
>- generalize kprobe page fault handling, by Anshuman Khandual
>- device-dax hotplug fixes and improvements, by Pavel Tatashin
>- enable synchronous DAX fault on powerpc, by Aneesh Kumar K.V
>- add pte_devmap() support for arm64, by Robin Murphy
>- unify locked_vm accounting with a helper, by Daniel Jordan
>- several misc fixes
>
>core/lib
>- new typeof_member() macro including some users, by Alexey Dobriyan
>- make BIT() and GENMASK() available in asm, by Masahiro Yamada
>- changed LIST_POISON2 on x86_64 to 0xdead000000000122 for better code
>generation, by Alexey Dobriyan
>- rbtree code size optimizations, by Michel Lespinasse
>- convert struct pid count to refcount_t, by Joel Fernandes
>
>get_maintainer.pl
>- add --no-moderated switch to skip moderated ML's, by Joe Perches
>
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
       [not found] <20190716162536.bb52b8f34a8ecf5331a86a42@linux-foundation.org>
@ 2019-07-17  8:47 ` Vlastimil Babka
  2019-07-17  8:57   ` incoming Bhaskar Chowdhury
  2019-07-17 16:13   ` incoming Linus Torvalds
  0 siblings, 2 replies; 307+ messages in thread
From: Vlastimil Babka @ 2019-07-17  8:47 UTC (permalink / raw)
  To: linux-kernel, Linus Torvalds
  Cc: linux-mm, Jonathan Corbet, Thorsten Leemhuis, LKML

On 7/17/19 1:25 AM, Andrew Morton wrote:
> 
> Most of the rest of MM and just about all of the rest of everything
> else.

Hi,

as I've mentioned at LSF/MM [1], I think it would be nice if mm pull
requests had summaries similar to other subsystems. I see they are now
more structured (thanks!), but they are now probably hitting the limit
of what scripting can do to produce a high-level summary for human
readers (unless patch authors themselves provide a blurb that can be
extracted later?).

So I've tried now to provide an example what I had in mind, below. Maybe
it's too concise - if there were "larger" features in this pull request,
they would probably benefit from more details. I'm CCing the known (to
me) consumers of these mails to judge :) Note I've only covered mm, and
core stuff that I think will be interesting to wide audience (change in
LIST_POISON2 value? I'm sure as hell glad to know about that one :)

Feel free to include this in the merge commit, if you find it useful.

Thanks,
Vlastimil

[1] https://lwn.net/Articles/787705/

-----

- z3fold fixes and enhancements by Henry Burns and Vitaly Wool
- more accurate reclaimed slab caches calculations by Yafang Shao
- fix MAP_UNINITIALIZED UAPI symbol to not depend on config, by
Christoph Hellwig
- !CONFIG_MMU fixes by Christoph Hellwig
- new novmcoredd parameter to omit device dumps from vmcore, by Kairui Song
- new test_meminit module for testing heap and pagealloc initialization,
by Alexander Potapenko
- ioremap improvements for huge mappings, by Anshuman Khandual
- generalize kprobe page fault handling, by Anshuman Khandual
- device-dax hotplug fixes and improvements, by Pavel Tatashin
- enable synchronous DAX fault on powerpc, by Aneesh Kumar K.V
- add pte_devmap() support for arm64, by Robin Murphy
- unify locked_vm accounting with a helper, by Daniel Jordan
- several misc fixes

core/lib
- new typeof_member() macro including some users, by Alexey Dobriyan
- make BIT() and GENMASK() available in asm, by Masahiro Yamada
- changed LIST_POISON2 on x86_64 to 0xdead000000000122 for better code
generation, by Alexey Dobriyan
- rbtree code size optimizations, by Michel Lespinasse
- convert struct pid count to refcount_t, by Joel Fernandes

get_maintainer.pl
- add --no-moderated switch to skip moderated ML's, by Joe Perches



^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-04 19:24       ` incoming Greg KH
@ 2007-05-04 19:29         ` Roland McGrath
  0 siblings, 0 replies; 307+ messages in thread
From: Roland McGrath @ 2007-05-04 19:29 UTC (permalink / raw)
  To: Greg KH
  Cc: Andrew Morton, Linus Torvalds, Hugh Dickins, Christoph Lameter,
	David S. Miller, Andi Kleen, Luck, Tony, Rik van Riel,
	Benjamin Herrenschmidt, linux-kernel, linux-mm, Stephen Smalley

> ABI changes are not a problem for -stable, so don't let that stop anyone
> :)

In fact this is the harmless sort (changes only the error code of a
failure case) that might actually go in if there were any important
reason.  But the smiley stands.


Thanks,
Roland

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-04 18:57     ` incoming Roland McGrath
@ 2007-05-04 19:24       ` Greg KH
  2007-05-04 19:29         ` incoming Roland McGrath
  0 siblings, 1 reply; 307+ messages in thread
From: Greg KH @ 2007-05-04 19:24 UTC (permalink / raw)
  To: Roland McGrath
  Cc: Andrew Morton, Linus Torvalds, Hugh Dickins, Christoph Lameter,
	David S. Miller, Andi Kleen, Luck, Tony, Rik van Riel,
	Benjamin Herrenschmidt, linux-kernel, linux-mm, Stephen Smalley

On Fri, May 04, 2007 at 11:57:21AM -0700, Roland McGrath wrote:
> > Ah.  The patch affects security code, but it doesn't actually address any
> > insecurity.  I didn't think it was needed for -stable?
> 
> I would not recommend it for -stable.  
> It is an ABI change for the case of a security refusal.

ABI changes are not a problem for -stable, so don't let that stop anyone
:)

thanks,

greg k-h

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-04 16:14   ` incoming Andrew Morton
  2007-05-04 17:02     ` incoming Greg KH
@ 2007-05-04 18:57     ` Roland McGrath
  2007-05-04 19:24       ` incoming Greg KH
  1 sibling, 1 reply; 307+ messages in thread
From: Roland McGrath @ 2007-05-04 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Greg KH, Linus Torvalds, Hugh Dickins, Christoph Lameter,
	David S. Miller, Andi Kleen, Luck, Tony, Rik van Riel,
	Benjamin Herrenschmidt, linux-kernel, linux-mm, Stephen Smalley

> Ah.  The patch affects security code, but it doesn't actually address any
> insecurity.  I didn't think it was needed for -stable?

I would not recommend it for -stable.  
It is an ABI change for the case of a security refusal.


Thanks,
Roland

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-04 16:14   ` incoming Andrew Morton
@ 2007-05-04 17:02     ` Greg KH
  2007-05-04 18:57     ` incoming Roland McGrath
  1 sibling, 0 replies; 307+ messages in thread
From: Greg KH @ 2007-05-04 17:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Hugh Dickins, Christoph Lameter, David S. Miller,
	Andi Kleen, Luck, Tony, Rik van Riel, Benjamin Herrenschmidt,
	linux-kernel, linux-mm, Roland McGrath, Stephen Smalley

On Fri, May 04, 2007 at 09:14:34AM -0700, Andrew Morton wrote:
> On Fri, 4 May 2007 06:37:28 -0700 Greg KH <greg@kroah.com> wrote:
> 
> > On Wed, May 02, 2007 at 03:02:52PM -0700, Andrew Morton wrote:
> > > - One little security patch
> > 
> > Care to cc: linux-stable with it so we can do a new 2.6.21 release with
> > it if needed?
> > 
> 
> Ah.  The patch affects security code, but it doesn't actually address any
> insecurity.  I didn't think it was needed for -stable?

Ah, ok, I read "security" as fixing a insecure problem, my mistake :)

thanks,

greg k-h

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-04 13:37 ` incoming Greg KH
@ 2007-05-04 16:14   ` Andrew Morton
  2007-05-04 17:02     ` incoming Greg KH
  2007-05-04 18:57     ` incoming Roland McGrath
  0 siblings, 2 replies; 307+ messages in thread
From: Andrew Morton @ 2007-05-04 16:14 UTC (permalink / raw)
  To: Greg KH
  Cc: Linus Torvalds, Hugh Dickins, Christoph Lameter, David S. Miller,
	Andi Kleen, Luck, Tony, Rik van Riel, Benjamin Herrenschmidt,
	linux-kernel, linux-mm, Roland McGrath, Stephen Smalley

On Fri, 4 May 2007 06:37:28 -0700 Greg KH <greg@kroah.com> wrote:

> On Wed, May 02, 2007 at 03:02:52PM -0700, Andrew Morton wrote:
> > - One little security patch
> 
> Care to cc: linux-stable with it so we can do a new 2.6.21 release with
> it if needed?
> 

Ah.  The patch affects security code, but it doesn't actually address any
insecurity.  I didn't think it was needed for -stable?



From: Roland McGrath <roland@redhat.com>

wait* syscalls return -ECHILD even when an individual PID of a live child
was requested explicitly, when security_task_wait denies the operation. 
This means that something like a broken SELinux policy can produce an
unexpected failure that looks just like a bug with wait or ptrace or
something.

This patch makes do_wait return -EACCES (or other appropriate error returned
from security_task_wait() instead of -ECHILD if some children were ruled out
solely because security_task_wait failed.

[jmorris@namei.org: switch error code to EACCES]
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/exit.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff -puN kernel/exit.c~return-eperm-not-echild-on-security_task_wait-failure kernel/exit.c
--- a/kernel/exit.c~return-eperm-not-echild-on-security_task_wait-failure
+++ a/kernel/exit.c
@@ -1033,6 +1033,8 @@ asmlinkage void sys_exit_group(int error
 
 static int eligible_child(pid_t pid, int options, struct task_struct *p)
 {
+	int err;
+
 	if (pid > 0) {
 		if (p->pid != pid)
 			return 0;
@@ -1066,8 +1068,9 @@ static int eligible_child(pid_t pid, int
 	if (delay_group_leader(p))
 		return 2;
 
-	if (security_task_wait(p))
-		return 0;
+	err = security_task_wait(p);
+	if (err)
+		return err;
 
 	return 1;
 }
@@ -1449,6 +1452,7 @@ static long do_wait(pid_t pid, int optio
 	DECLARE_WAITQUEUE(wait, current);
 	struct task_struct *tsk;
 	int flag, retval;
+	int allowed, denied;
 
 	add_wait_queue(&current->signal->wait_chldexit,&wait);
 repeat:
@@ -1457,6 +1461,7 @@ repeat:
 	 * match our criteria, even if we are not able to reap it yet.
 	 */
 	flag = 0;
+	allowed = denied = 0;
 	current->state = TASK_INTERRUPTIBLE;
 	read_lock(&tasklist_lock);
 	tsk = current;
@@ -1472,6 +1477,12 @@ repeat:
 			if (!ret)
 				continue;
 
+			if (unlikely(ret < 0)) {
+				denied = ret;
+				continue;
+			}
+			allowed = 1;
+
 			switch (p->state) {
 			case TASK_TRACED:
 				/*
@@ -1570,6 +1581,8 @@ check_continued:
 		goto repeat;
 	}
 	retval = -ECHILD;
+	if (unlikely(denied) && !allowed)
+		retval = denied;
 end:
 	current->state = TASK_RUNNING;
 	remove_wait_queue(&current->signal->wait_chldexit,&wait);
_


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-02 22:02 incoming Andrew Morton
  2007-05-02 22:31 ` incoming Benjamin Herrenschmidt
  2007-05-03  7:55 ` incoming Russell King
@ 2007-05-04 13:37 ` Greg KH
  2007-05-04 16:14   ` incoming Andrew Morton
  2 siblings, 1 reply; 307+ messages in thread
From: Greg KH @ 2007-05-04 13:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Hugh Dickins, Christoph Lameter, David S. Miller,
	Andi Kleen, Luck, Tony, Rik van Riel, Benjamin Herrenschmidt,
	linux-kernel, linux-mm

On Wed, May 02, 2007 at 03:02:52PM -0700, Andrew Morton wrote:
> - One little security patch

Care to cc: linux-stable with it so we can do a new 2.6.21 release with
it if needed?

thanks,

greg k-h

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-03  7:55 ` incoming Russell King
@ 2007-05-03  8:05   ` Andrew Morton
  0 siblings, 0 replies; 307+ messages in thread
From: Andrew Morton @ 2007-05-03  8:05 UTC (permalink / raw)
  To: Russell King
  Cc: Linus Torvalds, Hugh Dickins, Christoph Lameter, David S. Miller,
	Andi Kleen, Luck, Tony, Rik van Riel, Benjamin Herrenschmidt,
	linux-kernel, linux-mm

On Thu, 3 May 2007 08:55:43 +0100 Russell King <rmk+lkml@arm.linux.org.uk> wrote:

> On Wed, May 02, 2007 at 03:02:52PM -0700, Andrew Morton wrote:
> > So this is what I have lined up for the first mm->2.6.22 batch.  I won't be
> > sending it off for another 12-24 hours yet.  To give people time for final
> > comment and to give me time to see if it actually works.
> 
> I assume you're going to update this list with my comments I sent
> yesterday?
> 

Serial drivers?  Well you saw me drop a bunch of them.  I now have:

serial-driver-pmc-msp71xx.patch
rm9000-serial-driver.patch
serial-define-fixed_port-flag-for-serial_core.patch
mpsc-serial-driver-tx-locking.patch
serial-serial_core-use-pr_debug.patch

I'll also be holding off on MADV_FREE - Nick has some performance things to
share and I'm assuming they're not as good as he'd like.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-02 22:02 incoming Andrew Morton
  2007-05-02 22:31 ` incoming Benjamin Herrenschmidt
@ 2007-05-03  7:55 ` Russell King
  2007-05-03  8:05   ` incoming Andrew Morton
  2007-05-04 13:37 ` incoming Greg KH
  2 siblings, 1 reply; 307+ messages in thread
From: Russell King @ 2007-05-03  7:55 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Hugh Dickins, Christoph Lameter, David S. Miller,
	Andi Kleen, Luck, Tony, Rik van Riel, Benjamin Herrenschmidt,
	linux-kernel, linux-mm

On Wed, May 02, 2007 at 03:02:52PM -0700, Andrew Morton wrote:
> So this is what I have lined up for the first mm->2.6.22 batch.  I won't be
> sending it off for another 12-24 hours yet.  To give people time for final
> comment and to give me time to see if it actually works.

I assume you're going to update this list with my comments I sent
yesterday?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* Re: incoming
  2007-05-02 22:02 incoming Andrew Morton
@ 2007-05-02 22:31 ` Benjamin Herrenschmidt
  2007-05-03  7:55 ` incoming Russell King
  2007-05-04 13:37 ` incoming Greg KH
  2 siblings, 0 replies; 307+ messages in thread
From: Benjamin Herrenschmidt @ 2007-05-02 22:31 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Hugh Dickins, Christoph Lameter, David S. Miller,
	Andi Kleen, Luck, Tony, Rik van Riel, linux-kernel, linux-mm

On Wed, 2007-05-02 at 15:02 -0700, Andrew Morton wrote:
> So this is what I have lined up for the first mm->2.6.22 batch.  I won't be
> sending it off for another 12-24 hours yet.  To give people time for final
> comment and to give me time to see if it actually works.

Thanks.

I have some powerpc bits that depend on that stuff that will go through
Paulus after these show up in git and I've rebased.

Cheers,
Ben.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

* incoming
@ 2007-05-02 22:02 Andrew Morton
  2007-05-02 22:31 ` incoming Benjamin Herrenschmidt
                   ` (2 more replies)
  0 siblings, 3 replies; 307+ messages in thread
From: Andrew Morton @ 2007-05-02 22:02 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Hugh Dickins, Christoph Lameter, David S. Miller, Andi Kleen,
	Luck, Tony, Rik van Riel, Benjamin Herrenschmidt, linux-kernel,
	linux-mm

So this is what I have lined up for the first mm->2.6.22 batch.  I won't be
sending it off for another 12-24 hours yet.  To give people time for final
comment and to give me time to see if it actually works.



- A few serial bits.

- A few pcmcia bits.

- Some of the MM queue.  Includes:

  - An enhancement to /proc/pid/smaps to permit monitoring of a running
    program's working set.

    There's another patchset which builds on this quite a lot from Matt
    Mackall, but it's not quite ready yet.

  - The SLUB allocator.  It's pretty green but I do want to push ahead
    with this pretty aggressively with a view to replacing slab altogether.

    If it ends up not working out then we should remove slub altogether
    again, but I doubt if that will occur.

    If SLUB isn't in good shape by 2.6.22 we should hide it in Kconfig
    to prevent people from hitting known problems.  It'll remain
    EXPERIMENTAL.

  - generic pagetable quicklist management.  We have x86_64 and ia64
    and sparc64 implementations, but I'll only include David's sparc64
    implementation here.  I'll send the x86_64 and ia64 implementations
    through maintainers.

  - Various random MM bits

  - Benh's teach-get_unmapped_area-about-MAP_FIXED changes

  - madvise(MADV_FREE)



  This means I'm holding back Mel's page allocator work, and Andy's
  lumpy-reclaim.

  A shame in a way - I have high hopes for lumpy reclaim against the
  moveable zone, but these things are not to be done lightly.

  A few MM things have been held back awaiting subsystem tree merges
  (probably x86 - I didn't check).


- One little security patch

- the blackfin architecture

- small h8300 update

- small alpha update

- swsusp updates

- m68k bits

- cris udpates

- Lots of UML updates

- v850, xtensa



slab-introduce-krealloc.patch
at91_cf-minor-fix.patch
add-new_id-to-pcmcia-drivers.patch
ide-cs-recognize-2gb-compactflash-from-transcend.patch
serial-driver-pmc-msp71xx.patch
rm9000-serial-driver.patch
serial-define-fixed_port-flag-for-serial_core.patch
serial-use-resource_size_t-for-serial-port-io-addresses.patch
mpsc-serial-driver-tx-locking.patch
8250_pci-fix-pci-must_checks.patch
serial-serial_core-use-pr_debug.patch
add-apply_to_page_range-which-applies-a-function-to-a-pte-range.patch
safer-nr_node_ids-and-nr_node_ids-determination-and-initial.patch
use-zvc-counters-to-establish-exact-size-of-dirtyable-pages.patch
proper-prototype-for-hugetlb_get_unmapped_area.patch
mm-remove-gcc-workaround.patch
slab-ensure-cache_alloc_refill-terminates.patch
mm-make-read_cache_page-synchronous.patch
fs-buffer-dont-pageuptodate-without-page-locked.patch
allow-oom_adj-of-saintly-processes.patch
introduce-config_has_dma.patch
mm-slabc-proper-prototypes.patch
add-pfn_valid_within-helper-for-sub-max_order-hole-detection.patch
mm-simplify-filemap_nopage.patch
add-unitialized_var-macro-for-suppressing-gcc-warnings.patch
i386-add-ptep_test_and_clear_dirtyyoung.patch
i386-use-pte_update_defer-in-ptep_test_and_clear_dirtyyoung.patch
smaps-extract-pmd-walker-from-smaps-code.patch
smaps-add-pages-referenced-count-to-smaps.patch
smaps-add-clear_refs-file-to-clear-reference.patch
readahead-improve-heuristic-detecting-sequential-reads.patch
readahead-code-cleanup.patch
slab-use-num_possible_cpus-in-enable_cpucache.patch
slab-dont-allocate-empty-shared-caches.patch
slab-numa-kmem_cache-diet.patch
do-not-disable-interrupts-when-reading-min_free_kbytes.patch
slab-mark-set_up_list3s-__init.patch
cpusets-allow-tif_memdie-threads-to-allocate-anywhere.patch
i386-use-page-allocator-to-allocate-thread_info-structure.patch
slub-core.patch
make-page-private-usable-in-compound-pages-v1.patch
optimize-compound_head-by-avoiding-a-shared-page.patch
add-virt_to_head_page-and-consolidate-code-in-slab-and-slub.patch
slub-fix-object-tracking.patch
slub-enable-tracking-of-full-slabs.patch
slub-validation-of-slabs-metadata-and-guard-zones.patch
slub-add-min_partial.patch
slub-add-ability-to-list-alloc--free-callers-per-slab.patch
slub-free-slabs-and-sort-partial-slab-lists-in-kmem_cache_shrink.patch
slub-remove-object-activities-out-of-checking-functions.patch
slub-user-documentation.patch
slub-add-slabinfo-tool.patch
quicklists-for-page-table-pages.patch
quicklist-support-for-sparc64.patch
slob-handle-slab_panic-flag.patch
include-kern_-constant-in-printk-calls-in-mm-slabc.patch
mm-madvise-avoid-exclusive-mmap_sem.patch
mm-remove-destroy_dirty_buffers-from-invalidate_bdev.patch
mm-optimize-kill_bdev.patch
mm-optimize-acorn-partition-truncate.patch
slab-allocators-remove-obsolete-slab_must_hwcache_align.patch
kmem_cache-simplify-slab-cache-creation.patch
slab-allocators-remove-multiple-alignment-specifications.patch
fault-injection-fix-failslab-with-config_numa.patch
mm-fix-handling-of-panic_on_oom-when-cpusets-are-in-use.patch
oom-fix-constraint-deadlock.patch
get_unmapped_area-handles-map_fixed-on-powerpc.patch
get_unmapped_area-handles-map_fixed-on-alpha.patch
get_unmapped_area-handles-map_fixed-on-arm.patch
get_unmapped_area-handles-map_fixed-on-frv.patch
get_unmapped_area-handles-map_fixed-on-i386.patch
get_unmapped_area-handles-map_fixed-on-ia64.patch
get_unmapped_area-handles-map_fixed-on-parisc.patch
get_unmapped_area-handles-map_fixed-on-sparc64.patch
get_unmapped_area-handles-map_fixed-on-x86_64.patch
get_unmapped_area-handles-map_fixed-in-hugetlbfs.patch
get_unmapped_area-handles-map_fixed-in-generic-code.patch
get_unmapped_area-doesnt-need-hugetlbfs-hacks-anymore.patch
slab-allocators-remove-slab_debug_initial-flag.patch
slab-allocators-remove-slab_ctor_atomic.patch
slab-allocators-remove-useless-__gfp_no_grow-flag.patch
lazy-freeing-of-memory-through-madv_free.patch
restore-madv_dontneed-to-its-original-linux-behaviour.patch
hugetlbfs-add-null-check-in-hugetlb_zero_setup.patch
slob-fix-page-order-calculation-on-not-4kb-page.patch
page-migration-only-migrate-pages-if-allocation-in-the-highest-zone-is-possible.patch
return-eperm-not-echild-on-security_task_wait-failure.patch
blackfin-arch.patch
driver_bfin_serial_core.patch
blackfin-on-chip-ethernet-mac-controller-driver.patch
blackfin-patch-add-blackfin-support-in-smc91x.patch
blackfin-on-chip-rtc-controller-driver.patch
blackfin-blackfin-on-chip-spi-controller-driver.patch
convert-h8-300-to-generic-timekeeping.patch
h8300-generic-irq.patch
h8300-add-zimage-support.patch
round_up-macro-cleanup-in-arch-alpha-kernel-osf_sysc.patch
alpha-fix-bootp-image-creation.patch
alpha-prctl-macros.patch
srmcons-fix-kmallocgfp_kernel-inside-spinlock.patch
arm26-remove-useless-config-option-generic_bust_spinlock.patch
fix-refrigerator-vs-thaw_process-race.patch
swsusp-use-inline-functions-for-changing-page-flags.patch
swsusp-do-not-use-page-flags.patch
mm-remove-unused-page-flags.patch
swsusp-fix-error-paths-in-snapshot_open.patch
swsusp-use-gfp_kernel-for-creating-basic-data-structures.patch
freezer-remove-pf_nofreeze-from-handle_initrd.patch
swsusp-use-rbtree-for-tracking-allocated-swap.patch
freezer-fix-racy-usage-of-try_to_freeze-in-kswapd.patch
remove-software_suspend.patch
power-management-change-sys-power-disk-display.patch
kconfig-mentioneds-hibernation-not-just-swsusp.patch
swsusp-fix-snapshot_release.patch
swsusp-free-more-memory.patch
remove-unused-header-file-arch-m68k-atari-atasoundh.patch
spin_lock_unlocked-cleanup-in-arch-m68k.patch
remove-unused-header-file-drivers-serial-crisv10h.patch
cris-check-for-memory-allocation.patch
cris-remove-code-related-to-pre-22-kernel.patch
uml-delete-unused-code.patch
uml-formatting-fixes.patch
uml-host_info-tidying.patch
uml-mark-tt-mode-code-for-future-removal.patch
uml-print-coredump-limits.patch
uml-handle-block-device-hotplug-errors.patch
uml-driver-formatting-fixes.patch
uml-driver-formatting-fixes-fix.patch
uml-network-interface-hotplug-error-handling.patch
array_size-check-for-type.patch
uml-move-sigio-testing-to-sigioc.patch
uml-create-archh.patch
uml-create-as-layouth.patch
uml-move-remaining-useful-contents-of-user_utilh.patch
uml-remove-user_utilh.patch
uml-add-missing-__init-declarations.patch
remove-unused-header-file-arch-um-kernel-tt-include-mode_kern-tth.patch
uml-improve-checking-and-diagnostics-of-ethernet-macs.patch
uml-eliminate-temporary-buffer-in-eth_configure.patch
uml-replace-one-element-array-with-zero-element-array.patch
uml-fix-umid-in-xterm-titles.patch
uml-speed-up-exec.patch
uml-no-locking-needed-in-tlsc.patch
uml-tidy-processc.patch
uml-remove-page_size.patch
uml-kernel_thread-shouldnt-panic.patch
uml-tidy-fault-code.patch
uml-kernel-segfaults-should-dump-proper-registers.patch
uml-comment-early-boot-locking.patch
uml-irq-locking-commentary.patch
uml-delete-host_frame_size.patch
uml-drivers-get-release-methods.patch
uml-dump-registers-on-ptrace-or-wait-failure.patch
uml-speed-up-page-table-walking.patch
uml-remove-unused-x86_64-code.patch
uml-start-fixing-os_read_file-and-os_write_file.patch
uml-tidy-libc-code.patch
uml-convert-libc-layer-to-call-read-and-write.patch
uml-batch-i-o-requests.patch
uml-send-pointers-instead-of-structures-to-i-o-thread.patch
uml-send-pointers-instead-of-structures-to-i-o-thread-fix.patch
uml-dump-core-on-panic.patch
uml-dont-try-to-handle-signals-on-initial-process-stack.patch
uml-change-remaining-callers-of-os_read_write_file.patch
uml-formatting-fixes-around-os_read_write_file-callers.patch
uml-remove-debugging-remnants.patch
uml-rename-os_read_write_file_k-back-to-os_read_write_file.patch
uml-aio-deadlock-avoidance.patch
uml-speed-page-fault-path.patch
uml-eliminate-a-piece-of-debugging-code.patch
uml-more-page-fault-path-trimming.patch
uml-only-flush-areas-covered-by-vma.patch
uml-out-of-tmpfs-space-error-clarification.patch
uml-virtualized-time-fix.patch
uml-fix-prototypes.patch
v850-generic-timekeeping-conversion.patch
xtensa-strlcpy-is-smart-enough.patch

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 307+ messages in thread

end of thread, other threads:[~2022-04-27 19:41 UTC | newest]

Thread overview: 307+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09  4:29 incoming Andrew Morton
2020-06-09  4:29 ` [patch 01/93] kallsyms/printk: add loglvl to print_ip_sym() Andrew Morton
2020-06-09  4:30 ` [patch 02/93] alpha: add show_stack_loglvl() Andrew Morton
2020-06-09  4:30 ` [patch 03/93] arc: " Andrew Morton
2020-06-09  4:30 ` [patch 04/93] arm/asm: add loglvl to c_backtrace() Andrew Morton
2020-06-09  4:30 ` [patch 05/93] arm: add loglvl to unwind_backtrace() Andrew Morton
2020-06-09  4:30 ` [patch 06/93] arm: add loglvl to dump_backtrace() Andrew Morton
2020-06-09  4:30 ` [patch 07/93] arm: wire up dump_backtrace_{entry,stm} Andrew Morton
2020-06-09  4:30 ` [patch 08/93] arm: add show_stack_loglvl() Andrew Morton
2020-06-09  4:30 ` [patch 09/93] arm64: add loglvl to dump_backtrace() Andrew Morton
2020-06-09  4:30 ` [patch 10/93] arm64: add show_stack_loglvl() Andrew Morton
2020-06-09  4:30 ` [patch 11/93] c6x: " Andrew Morton
2020-06-09  4:30 ` [patch 12/93] csky: " Andrew Morton
2020-06-09  4:30 ` [patch 13/93] h8300: " Andrew Morton
2020-06-09  4:30 ` [patch 14/93] hexagon: " Andrew Morton
2020-06-09  4:30 ` [patch 15/93] ia64: pass log level as arg into ia64_do_show_stack() Andrew Morton
2020-06-09  4:30 ` [patch 16/93] ia64: add show_stack_loglvl() Andrew Morton
2020-06-09  4:30 ` [patch 17/93] m68k: " Andrew Morton
2020-06-09  4:30 ` [patch 18/93] microblaze: add loglvl to microblaze_unwind_inner() Andrew Morton
2020-06-09  4:30 ` [patch 19/93] microblaze: add loglvl to microblaze_unwind() Andrew Morton
2020-06-09  4:30 ` [patch 20/93] microblaze: add show_stack_loglvl() Andrew Morton
2020-06-09  4:30 ` [patch 21/93] mips: " Andrew Morton
2020-06-09  4:31 ` [patch 22/93] nds32: " Andrew Morton
2020-06-09  4:31 ` [patch 23/93] nios2: " Andrew Morton
2020-06-09  4:31 ` [patch 24/93] openrisc: " Andrew Morton
2020-06-09  4:31 ` [patch 25/93] parisc: " Andrew Morton
2020-06-09  4:31 ` [patch 26/93] powerpc: " Andrew Morton
2020-06-09  4:31 ` [patch 27/93] riscv: " Andrew Morton
2020-06-09  4:31 ` [patch 28/93] s390: " Andrew Morton
2020-06-09  4:31 ` [patch 29/93] sh: add loglvl to dump_mem() Andrew Morton
2020-06-09  4:31 ` [patch 30/93] sh: remove needless printk() Andrew Morton
2020-06-09  4:31 ` [patch 31/93] sh: add loglvl to printk_address() Andrew Morton
2020-06-09  4:31 ` [patch 32/93] sh: add loglvl to show_trace() Andrew Morton
2020-06-09  4:31 ` [patch 33/93] sh: add show_stack_loglvl() Andrew Morton
2020-06-09  4:31 ` [patch 34/93] sparc: " Andrew Morton
2020-06-09  4:31 ` [patch 35/93] um/sysrq: remove needless variable sp Andrew Morton
2020-06-09  4:31 ` [patch 36/93] um: add show_stack_loglvl() Andrew Morton
2020-06-09  4:31 ` [patch 37/93] unicore32: remove unused pmode argument in c_backtrace() Andrew Morton
2020-06-09  4:31 ` [patch 38/93] unicore32: add loglvl to c_backtrace() Andrew Morton
2020-06-09  4:31 ` [patch 39/93] unicore32: add show_stack_loglvl() Andrew Morton
2020-06-09  4:31 ` [patch 40/93] x86: add missing const qualifiers for log_lvl Andrew Morton
2020-06-09  4:32 ` [patch 41/93] x86: add show_stack_loglvl() Andrew Morton
2020-06-09  4:32 ` [patch 42/93] xtensa: add loglvl to show_trace() Andrew Morton
2020-06-09  4:32 ` [patch 43/93] xtensa: add show_stack_loglvl() Andrew Morton
2020-06-09  4:32 ` [patch 44/93] sysrq: use show_stack_loglvl() Andrew Morton
2020-06-09  4:32 ` [patch 45/93] x86/amd_gart: print stacktrace for a leak with KERN_ERR Andrew Morton
2020-06-09  4:32 ` [patch 46/93] power: use show_stack_loglvl() Andrew Morton
2020-06-09  4:32 ` [patch 47/93] kdb: don't play with console_loglevel Andrew Morton
2020-06-09  4:32 ` [patch 48/93] sched: print stack trace with KERN_INFO Andrew Morton
2020-06-09  4:32 ` [patch 49/93] kernel: use show_stack_loglvl() Andrew Morton
2020-06-09  4:32 ` [patch 50/93] kernel: rename show_stack_loglvl() => show_stack() Andrew Morton
2020-06-09  4:32 ` [patch 51/93] mm: don't include asm/pgtable.h if linux/mm.h is already included Andrew Morton
2020-06-09  4:32 ` [patch 52/93] mm: introduce include/linux/pgtable.h Andrew Morton
2020-06-09  4:32 ` [patch 53/93] mm: reorder includes after introduction of linux/pgtable.h Andrew Morton
2020-06-09  4:32 ` [patch 54/93] csky: replace definitions of __pXd_offset() with pXd_index() Andrew Morton
2020-06-09  4:32 ` [patch 55/93] m68k/mm/motorola: move comment about page table allocation funcitons Andrew Morton
2020-06-09  4:32 ` [patch 56/93] m68k/mm: move {cache,nocahe}_page() definitions close to their user Andrew Morton
2020-06-09  4:33 ` [patch 57/93] x86/mm: simplify init_trampoline() and surrounding logic Andrew Morton
2020-06-09  4:33 ` [patch 58/93] mm: pgtable: add shortcuts for accessing kernel PMD and PTE Andrew Morton
2020-06-09  4:33 ` [patch 59/93] mm: consolidate pte_index() and pte_offset_*() definitions Andrew Morton
2020-06-09  4:33 ` [patch 60/93] mmap locking API: initial implementation as rwsem wrappers Andrew Morton
2020-06-09  4:33 ` [patch 61/93] MMU notifier: use the new mmap locking API Andrew Morton
2020-06-09  4:33 ` [patch 62/93] DMA reservations: " Andrew Morton
2020-06-09  4:33 ` [patch 63/93] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites Andrew Morton
2020-06-09  4:33 ` [patch 64/93] mmap locking API: convert mmap_sem call sites missed by coccinelle Andrew Morton
2020-06-09  4:33 ` [patch 65/93] mmap locking API: convert nested write lock sites Andrew Morton
2020-06-09  4:33 ` [patch 66/93] mmap locking API: add mmap_read_trylock_non_owner() Andrew Morton
2020-06-09  4:33 ` [patch 67/93] mmap locking API: add MMAP_LOCK_INITIALIZER Andrew Morton
2020-06-09  4:33 ` [patch 68/93] mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked() Andrew Morton
2020-06-09  4:33 ` [patch 69/93] mmap locking API: rename mmap_sem to mmap_lock Andrew Morton
2020-06-09  4:33 ` [patch 70/93] mmap locking API: convert mmap_sem API comments Andrew Morton
2020-06-09  4:33 ` [patch 71/93] mmap locking API: convert mmap_sem comments Andrew Morton
2020-06-09  4:33 ` [patch 72/93] maccess: unexport probe_kernel_write() Andrew Morton
2020-06-09  4:34 ` [patch 73/93] maccess: remove various unused weak aliases Andrew Morton
2020-06-09  4:34 ` [patch 74/93] maccess: remove duplicate kerneldoc comments Andrew Morton
2020-06-09  4:34 ` [patch 75/93] maccess: clarify " Andrew Morton
2020-06-09  4:34 ` [patch 76/93] maccess: update the top of file comment Andrew Morton
2020-06-09  4:34 ` [patch 77/93] maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault Andrew Morton
2020-06-09  4:34 ` [patch 78/93] maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault Andrew Morton
2020-06-09  4:34 ` [patch 79/93] maccess: rename strnlen_unsafe_user to strnlen_user_nofault Andrew Morton
2020-06-09  4:34 ` [patch 80/93] maccess: remove probe_read_common and probe_write_common Andrew Morton
2020-06-09  4:34 ` [patch 81/93] maccess: unify the probe kernel arch hooks Andrew Morton
2020-06-09  4:34 ` [patch 82/93] bpf: factor out a bpf_trace_copy_string helper Andrew Morton
2020-06-09  4:34 ` [patch 83/93] bpf: handle the compat string in bpf_trace_copy_string better Andrew Morton
2020-06-09  4:34 ` [patch 84/93] bpf:bpf_seq_printf(): handle potentially unsafe format string better Andrew Morton
2020-06-09  4:34 ` [patch 85/93] bpf: rework the compat kernel probe handling Andrew Morton
2020-06-09  4:34 ` [patch 86/93] tracing/kprobes: handle mixed kernel/userspace probes better Andrew Morton
2020-06-09  4:34 ` [patch 87/93] maccess: remove strncpy_from_unsafe Andrew Morton
2020-06-09  4:34 ` [patch 88/93] maccess: always use strict semantics for probe_kernel_read Andrew Morton
2020-06-09  4:34 ` [patch 89/93] maccess: move user access routines together Andrew Morton
2020-06-09  4:34 ` [patch 90/93] maccess: allow architectures to provide kernel probing directly Andrew Morton
2020-06-09  4:35 ` [patch 91/93] x86: use non-set_fs based maccess routines Andrew Morton
2020-06-09 18:01   ` Linus Torvalds
2020-06-09 18:06     ` Linus Torvalds
2020-06-10  6:57       ` Christoph Hellwig
2020-06-09  4:35 ` [patch 92/93] maccess: return -ERANGE when probe_kernel_read() fails Andrew Morton
2020-06-09  4:35 ` [patch 93/93] include/linux/cache.h: expand documentation over __read_mostly Andrew Morton
2020-06-17 15:51   ` Christopher Lameter
2020-06-09  5:34 ` mmotm 2020-06-08-22-33 uploaded Andrew Morton
2020-06-09  5:36 ` mmotm 2020-06-08-22-35 uploaded Andrew Morton
2020-06-09 16:58 ` incoming Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2022-04-27 19:41 incoming Andrew Morton
2022-04-21 23:35 incoming Andrew Morton
2022-04-15  2:12 incoming Andrew Morton
2022-04-08 20:08 incoming Andrew Morton
2022-04-01 18:27 incoming Andrew Morton
2022-04-01 18:20 incoming Andrew Morton
2022-04-01 18:27 ` incoming Andrew Morton
2022-03-25  1:07 incoming Andrew Morton
2022-03-23 23:04 incoming Andrew Morton
2022-03-22 21:38 incoming Andrew Morton
2022-03-16 23:14 incoming Andrew Morton
2022-03-05  4:28 incoming Andrew Morton
2022-02-26  3:10 incoming Andrew Morton
2022-02-12  0:27 incoming Andrew Morton
2022-02-12  2:02 ` incoming Linus Torvalds
2022-02-12  5:24   ` incoming Andrew Morton
2022-02-04  4:48 incoming Andrew Morton
2022-01-29 21:40 incoming Andrew Morton
2022-01-29  2:13 incoming Andrew Morton
2022-01-29  4:25 ` incoming Matthew Wilcox
2022-01-29  6:23   ` incoming Andrew Morton
2022-01-22  6:10 incoming Andrew Morton
2022-01-20  2:07 incoming Andrew Morton
2022-01-14 22:02 incoming Andrew Morton
2021-12-31  4:12 incoming Andrew Morton
2021-12-25  5:11 incoming Andrew Morton
2021-12-10 22:45 incoming Andrew Morton
2021-11-20  0:42 incoming Andrew Morton
2021-11-11  4:32 incoming Andrew Morton
2021-11-09  2:30 incoming Andrew Morton
2021-11-05 20:34 incoming Andrew Morton
2021-10-28 21:35 incoming Andrew Morton
2021-10-18 22:14 incoming Andrew Morton
2021-09-24 22:42 incoming Andrew Morton
2021-09-10  3:09 incoming Andrew Morton
2021-09-10 17:11 ` incoming Kees Cook
2021-09-10 20:13   ` incoming Kees Cook
2021-09-09  1:08 incoming Andrew Morton
2021-09-08 22:17 incoming Andrew Morton
2021-09-08  2:52 incoming Andrew Morton
2021-09-08  8:57 ` incoming Vlastimil Babka
2021-09-02 21:48 incoming Andrew Morton
2021-09-02 21:49 ` incoming Andrew Morton
2021-08-25 19:17 incoming Andrew Morton
2021-08-20  2:03 incoming Andrew Morton
2021-08-13 23:53 incoming Andrew Morton
2021-07-29 21:52 incoming Andrew Morton
2021-07-23 22:49 incoming Andrew Morton
2021-07-15  4:26 incoming Andrew Morton
2021-07-08  0:59 incoming Andrew Morton
2021-07-01  1:46 incoming Andrew Morton
2021-07-03  0:28 ` incoming Linus Torvalds
2021-07-03  1:06   ` incoming Linus Torvalds
2021-06-29  2:32 incoming Andrew Morton
2021-06-25  1:38 incoming Andrew Morton
2021-06-16  1:22 incoming Andrew Morton
2021-06-05  3:00 incoming Andrew Morton
2021-05-23  0:41 incoming Andrew Morton
2021-05-15  0:26 incoming Andrew Morton
2021-05-07  1:01 incoming Andrew Morton
2021-05-07  7:12 ` incoming Linus Torvalds
2021-05-05  1:32 incoming Andrew Morton
2021-05-05  1:47 ` incoming Linus Torvalds
2021-05-05  3:16   ` incoming Andrew Morton
2021-05-05 17:10     ` incoming Linus Torvalds
2021-05-05 17:44       ` incoming Andrew Morton
2021-05-06  3:19         ` incoming Anshuman Khandual
2021-04-30  5:52 incoming Andrew Morton
2021-04-23 21:28 incoming Andrew Morton
2021-04-16 22:45 incoming Andrew Morton
2021-04-09 20:26 incoming Andrew Morton
2021-03-25  4:36 incoming Andrew Morton
2021-03-13  5:06 incoming Andrew Morton
2021-02-26  1:14 incoming Andrew Morton
2021-02-26 17:55 ` incoming Linus Torvalds
2021-02-26 19:16   ` incoming Andrew Morton
2021-02-24 19:58 incoming Andrew Morton
2021-02-24 21:30 ` incoming Linus Torvalds
2021-02-24 21:37   ` incoming Linus Torvalds
2021-02-25  8:53     ` incoming Arnd Bergmann
2021-02-25  9:12       ` incoming Andrey Ryabinin
2021-02-25 11:07         ` incoming Walter Wu
2021-02-13  4:52 incoming Andrew Morton
2021-02-09 21:41 incoming Andrew Morton
2021-02-10 19:30 ` incoming Linus Torvalds
2021-02-05  2:31 incoming Andrew Morton
2021-01-24  5:00 incoming Andrew Morton
2021-01-12 23:48 incoming Andrew Morton
2021-01-15 23:32 ` incoming Linus Torvalds
2020-12-29 23:13 incoming Andrew Morton
2020-12-22 19:58 incoming Andrew Morton
2020-12-22 21:43 ` incoming Linus Torvalds
2020-12-18 22:00 incoming Andrew Morton
2020-12-16  4:41 incoming Andrew Morton
2020-12-15 20:32 incoming Andrew Morton
2020-12-15 21:00 ` incoming Linus Torvalds
2020-12-15 22:48 ` incoming Linus Torvalds
2020-12-15 22:49   ` incoming Linus Torvalds
2020-12-15 22:55     ` incoming Andrew Morton
2020-12-15  3:02 incoming Andrew Morton
2020-12-15  3:25 ` incoming Linus Torvalds
2020-12-15  3:30   ` incoming Linus Torvalds
2020-12-15 14:04     ` incoming Konstantin Ryabitsev
2020-12-11 21:35 incoming Andrew Morton
2020-12-06  6:14 incoming Andrew Morton
2020-11-22  6:16 incoming Andrew Morton
2020-11-14  6:51 incoming Andrew Morton
2020-11-02  1:06 incoming Andrew Morton
2020-10-17 23:13 incoming Andrew Morton
2020-10-16  2:40 incoming Andrew Morton
2020-10-16  3:03 ` incoming Andrew Morton
2020-10-13 23:46 incoming Andrew Morton
2020-10-11  6:15 incoming Andrew Morton
2020-10-03  5:20 incoming Andrew Morton
2020-09-26  4:17 incoming Andrew Morton
2020-09-19  4:19 incoming Andrew Morton
2020-09-04 23:34 incoming Andrew Morton
2020-08-21  0:41 incoming Andrew Morton
2020-08-15  0:29 incoming Andrew Morton
2020-08-12  1:29 incoming Andrew Morton
2020-08-07  6:16 incoming Andrew Morton
2020-07-24  4:14 incoming Andrew Morton
2020-07-03 22:14 incoming Andrew Morton
2020-06-26  3:28 incoming Andrew Morton
2020-06-26  6:51 ` incoming Linus Torvalds
2020-06-26  7:31   ` incoming Linus Torvalds
2020-06-26 17:39   ` incoming Konstantin Ryabitsev
2020-06-26 17:40     ` incoming Konstantin Ryabitsev
2020-06-12  0:30 incoming Andrew Morton
2020-06-11  1:40 incoming Andrew Morton
2020-06-08  4:35 incoming Andrew Morton
2020-06-04 23:45 incoming Andrew Morton
2020-06-03 22:55 incoming Andrew Morton
2020-06-02 20:09 incoming Andrew Morton
2020-06-02  4:44 incoming Andrew Morton
2020-06-02 20:08 ` incoming Andrew Morton
2020-06-02 20:45   ` incoming Linus Torvalds
2020-06-02 21:38     ` incoming Andrew Morton
2020-06-02 22:18       ` incoming Linus Torvalds
2020-05-28  5:20 incoming Andrew Morton
2020-05-28 20:10 ` incoming Linus Torvalds
2020-05-29 20:31   ` incoming Andrew Morton
2020-05-29 20:38     ` incoming Linus Torvalds
2020-05-29 21:12       ` incoming Andrew Morton
2020-05-29 21:20         ` incoming Linus Torvalds
2020-05-23  5:22 incoming Andrew Morton
2020-05-14  0:50 incoming Andrew Morton
2020-05-08  1:35 incoming Andrew Morton
2020-04-21  1:13 incoming Andrew Morton
2020-04-12  7:41 incoming Andrew Morton
2020-04-10 21:30 incoming Andrew Morton
2020-04-07  3:02 incoming Andrew Morton
2020-04-02  4:01 incoming Andrew Morton
2020-03-29  2:14 incoming Andrew Morton
2020-03-22  1:19 incoming Andrew Morton
2020-03-06  6:27 incoming Andrew Morton
2020-02-21  4:00 incoming Andrew Morton
2020-02-21  4:03 ` incoming Andrew Morton
2020-02-21 18:21 ` incoming Linus Torvalds
2020-02-21 18:32   ` incoming Konstantin Ryabitsev
2020-02-27  9:59     ` incoming Vlastimil Babka
2020-02-21 19:33   ` incoming Linus Torvalds
2020-02-04  1:33 incoming Andrew Morton
2020-02-04  2:27 ` incoming Linus Torvalds
2020-02-04  2:46   ` incoming Andrew Morton
2020-02-04  3:11     ` incoming Linus Torvalds
2020-01-31  6:10 incoming Andrew Morton
2020-01-14  0:28 incoming Andrew Morton
2020-01-04 20:55 incoming Andrew Morton
2019-12-18  4:50 incoming Andrew Morton
2019-12-05  0:48 incoming Andrew Morton
2019-12-01  1:47 incoming Andrew Morton
2019-12-01  5:17 ` incoming James Bottomley
2019-12-01 21:07 ` incoming Linus Torvalds
2019-12-02  8:21   ` incoming Steven Price
2019-11-22  1:53 incoming Andrew Morton
2019-11-16  1:34 incoming Andrew Morton
2019-11-06  5:16 incoming Andrew Morton
2019-10-19  3:19 incoming Andrew Morton
2019-10-14 21:11 incoming Andrew Morton
2019-10-07  0:57 incoming Andrew Morton
2019-09-25 23:45 incoming Andrew Morton
2019-09-23 22:31 incoming Andrew Morton
2019-09-24  0:55 ` incoming Linus Torvalds
2019-09-24  4:31   ` incoming Andrew Morton
2019-09-24  7:48     ` incoming Michal Hocko
2019-09-24 15:34       ` incoming Linus Torvalds
2019-09-25  6:36         ` incoming Michal Hocko
2019-09-24 19:55       ` incoming Vlastimil Babka
2019-08-30 23:04 incoming Andrew Morton
2019-08-25  0:54 incoming Andrew Morton
     [not found] <20190716162536.bb52b8f34a8ecf5331a86a42@linux-foundation.org>
2019-07-17  8:47 ` incoming Vlastimil Babka
2019-07-17  8:57   ` incoming Bhaskar Chowdhury
2019-07-17 16:13   ` incoming Linus Torvalds
2019-07-17 17:09     ` incoming Christian Brauner
2019-07-17 18:13     ` incoming Vlastimil Babka
2007-05-02 22:02 incoming Andrew Morton
2007-05-02 22:31 ` incoming Benjamin Herrenschmidt
2007-05-03  7:55 ` incoming Russell King
2007-05-03  8:05   ` incoming Andrew Morton
2007-05-04 13:37 ` incoming Greg KH
2007-05-04 16:14   ` incoming Andrew Morton
2007-05-04 17:02     ` incoming Greg KH
2007-05-04 18:57     ` incoming Roland McGrath
2007-05-04 19:24       ` incoming Greg KH
2007-05-04 19:29         ` incoming Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).