Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/gpusvm: Limit the number of retries in drm_gpusvm_get_pages
@ 2025-11-22  1:25 Matthew Brost
  2025-11-22  1:25 ` [PATCH 2/2] drm/xe: Covert return of -EBUSY to -ENOMEM in VM bind IOCTL Matthew Brost
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Matthew Brost @ 2025-11-22  1:25 UTC (permalink / raw)
  To: intel-xe

drm_gpusvm_get_pages should not be allowed to retry forever, cap the
time spent in the function to HMM_RANGE_DEFAULT_TIMEOUT has this is
essentially a wrapper around hmm_range_fault.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_gpusvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index 73e550c8ff8c..39c8c50401dd 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -1288,6 +1288,9 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 							   DMA_BIDIRECTIONAL;
 
 retry:
+	if (time_after(jiffies, timeout))
+		return -EBUSY;
+
 	hmm_range.notifier_seq = mmu_interval_read_begin(notifier);
 	if (drm_gpusvm_pages_valid_unlocked(gpusvm, svm_pages))
 		goto set_seqno;
-- 
2.34.1


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

end of thread, other threads:[~2025-11-26  3:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-22  1:25 [PATCH 1/2] drm/gpusvm: Limit the number of retries in drm_gpusvm_get_pages Matthew Brost
2025-11-22  1:25 ` [PATCH 2/2] drm/xe: Covert return of -EBUSY to -ENOMEM in VM bind IOCTL Matthew Brost
2025-11-24  6:09   ` Upadhyay, Tejas
2025-11-24 21:42 ` ✓ CI.KUnit: success for series starting with [1/2] drm/gpusvm: Limit the number of retries in drm_gpusvm_get_pages Patchwork
2025-11-24 22:20 ` ✓ Xe.CI.BAT: " Patchwork
2025-11-25  0:45 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-26  3:16 ` [PATCH 1/2] " Ghimiray, Himal Prasad

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