All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuicheng Lin <shuicheng.lin@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Subject: [PATCH v4 0/2] drm/xe/shrinker: Runtime PM and walk termination fixes
Date: Tue,  1 Sep 2026 03:31:51 +0000	[thread overview]
Message-ID: <20260901033153.219481-1-shuicheng.lin@intel.com> (raw)

The xe shrinker walks the SYSTEM and TT LRUs without a runtime PM
reference.  Shrinking a bo outside system memory invalidates its GPU
mappings, so with the device runtime suspended the page table zap trips
an assert and the TLB invalidation returns -ENODEV.  Patch 2 takes a
reference before walking a memory type other than XE_PL_SYSTEM.

Patch 1 is a separate problem found while reviewing that one:
xe_bo_shrink() returns -EBUSY for a bo that is simply not a shrink
candidate, and the walk treats it as fatal.  It is first in the series
because its Fixes commit is a year older, so it applies on its own to
stable trees that must not take patch 2.

Verified with igt@xe_madvise@dontneed-before-exec while the GPU is
runtime suspended:

  unmodified                            15/15 runs hit the WARN
  with patch 2                           0/15
  CI-like, device active, 10 runs        10 pass, 0 skip, no splats

ftrace confirms the new path executes, runtime_usage returns to 0, and
there are no lockdep reports.

For patch 1, tracing shows the walk continuing past the -EBUSY and
reclaiming two further bos that previously ended it.  Note that
xe_shrinker_walk() re-enters the walk for each escalation level, so the
bos are usually still reached on a later pass and the pages reported to
mm were unchanged in that test - the effect is repeated restarts rather
than lost reclaim.

Shuicheng Lin (2):
  drm/xe/shrinker: Do not abort the walk on unshrinkable bos
  drm/xe/shrinker: Take a runtime PM ref before shrinking non-system
    memory

 drivers/gpu/drm/xe/xe_shrinker.c | 42 +++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 9 deletions(-)

-- 
2.43.0


             reply	other threads:[~2026-09-01  3:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  3:31 Shuicheng Lin [this message]
2026-09-01  3:31 ` [PATCH v4 1/2] drm/xe/shrinker: Do not abort the walk on unshrinkable bos Shuicheng Lin
2026-09-01  3:42   ` sashiko-bot
2026-09-01  3:31 ` [PATCH v4 2/2] drm/xe/shrinker: Take a runtime PM ref before shrinking non-system memory Shuicheng Lin
2026-09-01  3:38 ` ✗ CI.checkpatch: warning for drm/xe/shrinker: Runtime PM and walk termination fixes Patchwork
2026-09-01  3:40 ` ✓ CI.KUnit: success " Patchwork
2026-09-01  4:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-01  5:21 ` ✗ Xe.CI.FULL: failure " 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=20260901033153.219481-1-shuicheng.lin@intel.com \
    --to=shuicheng.lin@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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.