]> git.ipfire.org Git - thirdparty/linux.git/commit
rust_binder: use lock_vma_under_rcu() in shrinker
authorAlice Ryhl <aliceryhl@google.com>
Thu, 7 May 2026 11:07:47 +0000 (11:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 May 2026 11:47:32 +0000 (13:47 +0200)
commit908ad5bcccdcd8ab5582c0b7fe3091c5146c0b7a
treec76885857bee996fefd8cfe221b0ba628264a3fb
parent570ff5c850e71b0d038758b91b5bbccea534d877
rust_binder: use lock_vma_under_rcu() in shrinker

The shrinker callback currently uses the mmap read trylock operation to
attempt to access the vma, but it's generally better to only lock the
vma instead of the whole mmap when you can.

When lock_vma_under_rcu() fails, there is no reason to lock the mmap
lock instead because it's already a trylock operation that is allowed to
fail.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Lorenzo Stoakes <ljs@kernel.org>
Link: https://patch.msgid.link/20260507-binder-shrinker-lockvma-v1-1-76e3406bbfa6@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder/page_range.rs