From patchwork Wed Jul 29 08:30:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 6890551 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A7EF5C05AC for ; Wed, 29 Jul 2015 08:30:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAA0520718 for ; Wed, 29 Jul 2015 08:30:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CFAB120713 for ; Wed, 29 Jul 2015 08:30:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B16C6EBA6; Wed, 29 Jul 2015 01:30:27 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F8326EBA6 for ; Wed, 29 Jul 2015 01:30:25 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 29 Jul 2015 01:30:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,569,1432623600"; d="scan'208";a="772062676" Received: from djmorton-linux.isw.intel.com ([10.102.226.153]) by fmsmga002.fm.intel.com with ESMTP; 29 Jul 2015 01:30:23 -0700 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Wed, 29 Jul 2015 09:30:21 +0100 Message-Id: <1438158621-16944-1-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 Cc: thomas.wood@intel.com Subject: [Intel-gfx] [PATCH i-g-t] tests/gem_render_linear_blits: Increase min swap required 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-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The swap-thrash subtest had a requirement that swap memory be present but no minimum amount was specified. The subtest allowed for half the total swap memory for overhead. Some android systems have a only a small amount of swap space and half this was not enough resulting in OOM errors. It was not possible to determine the exact amount of memory the test would require in all configurations to guarentee swap memory would be used but not trigger an OOM error. As a minimum reccomended swap partition on Linux is 256Mb the subtest was updated to require this. Also fixed a couple of small memory leaks. Signed-off-by: Derek Morton --- tests/gem_render_linear_blits.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c index f83c6d4..5dd210d 100644 --- a/tests/gem_render_linear_blits.c +++ b/tests/gem_render_linear_blits.c @@ -184,6 +184,9 @@ static void run_test (int fd, int count) } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); + + free(bo); + free(start_val); } igt_main @@ -210,7 +213,12 @@ igt_main igt_subtest("swap-thrash") { uint64_t swap_mb = intel_get_total_swap_mb(); - igt_require(swap_mb > 0); + /* The calculation of count allows 1/2 the swap memory as + overhead. However on Android systems with a very small swap + partition this is not enough resulting in OOM errors. + As 256Mb is a minimum recomended size for a swap partition + on Linux, skip the subtest if less than this. */ + igt_require(swap_mb > 255); count = ((intel_get_avail_ram_mb() + (swap_mb / 2)) * 1024*1024) / SIZE; intel_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP); run_test(fd, count);