From eb4b2d056cd905b4b6ca0c985131c102f2254a45 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 28 Apr 2017 17:05:29 -0700 Subject: [PATCH] Increase max system_server hwbinder threadpool to 5. system_server hosts HIDL services, but also many different callback interfaces. Subtle deadlocks can occur if there's only one HwBinder thread to handle incoming transactions. Increasing this to 5 threads seems reasonable - we haven't really seen any performance issues due to this. The main danger with this change is that not all callback interfaces may be written in a thread-safe way, but some quick testing revealed no issues. Bug: 37531523 Bug: 37509431 Test: builds, Maps/YouTube/Camera/Music/Netflix Change-Id: I52bff2f2263625c1a33f60b8b27c307c1d31000c --- services/core/jni/com_android_server_SystemServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/jni/com_android_server_SystemServer.cpp b/services/core/jni/com_android_server_SystemServer.cpp index 4a08ce4aebb7c..96c2d7e382328 100644 --- a/services/core/jni/com_android_server_SystemServer.cpp +++ b/services/core/jni/com_android_server_SystemServer.cpp @@ -48,7 +48,7 @@ static void android_server_SystemServer_startHidlServices(JNIEnv* /* env */, job status_t err; - configureRpcThreadpool(1, false /* callerWillJoin */); + configureRpcThreadpool(5, false /* callerWillJoin */); sp sensorService = new SensorManager(); err = sensorService->registerAsService();