]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm/shrinker: Only iterate dontneed objs
authorRob Clark <robdclark@chromium.org>
Mon, 16 Nov 2020 17:48:51 +0000 (09:48 -0800)
committerRob Clark <robdclark@chromium.org>
Sat, 21 Nov 2020 17:50:24 +0000 (09:50 -0800)
commite539b5faea0e3700271adca3fbba56e141b7fc4a
treed234a13a566eeee447a9573ff4c80e57f8884353
parentad052b433c04cd10050792d632ee93acbcebb041
drm/msm/shrinker: Only iterate dontneed objs

In situations where the GPU is mostly idle, all or nearly all buffer
objects will be in the inactive list.  But if the system is under memory
pressure (from something other than GPU), we could still get a lot of
shrinker calls.  Which results in traversing a list of thousands of objs
and in the end finding nothing to shrink.  Which isn't so efficient.

Instead split the inactive_list into two lists, one inactive objs which
are shrinkable, and a second one for those that are not.  This way we
can avoid traversing objs which we know are not shrinker candidates.

v2: Fix inverted logic think-o

Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_debugfs.c
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_shrinker.c