summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSowmya Kaparthi <sowmyax.kaparthi@intel.com>2020-08-27 16:52:27 +0000
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2020-08-28 10:40:34 +0300
commit2a5db9f60241383272aeec176e1b97b3f487209f (patch)
tree7d847e1fe5c8f2b5474861b7c409a182bc649ed3
parent17641a0df4f4a37711a28a9aaf48c0de85ef53d4 (diff)
Fixing the latency of hrtimer
This test undergoes sanity check that we are not spending more than 1/100th of the time awake in the kernel. The right thing would be to adjust that value by the number of expected wakeups. We expect the kernel time not to exceed 1/100th of the total test duration at the default hrtimer of 200Hz/every5ms. Scale that by the provided hrtimer if applicable. Cc: Landwerlin, Lionel G <lionel.g.landwerlin@intel.com> Signed-off-by: Sowmya Kaparthi <sowmyax.kaparthi@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-rw-r--r--tests/i915/perf.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index a894fd38..20d0cc82 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -1993,6 +1993,7 @@ test_blocking(uint64_t requested_oa_period, bool set_kernel_hrtimer, uint64_t ke
int64_t start, end;
int n = 0;
+ uint64_t max_expected_kernel_ns;
stream_fd = __perf_open(drm_fd, &param, true /* prevent_pm */);
@@ -2098,7 +2099,13 @@ test_blocking(uint64_t requested_oa_period, bool set_kernel_hrtimer, uint64_t ke
*/
igt_assert(n > (min_iterations + n_extra_iterations));
- igt_assert(kernel_ns <= (test_duration_ns / 100ull));
+ if (set_kernel_hrtimer) {
+ max_expected_kernel_ns = kernel_hrtimer * (test_duration_ns / 100)
+ /(5 * 1000 * 1000);
+ } else {
+ max_expected_kernel_ns = test_duration_ns / 100;
+ }
+ igt_assert(kernel_ns <= max_expected_kernel_ns);
__perf_close(stream_fd);
}
@@ -2152,6 +2159,7 @@ test_polling(uint64_t requested_oa_period, bool set_kernel_hrtimer, uint64_t ker
int min_iterations = (test_duration_ns / (oa_period + (kernel_hrtimer + kernel_hrtimer / 5)));
int64_t start, end;
int n = 0;
+ uint64_t max_expected_kernel_ns;
stream_fd = __perf_open(drm_fd, &param, true /* prevent_pm */);
@@ -2286,7 +2294,13 @@ test_polling(uint64_t requested_oa_period, bool set_kernel_hrtimer, uint64_t ker
*/
igt_assert(n > (min_iterations + n_extra_iterations));
- igt_assert(kernel_ns <= (test_duration_ns / 100ull));
+ if (set_kernel_hrtimer) {
+ max_expected_kernel_ns = kernel_hrtimer * (test_duration_ns / 100)
+ /(5 * 1000 * 1000);
+ } else {
+ max_expected_kernel_ns = test_duration_ns / 100;
+ }
+ igt_assert(kernel_ns <= max_expected_kernel_ns);
__perf_close(stream_fd);
}