From f349ccdad7ce3c320f7af38bc56efa4547653f05 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Mon, 20 May 2019 15:53:09 -0700 Subject: Fix SystemServerInitThreadPool size on latest device. During boottime, we have relaxed cpuset to allow all cores to be used. This CL will give the thread pool higher chance to parallel things. Bug: 132974796 Test: Build Change-Id: I2ce0f337ce76ea918c4cce071e4bb44830d3b82b Signed-off-by: Wei Wang --- services/core/java/com/android/server/SystemServerInitThreadPool.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/SystemServerInitThreadPool.java b/services/core/java/com/android/server/SystemServerInitThreadPool.java index 1ce655618028..ff6a5375565a 100644 --- a/services/core/java/com/android/server/SystemServerInitThreadPool.java +++ b/services/core/java/com/android/server/SystemServerInitThreadPool.java @@ -45,7 +45,8 @@ public class SystemServerInitThreadPool { private static SystemServerInitThreadPool sInstance; - private ExecutorService mService = ConcurrentUtils.newFixedThreadPool(4, + private ExecutorService mService = ConcurrentUtils.newFixedThreadPool( + Runtime.getRuntime().availableProcessors(), "system-server-init-thread", Process.THREAD_PRIORITY_FOREGROUND); private List mPendingTasks = new ArrayList<>(); -- cgit v1.2.3-59-g8ed1b