Title: [271189] trunk/Source
Revision
271189
Author
[email protected]
Date
2021-01-05 19:24:49 -0800 (Tue, 05 Jan 2021)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (271188 => 271189)


--- trunk/Source/WTF/ChangeLog	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WTF/ChangeLog	2021-01-06 03:24:49 UTC (rev 271189)
@@ -1,3 +1,16 @@
+2021-01-05  Chris Dumez  <[email protected]>
+
+        [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.
+
+        Add new RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT build time flag since we need a recent
+        enough build of RunningBoard to do this.
+
+        * wtf/PlatformHave.h:
+
 2020-12-27  Wenson Hsieh  <[email protected]>
 
         Add a helper method to WTF::MachSemaphore to wait with a timeout duration

Modified: trunk/Source/WTF/wtf/PlatformHave.h (271188 => 271189)


--- trunk/Source/WTF/wtf/PlatformHave.h	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-01-06 03:24:49 UTC (rev 271189)
@@ -725,6 +725,12 @@
 #define HAVE_CTFONTDESCRIPTOR_CREATE_WITH_TEXT_STYLE_AND_ATTRIBUTES 1
 #endif
 
+#if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
+    || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
+    || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
+#define HAVE_RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT 1
+#endif
+
 #if PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
 #define HAVE_CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR 1
 #endif

Modified: trunk/Source/WebKit/ChangeLog (271188 => 271189)


--- trunk/Source/WebKit/ChangeLog	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/ChangeLog	2021-01-06 03:24:49 UTC (rev 271189)
@@ -1,3 +1,38 @@
+2021-01-05  Chris Dumez  <[email protected]>
+
+        [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.
+
+        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.
+
 2021-01-05  Alex Christensen  <[email protected]>
 
         Use sendWithAsyncReply instead of AttributedStringForCharacterRangeCallback and FontAtSelectionCallback

Modified: trunk/Source/WebKit/FeatureFlags/WebKit.plist (271188 => 271189)


--- trunk/Source/WebKit/FeatureFlags/WebKit.plist	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/FeatureFlags/WebKit.plist	2021-01-06 03:24:49 UTC (rev 271189)
@@ -87,5 +87,10 @@
         <key>Enabled</key>
         <true/>
     </dict>
+    <key>RB_full_manage_WK_jetsam</key>
+    <dict>
+        <key>Enabled</key>
+        <false/>
+    </dict>
 </dict>
 </plist>

Modified: trunk/Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist (271188 => 271189)


--- trunk/Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist	2021-01-06 03:24:49 UTC (rev 271189)
@@ -34,6 +34,8 @@
 		<string>Application</string>
 		<key>RunLoopType</key>
 		<string>NSRunLoop</string>
+                <key>_ProcessType</key>
+                <string>App</string>
 		<key>_MultipleInstances</key>
 		<true/>
 	</dict>

Modified: trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist (271188 => 271189)


--- trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist	2021-01-06 03:24:49 UTC (rev 271189)
@@ -34,6 +34,8 @@
 		<string>Application</string>
 		<key>RunLoopType</key>
 		<string>NSRunLoop</string>
+                <key>_ProcessType</key>
+                <string>App</string>
 		<key>_MultipleInstances</key>
 		<true/>
 	</dict>

Modified: trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm (271188 => 271189)


--- trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2021-01-06 03:24:49 UTC (rev 271189)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "ProcessLauncher.h"
 
+#import "WebPreferencesDefaultValues.h"
 #import <crt_externs.h>
 #import <mach-o/dyld.h>
 #import <mach/mach_error.h>
@@ -74,9 +75,15 @@
 static bool shouldLeakBoost(const ProcessLauncher::LaunchOptions& launchOptions)
 {
 #if PLATFORM(IOS_FAMILY)
-    // On iOS, leak a boost onto all child processes
     UNUSED_PARAM(launchOptions);
+#if HAVE(RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT)
+    // On iOS, we don't need to leak a boost message when RunningBoard process assertions give us the
+    // right priorities.
+    static const bool runningBoardHandlesPriorities = isFeatureFlagEnabled("RB_full_manage_WK_jetsam"_s);
+    return !runningBoardHandlesPriorities;
+#else
     return true;
+#endif // HAVE(RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT)
 #else
     // On Mac, leak a boost onto the NetworkProcess, GPUProcess, and WebAuthnProcess.
 #if ENABLE(GPU_PROCESS)

Modified: trunk/Source/WebKit/WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist (271188 => 271189)


--- trunk/Source/WebKit/WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist	2021-01-06 03:24:49 UTC (rev 271189)
@@ -34,6 +34,8 @@
 		<string>Application</string>
 		<key>RunLoopType</key>
 		<string>NSRunLoop</string>
+                <key>_ProcessType</key>
+                <string>App</string>
 		<key>_MultipleInstances</key>
 		<true/>
 	</dict>

Modified: trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist (271188 => 271189)


--- trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist	2021-01-06 03:11:17 UTC (rev 271188)
+++ trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist	2021-01-06 03:24:49 UTC (rev 271189)
@@ -34,6 +34,8 @@
 		<string>Application</string>
 		<key>RunLoopType</key>
 		<string>NSRunLoop</string>
+                <key>_ProcessType</key>
+                <string>App</string>
 		<key>_MultipleInstances</key>
 		<true/>
 		<key>_HighBitsASLR</key>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to