Commit bdceb036 authored by Joel Fernandes's avatar Joel Fernandes Committed by Todd Kjos
Browse files

ANDROID: 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: Id027adcfd61b2d6b37f69a3f6009a068e90e84f0
Signed-off-by: default avatarSherry Yang <sherryy@android.com>
parent a436d9c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment