From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Christian König" <christian.koenig@amd.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
intel-xe@lists.freedesktop.org,
"Dave Airlie" <airlied@redhat.com>,
"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 6.18.y 3/3] drm/xe: Don't abort the shrinker walk on -EBUSY
Date: Thu, 3 Dec 2026 19:54:09 -0500 [thread overview]
Message-ID: <20261204005309.1533197-3-sashal@kernel.org> (raw)
In-Reply-To: <20261204005309.1533197-1-sashal@kernel.org>
From: Thomas Hellström <thomas.hellstrom@linux.intel.com>
[ Upstream commit 9de430b6fbbdfeee1a5eec33edf53f52c13c869b ]
xe_bo_shrink() returns -EBUSY for bos that can't currently be shrunk,
for example imported dma-bufs, bos whose vm is currently validating,
bos that are still busy after the wait timeout, or bos whose backup
fails. The shrinker LRU walk treats any negative return value as
fatal and aborts, which also skips the remaining shrinker passes.
As a result, a single such bo, like an imported dma-buf on the
XE_PL_TT LRU, prevents reclaim of all bos behind it on the LRU.
Skip bos for which xe_bo_shrink() returns -EBUSY and continue the
walk, like the TTM LRU walk does.
v4:
- Patch introduced.
Fixes: 00c8efc3180f ("drm/xe: Add a shrinker for xe bos")
Cc: Christian König <christian.koenig@amd.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-xe@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.15+
Assisted-by: LLM
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261019095655.3501-2-thomas.hellstrom@linux.intel.com
(cherry picked from commit 846f333b3e0b48065f96bee74ffa0b9d390ed05f)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_shrinker.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c
index 7a3e6adb3220c..7c9a3bc46d1b3 100644
--- a/drivers/gpu/drm/xe/xe_shrinker.c
+++ b/drivers/gpu/drm/xe/xe_shrinker.c
@@ -113,6 +113,9 @@ static int __xe_shrinker_walk(struct xe_shrinker *shrinker,
continue;
lret = xe_bo_shrink(ctx, ttm_bo, flags, scanned);
+ /* Like the TTM LRU walk, skip bos we can't shrink now. */
+ if (lret == -EBUSY)
+ continue;
if (lret < 0) {
ret = lret;
goto out;
--
2.53.0
prev parent reply other threads:[~2026-12-04 0:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 10:54 FAILED: patch "[PATCH] drm/xe: Don't abort the shrinker walk on -EBUSY" failed to apply to 6.18-stable tree gregkh
2026-12-04 0:54 ` [PATCH 6.18.y 1/3] drm/xe/xe3p_lpg: flush shrinker bo cachelines manually Sasha Levin
2026-12-04 0:54 ` [PATCH 6.18.y 2/3] drm/xe/shrinker: Take a runtime PM ref before shrinking non-system memory Sasha Levin
2026-12-04 0:54 ` Sasha Levin [this message]
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=20261204005309.1533197-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=airlied@redhat.com \
--cc=christian.koenig@amd.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox