Bug 227269 - [macOS] Suspend WebProcesses that are in the process cache
Summary: [macOS] Suspend WebProcesses that are in the 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: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-22 14:13 PDT by Chris Dumez
Modified: 2021-07-07 09:44 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.75 KB, patch)
2021-06-22 14:16 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.63 KB, patch)
2021-07-01 15:54 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.95 KB, patch)
2021-07-06 12:54 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (6.98 KB, patch)
2021-07-06 13:22 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-06-22 14:13:07 PDT
Suspend WebProcesses that are in the process cache on macOS to make sure they use no CPU.
Comment 1 Chris Dumez 2021-06-22 14:16:58 PDT
Created attachment 431993 [details]
Patch
Comment 2 Geoffrey Garen 2021-06-22 14:41:52 PDT
Comment on attachment 431993 [details]
Patch

r=me
Comment 3 EWS 2021-06-22 16:48:41 PDT
Committed r279155 (239059@main): <https://commits.webkit.org/239059@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431993 [details].
Comment 4 Radar WebKit Bug Importer 2021-06-22 16:49:21 PDT
<rdar://problem/79639863>
Comment 5 Chris Dumez 2021-06-30 08:23:10 PDT
Reverted r279155 for reason:

Caused a PLT5 regression

Committed r279411 (239276@main): <https://commits.webkit.org/239276@main>
Comment 6 Chris Dumez 2021-07-01 14:55:52 PDT
I can reproduce the issue on PLT5 locally. I am investigating. 2 of the pages hang for an extended period of time of warm loads (but eventually recover). It looks like the cached process ends up exiting in this case and the load eventually happens in a fresh process. I don't see any crash report though.
Comment 7 Chris Dumez 2021-07-01 15:04:59 PDT
(In reply to Chris Dumez from comment #6)
> I can reproduce the issue on PLT5 locally. I am investigating. 2 of the
> pages hang for an extended period of time of warm loads (but eventually
> recover). It looks like the cached process ends up exiting in this case and
> the load eventually happens in a fresh process. I don't see any crash report
> though.

Oh, I think the pages that cause trouble are the ones with service workers. If I look at the logs, I see this logging right after we resume the cached process:
com.apple.WebKit	2021-07-01 14:51:37.071485 -0700	ServiceWorker	error	28186	com.apple.WebKit.WebContent.Development	Failed to terminate service worker with identifier 1535, killing the service worker process

And then the Cached WebProcess dies.
Comment 8 Chris Dumez 2021-07-01 15:54:42 PDT
Created attachment 432739 [details]
Patch
Comment 9 Geoffrey Garen 2021-07-01 16:10:19 PDT
Comment on attachment 432739 [details]
Patch

r=me
Comment 10 EWS 2021-07-01 20:14:34 PDT
Committed r279495 (239347@main): <https://commits.webkit.org/239347@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432739 [details].
Comment 11 Chris Dumez 2021-07-06 09:00:28 PDT
Reverted r279495 for reason:

Seems to have caused a ~2% PLT5 regression

Committed r279583 (239414@main): <https://commits.webkit.org/239414@main>
Comment 12 Chris Dumez 2021-07-06 12:54:51 PDT
Created attachment 432962 [details]
Patch
Comment 13 Chris Dumez 2021-07-06 12:57:43 PDT
(In reply to Chris Dumez from comment #12)
> Created attachment 432962 [details]
> Patch

New iteration, I am currently evaluating its impact on PLT5.
Comment 14 Chris Dumez 2021-07-06 13:22:46 PDT
Created attachment 432966 [details]
Patch
Comment 15 Chris Dumez 2021-07-07 08:17:30 PDT
Comment on attachment 432966 [details]
Patch

A/B bots say no PLT5 regression with this latest iteration.
Comment 16 Geoffrey Garen 2021-07-07 09:36:27 PDT
Comment on attachment 432966 [details]
Patch

r=me
Comment 17 EWS 2021-07-07 09:44:39 PDT
Committed r279644 (239457@main): <https://commits.webkit.org/239457@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432966 [details].