From patchwork Mon Dec 13 23:29:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Harrison X-Patchwork-Id: 12674871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C658DC433FE for ; Mon, 13 Dec 2021 23:29:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 268E710E9E9; Mon, 13 Dec 2021 23:29:28 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33BE110E905; Mon, 13 Dec 2021 23:29:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639438157; x=1670974157; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e3P6CCZWIEJ+WJBuR1EgDWMIuSI6jUofk7th+Gj+2CM=; b=jNqFD39jICFS+i57wmW4fc9hGz3yd9d1JabXb7jOFdH00XSnH6lfuHOh pJ98YIDENFYPMNJCiL9NHps1PSRw47DOoo5cU7Ywv0l8jfK7jJj8oosQH G7Io/ISGkSNe4kwFykNOKhLm2kDJa6xlZZErfWpifwQMInNem3OCec+eF 08+h1d6ycCAUmV0MDhXPnXzmavbd6IjdIWaTIu5KakKNmKGQaDfu6GRDy RQNnA0TS4bDDf3J4DNtVzy3wGc1HZXRqo/JzYJHdgLZgD7EGMW1kmrBgE ahACP+FEmr0dpeV4qfiG++JGRVZERO1FKiOVZzm88CtzkVBnGpbhTN96j A==; X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="299635177" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="299635177" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 15:29:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="517975939" Received: from relo-linux-5.jf.intel.com ([10.165.21.134]) by orsmga008.jf.intel.com with ESMTP; 13 Dec 2021 15:29:15 -0800 From: John.C.Harrison@Intel.com To: IGT-Dev@Lists.FreeDesktop.Org Date: Mon, 13 Dec 2021 15:29:12 -0800 Message-Id: <20211213232914.2523139-10-John.C.Harrison@Intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211213232914.2523139-1-John.C.Harrison@Intel.com> References: <20211213232914.2523139-1-John.C.Harrison@Intel.com> MIME-Version: 1.0 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH i-g-t 09/11] tests/i915/i915_hangman: Remove reliance on context persistance X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-GFX@Lists.FreeDesktop.Org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: John Harrison The hang test was relying on context persitence for no particular reason. That is, it would set a bunch of background spinners running then immediately destroy the active contexts but expect the spinners to keep spinning. With the current implementation of context persistence in i915, that means that super high priority pings are sent to each engine at the start of the test. Depending upon the timing and platform, one of those unexpected pings could cause test failures. There is no need to require context persitence in this test. So change to managing the contexts cleanly and only destroying them when they are no longer in use. Signed-off-by: John Harrison --- tests/i915/i915_hangman.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c index 4cb9b8b85..9bcf82dcd 100644 --- a/tests/i915/i915_hangman.c +++ b/tests/i915/i915_hangman.c @@ -287,27 +287,29 @@ test_engine_hang(const intel_ctx_t *ctx, const struct intel_execution_engine2 *e, unsigned int flags) { const struct intel_execution_engine2 *other; - const intel_ctx_t *tmp_ctx; + const intel_ctx_t *local_ctx[GEM_MAX_ENGINES]; igt_spin_t *spin, *next; IGT_LIST_HEAD(list); uint64_t ahnd = get_reloc_ahnd(device, ctx->id), ahndN; + int num_ctx; igt_skip_on(flags & IGT_SPIN_INVALID_CS && gem_engine_has_cmdparser(device, &ctx->cfg, e->flags)); /* Fill all the other engines with background load */ + num_ctx = 0; for_each_ctx_engine(device, ctx, other) { if (other->flags == e->flags) continue; - tmp_ctx = intel_ctx_create(device, &ctx->cfg); - ahndN = get_reloc_ahnd(device, tmp_ctx->id); + local_ctx[num_ctx] = intel_ctx_create(device, &ctx->cfg); + ahndN = get_reloc_ahnd(device, local_ctx[num_ctx]->id); spin = __igt_spin_new(device, .ahnd = ahndN, - .ctx = tmp_ctx, + .ctx = local_ctx[num_ctx], .engine = other->flags, .flags = IGT_SPIN_FENCE_OUT); - intel_ctx_destroy(device, tmp_ctx); + num_ctx++; igt_list_move(&spin->link, &list); } @@ -337,7 +339,10 @@ test_engine_hang(const intel_ctx_t *ctx, igt_spin_free(device, spin); put_ahnd(ahndN); } + put_ahnd(ahnd); + while (num_ctx) + intel_ctx_destroy(device, local_ctx[--num_ctx]); check_alive(); }