]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: Avoid mutex in shrinker_count()
authorRob Clark <robdclark@chromium.org>
Thu, 1 Apr 2021 01:27:19 +0000 (18:27 -0700)
committerRob Clark <robdclark@chromium.org>
Wed, 7 Apr 2021 18:05:42 +0000 (11:05 -0700)
commit1ce0f786e723a851a257c8c71c403b319dac9604
tree7de47a94da6e7aee4f9d19cf7be12351b926035a
parent7cf430c2de4b8ae1af4d3578c473decd7ecd4292
drm/msm: Avoid mutex in shrinker_count()

When the system is under heavy memory pressure, we can end up with lots
of concurrent calls into the shrinker.  Keeping a running tab on what we
can shrink avoids grabbing a lock in shrinker->count(), and avoids
shrinker->scan() getting called when not profitable.

Also, we can keep purged objects in their own list to avoid re-traversing
them to help cut down time in the critical section further.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20210401012722.527712-3-robdclark@gmail.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gem.h
drivers/gpu/drm/msm/msm_gem_shrinker.c