Commit 6d4341e0 authored by Carlos Llamas's avatar Carlos Llamas Committed by Rick Yiu
Browse files

BACKPORT: FROMGIT: binder: reverse locking order in shrinker callback



The locking order currently requires the alloc->mutex to be acquired
first followed by the mmap lock. However, the alloc->mutex is converted
into a spinlock in subsequent commits so the order needs to be reversed
to avoid nesting the sleeping mmap lock under the spinlock.

The shrinker's callback binder_alloc_free_page() is the only place that
needs to be reordered since other functions have been refactored and no
longer nest these locks.

Some minor cosmetic changes are also included in this patch.

Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-28-cmllamas@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 254650075
Bug: 320576997
(cherry picked from commit e50f4e6c
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git


 char-misc-next)
Change-Id: I7f7501945a477ac5571082a5dd2a7934f484b8ab
[cmllamas: fixed conflicts due to missing e66b77e5]
Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>
parent 1e89876d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment