Skip to content

drm/ttm, drm/xe: Consolidate the Buffer Object LRU walks

Thomas Hellström dri-devel intel-xe 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v13 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/ttm: Use a struct for the common part of struct ttm_lru_walk and struct ttm_bo_lru_cursordrivers/gpu/drm/ttm/ttm_bo.c drivers/gpu/drm/ttm/ttm_bo_util.c include/drm/ttm/ttm_bo.h+42 -310 replies
2/3drm/ttm, drm/xe: Modify the struct ttm_bo_lru_walk_cursor initializationdrivers/gpu/drm/ttm/ttm_bo_util.c drivers/gpu/drm/xe/xe_shrinker.c include/drm/ttm/ttm_bo.h+15 -140 replies
3/3drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iterationdrivers/gpu/drm/ttm/ttm_bo_util.c drivers/gpu/drm/xe/xe_shrinker.c include/drm/ttm/ttm_bo.h+88 -1162 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchChristian König
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] drm/ttm, drm/xe: Consolidate the Buffer Object LRU walks

This is a deferred task from the Xe bo shrinker addition.

TTM currently have two separate ways of doing buffer object LRU walks, of which one is exposed to drivers. Both have their benefits but we shouldn't be implementing the complex bo locking in two different places. So implement the ttm_lru_walk_for_evict() function in terms of the guarded iteration also exposed to drivers.

This means that when we get to implement locking using drm_exec, we only need to do that in a single place.

Add ticketlocking support to the guarded iteration and modify the iteration arguments.

Thomas Hellström (3):
drm/ttm: Use a struct for the common part of struct ttm_lru_walk and
struct ttm_bo_lru_cursor
drm/ttm, drm/xe: Modify the struct ttm_bo_lru_walk_cursor
initialization
drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded
LRU iteration

 drivers/gpu/drm/ttm/ttm_bo.c      |  24 ++--
 drivers/gpu/drm/ttm/ttm_bo_util.c | 202 ++++++++++++------------------
 drivers/gpu/drm/xe/xe_shrinker.c  |   8 +-
 include/drm/ttm/ttm_bo.h          |  44 ++++---
 4 files changed, 131 insertions(+), 147 deletions(-)
Signature · 1 line
2.49.0