From patchwork Wed May 30 10:33:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10438407 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 AB7D2601E9 for ; Wed, 30 May 2018 10:56:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BA7F2893A for ; Wed, 30 May 2018 10:56:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EE6F2893E; Wed, 30 May 2018 10:56:21 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 1A5D02893A for ; Wed, 30 May 2018 10:56:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 216A273962; Wed, 30 May 2018 10:33:28 +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 A9E4073962; Wed, 30 May 2018 10:33:25 +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 11886163-1500050 for multiple; Wed, 30 May 2018 11:33:16 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Wed, 30 May 2018 11:33:18 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 30 May 2018 11:33:13 +0100 Message-Id: <20180530103314.30565-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530103314.30565-1-chris@chris-wilson.co.uk> References: <20180530103314.30565-1-chris@chris-wilson.co.uk> X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH i-g-t 2/3] lib: Align ring measurement to timer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP After hitting the SIGINT from execbuf, wait until the next timer signal before trying again. This aligns the start of the ioctl to the timer, hopefully maximising the amount of time we have for processing before the next signal -- trying to prevent the case where we are scheduled out in the middle of processing and so hit the timer signal too early. References: https://bugs.freedesktop.org/show_bug.cgi?id=106695 Signed-off-by: Chris Wilson Acked-by: Antonio Argenziano --- lib/i915/gem_ring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c index 7d64165eb..0c061000c 100644 --- a/lib/i915/gem_ring.c +++ b/lib/i915/gem_ring.c @@ -96,6 +96,8 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags if (last == count) break; + /* sleep until the next timer interrupt (woken on signal) */ + pause(); last = count; } while (1);