igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] tests/intel/xe_pmu: Tie preempt timeout to exec quantum
@ 2025-11-07 15:12 Jonathan Cavitt
  2025-11-07 15:24 ` Cavitt, Jonathan
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jonathan Cavitt @ 2025-11-07 15:12 UTC (permalink / raw)
  To: igt-dev; +Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo, michal.wajdeczko

When updating the exec quantum in enable_and_provision_vfs, update the
preempt timeout value to be equal to the exec quantum value.  Also,
reset the preempt timeout value on test end in
unprovision_and_disable_vfs.

v2:
- Multiply exec quantum by 1 instead of 2 to get the preempt timeout
  (Michal)
- Compress the vf and pf exec quantum and preempt timeout values into a
  single define (VF_EXEC_QUANTUM), and operate on that using a
  PF_MULTIPLIER and PT_TO_EQ_RATIO to generate the requested values for
  xe_sriov_set_exec_quantum_ms and xe_sriov_set_preempt_timeout_us in
  enable_and_provision_vfs (jcavitt)

v3:
- Revert conversion to defined macros and just add pf_preempt_timeout
  and vf_preempt_timeout as variables (Michal)

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

diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c
index 9525655ba2..bc6688744f 100644
--- a/tests/intel/xe_pmu.c
+++ b/tests/intel/xe_pmu.c
@@ -974,6 +974,7 @@ static void test_gt_frequency(int fd, struct drm_xe_engine_class_instance *eci)
 static unsigned int enable_and_provision_vfs(int fd)
 {
 	unsigned int gt, num_vfs;
+	int pf_preempt_timeout = 64000, vf_preempt_timeout = 32000;
 	int pf_exec_quantum = 64, vf_exec_quantum = 32, vf;
 
 	igt_require(igt_sriov_is_pf(fd));
@@ -987,12 +988,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 equal 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, fn ? vf_preempt_timeout :
+							pf_preempt_timeout);
+		}
 	}
 
 	/* probe VFs */
@@ -1011,8 +1018,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


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

end of thread, other threads:[~2025-11-19 15:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 15:12 [PATCH v3] tests/intel/xe_pmu: Tie preempt timeout to exec quantum Jonathan Cavitt
2025-11-07 15:24 ` Cavitt, Jonathan
2025-11-08  1:29 ` ✓ Xe.CI.BAT: success for tests/intel/xe_pmu: Tie preempt timeout to exec quantum (rev3) Patchwork
2025-11-08  1:46 ` ✗ i915.CI.BAT: failure " Patchwork
2025-11-14 15:35   ` Cavitt, Jonathan
2025-11-09  7:16 ` ✗ Xe.CI.Full: " Patchwork
2025-11-14 15:35   ` Cavitt, Jonathan
2025-11-19 15:15 ` [PATCH v3] tests/intel/xe_pmu: Tie preempt timeout to exec quantum Bernatowicz, Marcin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).