All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH igt] igt/perf_pmu: Tweak wait_for_rc6, yet again
Date: Wed,  6 Dec 2017 23:12:22 +0000	[thread overview]
Message-ID: <20171206231222.10705-1-chris@chris-wilson.co.uk> (raw)

Still CI remains obstinate that RC6 is not smoothly incrementing during
the sample period. Tweak the wait_for_rc6() to first wait for the
initial Evaluation Interval before polling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c         | 15 +++++++++++----
 tests/pm_rc6_residency.c | 15 +++++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index ff6568221..917832d1b 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1000,13 +1000,20 @@ static bool wait_for_rc6(int fd)
 	struct timespec tv = {};
 	uint64_t start, now;
 
-	start = pmu_read_single(fd);
+	/* First wait for roughly an RC6 Evaluation Interval */
+	usleep(160 * 1000);
+
+	/* Then poll for RC6 to start ticking */
+	now = pmu_read_single(fd);
 	do {
-		usleep(50);
+		start = now;
+		usleep(5000);
 		now = pmu_read_single(fd);
-	} while (start == now && !igt_seconds_elapsed(&tv));
+		if (now - start > 2e6)
+			return true;
+	} while (!igt_seconds_elapsed(&tv));
 
-	return start != now;
+	return false;
 }
 
 static void
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 16f4b1421..7cc62dac8 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -170,13 +170,20 @@ static bool wait_for_rc6(void)
 	struct timespec tv = {};
 	unsigned long start, now;
 
-	start = read_rc6_residency("rc6");
+	/* First wait for roughly an RC6 Evaluation Interval */
+        usleep(160 * 1000);
+
+        /* Then poll for RC6 to start ticking */
+	now = read_rc6_residency("rc6");
 	do {
-		usleep(50);
+		start = now;
+		usleep(5000);
 		now = read_rc6_residency("rc6");
-	} while (now == start && !igt_seconds_elapsed(&tv));
+		if (now - start > 2)
+			return true;
+	} while (!igt_seconds_elapsed(&tv));
 
-	return now != start;
+	return false;
 }
 
 igt_main
-- 
2.15.1

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

             reply	other threads:[~2017-12-06 23:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 23:12 Chris Wilson [this message]
2017-12-06 23:50 ` ✓ Fi.CI.BAT: success for igt/perf_pmu: Tweak wait_for_rc6, yet again Patchwork
2017-12-07  1:04 ` ✓ Fi.CI.IGT: " Patchwork
2017-12-07 10:25 ` [PATCH igt] " Tvrtko Ursulin
2017-12-07 10:35   ` Chris Wilson
2017-12-07 12:43     ` Tvrtko Ursulin

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=20171206231222.10705-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.