[Webkit-unassigned] [Bug 183277] MemoryPressureHandler's dispatch_source_set_timer uses s_minimumHoldOffTime as nanoseconds

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 1 10:26:11 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=183277

Ryan Reno <rreno at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rreno at apple.com

--- Comment #1 from Ryan Reno <rreno at apple.com> ---
Ran across this FIXME when working on something else. I think this parameter is pretty benign as-is but there might be some risk keeping it.

This is the leeway parameter which is documented below: (https://developer.apple.com/documentation/dispatch/1385606-dispatch_source_set_timer/)

>The leeway parameter is a hint from the application as to the amount of time, in >nanoseconds, up to which the system can defer the timer to align with other system >activity for improved system performance or power consumption. For example, an >application might perform a periodic task every 5 minutes, with a leeway of up to 30 >seconds. Note that some latency is to be expected for all timers, even when a leeway >value of zero is specified.

So we're basically telling the system it can delay firing the timer by an upper limit of 5 ns. Since this is a hold off timer for re-installing the memory pressure handler (presumably to minimize responding to rapid ping-pong between memory pressure states?) I think 5 seconds is far too long of a leeway but 5ns is probably a little on the short side.

All that is to say I think unless we measure that we are responding to memory pressure too slowly and can confirm it is due to leeway parameter we might as well just make it 0 or maybe some other value that doesn't imply we mean for it to be 5 seconds.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230801/a665399c/attachment.htm>


More information about the webkit-unassigned mailing list