From patchwork Mon Dec 4 17:23:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Argenziano X-Patchwork-Id: 10091167 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 A023D600C5 for ; Mon, 4 Dec 2017 17:23:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88052285CA for ; Mon, 4 Dec 2017 17:23:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CF9228B74; Mon, 4 Dec 2017 17:23:37 +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 40160285CA for ; Mon, 4 Dec 2017 17:23:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D246C6E3A7; Mon, 4 Dec 2017 17:23:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 290A96E3A7 for ; Mon, 4 Dec 2017 17:23:35 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2017 09:23:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,359,1508828400"; d="scan'208";a="8934743" Received: from relo-linux-2.fm.intel.com ([10.1.27.122]) by FMSMGA003.fm.intel.com with ESMTP; 04 Dec 2017 09:23:35 -0800 From: Antonio Argenziano To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Dec 2017 09:23:14 -0800 Message-Id: <20171204172315.25487-2-antonio.argenziano@intel.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204172315.25487-1-antonio.argenziano@intel.com> References: <20171204172315.25487-1-antonio.argenziano@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/3] tests/gem_exec_schedule: Add reset on failed preemption test. 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 This patch adds a test where a low priority batch is going to be declared hung while a preemption is pending. The test wants to verify that a 'bad' low priority batch will not disrupt the execution of a high priority context and that the driver does due diligence in managing a reset while a preemption is pending. Cc: Chris Wilson Cc: Michal Winiarski Signed-off-by: Antonio Argenziano --- tests/gem_exec_schedule.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/gem_exec_schedule.c b/tests/gem_exec_schedule.c index 1e6b0ae7..ae44a6c0 100644 --- a/tests/gem_exec_schedule.c +++ b/tests/gem_exec_schedule.c @@ -356,7 +356,8 @@ static void promotion(int fd, unsigned ring) munmap(ptr, 4096); } -#define NEW_CTX 0x1 +#define NEW_CTX (0x1 << 0) +#define HANG_LP (0x1 << 1) static void preempt(int fd, unsigned ring, unsigned flags) { uint32_t result = gem_create(fd, 4096); @@ -370,6 +371,9 @@ static void preempt(int fd, unsigned ring, unsigned flags) ctx[HI] = gem_context_create(fd); gem_context_set_priority(fd, ctx[HI], MAX_PRIO); + if (flags & HANG_LP) + igt_spin_batch_new(fd, ctx[LO], ring, 0, false); + for (int n = 0; n < 16; n++) { if (flags & NEW_CTX) { gem_context_destroy(fd, ctx[LO]); @@ -1023,6 +1027,12 @@ igt_main igt_subtest_f("preempt-self-%s", e->name) preempt_self(fd, e->exec_id | e->flags); + + igt_subtest_f("preempt-bad-%s", e->name) { + igt_stop_hang_detector(); + preempt(fd, e->exec_id | e->flags, NEW_CTX | HANG_LP); + igt_fork_hang_detector(fd); + } } igt_subtest_f("deep-%s", e->name)