Bug 204210 - Add SPI to clear web process cache
Summary: Add SPI to clear web process cache
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ben Nham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-14 16:38 PST by Ben Nham
Modified: 2019-11-15 19:16 PST (History)
6 users (show)

See Also:


Attachments
Patch (2.94 KB, patch)
2019-11-14 16:50 PST, Ben Nham
no flags Details | Formatted Diff | Diff
Patch (2.33 KB, patch)
2019-11-15 11:17 PST, Ben Nham
no flags Details | Formatted Diff | Diff
Patch (2.45 KB, patch)
2019-11-15 12:59 PST, Ben Nham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Nham 2019-11-14 16:38:33 PST
We should add an SPI to kill cached web processes. The intended use case is to add a lukewarm mode to Mac PLT5 in which web pages load in a new WebProcess but load resources from the disk cache. Currently the warm run of PLT5 is small enough to fit inside the Mac's process pool size, so we only end up exercising the memory cache in the cached WebProcess when loading resources.
Comment 1 Ben Nham 2019-11-14 16:50:56 PST
Created attachment 383584 [details]
Patch
Comment 2 Chris Dumez 2019-11-15 08:07:40 PST
Comment on attachment 383584 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=383584&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm:527
> +        bool shouldTerminateCached = process->isInProcessCache() && (type & _WKWebProcessTerminationTypeCached);

Calling WebProcessCache::clear() would do the right thing for clearing the process cache.

Also, is there really value to clearing the prewarmed process?
Comment 3 Chris Dumez 2019-11-15 08:11:03 PST
Comment on attachment 383584 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=383584&action=review

> Source/WebKit/ChangeLog:3
> +        Add SPI to clear web process cache

The patch does more that that.
Comment 4 Ben Nham 2019-11-15 11:17:18 PST
Created attachment 383630 [details]
Patch
Comment 5 Ben Nham 2019-11-15 11:19:01 PST
Comment on attachment 383630 [details]
Patch

remove option to kill prewarmed process
Comment 6 Chris Dumez 2019-11-15 11:43:20 PST
Comment on attachment 383630 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=383630&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm:472
> +- (void)_terminateCachedWebProcesses

I would call this _clearWebProcessCache
Comment 7 Ben Nham 2019-11-15 12:59:32 PST
Created attachment 383636 [details]
Patch
Comment 8 Ben Nham 2019-11-15 12:59:59 PST
Comment on attachment 383636 [details]
Patch

change method name
Comment 9 WebKit Commit Bot 2019-11-15 13:51:59 PST
Comment on attachment 383636 [details]
Patch

Clearing flags on attachment: 383636

Committed r252500: <https://trac.webkit.org/changeset/252500>
Comment 10 WebKit Commit Bot 2019-11-15 13:52:01 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-11-15 13:52:17 PST
<rdar://problem/57239080>