Bug 224829 - If an idle GPUProcess doesn't exit under memory pressure because it just launched, check again later
Summary: If an idle GPUProcess doesn't exit under memory pressure because it just laun...
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: 224798
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-20 14:23 PDT by Chris Dumez
Modified: 2021-04-23 01:23 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.29 KB, patch)
2021-04-20 14:33 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (5.99 KB, patch)
2021-04-20 15:32 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (5.84 KB, patch)
2021-04-20 15:36 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-04-20 14:23:38 PDT
If an idle GPUProcess doesn't exit under memory pressure because it just launched, check again later. This is a follow-up to r276305.
Comment 1 Chris Dumez 2021-04-20 14:33:46 PDT
Created attachment 426594 [details]
Patch
Comment 2 Darin Adler 2021-04-20 15:16:55 PDT
Comment on attachment 426594 [details]
Patch

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

> Source/WebKit/GPUProcess/GPUProcess.cpp:155
>      return true;

Should we do m_idleExitTimer.stop() here too?
Comment 3 Chris Dumez 2021-04-20 15:19:36 PDT
Comment on attachment 426594 [details]
Patch

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

>> Source/WebKit/GPUProcess/GPUProcess.cpp:155
>>      return true;
> 
> Should we do m_idleExitTimer.stop() here too?

Hmm. In this case, we will end up exiting anyway, but sure, it feels a bit cleaner to stop the timer in this case too.
Comment 4 Chris Dumez 2021-04-20 15:32:23 PDT
Created attachment 426600 [details]
Patch
Comment 5 Chris Dumez 2021-04-20 15:36:51 PDT
Created attachment 426602 [details]
Patch
Comment 6 Chris Dumez 2021-04-20 15:38:37 PDT
I made the suggested change. I am asking for review again because I made a significant change. I moved the whole logic from canExitUnderMemoryPressure() to tryExitIfUnused(). It feels much nicer for tryExitIfUnused() to schedule a timer to call tryExitIfUnused() then a simple query function like canExitUnderMemoryPressure().
Comment 7 EWS 2021-04-20 17:59:00 PDT
Committed r276339 (236817@main): <https://commits.webkit.org/236817@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426602 [details].
Comment 8 Radar WebKit Bug Importer 2021-04-23 01:23:08 PDT
<rdar://problem/77061558>