[Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

Hillf Danton hdanton at sina.com
Mon Oct 5 09:24:19 UTC 2020


On Sun,  4 Oct 2020 12:21:45
> From: Rob Clark <robdclark at chromium.org>
> 
> Now that the inactive_list is protected by mm_lock, and everything
> else on per-obj basis is protected by obj->lock, we no longer depend
> on struct_mutex.
> 
> Signed-off-by: Rob Clark <robdclark at chromium.org>
> ---
>  drivers/gpu/drm/msm/msm_gem.c          |  1 -
>  drivers/gpu/drm/msm/msm_gem_shrinker.c | 54 --------------------------
>  2 files changed, 55 deletions(-)
> 
[...]

> @@ -71,13 +33,8 @@ msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>  {
>  	struct msm_drm_private *priv =
>  		container_of(shrinker, struct msm_drm_private, shrinker);
> -	struct drm_device *dev = priv->dev;
>  	struct msm_gem_object *msm_obj;
>  	unsigned long freed = 0;
> -	bool unlock;
> -
> -	if (!msm_gem_shrinker_lock(dev, &unlock))
> -		return SHRINK_STOP;
>  
>  	mutex_lock(&priv->mm_lock);

Better if the change in behavior is documented that SHRINK_STOP will
no longer be needed.



More information about the Freedreno mailing list