From patchwork Wed Dec 6 23:12:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10097387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB80F60329 for ; Wed, 6 Dec 2017 23:12:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DCD129ECE for ; Wed, 6 Dec 2017 23:12:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 929C129ED3; Wed, 6 Dec 2017 23:12:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B40429ECE for ; Wed, 6 Dec 2017 23:12:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AB7A89C1A; Wed, 6 Dec 2017 23:12:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BD0589C1A for ; Wed, 6 Dec 2017 23:12:35 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 9896052-1500050 for multiple; Wed, 06 Dec 2017 23:12:22 +0000 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Wed, 06 Dec 2017 23:12:23 +0000 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 6 Dec 2017 23:12:22 +0000 Message-Id: <20171206231222.10705-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.15.1 X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH igt] igt/perf_pmu: Tweak wait_for_rc6, yet again X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin --- 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