From: Shuicheng Lin <shuicheng.lin@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Shuicheng Lin" <shuicheng.lin@intel.com>,
Sashiko <sashiko-bot@kernel.org>,
stable@vger.kernel.org,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Matthew Brost" <matthew.brost@intel.com>
Subject: [PATCH v4 1/2] drm/xe/shrinker: Do not abort the walk on unshrinkable bos
Date: Tue, 1 Sep 2026 03:31:52 +0000 [thread overview]
Message-ID: <20260901033153.219481-2-shuicheng.lin@intel.com> (raw)
In-Reply-To: <20260901033153.219481-1-shuicheng.lin@intel.com>
xe_bo_shrink() returns -EBUSY for a bo that is simply not a candidate:
a kernel bo, a non-purgeable bo during the purge pass, or one that is
not eviction valuable. ttm_bo_shrink_suitable() does not filter those
out, so __xe_shrinker_walk() ends the walk at the first one it meets and
returns the error in place of the pages it had already freed.
xe_shrinker_walk() re-enters the walk for each escalation level, so the
remaining bos are usually still reached and the effect is repeated
restarts rather than lost reclaim.
Skip the bo on -EBUSY and keep walking, and on a real error report what
was already freed rather than dropping it.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: 00c8efc3180f ("drm/xe: Add a shrinker for xe bos")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
---
drivers/gpu/drm/xe/xe_shrinker.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c
index 83374cd57660..953a911b51b3 100644
--- a/drivers/gpu/drm/xe/xe_shrinker.c
+++ b/drivers/gpu/drm/xe/xe_shrinker.c
@@ -79,8 +79,10 @@ static s64 __xe_shrinker_walk(struct xe_device *xe,
continue;
lret = xe_bo_shrink(ctx, ttm_bo, flags, scanned);
+ if (lret == -EBUSY)
+ continue;
if (lret < 0)
- return lret;
+ return freed ? freed : lret;
freed += lret;
if (*scanned >= to_scan)
--
2.43.0
next prev parent reply other threads:[~2026-09-01 3:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 3:31 [PATCH v4 0/2] drm/xe/shrinker: Runtime PM and walk termination fixes Shuicheng Lin
2026-09-01 3:31 ` Shuicheng Lin [this message]
2026-09-01 3:42 ` [PATCH v4 1/2] drm/xe/shrinker: Do not abort the walk on unshrinkable bos 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-2-shuicheng.lin@intel.com \
--to=shuicheng.lin@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=thomas.hellstrom@linux.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.