diff options
author | Rob Clark <robdclark@chromium.org> | 2022-08-02 18:51:42 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2022-08-27 19:32:45 +0300 |
commit | e7c2af13f811d0c23340154b7b2795876c71e4be (patch) | |
tree | 85b5ab9a44e2a89d5169682b893879c23a267944 /include/drm/drm_file.h | |
parent | da53d8b54647482125e29ef80dd9acbb64f2d67f (diff) | |
download | linux-e7c2af13f811d0c23340154b7b2795876c71e4be.tar.xz |
drm/gem: Add LRU/shrinker helper
Add a simple LRU helper to assist with driver's shrinker implementation.
It handles tracking the number of backing pages associated with a given
LRU, and provides a helper to implement shrinker_scan.
A driver can use multiple LRU instances to track objects in various
states, for example a dontneed LRU for purgeable objects, a willneed LRU
for evictable objects, and an unpinned LRU for objects without backing
pages.
All LRUs that the object can be moved between must share a single lock.
v2: lockdep_assert_held() instead of WARN_ON(!mutex_is_locked())
v3: make drm_gem_lru_move_tail_locked() static until there is a user
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Patchwork: https://patchwork.freedesktop.org/patch/496128/
Link: https://lore.kernel.org/r/20220802155152.1727594-10-robdclark@gmail.com
Diffstat (limited to 'include/drm/drm_file.h')
0 files changed, 0 insertions, 0 deletions