<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [All Regression]igt/gem_fence_upload/thread-contention costs long time to execute sporadically"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80578">bug 80578</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [All Regression]igt/gem_fence_upload/thread-contention costs long time to execute sporadically"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80578#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [All Regression]igt/gem_fence_upload/thread-contention costs long time to execute sporadically"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80578">bug 80578</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>commit 37e9562453b813d2ea527bd9531fef2c3c592847
Author: Jason Low <<a href="mailto:jason.low2@hp.com">jason.low2@hp.com</a>>
Date:   Fri Jul 4 20:49:32 2014 -0700

    locking/rwsem: Allow conservative optimistic spinning when readers have
lock

    Commit 4fc828e24cd9 ("locking/rwsem: Support optimistic spinning")
    introduced a major performance regression for workloads such as
    xfs_repair which mix read and write locking of the mmap_sem across
    many threads. The result was xfs_repair ran 5x slower on 3.16-rc2
    than on 3.15 and using 20x more system CPU time.

    Perf profiles indicate in some workloads that significant time can
    be spent spinning on !owner. This is because we don't set the lock
    owner when readers(s) obtain the rwsem.

    In this patch, we'll modify rwsem_can_spin_on_owner() such that we'll
    return false if there is no lock owner. The rationale is that if we
    just entered the slowpath, yet there is no lock owner, then there is
    a possibility that a reader has the lock. To be conservative, we'll
    avoid spinning in these situations.

    This patch reduced the total run time of the xfs_repair workload from
    about 4 minutes 24 seconds down to approximately 1 minute 26 seconds,
    back to close to the same performance as on 3.15.

    Retesting of AIM7, which were some of the workloads used to test the
    original optimistic spinning code, confirmed that we still get big
    performance gains with optimistic spinning, even with this additional
    regression fix. Davidlohr found that while the 'custom' workload took
    a performance hit of ~-14% to throughput for >300 users with this
    additional patch, the overall gain with optimistic spinning is
    still ~+45%. The 'disk' workload even improved by ~+15% at >1000 users.

    Tested-by: Dave Chinner <<a href="mailto:dchinner@redhat.com">dchinner@redhat.com</a>>
    Acked-by: Davidlohr Bueso <<a href="mailto:davidlohr@hp.com">davidlohr@hp.com</a>>
    Signed-off-by: Jason Low <<a href="mailto:jason.low2@hp.com">jason.low2@hp.com</a>>
    Signed-off-by: Peter Zijlstra <<a href="mailto:peterz@infradead.org">peterz@infradead.org</a>>
    Cc: Tim Chen <<a href="mailto:tim.c.chen@linux.intel.com">tim.c.chen@linux.intel.com</a>>
    Cc: Linus Torvalds <<a href="mailto:torvalds@linux-foundation.org">torvalds@linux-foundation.org</a>>
    Link: <a href="http://lkml.kernel.org/r/1404532172.2572.30.camel@j-VirtualBox">http://lkml.kernel.org/r/1404532172.2572.30.camel@j-VirtualBox</a>
    Signed-off-by: Ingo Molnar <<a href="mailto:mingo@kernel.org">mingo@kernel.org</a>></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>