⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271189 in webkit


Ignore:
Timestamp:
Jan 5, 2021, 7:24:49 PM (6 years ago)
Author:
Chris Dumez
Message:

[iOS] Add a feature flag to stop leaking an XPC boost message to XPC services
https://bugs.webkit.org/show_bug.cgi?id=219453
<rdar://72834999>

Reviewed by Geoff Garen.

Source/WebKit:

Add a feature flag to stop leaking an XPC boost message to XPC services on builds where RunningBoard is
able to give the right priorities to our XPC services based on the type of RunningBoard assertion is being
held. There is no behavior change for the Network/WebContent processes since those were blocklisted in
RunningBoard (Turning on the RB_full_manage_WK_jetsam feature flag gives us the default RunningBoard
behavior without blocklisting). However, this allows the new GPUProcess to move to IDLE jetsam band when
homing out of MobileSafari, which makes the GPUProcess eligible for the freezer. Previously, the leaked
boost message would keep the GPUProcess in a higher jetsam band.

For now, the feature flag is off by default. I will turn it on later on.

  • FeatureFlags/WebKit.plist:

Add RB_full_manage_WK_jetsam feature flag but keep it off for now. On recent enough builds of RunningBoard, this
flag disables the blocklisting of the WebContent/Network processes in RunningBoard so that RunningBoard can now
set the priority of those processes (instead of us boosting our priority via boost messages).

  • GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist:
  • NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist:
  • WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist:
  • WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist:

Set _ProcessType=App so that RunningBoard is able to set the priority of our XPC services on iOS. Without
this change, we get a permission denied when RunningBoard attempts to set the priority of our XPC services.

  • UIProcess/Launcher/mac/ProcessLauncherMac.mm:

(WebKit::shouldLeakBoost):
Stop leaking a boost message on iOS when RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT compile-time flag is enabled
and when the RB_full_manage_WK_jetsam feature flag is enabled.

Source/WTF:

Add new RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT build time flag since we need a recent
enough build of RunningBoard to do this.

  • wtf/PlatformHave.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r271101 r271189  
     12021-01-05  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Add a feature flag to stop leaking an XPC boost message to XPC services
     4        https://bugs.webkit.org/show_bug.cgi?id=219453
     5        <rdar://72834999>
     6
     7        Reviewed by Geoff Garen.
     8
     9        Add new RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT build time flag since we need a recent
     10        enough build of RunningBoard to do this.
     11
     12        * wtf/PlatformHave.h:
     13
    1142020-12-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WTF/wtf/PlatformHave.h

    r271017 r271189  
    726726#endif
    727727
     728#if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
     729    || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
     730    || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
     731#define HAVE_RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT 1
     732#endif
     733
    728734#if PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
    729735#define HAVE_CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR 1
  • trunk/Source/WebKit/ChangeLog

    r271187 r271189  
     12021-01-05  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Add a feature flag to stop leaking an XPC boost message to XPC services
     4        https://bugs.webkit.org/show_bug.cgi?id=219453
     5        <rdar://72834999>
     6
     7        Reviewed by Geoff Garen.
     8
     9        Add a feature flag to stop leaking an XPC boost message to XPC services on builds where RunningBoard is
     10        able to give the right priorities to our XPC services based on the type of RunningBoard assertion is being
     11        held. There is no behavior change for the Network/WebContent processes since those were blocklisted in
     12        RunningBoard (Turning on the RB_full_manage_WK_jetsam feature flag gives us the default RunningBoard
     13        behavior without blocklisting). However, this allows the new GPUProcess to move to IDLE jetsam band when
     14        homing out of MobileSafari, which makes the GPUProcess eligible for the freezer. Previously, the leaked
     15        boost message would keep the GPUProcess in a higher jetsam band.
     16
     17        For now, the feature flag is off by default. I will turn it on later on.
     18
     19        * FeatureFlags/WebKit.plist:
     20        Add RB_full_manage_WK_jetsam feature flag but keep it off for now. On recent enough builds of RunningBoard, this
     21        flag disables the blocklisting of the WebContent/Network processes in RunningBoard so that RunningBoard can now
     22        set the priority of those processes (instead of us boosting our priority via boost messages).
     23
     24        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist:
     25        * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist:
     26        * WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist:
     27        * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist:
     28        Set _ProcessType=App so that RunningBoard is able to set the priority of our XPC services on iOS. Without
     29        this change, we get a permission denied when RunningBoard attempts to set the priority of our XPC services.
     30
     31        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
     32        (WebKit::shouldLeakBoost):
     33        Stop leaking a boost message on iOS when RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT compile-time flag is enabled
     34        and when the RB_full_manage_WK_jetsam feature flag is enabled.
     35
    1362021-01-05  Alex Christensen  <achristensen@webkit.org>
    237
  • trunk/Source/WebKit/FeatureFlags/WebKit.plist

    r271017 r271189  
    8888        <true/>
    8989    </dict>
     90    <key>RB_full_manage_WK_jetsam</key>
     91    <dict>
     92        <key>Enabled</key>
     93        <false/>
     94    </dict>
    9095</dict>
    9196</plist>
  • trunk/Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist

    r271131 r271189  
    3535                <key>RunLoopType</key>
    3636                <string>NSRunLoop</string>
     37                <key>_ProcessType</key>
     38                <string>App</string>
    3739                <key>_MultipleInstances</key>
    3840                <true/>
  • trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist

    r271131 r271189  
    3535                <key>RunLoopType</key>
    3636                <string>NSRunLoop</string>
     37                <key>_ProcessType</key>
     38                <string>App</string>
    3739                <key>_MultipleInstances</key>
    3840                <true/>
  • trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm

    r271017 r271189  
    2727#import "ProcessLauncher.h"
    2828
     29#import "WebPreferencesDefaultValues.h"
    2930#import <crt_externs.h>
    3031#import <mach-o/dyld.h>
     
    7576{
    7677#if PLATFORM(IOS_FAMILY)
    77     // On iOS, leak a boost onto all child processes
    7878    UNUSED_PARAM(launchOptions);
     79#if HAVE(RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT)
     80    // On iOS, we don't need to leak a boost message when RunningBoard process assertions give us the
     81    // right priorities.
     82    static const bool runningBoardHandlesPriorities = isFeatureFlagEnabled("RB_full_manage_WK_jetsam"_s);
     83    return !runningBoardHandlesPriorities;
     84#else
    7985    return true;
     86#endif // HAVE(RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT)
    8087#else
    8188    // On Mac, leak a boost onto the NetworkProcess, GPUProcess, and WebAuthnProcess.
  • trunk/Source/WebKit/WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist

    r271131 r271189  
    3535                <key>RunLoopType</key>
    3636                <string>NSRunLoop</string>
     37                <key>_ProcessType</key>
     38                <string>App</string>
    3739                <key>_MultipleInstances</key>
    3840                <true/>
  • trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist

    r271131 r271189  
    3535                <key>RunLoopType</key>
    3636                <string>NSRunLoop</string>
     37                <key>_ProcessType</key>
     38                <string>App</string>
    3739                <key>_MultipleInstances</key>
    3840                <true/>
Note: See TracChangeset for help on using the changeset viewer.