android_kernel_msm-6.1_noth.../include
Suren Baghdasaryan 200745f46a UPSTREAM: mm: separate vma->lock from vm_area_struct
vma->lock being part of the vm_area_struct causes performance regression
during page faults because during contention its count and owner fields
are constantly updated and having other parts of vm_area_struct used
during page fault handling next to them causes constant cache line
bouncing.  Fix that by moving the lock outside of the vm_area_struct.

All attempts to keep vma->lock inside vm_area_struct in a separate cache
line still produce performance regression especially on NUMA machines.
Smallest regression was achieved when lock is placed in the fourth cache
line but that bloats vm_area_struct to 256 bytes.

Considering performance and memory impact, separate lock looks like the
best option.  It increases memory footprint of each VMA but that can be
optimized later if the new size causes issues.  Note that after this
change vma_init() does not allocate or initialize vma->lock anymore.  A
number of drivers allocate a pseudo VMA on the stack but they never use
the VMA's lock, therefore it does not need to be allocated.  The future
drivers which might need the VMA lock should use
vm_area_alloc()/vm_area_free() to allocate the VMA.

Link: https://lkml.kernel.org/r/20230227173632.3292573-34-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit c7f8f31c00d187a2c71a241c7f2bd6aa102a4e6f)

Bug: 161210518
Change-Id: I0c4dff518b74e1a9ea2b40636b436a122841564d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:25:02 +00:00
..
acpi ACPI: video: Add auto_detect arg to __acpi_video_get_backlight_type() 2023-04-13 16:55:33 +02:00
asm-generic BACKPORT: arm64: unwind: add asynchronous unwind tables to kernel and modules 2023-05-25 15:37:14 -07:00
clocksource
crypto
drm Merge 6.1.24 into android14-6.1 2023-04-22 08:52:25 +00:00
dt-bindings dt-bindings: clocks: imx8mp: Add ID for usb suspend clock 2022-12-31 13:33:09 +01:00
keys
kunit kunit: fix kunit_test_init_section_suites(...) 2023-02-09 11:28:08 +01:00
kvm Revert "Revert "KVM: arm64: PMU: Align chained counter implementation with architecture pseudocode"" 2023-05-11 05:22:29 +00:00
linux UPSTREAM: mm: separate vma->lock from vm_area_struct 2023-06-07 14:25:02 +00:00
math-emu
media ANDROID: GKI: add kabi padding for structures for the android14 release 2023-06-07 14:24:51 +00:00
memory memory: renesas-rpc-if: Split-off private data from struct rpcif 2023-03-11 13:55:17 +01:00
misc
net ANDROID: GKI: sock.h: add Android ABI padding to some structures 2023-06-07 14:24:55 +00:00
pcmcia
ras
rdma
rv
scsi ANDROID: GKI: scsi: add Android ABI padding to some structures 2023-06-07 14:24:56 +00:00
soc
sound ANDROID: GKI: add kabi padding for structures for the android14 release 2023-06-07 14:24:51 +00:00
target
trace ANDROID: vendor_hooks: add hooks for extra memory 2023-06-07 01:06:25 +00:00
uapi UPSTREAM: ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-07 14:24:50 +00:00
ufs ANDROID: GKI: add kabi padding for structures for the android14 release 2023-06-07 14:24:51 +00:00
vdso
video
xen x86/PVH: obtain VGA console info in Dom0 2023-04-06 12:10:39 +02:00
OWNERS