Bug 220659 - [GPUProcess] Improve the GPUProcess' memory pressure handler
Summary: [GPUProcess] Improve the GPUProcess' memory pressure handler
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-01-15 08:52 PST by Chris Dumez
Modified: 2021-01-15 10:30 PST (History)
5 users (show)

See Also:


Attachments
Patch (6.93 KB, patch)
2021-01-15 08:54 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.69 KB, patch)
2021-01-15 09:47 PST, 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-01-15 08:52:56 PST
Improve the GPUProcess' memory pressure handler to clear things like the IOSurfacePool and the SubimageCacheWithTimer.
Comment 1 Chris Dumez 2021-01-15 08:54:35 PST
Created attachment 417703 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-01-15 09:37:44 PST
Comment on attachment 417703 [details]
Patch

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

Should we also propagate the memory warning to the web content processes? Or will they also get the warning?

> Source/WebCore/page/MemoryRelease.cpp:169
> +        // Return unused pages back to the OS now as this will likely give us a little memory to work with.

I don't think this comment adds anything. In fact, I'm confused by it.

> Source/WebCore/page/MemoryRelease.cpp:176
> +    if (synchronous == Synchronous::Yes)
> +        WTF::releaseFastMallocFreeMemory();

What's the reason for calling it a second time?
Comment 3 Chris Dumez 2021-01-15 09:41:25 PST
Comment on attachment 417703 [details]
Patch

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

>> Source/WebCore/page/MemoryRelease.cpp:169
>> +        // Return unused pages back to the OS now as this will likely give us a little memory to work with.
> 
> I don't think this comment adds anything. In fact, I'm confused by it.

Ok. This was from releaseMemory() above.

>> Source/WebCore/page/MemoryRelease.cpp:176
>> +        WTF::releaseFastMallocFreeMemory();
> 
> What's the reason for calling it a second time?

I am not sure. This is a stripped down version of releaseMemory() above.
Comment 4 Simon Fraser (smfr) 2021-01-15 09:46:17 PST
Comment on attachment 417703 [details]
Patch

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

>>> Source/WebCore/page/MemoryRelease.cpp:169
>>> +        // Return unused pages back to the OS now as this will likely give us a little memory to work with.
>> 
>> I don't think this comment adds anything. In fact, I'm confused by it.
> 
> Ok. This was from releaseMemory() above.

I need to read more closely. This is releasing "free" memory, so presumably pages that are free to return to the OS. The comments makes more sense now (but the comment should use "free", not "unused" to match the function name).

>>> Source/WebCore/page/MemoryRelease.cpp:176
>>> +        WTF::releaseFastMallocFreeMemory();
>> 
>> What's the reason for calling it a second time?
> 
> I am not sure. This is a stripped down version of releaseMemory() above.

I'm guessing this can touch pages and thus trigger them getting mapped back in.
Comment 5 Chris Dumez 2021-01-15 09:47:09 PST
Created attachment 417711 [details]
Patch
Comment 6 EWS 2021-01-15 10:29:13 PST
Committed r271526: <https://trac.webkit.org/changeset/271526>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417711 [details].
Comment 7 Radar WebKit Bug Importer 2021-01-15 10:30:22 PST
<rdar://problem/73254115>