[webkit-reviews] review granted: [Bug 224798] Make sure we don't exit the GPUProcess too frequently while under memory pressure : [Attachment 426514] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 20 08:09:57 PDT 2021


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 224798: Make sure we don't exit the GPUProcess too frequently while under
memory pressure
https://bugs.webkit.org/show_bug.cgi?id=224798

Attachment 426514: Patch

https://bugs.webkit.org/attachment.cgi?id=426514&action=review




--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 426514
  --> https://bugs.webkit.org/attachment.cgi?id=426514
Patch

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

> Source/WebKit/GPUProcess/GPUProcess.cpp:136
> +    // To avoid exiting the GPUProcess too aggressively while under memory
pressure, we don't exit if we've been running
> +    // for less than 5 seconds. In case of simulated memory pressure, we
ignore this rule to avoid generating flakiness
> +    // in our benchmarks and tests.
> +    if ((MonotonicTime::now() - m_creationTime) < 5_s &&
!MemoryPressureHandler::singleton().isSimulatingMemoryPressure())
> +	   return false;

In cases like this I really like a comment somewhere explaining the choice of 5
seconds. One way to do that is to use a named constant at the top of the file
and have the comment there focus on how we selected 5 seconds over other
possible values. It’s sort of a "human being taking a pause" constant, I think?


More information about the webkit-reviews mailing list