All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>
Subject: [PATCH v3 0/3] drm/xe: Adjust the bo shrinker batch size
Date: Thu,  8 Oct 2026 14:30:21 +0200	[thread overview]
Message-ID: <20261008123024.38522-1-thomas.hellstrom@linux.intel.com> (raw)

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


             reply	other threads:[~2026-10-08 12:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 12:30 Thomas Hellström [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261008123024.38522-1-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.