Changeset 244229 in webkit


Ignore:
Timestamp:
Apr 12, 2019 1:37:38 PM (5 years ago)
Author:
rniwa@webkit.org
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244226 r244229  
     12019-04-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        WebThread should run at a higher priority than user initiated
     4        https://bugs.webkit.org/show_bug.cgi?id=196849
     5        <rdar://problem/46851062>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
     10        won't wait for other threads with priority 30-37 but does not content with the main thread.
     11
     12        Also removed the call to pthread_attr_setschedparam which disables QoS.
     13
     14        This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
     15        iBooks to an opened book.
     16
     17        * platform/ios/wak/WebCoreThread.mm:
     18        (StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
     19
    1202019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm

    r239353 r244229  
    668668    // a 512 kb stack, but we need more space in order to have room for the JavaScriptCore
    669669    // reentrancy limit. This limit works on both the simulator and the device.
    670     pthread_attr_setstacksize(&tattr, 200 * 4096);
    671 
    672     struct sched_param param;
    673     pthread_attr_getschedparam(&tattr, &param);
    674     param.sched_priority--;
    675     pthread_attr_setschedparam(&tattr, &param);
     670    pthread_attr_setstacksize(&tattr, 800 * KB);
     671
     672    pthread_attr_set_qos_class_np(&tattr, QOS_CLASS_USER_INTERACTIVE, -10);
    676673
    677674    // Wait for the web thread to startup completely before we continue.
Note: See TracChangeset for help on using the changeset viewer.