From 37e63c705e827fe52b743f125875e61ce5cb74ce Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Tue, 24 Jan 2017 00:09:27 -0800 Subject: Don't lower priority of EGL Init thread The EGL Init thread spends a lot of time loading shared libraries, which involves reading pages and adjusting VM pages. Previously it was a low priority thread, which meant that when it blocked while holding a VM lock, it might take a while to be scheduled again once ready, so it would hold the VM lock longer than necessary, blocking other threads waiting on soft faults, etc. Classic priority inversion. Leaving the thread at normal priority causes it to interfere *less* with critical-path Activity launch work. Bug: 34611670 Test: go/platform-startup, specifically: ./tradefed.sh run google/template/local --template:map test google/test/performance/app-launch-perf --post-boot-command "service call persistent_data_block 6 i32 1" --post-boot-command "service call persistent_data_block 7 i32 1" --apps Clock alarmclock --trial-launch --launch-iteration 10 --launch-order cyclic --drop-cache --trace-directory sdcard --trace-iteration 2 --simple-perf-cmd "simpleperf stat -a" --report-metrics all --force-skip-system-props --alt-dir `pwd` Change-Id: I17647c657da64d15f40f8f2b97ee3400e1f0be7f --- core/java/android/os/GraphicsEnvironment.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index 20de370fa344..e4cdbce09796 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -44,7 +44,6 @@ public final class GraphicsEnvironment { // without significantly disrupting other activity launch work. Thread eglInitThread = new Thread( () -> { - Thread.currentThread().setPriority(Thread.MIN_PRIORITY); EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY); }, "EGL Init"); -- cgit v1.2.3-59-g8ed1b