* [PATCH v4 1/4] drm/xe: Don't abort the shrinker walk on -EBUSY [not found] <20261016133523.3622-1-thomas.hellstrom@linux.intel.com> @ 2026-10-16 13:35 ` Thomas Hellström 2026-10-16 13:55 ` Matthew Brost 0 siblings, 1 reply; 2+ messages in thread From: Thomas Hellström @ 2026-10-16 13:35 UTC (permalink / raw) To: intel-xe Cc: Thomas Hellström, Christian König, Matthew Brost, Rodrigo Vivi, stable, Matthew Auld, Maarten Lankhorst 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> --- 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 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; -- 2.56.0 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4 1/4] drm/xe: Don't abort the shrinker walk on -EBUSY 2026-10-16 13:35 ` [PATCH v4 1/4] drm/xe: Don't abort the shrinker walk on -EBUSY Thomas Hellström @ 2026-10-16 13:55 ` Matthew Brost 0 siblings, 0 replies; 2+ messages in thread From: Matthew Brost @ 2026-10-16 13:55 UTC (permalink / raw) To: Thomas Hellström Cc: intel-xe, Christian König, Rodrigo Vivi, stable, Matthew Auld, Maarten Lankhorst On Fri, Oct 16, 2026 at 03:35:20PM +0200, Thomas Hellström wrote: > 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> I noticed this on as well. Reviewed-by: 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> > --- > 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 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; > -- > 2.56.0 > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-16 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261016133523.3622-1-thomas.hellstrom@linux.intel.com>
2026-10-16 13:35 ` [PATCH v4 1/4] drm/xe: Don't abort the shrinker walk on -EBUSY Thomas Hellström
2026-10-16 13:55 ` Matthew Brost
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox