From patchwork Sun Oct 16 10:53:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9378085 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 763ED600CA for ; Sun, 16 Oct 2016 10:54:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67F7228C57 for ; Sun, 16 Oct 2016 10:54:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C7E728C94; Sun, 16 Oct 2016 10:54:20 +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 EB53D28C57 for ; Sun, 16 Oct 2016 10:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755532AbcJPKyT (ORCPT ); Sun, 16 Oct 2016 06:54:19 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:32953 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752904AbcJPKyT (ORCPT ); Sun, 16 Oct 2016 06:54:19 -0400 Received: by mail-lf0-f65.google.com with SMTP id l131so18076908lfl.0 for ; Sun, 16 Oct 2016 03:54:18 -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=YDSm8AzzQcE+AvsKdCV/ZxSXxEgR6keuoYNUNYo8xWw=; b=MvzXaHGcLYUj10B5q1GM9izwqTf8kTYbbdxPum6yz1Wt/sNQSxMoYUiOcYfbuQeyI4 QcvZCG2hRlzddHgRSPZCitMehtLst/5T9ghrfJZQIl9ZJ5UhYW5b4y9rlfqvhRQhrgf2 +S4iywc933BIcjelRASCUDeklMehsmZ1V0z/Z+jaTpEJNL2GJC5pM549tf9dDiRJ8H/s L6vThrJc5UVVRc7uGgw/JqTBiyKyLwhPe4SrrwHefRdoWFl1X8qGQRzKNcw0v0Y6xSPH dcKavS1Z8A59r7sXi28vQHEmT8uHpE4M9C7XU27XfFTaSDk2nZQ16vHMRDZZ9qIXMOEj qg1g== 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=YDSm8AzzQcE+AvsKdCV/ZxSXxEgR6keuoYNUNYo8xWw=; b=cxltRZkF7BiKgRoJ6CiyItSXvQWPA6YmF8OrcuTOPrkFFf3ddyNzFOW4DFqa8XOIbj CcYw2aHKrG9SyVY0vqWbLQMHQKWmjQwN0aOLuGgGsS1g3OLwQbZ6bBlFj6i6GgQIP2Ue 8u3Pl35V6C7hHhKDPi+AXYhr5NPmoIe6pVqJC18dnqEVqLHPt8JmOvOjHIWjK1PaGS8V 5o9Af9/5bQ/S/TUfmdUkErp8x8DdDUqzDi6J3ivAToRuGAzEZgFRkeG1TG2B0rdcAESg DKsUzDkOQVkhTNc/bsvCYbODUimJ1NPvn52TjH5aevi7uPJ+EsCfCCHmk7DqU7GEHlQS MPtw== X-Gm-Message-State: AA6/9RlL3xNc5pzS1WDtXUpzfutHsN7eZly6t6IVU8i5GWGBENytML4poTP+bBFFRyDIXQ== X-Received: by 10.28.203.202 with SMTP id b193mr5603237wmg.0.1476615257367; Sun, 16 Oct 2016 03:54:17 -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 q8sm41269099wjj.7.2016.10.16.03.54.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Oct 2016 03:54:16 -0700 (PDT) From: Amir Goldstein To: Dave Chinner , Eryu Guan , Christoph Hellwig Cc: "Darrick J . Wong" , fstests@vger.kernel.org Subject: [PATCH v2 3/3] fstests: run xfs_io as multi threaded for 'quick' tests Date: Sun, 16 Oct 2016 13:53:42 +0300 Message-Id: <1476615222-7804-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476615222-7804-1-git-send-email-amir73il@gmail.com> References: <1476615222-7804-1-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 for tests in group quick with command line option -M 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 -M 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). Therefore, we automatically add the -M flags only to tests in the 'quick' group. Signed-off-by: Amir Goldstein --- check | 2 ++ common/rc | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/check b/check index 69341d8..e568598 100755 --- a/check +++ b/check @@ -574,6 +574,8 @@ for section in $HOST_OPTIONS_SECTIONS; do mkdir -p $RESULT_DIR + export TEST_GROUPS=`grep $(basename $seqnum) "$SRC_DIR/$(dirname $seqnum)/group"` + echo -n "$seqnum" if $showme; then diff --git a/common/rc b/common/rc index a838750..7c478cf 100644 --- a/common/rc +++ b/common/rc @@ -3799,6 +3799,21 @@ 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" + if echo $TEST_GROUPS | grep -q quick; then + # xfs_io -M flag runs xfs_io as multi threaded process + # in order to catch fdget/fdset reference leaks, because + # file structs are not reference counted in a single threaded + # process. + # Because reference counted fdget/fdset may lead to slightly + # longer run times in extreme cases (such as generic/132), + # we limit the use of -M flags to tests with short runtime, + # where the effect of the flag is negligable. + # + # Figure out if xfs_io supports the -M option + $XFS_IO_PROG -M -c quit 2>/dev/null && \ + export XFS_IO_PROG="$XFS_IO_PROG -M" + fi + # 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"