From patchwork Tue Aug 6 08:49:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11078453 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 AA80314DB for ; Tue, 6 Aug 2019 08:49:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A54C2890B for ; Tue, 6 Aug 2019 08:49:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EA4A2891B; Tue, 6 Aug 2019 08:49:49 +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 4FB842890B for ; Tue, 6 Aug 2019 08:49:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E59896E334; Tue, 6 Aug 2019 08:49: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 409AE6E330; Tue, 6 Aug 2019 08:49:46 +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 17901204-1500050 for multiple; Tue, 06 Aug 2019 09:49:39 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 6 Aug 2019 09:49:39 +0100 Message-Id: <20190806084939.20203-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20190806081052.11564-1-chris@chris-wilson.co.uk> References: <20190806081052.11564-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] i915/gem_persistent_relocs: Don't call DROP_IDLE in the middle of submitting 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 To actually DROP_IDLE means that we have to wait for ongoing submission, and any new concurrently submitted, i.e. it should only be called during single-threaded submission to ensure the GPU is idle before the new action. v2: Also include SHRINK for thrash-all-the-things, and find a dupe in gem_reloc_vs_gpu. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala --- tests/i915/gem_persistent_relocs.c | 9 ++++++--- tests/i915/gem_reloc_vs_gpu.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/i915/gem_persistent_relocs.c b/tests/i915/gem_persistent_relocs.c index 452fe686e..dff4e9a76 100644 --- a/tests/i915/gem_persistent_relocs.c +++ b/tests/i915/gem_persistent_relocs.c @@ -281,10 +281,13 @@ static void do_forked_test(int fd, unsigned flags) struct igt_helper_process thrasher = {}; if (flags & (THRASH | THRASH_INACTIVE)) { - uint64_t val = (flags & THRASH_INACTIVE) ? - (DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL; - igt_fork_helper(&thrasher) { + uint64_t val; + + val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND; + if (!(flags & THRASH_INACTIVE)) + val |= DROP_ACTIVE | DROP_SHRINK_ALL; + while (1) { usleep(1000); igt_drop_caches_set(fd, val); diff --git a/tests/i915/gem_reloc_vs_gpu.c b/tests/i915/gem_reloc_vs_gpu.c index d421e4340..328730a9b 100644 --- a/tests/i915/gem_reloc_vs_gpu.c +++ b/tests/i915/gem_reloc_vs_gpu.c @@ -258,10 +258,13 @@ static void do_forked_test(int fd, unsigned flags) igt_require_hang_ring(fd, I915_EXEC_BLT); if (flags & (THRASH | THRASH_INACTIVE)) { - uint64_t val = (flags & THRASH_INACTIVE) ? - (DROP_RETIRE | DROP_BOUND | DROP_UNBOUND) : DROP_ALL; - igt_fork_helper(&thrasher) { + uint64_t val; + + val = DROP_RETIRE | DROP_BOUND | DROP_UNBOUND; + if (!(flags & THRASH_INACTIVE)) + val |= DROP_ACTIVE | DROP_SHRINK_ALL; + while (1) { usleep(1000); igt_drop_caches_set(fd, val);