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

Changeset 270542 in webkit


Ignore:
Timestamp:
Dec 8, 2020, 9:39:35 AM (6 years ago)
Author:
Chris Dumez
Message:

[iOS] Stop leaking an XPC boost message to XPC services
https://bugs.webkit.org/show_bug.cgi?id=219453

Reviewed by Geoffrey Garen.

Source/WebKit:

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.

  • FeatureFlags/WebKit.plist:

Add RB_full_manage_WK_jetsam feature flag and turn it on. On recent enough builds of RunningBoard, this
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

    r270516 r270542  
     12020-12-08  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Stop leaking an XPC boost message to XPC services
     4        https://bugs.webkit.org/show_bug.cgi?id=219453
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Add new RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT build time flag since we need a recent
     9        enough build of RunningBoard to do this.
     10
     11        * wtf/PlatformHave.h:
     12
    1132020-12-07  Don Olmstead  <don.olmstead@sony.com>
    214
  • trunk/Source/WTF/wtf/PlatformHave.h

    r270449 r270542  
    722722#endif
    723723
     724#if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
     725    || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
     726    || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
     727#define HAVE_RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT 1
     728#endif
     729
    724730#if PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
    725731#define HAVE_CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR 1
  • trunk/Source/WebKit/ChangeLog

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

    r269865 r270542  
    8383        <true/>
    8484    </dict>
     85    <key>RB_full_manage_WK_jetsam</key>
     86    <dict>
     87        <key>Enabled</key>
     88        <true/>
     89    </dict>
    8590</dict>
    8691</plist>
  • trunk/Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist

    r257386 r270542  
    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

    r253968 r270542  
    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

    r269472 r270542  
    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

    r268605 r270542  
    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

    r260904 r270542  
    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.