Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jonathan.cavitt@intel.com, saurabhg.gupta@intel.com,
	alex.zuo@intel.com, michal.wajdeczko@intel.com
Subject: [PATCH] tests/intel/xe_pmu: Tie preempt timeout to exec quantum
Date: Thu,  6 Nov 2025 22:12:49 +0000	[thread overview]
Message-ID: <20251106221248.260255-2-jonathan.cavitt@intel.com> (raw)

When updating the exec quantum in enable_and_provision_vfs, update the
preempt timeout value to be double the exec quantum value.  Also, reset
the preempt timeout value on test end in unprovision_and_disable_vfs.
The value for the preempt timeout here was chosen because it's what
we've used historically for cases like this.

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
 tests/intel/xe_pmu.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c
index 9525655ba2..e7c2d82da4 100644
--- a/tests/intel/xe_pmu.c
+++ b/tests/intel/xe_pmu.c
@@ -987,12 +987,18 @@ static unsigned int enable_and_provision_vfs(int fd)
 	num_vfs = igt_sriov_get_enabled_vfs(fd);
 	igt_require(num_vfs == 2);
 
-	/* Set 32ms for VF execution quantum and 64ms for PF execution quantum */
+	/*
+	 * Set 32ms for VF execution quantum and 64ms for PF execution quantum.
+	 * Set the preempt timeout for the VF and PF to be double their execution quantum.
+	 */
 	xe_for_each_gt(fd, gt) {
 		xe_sriov_set_sched_if_idle(fd, gt, 0);
-		for (int fn = 0; fn <= num_vfs; fn++)
+		for (int fn = 0; fn <= num_vfs; fn++) {
 			xe_sriov_set_exec_quantum_ms(fd, fn, gt, fn ? vf_exec_quantum :
 						     pf_exec_quantum);
+			xe_sriov_set_preempt_timeout_us(fd, fn, gt, 2000 *
+							(fn ? vf_exec_quantum : pf_exec_quantum));
+		}
 	}
 
 	/* probe VFs */
@@ -1011,8 +1017,10 @@ static void unprovision_and_disable_vfs(int fd)
 
 	xe_for_each_gt(fd, gt) {
 		xe_sriov_set_sched_if_idle(fd, gt, 0);
-		for (int fn = 0; fn <= num_vfs; fn++)
+		for (int fn = 0; fn <= num_vfs; fn++) {
 			xe_sriov_set_exec_quantum_ms(fd, fn, gt, 0);
+			xe_sriov_set_preempt_timeout_us(fd, fn, gt, 0);
+		}
 	}
 
 	xe_sriov_disable_vfs_restore_auto_provisioning(fd);
-- 
2.43.0


             reply	other threads:[~2025-11-06 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 22:12 Jonathan Cavitt [this message]
2025-11-06 22:35 ` [PATCH] tests/intel/xe_pmu: Tie preempt timeout to exec quantum Michal Wajdeczko
2025-11-06 22:49   ` Cavitt, Jonathan
2025-11-06 23:23     ` Cavitt, Jonathan

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=20251106221248.260255-2-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=saurabhg.gupta@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