public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Dave Chinner <david@fromorbit.com>, Eryu Guan <eguan@redhat.com>,
	Christoph Hellwig <hch@lst.de>
Cc: fstests@vger.kernel.org
Subject: [PATCH v3 3/3] fstests: run xfs_io with -i option is supported
Date: Mon, 17 Oct 2016 10:23:34 +0300	[thread overview]
Message-ID: <1476689014-384-3-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1476689014-384-1-git-send-email-amir73il@gmail.com>

Try to run xfs_io with command line option -i, which starts an idle
thread before performing any io.

The purpose of this idle thread is to test io from a multi threaded
process. With single threaded process, the file table is not shared
and file structs are not reference counted.

In order to improve the chance of detecting file struct reference
leaks, we should run xfs_io commands with this option as much as
possible.

Analysis of the effect of xfs_io -i on tests runtime showed that
it may lead to slightly longer run times in extreme cases (e.g +3s
for generic/132), but has a negligable effect on runtime of tests
among the 'quick' group (worst case +0.3s for generic/130).

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 common/rc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/rc b/common/rc
index a838750..da079f3 100644
--- a/common/rc
+++ b/common/rc
@@ -3799,6 +3799,15 @@ init_rc()
 	$XFS_IO_PROG -c stat $TEST_DIR 2>&1 | grep -q "is not on an XFS filesystem" && \
 		export XFS_IO_PROG="$XFS_IO_PROG -F"
 
+	# xfs_io -i option starts an idle thread for xfs_io.
+	# With single threaded process, the file table is not shared
+	# and file structs are not reference counted.
+	# Spawning an idle thread can help detecting file struct
+	# reference leaks, so we want to enable the option whenever
+	# it is supported.
+	$XFS_IO_PROG -i -c quit 2>/dev/null && \
+		export XFS_IO_PROG="$XFS_IO_PROG -i"
+
 	# xfs_copy doesn't work on v5 xfs yet without -d option
 	if [ "$FSTYP" == "xfs" ] && [[ $MKFS_OPTIONS =~ crc=1 ]]; then
 		export XFS_COPY_PROG="$XFS_COPY_PROG -d"
-- 
2.7.4


  parent reply	other threads:[~2016-10-17  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  7:23 [PATCH v3 1/3] fstests: fix call sites that used xfs_io directly Amir Goldstein
2016-10-17  7:23 ` [PATCH v3 2/3] fstests: strip quotes from "$XFS_IO_PROG" call sites Amir Goldstein
2016-10-20 14:35   ` Eryu Guan
2016-10-20 17:36     ` Amir Goldstein
2016-10-17  7:23 ` Amir Goldstein [this message]
2016-10-17  7:31   ` [PATCH v3 3/3] fstests: run xfs_io with -i option if supported Amir Goldstein

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=1476689014-384-3-git-send-email-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=david@fromorbit.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    /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