All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] drm/xe: Adjust the bo shrinker batch size
@ 2026-10-08 12:30 Thomas Hellström
  2026-10-08 12:30 ` [PATCH v3 1/3] drm/xe: Track number of populated ttm_tts in the shrinker Thomas Hellström
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Thomas Hellström @ 2026-10-08 12:30 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.

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 2/3: new patch, splitting the bo shrinker into purgeable and
  non-purgeable shrinkers, per a suggestion from Matthew Brost.
- Patch 3/3: 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.

Thomas Hellström (3):
  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 | 172 ++++++++++++++++++++++---------
 drivers/gpu/drm/xe/xe_shrinker.h |   3 +-
 3 files changed, 129 insertions(+), 58 deletions(-)

-- 
2.56.0


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

end of thread, other threads:[~2026-10-08 14:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08 12:30 [PATCH v3 0/3] drm/xe: Adjust the bo shrinker batch size Thomas Hellström
2026-10-08 12:30 ` [PATCH v3 1/3] drm/xe: Track number of populated ttm_tts in the shrinker Thomas Hellström
2026-10-08 12:44   ` sashiko-bot
2026-10-08 12:30 ` [PATCH v3 2/3] drm/xe: Split the bo shrinker into purgeable and non-purgeable shrinkers Thomas Hellström
2026-10-08 12:46   ` sashiko-bot
2026-10-08 12:30 ` [PATCH v3 3/3] drm/xe: Update non-purgeable shrinker batch size based on average BO size Thomas Hellström
2026-10-08 13:17 ` ✓ CI.KUnit: success for drm/xe: Adjust the bo shrinker batch size (rev3) Patchwork
2026-10-08 14:00 ` ✓ 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.