All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] drm/xe: Adjust the bo shrinker batch size
@ 2026-10-16 13:35 Thomas Hellström
  2026-10-16 13:35 ` [PATCH v4 1/4] drm/xe: Don't abort the shrinker walk on -EBUSY Thomas Hellström
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Thomas Hellström @ 2026-10-16 13:35 UTC (permalink / raw)
  To: intel-xe
  Cc: Thomas Hellström, Matthew Brost, Matthew Auld,
	Maarten Lankhorst

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.

Sashiko AI review of the v2 posting flagged two issues:

 - [High] a pre-existing shrinker accounting double-subtraction bug on
   nested external pins (plus a related underflow for imported
   dma-bufs, found while fixing it). This has since been fixed and
   merged upstream as its own, separate fixes series, so it is no
   longer carried as a patch here.

 - [Medium] a data race on the unsynchronized read-modify-write of the
   shrinker batch size. Fixed in v3 below.

Sashiko AI review of the v3 posting flagged, among others:

 - [High] a pre-existing shrinker accounting underflow when the
   purgeable state of a pinned bo changes. This is fixed by a
   separately posted patch, "drm/xe: Don't transfer shrinker pages for
   pinned bos on purgeable state change".

 - [High] the standalone purgeable shrinker aborting its LRU walk at
   the first non-purgeable object. This turned out to be a
   pre-existing bug affecting also the non-purge walk, for example
   at imported dma-bufs. Fixed in patch 1/4, placed first so that it
   can be backported independently.

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)

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/xe_bo.c       |  12 +--
 drivers/gpu/drm/xe/xe_shrinker.c | 175 ++++++++++++++++++++++---------
 drivers/gpu/drm/xe/xe_shrinker.h |   3 +-
 3 files changed, 132 insertions(+), 58 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-10-16 18:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 13:35 [PATCH v4 0/4] drm/xe: Adjust the bo shrinker batch size Thomas Hellström
2026-10-16 13:35 ` [PATCH v4 1/4] drm/xe: Don't abort the shrinker walk on -EBUSY Thomas Hellström
2026-10-16 13:44   ` sashiko-bot
2026-10-16 13:55   ` Matthew Brost
2026-10-16 13:35 ` [PATCH v4 2/4] drm/xe: Track number of populated ttm_tts in the shrinker Thomas Hellström
2026-10-16 14:26   ` Matthew Brost
2026-10-16 13:35 ` [PATCH v4 3/4] drm/xe: Split the bo shrinker into purgeable and non-purgeable shrinkers Thomas Hellström
2026-10-16 13:53   ` sashiko-bot
2026-10-16 14:09     ` Thomas Hellström
2026-10-16 18:41       ` Matthew Brost
2026-10-16 18:16   ` Matthew Brost
2026-10-16 13:35 ` [PATCH v4 4/4] drm/xe: Update non-purgeable shrinker batch size based on average BO size Thomas Hellström
2026-10-16 13:45   ` sashiko-bot
2026-10-16 14:06     ` Thomas Hellström
2026-10-16 18:42       ` Matthew Brost
2026-10-16 18:44   ` Matthew Brost
2026-10-16 13:45 ` ✓ CI.KUnit: success for drm/xe: Adjust the bo shrinker batch size (rev4) Patchwork
2026-10-16 14:37 ` ✓ Xe.CI.BAT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.