mirror of
https://github.com/torvalds/linux.git
synced 2026-05-04 14:32:27 -04:00
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>
This commit is contained in:
@@ -448,6 +448,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
|
||||
|
||||
INIT_LIST_HEAD(&priv->inactive_willneed);
|
||||
INIT_LIST_HEAD(&priv->inactive_dontneed);
|
||||
INIT_LIST_HEAD(&priv->inactive_purged);
|
||||
mutex_init(&priv->mm_lock);
|
||||
|
||||
/* Teach lockdep about lock ordering wrt. shrinker: */
|
||||
|
||||
Reference in New Issue
Block a user