<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 - [CI] igt@gem_exec_reuse@contexts - dmesg-warn - BUG: sleeping function called from invalid context at mm/vmalloc.c:1037"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103638">bug 103638</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;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [CI] igt@gem_exec_reuse@contexts - dmesg-warn - BUG: sleeping function called from invalid context at mm/vmalloc.c:1037"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103638#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [CI] igt@gem_exec_reuse@contexts - dmesg-warn - BUG: sleeping function called from invalid context at mm/vmalloc.c:1037"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103638">bug 103638</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 94dec87159af6f3dcc0b78d3f909aefa9e29c01a
Author: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>>
Date:   Thu Nov 9 08:55:40 2017 +0000

    drm/i915: Reorder context-close to avoid calling i915_vma_close() under RCU

    When we close the VMA, we unbind it from the ppgtt and tear down the
    page directory pointing at it. That may trigger us to return WC pages
    back to the system, requiring conversion back to WB which itself may
    sleep. That makes i915_vma_close() unsuitable for use inside the RCU
    read lock, which we need to hold to iterate the radixtree.

    The fix is quite simple, we can close all the VMA as we close the ppgtt,
    we only need to do that instead of closing them during destruction of
    the LUT.

    v2: Order between closing the LUT and the ppgtt is important; we use the
    vma inside the LUT as a means of retrieving the object, and so we must
    clear the LUT before freeing the VMA when closing the ppgtt.

    Bugzilla: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [CI] igt@gem_exec_reuse@contexts - dmesg-warn - BUG: sleeping function called from invalid context at mm/vmalloc.c:1037"
   href="show_bug.cgi?id=103638">https://bugs.freedesktop.org/show_bug.cgi?id=103638</a>
    Fixes: 547da76b5777 ("drm/i915: Hold rcu_read_lock when iterating over the
radixtree (vma idr)")
    Fixes: d1b48c1e7184 ("drm/i915: Replace execbuf vma ht with an idr")
    Signed-off-by: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>>
    Cc: Tvrtko Ursulin <<a href="mailto:tvrtko.ursulin@intel.com">tvrtko.ursulin@intel.com</a>>
    Cc: Joonas Lahtinen <<a href="mailto:joonas.lahtinen@linux.intel.com">joonas.lahtinen@linux.intel.com</a>>
    Cc: Matthew Auld <<a href="mailto:matthew.william.auld@gmail.com">matthew.william.auld@gmail.com</a>>
    Link:
<a href="https://patchwork.freedesktop.org/patch/msgid/20171109085540.32264-1-chris@chris-wilson.co.uk">https://patchwork.freedesktop.org/patch/msgid/20171109085540.32264-1-chris@chris-wilson.co.uk</a>
    Reviewed-by: Tvrtko Ursulin <<a href="mailto:tvrtko.ursulin@intel.com">tvrtko.ursulin@intel.com</a>></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are on the CC list for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>