From patchwork Mon Oct 17 07:23:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9378467 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 2D665600CA for ; Mon, 17 Oct 2016 07:24:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2046B28F9C for ; Mon, 17 Oct 2016 07:24:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 149CE28F99; Mon, 17 Oct 2016 07:24:15 +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 B651128F81 for ; Mon, 17 Oct 2016 07:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757580AbcJQHYO (ORCPT ); Mon, 17 Oct 2016 03:24:14 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34617 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757530AbcJQHYN (ORCPT ); Mon, 17 Oct 2016 03:24:13 -0400 Received: by mail-lf0-f68.google.com with SMTP id x23so19380429lfi.1 for ; Mon, 17 Oct 2016 00:24:13 -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=6BShOSxaQw5Amy1k6vWeaszsQeygiPioCcPeCux4sOQ=; b=ZOW1w1TpeYsNSUvlMshQprZznhWMGiCiUy4uhrZJc6BsEANlHY0SGAdW5S9ogtrPmG ejBXqlWvqR0JsV27AfY89QhoRfRhQ5MFjpvbv2OeaYBk7wUVVG0BdiqSZvt8T66pRZqD nHWKwYEaIhE1ouPavnWnhkAfWcgoeSsgnp5I/4Rfy+Vqg7k1I26/PF0e37sHH44yF46U L8bFBJo5ZNMaVflOnb5blENhkvUmkHn3iCD++eFXohWdl/gLGUKVhEg1YoXKwaugS95L QJIKHfanV2EAuesdygLpmx1BKnLa47BXPW4GAO9n84GeoXLAXdxJq0YwJLR0hyRMJYH7 11jw== 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=6BShOSxaQw5Amy1k6vWeaszsQeygiPioCcPeCux4sOQ=; b=bXVO8SnI8Fk9LinAmdf9yrtckgZMMLwmufcOMzl4+HlfULh/gShE2sU1VRhkhDvMzt Rgc1ImF+qT52PbZUPCAENrWmppgzE3k+8uUURM7z7BXnogtae+M4AePLc+2fYmaJGQSv Eza/VLxB7502xPqDC7lUhHPsQnD7D6qKV0734cueHnOsJm0ixsGUda2d7f3fSpCAkDml PqSXGyspIJp/xIQEIi4SstJPPP1R/L7N7/Roq4galnobcwpZsOddNUSGtKdONzutXAao Sz1Ttm9gGa7BNNfI9TzFM1+j3dThDj0+VaUjOgRXlTxz5in0z8+1DVX5AD7UvqvNKHBd 4YGA== X-Gm-Message-State: AA6/9RkhF5CLMnl+91/eQk/sD1siuWoxEDeY7V8ZcP06905Chc7njNmSmGKe7y70qHrZjw== X-Received: by 10.28.15.202 with SMTP id 193mr7566945wmp.62.1476689052301; Mon, 17 Oct 2016 00:24:12 -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 j1sm40233285wjl.21.2016.10.17.00.24.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 00:24:11 -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 is supported Date: Mon, 17 Oct 2016 10:23:34 +0300 Message-Id: <1476689014-384-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476689014-384-1-git-send-email-amir73il@gmail.com> References: <1476689014-384-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 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 --- 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"