Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] drm/xe/shrinker: Runtime PM and freed page accounting fixes
@ 2026-09-01 17:30 Shuicheng Lin
  2026-09-01 17:30 ` [PATCH v5 1/2] drm/xe/shrinker: Do not discard freed pages on error Shuicheng Lin
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Shuicheng Lin @ 2026-09-01 17:30 UTC (permalink / raw)
  To: intel-xe; +Cc: Shuicheng Lin

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_shrinker_walk() and xe_shrinker_walk() return an error in place of
the pages they have already freed, so those pages are never reported to
mm while *scanned still counts them.  It comes first because its Fixes
commit is a year older and it applies on its own to stable trees that
must not take patch 2.

Since v4, patch 1 no longer skips bos that return -EBUSY.  That made the
walk traverse the whole LRU instead of stopping at to_scan, and it had
no measurable effect on the pages reported to mm, so only the accounting
fix is kept here.  Treating -EBUSY as fatal is still wrong and will be
revisited separately with a proper progress bound.

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.

Shuicheng Lin (2):
  drm/xe/shrinker: Do not discard freed pages on error
  drm/xe/shrinker: Take a runtime PM ref before shrinking non-system
    memory

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

-- 
2.43.0


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

end of thread, other threads:[~2026-09-01 20:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 17:30 [PATCH v5 0/2] drm/xe/shrinker: Runtime PM and freed page accounting fixes Shuicheng Lin
2026-09-01 17:30 ` [PATCH v5 1/2] drm/xe/shrinker: Do not discard freed pages on error Shuicheng Lin
2026-09-01 17:42   ` sashiko-bot
2026-09-01 17:30 ` [PATCH v5 2/2] drm/xe/shrinker: Take a runtime PM ref before shrinking non-system memory Shuicheng Lin
2026-09-01 17:41   ` sashiko-bot
2026-09-01 17:37 ` ✗ CI.checkpatch: warning for drm/xe/shrinker: Runtime PM and freed page accounting fixes Patchwork
2026-09-01 17:39 ` ✓ CI.KUnit: success " Patchwork
2026-09-01 18:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-01 20:12 ` ✗ Xe.CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox