Skip to content

drm/xe: Split the bo shrinker and adjust batch size

Thomas Hellström intel-xe stable 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 1 replyIn review
  2. v44 patches 10 repliesSuperseded
  3. v33 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches6 repliesSuperseded
v12 patches0 repliesSuperseded

Changes in v5 from the cover letter

- Patch 3/4: make the non-purgeable shrinker seeks value tunable through Kconfig and sysfs. (Matthew Brost)

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drm/xe: Don't abort the shrinker walk on -EBUSYdrivers/gpu/drm/xe/xe_shrinker.c+3 -00 replies
2/4drm/xe: Track number of populated ttm_tts in the shrinkerdrivers/gpu/drm/xe/xe_bo.c drivers/gpu/drm/xe/xe_shrinker.c drivers/gpu/drm/xe/xe_shrinker.h+19 -110 replies
3/4drm/xe: Split the bo shrinker into purgeable and non-purgeable shrinkersdrivers/gpu/drm/xe/Kconfig.profile drivers/gpu/drm/xe/xe_device_sysfs.c drivers/gpu/drm/xe/xe_shrinker.c +1 more+172 -411 reply
4/4drm/xe: Update non-purgeable shrinker batch size based on average BO sizedrivers/gpu/drm/xe/xe_shrinker.c+42 -60 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchMatthew Brost
1/4R-b
2/4R-b
3/4R-b
4/4R-b

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

Read the v5 thread

Cover letter [PATCH v5 0/4] drm/xe: Split the bo shrinker and adjust batch size

Shamelessly stolen from i915, To avoid gpu stalls for small shrinker request, Set the shrinker batch size to the average size of system buffer objects. Use the number of populated struct ttm_tts to compute the average size.

However, it turned out that it may be desirable to have different settings for purgeable and non-purgeable objects, since purgeable objects are cheap to reclaim so split the shrinker into one for purgeable objects and one which can shrink both but is invoked with lower priority.

v2:
- Fix the average object size estimate to account for the full shrinkable and purgeable population.

v3:
- Drop the shrinker accounting double-subtraction fix from this series; it has been fixed and merged upstream separately.
- Patch 3/4: new patch, splitting the bo shrinker into purgeable and non-purgeable shrinkers, per a suggestion from Matthew Brost.
- Patch 4/4: reworked on top of the shrinker split, and the batch size update is now performed under the existing shrinker lock, fixing the data race caught by Sashiko AI review.

v4:
- Patch 1/4: new patch, skipping objects for which xe_bo_shrink() returns -EBUSY rather than aborting the shrinker walk. (Sashiko)

v5:
- Patch 3/4: make the non-purgeable shrinker seeks value tunable through Kconfig and sysfs. (Matthew Brost)

Thomas Hellström (4):
drm/xe: Don't abort the shrinker walk on -EBUSY
drm/xe: Track number of populated ttm_tts in the shrinker drm/xe: Split the bo shrinker into purgeable and non-purgeable
shrinkers
drm/xe: Update non-purgeable shrinker batch size based on average BO
size

 drivers/gpu/drm/xe/Kconfig.profile   |  12 ++
 drivers/gpu/drm/xe/xe_bo.c           |  12 +-
 drivers/gpu/drm/xe/xe_device_sysfs.c |  50 +++++++
 drivers/gpu/drm/xe/xe_shrinker.c     | 213 ++++++++++++++++++++-------
 drivers/gpu/drm/xe/xe_shrinker.h     |   7 +-
 5 files changed, 236 insertions(+), 58 deletions(-)
Signature · 1 line
2.56.0