summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_drv.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2020-11-16 09:48:51 -0800
committerRob Clark <robdclark@chromium.org>2020-11-21 09:50:24 -0800
commit3edfa30f2340e6c361b34fc0c53a5f3d3bbf9704 (patch)
treed234a13a566eeee447a9573ff4c80e57f8884353 /drivers/gpu/drm/msm/msm_drv.h
parentfcd371c23c3a0a89bf6f3f415b14f75658c55c1c (diff)
downloadlinux-3edfa30f2340e6c361b34fc0c53a5f3d3bbf9704.tar.bz2
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>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.h')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 9771e971fd40..f9e46a240d0a 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -175,8 +175,9 @@ struct msm_drm_private {
struct msm_perf_state *perf;
/*
- * List of inactive GEM objects. Every bo is either in the inactive_list
- * or gpu->active_list (for the gpu it is active on[1])
+ * Lists of inactive GEM objects. Every bo is either in one of the
+ * inactive lists (depending on whether or not it is shrinkable) or
+ * gpu->active_list (for the gpu it is active on[1])
*
* These lists are protected by mm_lock. If struct_mutex is involved, it
* should be aquired prior to mm_lock. One should *not* hold mm_lock in
@@ -185,7 +186,8 @@ struct msm_drm_private {
* [1] if someone ever added support for the old 2d cores, there could be
* more than one gpu object
*/
- struct list_head inactive_list;
+ struct list_head inactive_willneed; /* inactive + !shrinkable */
+ struct list_head inactive_dontneed; /* inactive + shrinkable */
struct mutex mm_lock;
struct workqueue_struct *wq;