diff options
author | Rob Clark <robdclark@chromium.org> | 2020-11-16 09:48:51 -0800 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2020-11-21 09:50:24 -0800 |
commit | 3edfa30f2340e6c361b34fc0c53a5f3d3bbf9704 (patch) | |
tree | d234a13a566eeee447a9573ff4c80e57f8884353 /drivers/gpu/drm/msm/msm_debugfs.c | |
parent | fcd371c23c3a0a89bf6f3f415b14f75658c55c1c (diff) | |
download | lwn-3edfa30f2340e6c361b34fc0c53a5f3d3bbf9704.tar.gz lwn-3edfa30f2340e6c361b34fc0c53a5f3d3bbf9704.zip |
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_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_debugfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index 64afbed89821..85ad0babc326 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -124,7 +124,8 @@ static int msm_gem_show(struct drm_device *dev, struct seq_file *m) } seq_printf(m, "Inactive Objects:\n"); - msm_gem_describe_objects(&priv->inactive_list, m); + msm_gem_describe_objects(&priv->inactive_dontneed, m); + msm_gem_describe_objects(&priv->inactive_willneed, m); mutex_unlock(&priv->mm_lock); |