drm/i915: drop unneeded make_unshrinkable in free_object
authorMatthew Auld <matthew.auld@intel.com>
Mon, 18 Oct 2021 09:10:51 +0000 (10:10 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Fri, 22 Oct 2021 12:19:24 +0000 (13:19 +0100)
The comment here is no longer accurate, since the current shrinker code
requires a full ref before touching any objects. Also unset_pages()
should already do the required make_unshrinkable() for us, if needed,
which is also nicely balanced with set_pages().

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-4-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_object.c

index 1e426a42a36c094a69d78d3656c2c1859ea3b8c2..55b0f1df3192ad9c78ba1a89c890faf9b5f0028d 100644 (file)
@@ -363,15 +363,6 @@ static void i915_gem_free_object(struct drm_gem_object *gem_obj)
         */
        atomic_inc(&i915->mm.free_count);
 
-       /*
-        * This serializes freeing with the shrinker. Since the free
-        * is delayed, first by RCU then by the workqueue, we want the
-        * shrinker to be able to free pages of unreferenced objects,
-        * or else we may oom whilst there are plenty of deferred
-        * freed objects.
-        */
-       i915_gem_object_make_unshrinkable(obj);
-
        /*
         * Since we require blocking on struct_mutex to unbind the freed
         * object from the GPU before releasing resources back to the