[PATCH i-g-t] i915/perf_pmu: Cap target number of interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Limit the maximum number of interrupts in order to avoid overburdening
older CPUs and GPUs.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 tests/perf_pmu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 33fb4d653..e1bbf2410 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1274,11 +1274,15 @@ static void cpu_hotplug(int gem_fd)
 	assert_within_epsilon(val, ts[1] - ts[0], tolerance);
 }
 
+static int target_num_interrupts(int i915)
+{
+	return min(gem_measure_ring_inflight(i915, I915_EXEC_DEFAULT, 0), 30);
+}
+
 static void
 test_interrupts(int gem_fd)
 {
-	const int target =
-		gem_measure_ring_inflight(gem_fd, I915_EXEC_DEFAULT, 0);
+	const int target = target_num_interrupts(gem_fd);
 	const unsigned int test_duration_ms = 1000;
 	igt_spin_t *spin[target];
 	struct pollfd pfd;
@@ -1342,8 +1346,7 @@ test_interrupts(int gem_fd)
 static void
 test_interrupts_sync(int gem_fd)
 {
-	const int target =
-		gem_measure_ring_inflight(gem_fd, I915_EXEC_DEFAULT, 0);
+	const int target = target_num_interrupts(gem_fd);
 	const unsigned int test_duration_ms = 1000;
 	igt_spin_t *spin[target];
 	struct pollfd pfd;
-- 
2.24.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux