Apply BlinkCompositorUseDisplayThreadPriority feature to IO thread
The original change to use ThreadPriority::DISPLAY for the renderer
compositor thread (7b97c3240fb3 "base: Allow renderer thread priorities
to be changed.") also applied the priority to the IO thread to avoid
delays in IPC message delivery to the compositor thread.
We recently added a feature to control compositor thread priority, but it
does not affect setting the IO thread priority. Instead, we always try to
raise the priority on Linux, Android, & Chrome OS, and never try on
Windows or Mac. This causes strange situations such as having render
IO threads run with higher priority than any browser or GPU process
thread even though the priority Features were disabled.
Fix the BlinkCompositorUseDisplayThreadPriority feature to also apply to
the IO thread and use it to control the initial thread priority, as well
as whether we ask the browser to adjust it (which is used on Chrome OS
for some cgroup manipulation that needs to be done from the browser).
After this change, each of the display priority flags also control the IO
thread priority of the corresponding process.
Bug: 937462
Change-Id: I1950182fccd8bc6ea35359792878283c2fd9401c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1714204
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Sunny Sachanandani <[email protected]>
Commit-Queue: Michael Spang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#681121}
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
index 110e4eb..aee815d 100644
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -352,5 +352,16 @@
"VerifyHTMLFetchedFromAppCacheBeforeDelay",
base::FEATURE_DISABLED_BY_DEFAULT};
+// Controls whether we use ThreadPriority::DISPLAY for renderer
+// compositor & IO threads.
+const base::Feature kBlinkCompositorUseDisplayThreadPriority {
+ "BlinkCompositorUseDisplayThreadPriority",
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+ base::FEATURE_ENABLED_BY_DEFAULT
+#else
+ base::FEATURE_DISABLED_BY_DEFAULT
+#endif
+};
+
} // namespace features
} // namespace blink