Title: [244229] trunk/Source/WebCore
Revision
244229
Author
rn...@webkit.org
Date
2019-04-12 13:37:38 -0700 (Fri, 12 Apr 2019)

Log Message

WebThread should run at a higher priority than user initiated
https://bugs.webkit.org/show_bug.cgi?id=196849
<rdar://problem/46851062>

Reviewed by Geoffrey Garen.

Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
won't wait for other threads with priority 30-37 but does not content with the main thread.

Also removed the call to pthread_attr_setschedparam which disables QoS.

This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
iBooks to an opened book.

* platform/ios/wak/WebCoreThread.mm:
(StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (244228 => 244229)


--- trunk/Source/WebCore/ChangeLog	2019-04-12 18:52:01 UTC (rev 244228)
+++ trunk/Source/WebCore/ChangeLog	2019-04-12 20:37:38 UTC (rev 244229)
@@ -1,3 +1,22 @@
+2019-04-11  Ryosuke Niwa  <rn...@webkit.org>
+
+        WebThread should run at a higher priority than user initiated
+        https://bugs.webkit.org/show_bug.cgi?id=196849
+        <rdar://problem/46851062>
+
+        Reviewed by Geoffrey Garen.
+
+        Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
+        won't wait for other threads with priority 30-37 but does not content with the main thread.
+
+        Also removed the call to pthread_attr_setschedparam which disables QoS.
+
+        This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
+        iBooks to an opened book.
+
+        * platform/ios/wak/WebCoreThread.mm:
+        (StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
+
 2019-04-12  Ryosuke Niwa  <rn...@webkit.org>
 
         Add CSS Shadow Parts as a feature under consideration

Modified: trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm (244228 => 244229)


--- trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm	2019-04-12 18:52:01 UTC (rev 244228)
+++ trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm	2019-04-12 20:37:38 UTC (rev 244229)
@@ -667,12 +667,9 @@
     // The web thread is a secondary thread, and secondary threads are usually given
     // a 512 kb stack, but we need more space in order to have room for the _javascript_Core
     // reentrancy limit. This limit works on both the simulator and the device.
-    pthread_attr_setstacksize(&tattr, 200 * 4096);
+    pthread_attr_setstacksize(&tattr, 800 * KB);
 
-    struct sched_param param;
-    pthread_attr_getschedparam(&tattr, &param);
-    param.sched_priority--;
-    pthread_attr_setschedparam(&tattr, &param);
+    pthread_attr_set_qos_class_np(&tattr, QOS_CLASS_USER_INTERACTIVE, -10);
 
     // Wait for the web thread to startup completely before we continue.
     {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to