From patchwork Thu Jul 2 17:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11640043 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CD65739 for ; Thu, 2 Jul 2020 17:46:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 654E920702 for ; Thu, 2 Jul 2020 17:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 654E920702 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chris-wilson.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E3776E0F8; Thu, 2 Jul 2020 17:46:38 +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 5F19D6E0F8; Thu, 2 Jul 2020 17:46:35 +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 21693839-1500050 for multiple; Thu, 02 Jul 2020 18:46:20 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jul 2020 18:46:20 +0100 Message-Id: <20200702174620.230048-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200702123908.227124-1-chris@chris-wilson.co.uk> References: <20200702123908.227124-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] i915/perf: Instantiate a local drm_fd for the unprivileged helper 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: igt-dev@lists.freedesktop.org, Chris Wilson Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" While the test is blocked, we keep trying the gen12_single_ctx_helper(). As this is using the parent's drm_fd, all of our context allocations are persistent. Reopen the device in the child so that when we exit, our allocations are freed along with the process -- avoiding a total memory leak if the test is stuck. This does not explain why the test was stuck, it just prevents us from exacerbating the error condition. Hopefully leaving the system in a more debuggable state. References: https://gitlab.freedesktop.org/drm/intel/-/issues/2126 Signed-off-by: Chris Wilson Cc: Lionel Landwerlin Reviewed-by: Lionel Landwerlin --- tests/i915/perf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/i915/perf.c b/tests/i915/perf.c index d4ebae30d..92edc9f1f 100644 --- a/tests/i915/perf.c +++ b/tests/i915/perf.c @@ -4120,8 +4120,13 @@ gen12_test_single_ctx_render_target_writes_a_counter(void) do { igt_fork_helper(&child) { + /* A local device for local resources. */ + drm_fd = gem_reopen_driver(drm_fd); + igt_drop_root(); gen12_single_ctx_helper(); + + close(drm_fd); } child_ret = igt_wait_helper(&child); igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||