From patchwork Fri Mar 8 18:11:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10845261 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 33341922 for ; Fri, 8 Mar 2019 18:11:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 222D72F9BC for ; Fri, 8 Mar 2019 18:11:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16C712F9CE; Fri, 8 Mar 2019 18:11:54 +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 CDCA32F9BC for ; Fri, 8 Mar 2019 18:11:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CFA56E412; Fri, 8 Mar 2019 18:11:48 +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 70BF26E3B2 for ; Fri, 8 Mar 2019 18:11: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 15827693-1500050 for multiple; Fri, 08 Mar 2019 18:11:32 +0000 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Mar 2019 18:11:11 +0000 Message-Id: <20190308181129.15562-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 01/19] i915/gem_ppgtt: Estimate resource usage and bail if it means swapping! 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP fi-kbl-guc's swap ran dry while running blt-vs-render-ctxN, which is midly concerning but conceivable as we never checked there was enough memory to run the test to begin with. Each child needs to keep its own surface and possible a pair of logical contexts (one for rcs and one for bcs) so check that there is enough memory to allow all children to co-exist. During execution, we require another surface and batch, but these are temporary and so should fit fine with a small amount of thrashing on the boundary. References: https://bugs.freedesktop.org/show_bug.cgi?id=109801 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala --- tests/i915/gem_ppgtt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c index 11ca31e74..9409bef14 100644 --- a/tests/i915/gem_ppgtt.c +++ b/tests/i915/gem_ppgtt.c @@ -91,8 +91,14 @@ static void fork_rcs_copy(int timeout, uint32_t final, #define CREATE_CONTEXT 0x1 { igt_render_copyfunc_t render_copy; + uint64_t mem_per_child; int devid; + mem_per_child = SIZE; + if (flags & CREATE_CONTEXT) + mem_per_child += 2 * 128 * 1024; /* rough context sizes */ + intel_require_memory(mem_per_child, count, CHECK_RAM); + for (int child = 0; child < count; child++) { int fd = drm_open_driver(DRIVER_INTEL); drm_intel_bufmgr *bufmgr;