summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2026-10-19 11:56:52 +0200
committerDave Airlie <airlied@redhat.com>2026-11-09 19:17:56 +1000
commit9de430b6fbbdfeee1a5eec33edf53f52c13c869b (patch)
treee7273fbd4e9420dbd99eea539b50bd4151a936fb /drivers/gpu
parentf8795bced27bb00d74cef9de33e8a5e939c05e02 (diff)
downloadlinux-9de430b6fbbdfeee1a5eec33edf53f52c13c869b.tar.gz
linux-9de430b6fbbdfeee1a5eec33edf53f52c13c869b.zip
drm/xe: Don't abort the shrinker walk on -EBUSY
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/xe_shrinker.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c
index deb4378c1ec1..4e4da76936f4 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;