<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>183277</bug_id>
          
          <creation_ts>2018-03-01 23:00:53 -0800</creation_ts>
          <short_desc>MemoryPressureHandler&apos;s dispatch_source_set_timer uses s_minimumHoldOffTime as nanoseconds</short_desc>
          <delta_ts>2023-08-01 10:26:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>182911</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yusuke Suzuki">ysuzuki</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>rreno</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1403159</commentid>
    <comment_count>0</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2018-03-01 23:00:53 -0800</bug_when>
    <thetext>...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1969069</commentid>
    <comment_count>1</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2023-08-01 10:26:11 -0700</bug_when>
    <thetext>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/)

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

So we&apos;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&apos;t imply we mean for it to be 5 seconds.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>