From patchwork Wed Sep 12 11:14:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10597379 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EAA8A13B8 for ; Wed, 12 Sep 2018 11:14:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D041E27165 for ; Wed, 12 Sep 2018 11:14:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C33E7286E5; Wed, 12 Sep 2018 11:14:48 +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 885A527165 for ; Wed, 12 Sep 2018 11:14:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B4AE89FD3; Wed, 12 Sep 2018 11:14:47 +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 11C5F89FD3; Wed, 12 Sep 2018 11:14:44 +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 13742727-1500050 for multiple; Wed, 12 Sep 2018 12:14:36 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 12 Sep 2018 12:14:37 +0100 Message-Id: <20180912111437.21323-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] igt/gem_exec_await: Flush vm caches between runs 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 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP On allocating a request, we apply some backpressure if we fail to allocate a request. The backpressure we apply involves waiting for the device to idle, causing a stall on the clients (trying to throttle heavy allocators) and as we may be inside a plugged critical section, the only way to idle the GPU is by waiting for hangcheck to kick in. Try to avoid the allocation failure by trimming the VM caches between iterations. References: https://bugs.freedesktop.org/show_bug.cgi?id=106680 Signed-off-by: Chris Wilson --- tests/gem_exec_await.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/gem_exec_await.c b/tests/gem_exec_await.c index 5cfeb8ec8..b9a2c6105 100644 --- a/tests/gem_exec_await.c +++ b/tests/gem_exec_await.c @@ -147,6 +147,13 @@ static void wide(int fd, int ring_size, int timeout, unsigned int flags) count = 0; igt_until_timeout(timeout) { struct timespec start, now; + + /* + * Flush all caches between runs, we do not want to encounter + * reclaim in the middle of the plugged critical section. + */ + intel_purge_vm_caches(fd); + for (unsigned e = 0; e < nengine; e++) { uint64_t address; int i;