linux/drivers/android
Carlos Llamas d1716b4b78 binder: concurrent page installation
Allow multiple callers to install pages simultaneously by switching the
mmap_sem from write-mode to read-mode. Races to the same PTE are handled
using get_user_pages_remote() to retrieve the already installed page.
This method significantly reduces contention in the mmap semaphore.

To ensure safety, vma_lookup() is used (instead of alloc->vma) to avoid
operating on an isolated VMA. In addition, zap_page_range_single() is
called under the alloc->mutex to avoid racing with the shrinker.

Many thanks to Barry Song who posted a similar approach [1].

Link: https://lore.kernel.org/all/20240902225009.34576-1-21cnbao@gmail.com/ [1]
Cc: David Hildenbrand <david@redhat.com>
Cc: Barry Song <v-songbaohua@oppo.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20241210143114.661252-3-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-24 09:35:23 +01:00
..
binder.c binder: add delivered_freeze to debugfs output 2024-10-13 17:12:22 +02:00
binder_alloc.c binder: concurrent page installation 2024-12-24 09:35:23 +01:00
binder_alloc.h Revert "binder: switch alloc->mutex to spinlock_t" 2024-12-24 09:35:23 +01:00
binder_alloc_selftest.c android: binder: fix a kernel-doc enum warning 2023-12-06 08:48:26 +09:00
binder_internal.h binder: frozen notification 2024-07-31 13:56:00 +02:00
binder_trace.h binder: keep vma addresses type as unsigned long 2023-12-05 09:23:38 +09:00
binderfs.c binder: frozen notification binder_features flag 2024-07-31 13:56:00 +02:00
dbitmap.h binder: fix descriptor lookup for context manager 2024-07-31 13:47:48 +02:00
Kconfig remove CONFIG_ANDROID 2022-07-01 10:41:09 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00