]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
authorMichel Lespinasse <walken@google.com>
Tue, 9 Jun 2020 04:33:25 +0000 (21:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Jun 2020 16:39:14 +0000 (09:39 -0700)
commitd8ed45c5dcd455fc5848d47f86883a1b872ac0d0
treef9270b32da5f3f7be73b086c99d3dfc29a13161a
parent0adf65f53aae86aa86d8dccada02890545de8938
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)

Signed-off-by: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
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>
Link: http://lkml.kernel.org/r/20200520052908.204642-5-walken@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
148 files changed:
arch/alpha/kernel/traps.c
arch/alpha/mm/fault.c
arch/arc/kernel/process.c
arch/arc/kernel/troubleshoot.c
arch/arc/mm/fault.c
arch/arm/kernel/process.c
arch/arm/kernel/swp_emulate.c
arch/arm/lib/uaccess_with_memcpy.c
arch/arm/mm/fault.c
arch/arm64/kernel/traps.c
arch/arm64/kernel/vdso.c
arch/arm64/mm/fault.c
arch/csky/kernel/vdso.c
arch/csky/mm/fault.c
arch/hexagon/kernel/vdso.c
arch/hexagon/mm/vm_fault.c
arch/ia64/kernel/perfmon.c
arch/ia64/mm/fault.c
arch/ia64/mm/init.c
arch/m68k/kernel/sys_m68k.c
arch/m68k/mm/fault.c
arch/microblaze/mm/fault.c
arch/mips/kernel/traps.c
arch/mips/kernel/vdso.c
arch/nds32/kernel/vdso.c
arch/nds32/mm/fault.c
arch/nios2/mm/fault.c
arch/nios2/mm/init.c
arch/openrisc/mm/fault.c
arch/parisc/kernel/traps.c
arch/parisc/mm/fault.c
arch/powerpc/kernel/vdso.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_uvmem.c
arch/powerpc/kvm/e500_mmu_host.c
arch/powerpc/mm/book3s64/iommu_api.c
arch/powerpc/mm/book3s64/subpage_prot.c
arch/powerpc/mm/copro_fault.c
arch/powerpc/mm/fault.c
arch/powerpc/oprofile/cell/spu_task_sync.c
arch/powerpc/platforms/cell/spufs/file.c
arch/riscv/kernel/vdso.c
arch/riscv/mm/fault.c
arch/s390/kernel/uv.c
arch/s390/kernel/vdso.c
arch/s390/kvm/gaccess.c
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/priv.c
arch/s390/mm/fault.c
arch/s390/mm/gmap.c
arch/s390/pci/pci_mmio.c
arch/sh/kernel/sys_sh.c
arch/sh/kernel/vsyscall/vsyscall.c
arch/sh/mm/fault.c
arch/sparc/mm/fault_32.c
arch/sparc/mm/fault_64.c
arch/sparc/vdso/vma.c
arch/um/include/asm/mmu_context.h
arch/um/kernel/tlb.c
arch/um/kernel/trap.c
arch/unicore32/mm/fault.c
arch/x86/entry/vdso/vma.c
arch/x86/kernel/vm86_32.c
arch/x86/mm/fault.c
arch/x86/um/vdso/vma.c
arch/xtensa/mm/fault.c
drivers/android/binder_alloc.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdkfd/kfd_events.c
drivers/gpu/drm/i915/gem/i915_gem_mman.c
drivers/gpu/drm/i915/gem/i915_gem_userptr.c
drivers/gpu/drm/nouveau/nouveau_svm.c
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_gem.c
drivers/gpu/drm/ttm/ttm_bo_vm.c
drivers/infiniband/core/umem_odp.c
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/hw/mlx4/mr.c
drivers/infiniband/hw/qib/qib_user_pages.c
drivers/infiniband/hw/usnic/usnic_uiom.c
drivers/infiniband/sw/siw/siw_mem.c
drivers/iommu/amd_iommu_v2.c
drivers/iommu/intel-svm.c
drivers/media/v4l2-core/videobuf-core.c
drivers/media/v4l2-core/videobuf-dma-contig.c
drivers/media/v4l2-core/videobuf-dma-sg.c
drivers/misc/cxl/cxllib.c
drivers/misc/cxl/fault.c
drivers/misc/sgi-gru/grufault.c
drivers/misc/sgi-gru/grufile.c
drivers/oprofile/buffer_sync.c
drivers/staging/kpc2000/kpc_dma/fileops.c
drivers/tee/optee/call.c
drivers/vfio/vfio_iommu_type1.c
drivers/vhost/vdpa.c
drivers/xen/gntdev.c
drivers/xen/privcmd.c
fs/aio.c
fs/coredump.c
fs/exec.c
fs/io_uring.c
fs/proc/base.c
fs/proc/task_mmu.c
fs/proc/task_nommu.c
fs/userfaultfd.c
ipc/shm.c
kernel/acct.c
kernel/bpf/stackmap.c
kernel/events/core.c
kernel/events/uprobes.c
kernel/exit.c
kernel/fork.c
kernel/futex.c
kernel/sched/fair.c
kernel/sys.c
kernel/trace/trace_output.c
lib/test_lockup.c
mm/filemap.c
mm/frame_vector.c
mm/gup.c
mm/internal.h
mm/khugepaged.c
mm/ksm.c
mm/madvise.c
mm/memcontrol.c
mm/memory.c
mm/mempolicy.c
mm/migrate.c
mm/mincore.c
mm/mlock.c
mm/mmap.c
mm/mmu_notifier.c
mm/mprotect.c
mm/mremap.c
mm/msync.c
mm/nommu.c
mm/oom_kill.c
mm/process_vm_access.c
mm/ptdump.c
mm/swapfile.c
mm/userfaultfd.c
mm/util.c
net/ipv4/tcp.c
net/xdp/xdp_umem.c
virt/kvm/async_pf.c
virt/kvm/kvm_main.c