From patchwork Sun Jun 9 17:12:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10983777 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 0E3C6924 for ; Sun, 9 Jun 2019 17:12:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3DCB28702 for ; Sun, 9 Jun 2019 17:12:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D817A2886A; Sun, 9 Jun 2019 17:12:39 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C332328702 for ; Sun, 9 Jun 2019 17:12:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387817AbfFIRMi (ORCPT ); Sun, 9 Jun 2019 13:12:38 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42264 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387653AbfFIRMh (ORCPT ); Sun, 9 Jun 2019 13:12:37 -0400 Received: by mail-wr1-f66.google.com with SMTP id x17so6793155wrl.9 for ; Sun, 09 Jun 2019 10:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BocLJe+nf1h0mi7JMNZusrYf39oXIXO3U2rfhrq2I/E=; b=D74J+QuhNhOG6sCoCsyC0L6M6oH4+xOpHBvNqeoMIwNlqNZfbcIRYzBaA8Iq5+fWNd otmuDyngac9dGl0OZKsAd8EAJ1HcjfGVV4E3sRuOE6i6YaZgrBqQx8jHW26sHt/tpO1X hEMS8mYNnaWHphC4gCPN3gdigVAji042NkYZ22JoLiRqHY0MoMUWsG31kKki6X438qd5 veOrNJy6gUZnOrZ2QwLGw3WZgErDtE2jcibO04CU+6P3qh2WDjfdZgFK2F9G6Bu7RKuR WCcnwDZUfEtff5c3EWFvG1GJfE8OL1hueE2vdGkBHCukhiFl3UTBEeXHyiTXYQJMTHQd 4IuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BocLJe+nf1h0mi7JMNZusrYf39oXIXO3U2rfhrq2I/E=; b=EKnElq5/mqiqNNhdmTDX/lm1iMlHMTTQCw9PNLzCr5gwO9vA8h7MDcjlIDI1W7QVV3 zrzOPodTx1NynkbH9IvBh14M1fdEn+E2/59eXWweQVptrnj/eU1DGvoLL8eePHg4NBmO jTSDksNU1DRmxl6wlSDvw3d+mwzPSkJQYaytFiw9Iy31jw6xZk9lrCW+BvkR3iUvAOR1 uSOuYTqfghNlNA+9Y5hc+QOys/BFCmZ8tkC+jB9FxoFI9Z3FaRqoUv7xIzaJXT1scA6m uIFfpJWR/BFku1+xBe+4U0m49fTzbcLnalhMNGlqWGT8BMOPeAdDG1L8WwthaEgvrM+a sQ4Q== X-Gm-Message-State: APjAAAXD2fzBtE1ldG1h7zSLfc3kZsuZte5eM038Kd4IGhAHlwYaS7Jw YD39dQ/QuhhpkSjgWXpSfdS5AvTj X-Google-Smtp-Source: APXvYqzWbiDEJJj3Oa451h3jcH7GVBRg0kGajD6g/Ns2s0S345CryYQIeWC6tDmL7+d//+0ByepOCA== X-Received: by 2002:adf:90e7:: with SMTP id i94mr26026560wri.213.1560100356183; Sun, 09 Jun 2019 10:12:36 -0700 (PDT) Received: from localhost.localdomain ([5.102.238.208]) by smtp.gmail.com with ESMTPSA id y184sm10106807wmg.14.2019.06.09.10.12.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 10:12:35 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: "Darrick J . Wong" , fstests@vger.kernel.org Subject: [PATCH] fstests: don't oom the box opening tmpfiles (take 2) Date: Sun, 9 Jun 2019 20:12:29 +0300 Message-Id: <20190609171229.27779-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For the t_open_tmpfiles tests that run multiple jobs in parallel, limit ourselves to half of file-max for all jobs combined, so that we don't OOM the test machine. Signed-off-by: Amir Goldstein Reviewed-by: Darrick J. Wong --- Eryu, Reducing max allowed file by factor of 2 wasn't good enough for the multi jobs variants of the tests. They still OOM mytest machine (with 2GB RAM). Thanks, Amir. tests/generic/531 | 4 ++-- tests/xfs/502 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/generic/531 b/tests/generic/531 index 8ce4cc93..ea77eec2 100755 --- a/tests/generic/531 +++ b/tests/generic/531 @@ -41,10 +41,10 @@ _scratch_mount # Try to load up all the CPUs, two threads per CPU. nr_cpus=$(( $(getconf _NPROCESSORS_ONLN) * 2 )) -# Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR) +# Set ULIMIT_NOFILE to min(file-max / $nr_cpus / 2, 50000 files per LOAD_FACTOR) # so that this test doesn't take forever or OOM the box max_files=$((50000 * LOAD_FACTOR)) -max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 )) +max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / $nr_cpus / 2 )) test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \ max_files=$max_allowable_files ulimit -n $max_files diff --git a/tests/xfs/502 b/tests/xfs/502 index 0a7921a3..1b747a1a 100755 --- a/tests/xfs/502 +++ b/tests/xfs/502 @@ -43,10 +43,10 @@ _scratch_mount # Load up all the CPUs, two threads per CPU. nr_cpus=$(( $(getconf _NPROCESSORS_ONLN) * 2 )) -# Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per cpu per LOAD_FACTOR) +# Set ULIMIT_NOFILE to min(file-max / $nr_cpus / 2, 30000 files per cpu per LOAD_FACTOR) # so that this test doesn't take forever or OOM the box max_files=$((30000 * LOAD_FACTOR)) -max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 )) +max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / $nr_cpus / 2 )) test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \ max_files=$max_allowable_files ulimit -n $max_files