From patchwork Mon Oct 17 07:31:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9378469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CBB2600CA for ; Mon, 17 Oct 2016 07:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2433528B3D for ; Mon, 17 Oct 2016 07:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16C9D28C3B; Mon, 17 Oct 2016 07:32:18 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 CFF9128B3D for ; Mon, 17 Oct 2016 07:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757541AbcJQHcQ (ORCPT ); Mon, 17 Oct 2016 03:32:16 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34430 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757465AbcJQHcQ (ORCPT ); Mon, 17 Oct 2016 03:32:16 -0400 Received: by mail-lf0-f66.google.com with SMTP id x23so19415236lfi.1 for ; Mon, 17 Oct 2016 00:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y1wO/OoA5oYtf5TFTpFiPEa4ONfLTT+X3dglwaGZ0J8=; b=K410milxBPe6ZQIkyGN8rTr72f1tX8y3rmcLiHLOaOppnaxioNRaBr4cSxfYD8sBg5 Tw1Q0PA3wUciv2/VNAJU+qelOq6t6EGGW7SY+CDLtYE889MuuJjRjIYlg3+rxzwo88JX F93Zu57zF+e2gQ1EJYmh4EB1cyqwQqveoAldOZ8MFBKUzPtSJW8OV7IdNF19WFTux5Ih 4bFADq9mOEbXhRuPvOgEH8orXAhWgQVsyn/PLz3X6r2wxH5w4O+wQPE+1zyO/uWs5qMV /G2gBP7+pklv2vhlSChYgadmeya8VLiq7HhrX9JmcIwSgY8jCRv6I4Df+zXdIc8EmgZO I7Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y1wO/OoA5oYtf5TFTpFiPEa4ONfLTT+X3dglwaGZ0J8=; b=a+8isZS4SZM7zjZgQEmrMlyFJBEjUjFuzgBPKF7WCt1vVbe7ELY7AXQ18ELIc0w9zE 7qJO3QaKHoTq2GMyZK28ei0qoh+mtmfVVlnwGumBaCrX9c7a7g0dryrm4GLjqDfjCI9F zMLRTS+69hkedLx8blyBhdfp1zdTMl+rmEBcEaXviLZPl3vhSoZq2rOJ/l9o3adVopDD x9gLdtmQ9rxE9DClnAMrwkIluF6oDIfk9EtKOVaqmCiZs9/TQ5pmQptTmngCtutL+Btk nDcYKUmghpfOp6jgfrGgJQlgxCs/RG1ipp81Vd7UnXbtyg1rNaOcmg5yVf0GAZkDLsfx KVUw== X-Gm-Message-State: AA6/9RkawhD01jvguw7x2UMyzk1awdO6UbNMJpZlbKSbnaJfs9rLUxQpNYYFYlywfKtFkw== X-Received: by 10.28.1.83 with SMTP id 80mr2039179wmb.31.1476689534186; Mon, 17 Oct 2016 00:32:14 -0700 (PDT) Received: from amir-VirtualBox.Home (bzq-79-177-34-153.red.bezeqint.net. [79.177.34.153]) by smtp.gmail.com with ESMTPSA id q8sm50480533wjj.7.2016.10.17.00.32.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 00:32:13 -0700 (PDT) From: Amir Goldstein To: Dave Chinner , Eryu Guan , Christoph Hellwig Cc: fstests@vger.kernel.org Subject: [PATCH v3 3/3] fstests: run xfs_io with -i option if supported Date: Mon, 17 Oct 2016 10:31:41 +0300 Message-Id: <1476689501-735-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476689014-384-3-git-send-email-amir73il@gmail.com> References: <1476689014-384-3-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 negligible effect on runtime of tests among the 'quick' group (worst case +0.3s for generic/130). Signed-off-by: Amir Goldstein --- 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"