Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org,
	thomas.hellstrom@linux.intel.com,
	himal.prasad.ghimiray@intel.com
Subject: [PATCH v2 4/5] drm/xe: Timeslice GPU on atomic SVM fault
Date: Wed, 16 Apr 2025 21:13:39 -0700	[thread overview]
Message-ID: <20250417041340.479973-5-matthew.brost@intel.com> (raw)
In-Reply-To: <20250417041340.479973-1-matthew.brost@intel.com>

Ensure GPU can make forward progress on an atomic SVM GPU fault by
giving the GPU a timeslice of 5ms

v2:
 - Reduce timeslice to 5ms
 - Double timeslice on retry
 - Split out GPU SVM changes into independent patch

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

diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index 1cc41ce7b684..4b0e0820153a 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -780,6 +780,7 @@ int xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
 		.check_pages_threshold = IS_DGFX(vm->xe) &&
 			IS_ENABLED(CONFIG_DRM_XE_DEVMEM_MIRROR) ? SZ_64K : 0,
 		.vram_only = atomic,
+		.timeslice_ms = atomic ? 5 : 0,
 	};
 	struct xe_svm_range *range;
 	struct drm_gpusvm_range *r;
@@ -816,6 +817,7 @@ int xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
 	if (--migrate_try_count >= 0 &&
 	    xe_svm_range_needs_migrate_to_vram(range, vma)) {
 		err = xe_svm_alloc_vram(vm, tile, range, &ctx);
+		ctx.timeslice_ms <<= 1;	/* Double timeslice if we have to retry */
 		if (err) {
 			if (migrate_try_count || !ctx.vram_only) {
 				drm_dbg(&vm->xe->drm,
-- 
2.34.1


  parent reply	other threads:[~2025-04-17  4:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17  4:13 [PATCH v2 0/5] Enable SVM atomics in Xe / GPU SVM Matthew Brost
2025-04-17  4:13 ` [PATCH v2 1/5] drm/gpusvm: Introduce vram_only flag for VRAM allocation Matthew Brost
2025-04-17  4:13 ` [PATCH v2 2/5] drm/xe: Strict migration policy for atomic SVM faults Matthew Brost
2025-04-21  6:39   ` Ghimiray, Himal Prasad
2025-04-22 15:21     ` Matthew Brost
2025-04-17  4:13 ` [PATCH v2 3/5] drm/gpusvm: Add timeslicing support to GPU SVM Matthew Brost
2025-04-17  4:13 ` Matthew Brost [this message]
2025-04-17  4:13 ` [PATCH v2 5/5] drm/xe: Add atomic_svm_timeslice_ms debugfs entry Matthew Brost
2025-04-17  4:33 ` ✓ CI.Patch_applied: success for Enable SVM atomics in Xe / GPU SVM (rev2) Patchwork
2025-04-17  4:33 ` ✓ CI.checkpatch: " Patchwork
2025-04-17  4:34 ` ✓ CI.KUnit: " Patchwork
2025-04-17  4:43 ` ✓ CI.Build: " Patchwork
2025-04-17  4:45 ` ✓ CI.Hooks: " Patchwork
2025-04-17  4:47 ` ✓ CI.checksparse: " Patchwork
2025-04-17  5:17 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-17 19:12 ` ✗ Xe.CI.Full: failure " Patchwork

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=20250417041340.479973-5-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.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