From patchwork Sun Oct 16 08:50:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9378063 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 1A83D607FD for ; Sun, 16 Oct 2016 08:50:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8D5828D0D for ; Sun, 16 Oct 2016 08:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD7C528ED6; Sun, 16 Oct 2016 08:50:38 +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 E72F528D0D for ; Sun, 16 Oct 2016 08:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754709AbcJPIuh (ORCPT ); Sun, 16 Oct 2016 04:50:37 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36447 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752383AbcJPIug (ORCPT ); Sun, 16 Oct 2016 04:50:36 -0400 Received: by mail-wm0-f66.google.com with SMTP id 79so5228556wmy.3 for ; Sun, 16 Oct 2016 01:50:35 -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=yW87SHxRFp06rLCqAClkDy1oeJdDB/aXZtizGHUugLg=; b=jrb+ql1NT5HKdro/pjevNZlqQGcjCjYhjToYmYM1SB0rCpg3+nD/ijBeM/pIj3eWuq ZWekkBIrxEqk5SdlFV8x7m/qoSoKSG03pDzIelLv5pJ7bWI5LTGkL7qqhyHrqOMQg0nE 5WxHkNNUz6mqgUlu1rzGTQ7rebnMco9/qh8LyE01+ZPNQVMVfrcFqlztXOrS9QmNpuXx XdEq/Kay9amVHIfxF5YP/wwGerCbytwHdZp6PLzvX2bIhrewLCXnhosNwdsKp5W5z7jt uaQz4x5odeyiNnp34vaX+0WHSdQvfzXsf6To8uW86GeDeAxS//DtBRB+jYZZ2WWHSwZG YSGw== 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=yW87SHxRFp06rLCqAClkDy1oeJdDB/aXZtizGHUugLg=; b=R5dAuJbDK2LTPstK/axV7HOWIg/3DnfAiQyIgeSEIC875HT8cHAV1tx/9RFYFEhTIi 63VAqbMWNzEc5qEC68RotF2QmrygE4Ba5c6n8uRVXiddKPBNyvy7nv8NApjQhDt0NcmO 1auhHzAFc9IJk3RzFJmZDlLN4mlebvz/N+Az+VrtArsshBymdF8Isaq5ZlXvsC3fftkz g2oIlDu9NJfW3nAiKhzLVmoyx3YMfxnXw9SQkAdlPle6kTxspp5mm72sO+AyjY4kNAaM L6dp0ju9iQxRw1UU3dnUwJB+0d1FtTLz0nLiDe2ZvHFg5lM4wB2Qrh4VozmkC4t2DhBD O/3w== X-Gm-Message-State: AA6/9Rl6h8y9rud2tpXZfoO7w+VUHQhw70OKmumbgkNk36vE5TV4gXzZqAo2FM2MIxKs5Q== X-Received: by 10.28.142.82 with SMTP id q79mr4195679wmd.20.1476607834735; Sun, 16 Oct 2016 01:50:34 -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 g9sm40886385wjk.25.2016.10.16.01.50.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Oct 2016 01:50:34 -0700 (PDT) From: Amir Goldstein To: Dave Chinner , Eryu Guan , Christoph Hellwig Cc: fstests@vger.kernel.org Subject: [PATCH v2 2/2] fstests: run xfs_io as multi threaded for 'quick' tests Date: Sun, 16 Oct 2016 11:50:01 +0300 Message-Id: <1476607801-27684-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476607801-27684-1-git-send-email-amir73il@gmail.com> References: <1476607801-27684-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 565ba67..6a76fba 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"