<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:huax.lu@intel.com" title="lu hua <huax.lu@intel.com>"> <span class="fn">lu hua</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ILK/HSW]igt/gem_tiled_swapping randomly causes OOM killer"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=72742">bug 72742</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>NEEDINFO
           </td>
           <td>NEW
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ILK/HSW]igt/gem_tiled_swapping randomly causes OOM killer"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=72742#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ILK/HSW]igt/gem_tiled_swapping randomly causes OOM killer"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=72742">bug 72742</a>
              from <span class="vcard"><a class="email" href="mailto:huax.lu@intel.com" title="lu hua <huax.lu@intel.com>"> <span class="fn">lu hua</span></a>
</span></b>
        <pre>Patch failed at @@ -5060,6 +5060,26 @@ static bool mutex_is_locked_by(struct
mutex *mutex, struct task_struct *task).

Add this patch as following, It still fails with OOM killer.
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -5060,6 +5060,26 @@ static bool mutex_is_locked_by(struct mutex *mutex,
struct task_struct *task)
 #endif
 }

+static bool
+i915_gem_shrinker_lock(struct drm_device *dev, bool *unlock)
+{
+    *unlock = true;
+    if (mutex_trylock(&dev->struct_mutex))
+        return true;
+
+    if (mutex_is_locked_by(&dev->struct_mutex, current)) {
+        if (to_i915(dev)->mm.shrinker_no_lock_stealing)
+            return false;
+
+        *unlock = false;
+    } else {
+        if (i915_mutex_lock_interruptible(dev))
+            return false;
+    }
+
+    return true;
+}
+
 static int num_vma_bound(struct drm_i915_gem_object *obj)
 {
     struct i915_vma *vma;</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>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>