public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: fstests@vger.kernel.org
Cc: Eryu Guan <eguan@redhat.com>
Subject: [PATCH] generic/072: limit max cpu number to 8 to avoid long run time and high system pressure
Date: Thu, 11 Feb 2016 17:28:46 +0800	[thread overview]
Message-ID: <1455182926-7782-1-git-send-email-eguan@redhat.com> (raw)

Right now generic/072 scales the loop count based on the cpu count. But
on hosts with many cpus(100+), generic/072 runs for hours and generates
very high system load.

Given that the original bug can be reproduced easily on unpatched
kernel, the great number of loops and long run time are not needed. So
limiting the cpu number to 8 (which gives around 20 seconds run time on
my test vm with 8 vcpus) seems reasonable.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 tests/generic/072 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/generic/072 b/tests/generic/072
index 6e59d84..ece71fb 100755
--- a/tests/generic/072
+++ b/tests/generic/072
@@ -51,6 +51,10 @@ _require_xfs_io_command "fcollapse"
 
 testfile=$TEST_DIR/testfile.$seq
 NCPUS=`$here/src/feature -o`
+# cap NCPUS to 8 at maximum to avoid long run time on hosts with many cpus
+if [ $NCPUS -gt 8 ]; then
+	NCPUS=8
+fi
 OUTER_LOOPS=$((10 * $NCPUS * $LOAD_FACTOR))
 INNER_LOOPS=$((50 * $NCPUS * $LOAD_FACTOR))
 # fcollapse/truncate continuously and simultaneously a same file
-- 
2.5.0


                 reply	other threads:[~2016-02-11  9:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455182926-7782-1-git-send-email-eguan@redhat.com \
    --to=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox