From patchwork Thu Nov 21 10:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13881839 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 6DD4AD6ED00 for ; Thu, 21 Nov 2024 10:41:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0759F10E8DF; Thu, 21 Nov 2024 10:41:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="CPXIA7jc"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id C653E10E8E0; Thu, 21 Nov 2024 10:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732185705; x=1763721705; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z6Ar+/x2+ubkfntXhieRnaRBMOLWlRceSxfJKEFKE8g=; b=CPXIA7jcdwHYbde3B34IfCn1nH5dcETY7BCZ7tUCDIgw6tIqUFKHANo+ DMcNmmyQuBV9UIUVp6MCwy/7rDi9jMUlzFsH3NZNgqWWI5rJ9i7lWOgqN 9viCv4+A5pjT5KLuGptjcCMt+XcD5LG7ajZ0Bhp4SghRYM6WAS68vj6rq o1RFf7s07Ct5C0QbJRAFRrjK5U7N+FEtXeiugRXYZaAKZUOAJHXdcLDke lHAt8INo4QUu9PVk5y4oo3E5xqumXWfHt4ZDvuoQt3VpQIpgzuXw8wVvQ ETTHiv84/kPMzbIRX2UmwW6kWXO4cv3norp9PBcFGvMb/xm1RD9fr/401 w==; X-CSE-ConnectionGUID: l7JpyObwSkuHqMMz0neulQ== X-CSE-MsgGUID: bXKqs9ekQwCK5HbbHAFpYQ== X-IronPort-AV: E=McAfee;i="6700,10204,11262"; a="32406868" X-IronPort-AV: E=Sophos;i="6.12,172,1728975600"; d="scan'208";a="32406868" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2024 02:41:44 -0800 X-CSE-ConnectionGUID: nvKE0PyUTPGYSWS/qRLFfQ== X-CSE-MsgGUID: rdAvhzgGSwWTClTn5mDppQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,172,1728975600"; d="scan'208";a="91022948" Received: from jkrzyszt-mobl2.ger.corp.intel.com ([10.245.246.105]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2024 02:41:41 -0800 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, Kamil Konieczny , =?utf-8?q?Zbigniew_Kempc?= =?utf-8?q?zy=C5=84ski?= , Chris Wilson , Janusz Krzysztofik Subject: [PATCH i-g-t 2/2] tests/gem_mmap_offset: Fix OOM hits Date: Thu, 21 Nov 2024 11:39:28 +0100 Message-ID: <20241121104039.314188-6-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241121104039.314188-4-janusz.krzysztofik@linux.intel.com> References: <20241121104039.314188-4-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The 'clear' subtest exercises correctness of object memory clearing on passing a batch with the object to GPU for processing. The exercise is executed in several parallel threads, one per CPU. Each thread repeats the exercise in a time only limited loop, with no delay between consecutive iterations. In case of system memory objects, that happens to exhaust all available physical memory, which is neither the goal nor requirement of the exercise. Make sure sufficient amount of physical memory is available before calling another execbuf. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11738 Signed-off-by: Janusz Krzysztofik --- tests/intel/gem_mmap_offset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/intel/gem_mmap_offset.c b/tests/intel/gem_mmap_offset.c index 20dca17378..4b8c25c56b 100644 --- a/tests/intel/gem_mmap_offset.c +++ b/tests/intel/gem_mmap_offset.c @@ -745,6 +745,9 @@ static void *thread_clear(void *data) npages = get_npages(&arg->max, npages); size = npages << 12; + /* Execbuf requires sufficient amount of free physical memory */ + if (arg->flags & CLEAR_IN_EXECBUF) + igt_require_memory(1, size, CHECK_RAM); igt_assert_eq(__gem_create_in_memory_region_list(i915, &handle, &size, 0, &arg->region, 1), 0); /* Zero-init bo in execbuf or pagefault handler path as requested */ if (arg->flags & CLEAR_IN_EXECBUF)