Skip to contentSkip to conversation

tests/intel/xe_pmu: Update preempt timeout when sched_is_idle

PATCH In review Jonathan Cavitt 2 participants 2 messages Nov 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/intel/xe_pmu: Update preempt timeout when sched_is_idle

It's necessary for the VF/PF preempt timeout to not be infinity when sched_is_idle is active, so update the value to be twice the exec quantum during the fn-engine-activity-sched-is-idle subtest. This value is chosen because it's what we've used historically in cases like this.

Since we only want to update this value when sched_is_idle is active, this necessitates a minor rework of how the test is initialized, but test functionality is otherwise unmodified.

---
 tests/intel/xe_pmu.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
tests/intel/xe_pmu.c +13 -2
index 9525655ba2..2150c314b6 100644
@@ -1192,9 +1192,20 @@ igt_main
 
 		igt_describe("Validate per-function engine activity when sched-if-idle is set");
 		test_each_engine("fn-engine-activity-sched-if-idle", fd, eci) {
-			xe_sriov_set_sched_if_idle(fd, eci->gt_id, 1);
-			for (int fn = 0; fn < num_fns; fn++)
+			int preempt_timeout_us;
+			for (int fn = 0; fn < num_fns; fn++) {
+				preempt_timeout_us = 2000 *
+						    xe_sriov_get_exec_quantum_ms(fd, fn,
+										 eci->gt_id);
+				xe_sriov_set_preempt_timeout_us(fd, fn, eci->gt_id,
+								preempt_timeout_us);
+				xe_sriov_set_sched_if_idle(fd, eci->gt_id, 1);
+
 				engine_activity_fn(fd, eci, fn);
+
+				xe_sriov_set_sched_if_idle(fd, eci->gt_id, 0);
+				xe_sriov_set_preempt_timeout_us(fd, fn, eci->gt_id, 0);
+			}
 		}
 
 		igt_fixture
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Jonathan Cavitt

It's necessary for the VF/PF preempt timeout to not be infinity when sched_is_idle is active, so update the value to be twice the exec quantum during the fn-engine-activity-sched-is-idle subtest. This value is chosen because it's what we've used historically in cases like this.

we should setup PT together with EQ
for this test it should be done in enable_and_provision_vfs()

Quoted 38 lines

Since we only want to update this value when sched_is_idle is active, this necessitates a minor rework of how the test is initialized, but test functionality is otherwise unmodified.

---
 tests/intel/xe_pmu.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
tests/intel/xe_pmu.c +13 -2
index 9525655ba2..2150c314b6 100644
@@ -1192,9 +1192,20 @@ igt_main
 
 		igt_describe("Validate per-function engine activity when sched-if-idle is set");
 		test_each_engine("fn-engine-activity-sched-if-idle", fd, eci) {
-			xe_sriov_set_sched_if_idle(fd, eci->gt_id, 1);
-			for (int fn = 0; fn < num_fns; fn++)
+			int preempt_timeout_us;
+			for (int fn = 0; fn < num_fns; fn++) {
+				preempt_timeout_us = 2000 *
+						    xe_sriov_get_exec_quantum_ms(fd, fn,
+										 eci->gt_id);
+				xe_sriov_set_preempt_timeout_us(fd, fn, eci->gt_id,
+								preempt_timeout_us);
+				xe_sriov_set_sched_if_idle(fd, eci->gt_id, 1);
+
 				engine_activity_fn(fd, eci, fn);
+
+				xe_sriov_set_sched_if_idle(fd, eci->gt_id, 0);
+				xe_sriov_set_preempt_timeout_us(fd, fn, eci->gt_id, 0);
+			}
 		}
 
 		igt_fixture