From patchwork Fri Sep 18 02:08:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11783879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87E4C6CA for ; Fri, 18 Sep 2020 02:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65AC72078B for ; Fri, 18 Sep 2020 02:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="w/ulQWXT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728111AbgIRCIj (ORCPT ); Thu, 17 Sep 2020 22:08:39 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:49676 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbgIRCIi (ORCPT ); Thu, 17 Sep 2020 22:08:38 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08I254on096672; Fri, 18 Sep 2020 02:08:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=7X1FOUfX0O6+9WYPysj3uyalS4r6G8fNTyARC6J9rAs=; b=w/ulQWXTCx8PkMeiCtiZBE7qhXrf+juM6O4wK7HdFv9Cj6YILfhlI85FaDPSyA5ovAHh UPSDI9TaRKNHBfKmOvI6HdFM+PwDDROGDVLg9IHUcCiQ2F/Kn1TR8Mbc6vsF5Y1vtFVU /wRYF1TCJ1nH82p5PtB4HhpVoyRxKDjLz+N09lLgGqlW7yLaV1+1eekhowDNfRX9l7Jv wLwzH16AbilTdpJ+RlZ+eoomYe2AZoltXW447usyJvGpFker+blj89L/dHzlwBDmFxmc a/ZzSvrKIU1NYVrw+1FxQPnUPjRSlsBJnptLLZpMFhrjBN3+gWrWqN+7H1A1nNeEVJKT ZA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 33j91dx77g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Sep 2020 02:08:35 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08I266PG081898; Fri, 18 Sep 2020 02:08:34 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 33khpny3ah-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Sep 2020 02:08:34 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08I28YSc003866; Fri, 18 Sep 2020 02:08:34 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Sep 2020 02:08:33 +0000 Date: Thu, 17 Sep 2020 19:08:33 -0700 From: "Darrick J. Wong" To: guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 21/24] common/rc: teach _scratch_mkfs_sized to set a size on an xfs realtime volume Message-ID: <20200918020833.GI7954@magnolia> References: <160013417420.2923511.6825722200699287884.stgit@magnolia> <160013430895.2923511.7033338053997588353.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <160013430895.2923511.7033338053997588353.stgit@magnolia> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=3 mlxlogscore=999 phishscore=0 mlxscore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180019 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 suspectscore=3 mlxlogscore=999 clxscore=1015 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180018 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Generally speaking, tests that call _scratch_mkfs_sized are trying to constrain a test's run time by formatting a filesystem that's smaller than the device. The current helper does this for the scratch device, but it doesn't do this for the xfs realtime volume. If fstests has been configured to create files on the realtime device by default ("-d rtinherit=1) then those tests that want to run with a small volume size will instead be running with a huge realtime device. This makes certain tests take forever to run, so apply the same sizing to the rt volume if one exists. Signed-off-by: Darrick J. Wong --- v2: don't bother with HOSTOS --- common/rc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 6366a7b2..b707db76 100644 --- a/common/rc +++ b/common/rc @@ -997,14 +997,20 @@ _scratch_mkfs_sized() [ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small" fi + if [ "$FSTYP" = "xfs" ] && [ -b "$SCRATCH_RTDEV" ]; then + local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV` + [ "$fssize" -gt "$rtdevsize" ] && _notrun "Scratch rt device too small" + rt_ops="-r size=$fssize" + fi + case $FSTYP in xfs) # don't override MKFS_OPTIONS that set a block size. echo $MKFS_OPTIONS |egrep -q "b?size=" if [ $? -eq 0 ]; then - _scratch_mkfs_xfs -d size=$fssize + _scratch_mkfs_xfs -d size=$fssize $rt_ops else - _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize + _scratch_mkfs_xfs -d size=$fssize $rt_ops -b size=$blocksize fi ;; ext2|ext3|ext4|ext4dev) From patchwork Fri Sep 18 02:06:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11783885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 753B7618 for ; Fri, 18 Sep 2020 02:57:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58A3F2395B for ; Fri, 18 Sep 2020 02:57:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="uyuqOYWk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbgIRC5G (ORCPT ); Thu, 17 Sep 2020 22:57:06 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44650 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727805AbgIRCGm (ORCPT ); Thu, 17 Sep 2020 22:06:42 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08I24vjq150578; Fri, 18 Sep 2020 02:06:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=4oNDzWHHTzDq0UDJgFvG58EhjBvcDBCxyJDSncT430w=; b=uyuqOYWkU92YDdDUn8aSVssUDfPRgEs5elCdwGXxBWdgkG9UDe6gmGqQsuXhh/qS6XT7 8V7+zbxMMtRoj5Cy40hCAH+zKGu10HqT3rFkYnvT2pieCdlfBmJX24FxN8+r+yNTC3qr oJ9WrvoZIOp4AUUm4wVTePFfN3OcqxpWiOV8kYSZucZ7tBRKylDS5wn5PIJ7KKcueLAM PTP99V0bzvBHQXRTwmpkPAX4M4Q6E4cJSXE7Xo/5f/OpOlhY7/AeXvfbZAkpeDAKkzk0 nE+WoK6MOBYDY07kw9yeXBibBGEFV/S7zJ7eBZQa767aq/1lZsXAxjJN69R6t2PReqIu bw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 33gp9mmgtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Sep 2020 02:06:40 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08I24pGB167147; Fri, 18 Sep 2020 02:06:39 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 33megag08e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Sep 2020 02:06:39 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 08I26cMF019804; Fri, 18 Sep 2020 02:06:38 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Sep 2020 02:06:38 +0000 Date: Thu, 17 Sep 2020 19:06:37 -0700 From: "Darrick J. Wong" To: guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 24/24] check: try reloading modules Message-ID: <20200918020637.GH7954@magnolia> MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 mlxscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180019 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 spamscore=0 priorityscore=1501 suspectscore=3 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180018 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Optionally reload the module between each test to try to pinpoint slab cache errors and whatnot. Signed-off-by: Darrick J. Wong --- v2: use "fs-$FSTYP" for the module name --- README | 3 +++ check | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/README b/README index d0e23fcd..4af331b4 100644 --- a/README +++ b/README @@ -106,6 +106,9 @@ Preparing system for tests: - set USE_KMEMLEAK=yes to scan for memory leaks in the kernel after every test, if the kernel supports kmemleak. - set KEEP_DMESG=yes to keep dmesg log after test + - Set TEST_FS_MODULE_RELOAD=1 to unload the module and reload + it between test invocations. This assumes that the name of + the module is the same as FSTYP. - or add a case to the switch in common/config assigning these variables based on the hostname of your test diff --git a/check b/check index 6a353399..6002233a 100755 --- a/check +++ b/check @@ -834,6 +834,15 @@ function run_section() _check_dmesg || err=true fi + # Reload the module after each test to check for leaks or + # other problems. + if [ -n "${TEST_FS_MODULE_RELOAD}" ]; then + _test_unmount 2> /dev/null + _scratch_unmount 2> /dev/null + modprobe -r fs-$FSTYP + modprobe fs-$FSTYP + fi + # Scan for memory leaks after every test so that associating # a leak to a particular test will be as accurate as possible. _check_kmemleak || err=true