Skip to content
Snippets Groups Projects
Commit 3c31c7b7 authored by Joel Fernandes's avatar Joel Fernandes Committed by Maggie White
Browse files

binder: always allocate/map first BINDER_MIN_ALLOC pages


Certain usecases like camera are constantly allocating and freeing
binder buffers beyond the first 4k resulting in mmap_sem contention.

If we expand the allocated range from 4k to something higher, we can
reduce the contention. Tests show that 6 pages is enough to cause very
little update_page_range operations and reduces contention.

Bug: 36727951

Change-Id: I28bc3fb9b33c764c257e28487712fce2a3c1078b
Reported-by: default avatarTim Murray <timmurray@google.com>
Signed-off-by: default avatarJoel Fernandes <joelaf@google.com>

Pre-allocate 1 instead of 6 pages as in the original patch,
as we use this pre-allocated page to prevent the first page
from getting unpinned after removing the buffer headers,
rather than pinning pages to speedup larger transactions.

Change-Id: I7c3e4884a9538ecfd86601d31c5bcfd6611d37a4
Signed-off-by: default avatarSherry Yang <sherryy@android.com>
parent 9eb5d047
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment