[webkit-changes] [WebKit/WebKit] 02d661: Processes in the WebProcessCache should suspend mo...

Chris Dumez noreply at github.com
Mon May 8 17:26:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 02d6615aea2e51b0f048e9500e9f24565231d36e
      https://github.com/WebKit/WebKit/commit/02d6615aea2e51b0f048e9500e9f24565231d36e
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-05-08 (Mon, 08 May 2023)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
    M Source/WebKit/UIProcess/ProcessThrottler.cpp
    M Source/WebKit/UIProcess/ProcessThrottler.h
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

  Log Message:
  -----------
  Processes in the WebProcessCache should suspend more promptly
https://bugs.webkit.org/show_bug.cgi?id=256468
rdar://108624630

Reviewed by Geoffrey Garen.

When processes entered the WebProcessCache, they would not suspend for ~8 minutes
due to the near-suspended assertion we take after releasing the last useful
process assertion.

To cause them to suspend more promptly, I am adding an implementation for
WebProcessProxy::platformSuspendProcess() & platformResumeProcess() to drop
& retake the near-suspended assertion. platformSuspendProcess() gets called
by the WebProcessCache 30 seconds after the process has entered the cache.

This patch effectively causes our WebProcesses to fully suspend 30 seconds after
entering the WebProcessCache, instead of 8 minutes. This tested as neutral on
PLT5 and Membuster.

* Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _requestWebProcessTermination:]):
(-[WKProcessPool _isWebProcessSuspended:]):
* Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* Source/WebKit/UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::setShouldTakeNearSuspendedAssertion):
* Source/WebKit/UIProcess/ProcessThrottler.h:
(WebKit::ProcessThrottler::isHoldingNearSuspendedAssertion const):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::platformSuspendProcess):
(WebKit::WebProcessProxy::platformResumeProcess):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Canonical link: https://commits.webkit.org/263839@main




More information about the webkit-changes mailing list