Binder: fixing contention in buffer allocations
summary
Android binder suffers from alloc-mutex contention when many clients fault pages into a single mmaped service VMA, causing background tasks to hold the mutex while sleeping and high-priority threads to block. The fix is to split buffer setup from page insertion, preallocate pages outside the mutex, and move page faults out of the alloc path so the mutex becomes a spinlock. A synthetic worst-case test shows up to 200% improvement. Followups propose per-binder-page synchronization, RCU/maple tree structures and lockless fault-in retries.
AI-written summary · about
chapters (6)
- 0:00Introduction to Binder issue
- 1:29Binder memory mapping and contention
- 4:20Mutex contention problem explained
- 7:11Solution and performance improvements
- 9:00Results and test workload
- 10:04Q&A on lock contention
related talks
56mDeep Dive into Android IPC/Binder Framework
49mTrash Talk
37mMemory Hotplug on Android
18mEnd the Senseless Killing: Improving Memory Management for Mobile Operating Systems
21mAcclaim: Adaptive Memory Reclaim to Improve User Experience in Android Systems
16mExploiting Android’s Hardened Memory Allocator
08mLinux is Getting Rusty (And So Is Android)
27mBad io_uring: A New Era of Rooting for Android
