Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe: Keep walking on SVM eviction failure
@ 2026-09-17 20:31 Matthew Brost
  2026-09-17 22:03 ` ✓ CI.KUnit: success for drm/xe: Keep walking on SVM eviction failure (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthew Brost @ 2026-09-17 20:31 UTC (permalink / raw)
  To: intel-xe; +Cc: stable

The desired behavior for SVM eviction failures, which can occur due to
various uncontrollable races, is for TTM to continue walking the LRU
list and look for another eviction candidate. This is expressed by
returning -ENOSPC from the ->move() callback.

Adjust the SVM eviction failure path because of races in ->move() to
return -ENOSPC so that TTM continues searching for another buffer to
evict.

Fixes: 3ca608dc7561 ("drm/xe: Basic SVM BO eviction")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>

---
v2:
 - Only convert -EBUSY (races) to -ENOSPC
---
 drivers/gpu/drm/xe/xe_bo.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 9f3f0cb95afa..f2ab9bf43a86 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1044,6 +1044,13 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
 		} else {
 			drm_dbg(&xe->drm, "Evict system allocator BO failed=%pe\n",
 				ERR_PTR(ret));
+			/*
+			 * The semantic we want upon SVM eviction failure
+			 * because of racing access is keep walking for
+			 * eviction, which is -ENOSPC.
+			 */
+			if (ret == -EBUSY)
+				ret = -ENOSPC;
 		}
 
 		goto out;
-- 
2.34.1


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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 20:31 [PATCH v2] drm/xe: Keep walking on SVM eviction failure Matthew Brost
2026-09-17 22:03 ` ✓ CI.KUnit: success for drm/xe: Keep walking on SVM eviction failure (rev2) Patchwork
2026-09-17 23:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-18  3:24 ` [PATCH v2] drm/xe: Keep walking on SVM eviction failure Ghimiray, Himal Prasad
2026-09-18  4:12 ` ✓ Xe.CI.FULL: success for drm/xe: Keep walking on SVM eviction failure (rev2) Patchwork

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