diff mbox series

[v6,4/8] drm/i915: drop unneeded make_unshrinkable in free_object

Message ID 20211005182405.915100-4-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [v6,1/8] drm/i915/gem: Break out some shmem backend utils | expand

Commit Message

Matthew Auld Oct. 5, 2021, 6:24 p.m. UTC
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>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Thomas Hellstrom Oct. 6, 2021, 8:03 a.m. UTC | #1
On 10/5/21 20:24, Matthew Auld wrote:
> 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>


> ---
>   drivers/gpu/drm/i915/gem/i915_gem_object.c | 9 ---------
>   1 file changed, 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> index 76ce6a1500bc..1dc3c1940c32 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> @@ -337,15 +337,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
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index 76ce6a1500bc..1dc3c1940c32 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -337,15 +337,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