From patchwork Wed Aug 8 11:31: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: 10559773 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 D570D139A for ; Wed, 8 Aug 2018 11:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B40862A8D3 for ; Wed, 8 Aug 2018 11:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5FEA2A8EA; Wed, 8 Aug 2018 11:31:51 +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 577572A8D3 for ; Wed, 8 Aug 2018 11:31:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57A4A6E52D; Wed, 8 Aug 2018 11:31:49 +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 08F426E52D; Wed, 8 Aug 2018 11:31:47 +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 12713360-1500050 for multiple; Wed, 08 Aug 2018 12:31:38 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Aug 2018 12:31:37 +0100 Message-Id: <20180808113137.3747-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.18.0 Subject: [Intel-gfx] [PATCH i-g-t] igt/gem_eio: Preserve batch between reset-stress iterations 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 We can keep the original batch around and avoid recreating it between reset iterations to focus on the impact of resets. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin --- tests/gem_eio.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tests/gem_eio.c b/tests/gem_eio.c index de161332d..5250a414c 100644 --- a/tests/gem_eio.c +++ b/tests/gem_eio.c @@ -650,35 +650,38 @@ static void reset_stress(int fd, uint32_t ctx0, unsigned int engine, unsigned int flags) { + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 obj = { + .handle = gem_create(fd, 4096) + }; + struct drm_i915_gem_execbuffer2 execbuf = { + .buffers_ptr = to_user_pointer(&obj), + .buffer_count = 1, + .flags = engine, + }; + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + igt_until_timeout(5) { - struct drm_i915_gem_execbuffer2 execbuf = { }; - struct drm_i915_gem_exec_object2 obj = { }; - uint32_t bbe = MI_BATCH_BUFFER_END; + uint32_t ctx = context_create_safe(fd); igt_spin_t *hang; unsigned int i; - uint32_t ctx; gem_quiescent_gpu(fd); igt_require(i915_reset_control(flags & TEST_WEDGE ? false : true)); - ctx = context_create_safe(fd); - /* * Start executing a spin batch with some queued batches * against a different context after it. */ hang = spin_sync(fd, ctx0, engine); - obj.handle = gem_create(fd, 4096); - gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + execbuf.rsvd1 = ctx; + for (i = 0; i < 10; i++) + gem_execbuf(fd, &execbuf); - execbuf.buffers_ptr = to_user_pointer(&obj); - execbuf.buffer_count = 1; execbuf.rsvd1 = ctx0; - execbuf.flags = engine; - for (i = 0; i < 10; i++) gem_execbuf(fd, &execbuf); @@ -706,8 +709,9 @@ static void reset_stress(int fd, gem_sync(fd, obj.handle); igt_spin_batch_free(fd, hang); gem_context_destroy(fd, ctx); - gem_close(fd, obj.handle); } + + gem_close(fd, obj.handle); } /*