[REPOST,blktests,v2,3/9] common-xfs: Make size argument optional for _xfs_run_fio_verify_io
Message ID | 20230421060505.10132-4-dwagner@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp851557vqo; Thu, 20 Apr 2023 23:15:27 -0700 (PDT) X-Google-Smtp-Source: AKy350YyNMNXwCp4khQvb2MzNCtgCOPEFloUwqu31bDpesTbgPBl8Jjv6yuPltQ44vwUm+yVNwMO X-Received: by 2002:a17:90b:28b:b0:246:91d0:9e6f with SMTP id az11-20020a17090b028b00b0024691d09e6fmr4258675pjb.3.1682057727348; Thu, 20 Apr 2023 23:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682057727; cv=none; d=google.com; s=arc-20160816; b=FN47C0Iw3Ps2+EEZ6hpDepy3GybldhhEK/S1a/wQAf+8ynCA3LWFfqurMRhtRLjo1Q fVSaxq5PLDOfzKu9nKh3cvOHxmpr3IZ8bgxmUAfKqe3LLy87jSzI9IT3ciz8MGzbfHVM pFuZ+ZPI7+e/GPi5tOyNOqPWnwONtR2OY3nlACT9ins2sQXBoifYxU3yBBNp5VKtpYjT bWzINry0EvDnXksPs68Fiy8C4TYaky0IgzsEg0haxl9GCEn4nM+wsN6k9RZBycjHEf0p E+yVQQylcAP3tJ3bv5kF3EJkLAcKq6Wh9GxKziNKGxhvVNMH0HajFAzdNif/S/bFE+Zk cU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Piq20gmCbu/sfasT+BJykUx1CpQBqc0w9RDrikSeIvU=; b=Oscd5A7FXMzaN8qbfrJ08eOU5AtemE2RB48EXsTr8v2UyF6hS+f3Y9eu5cACpaO80e 66OGUacwHQ+EyEXCWxx91hk18WyZIqHp3MywjtqEm2eudtLFMi+Tz5N3V7XDQC39m8Bl yfRNED3sKPKm7cSlfaZK02Kd/3aDEF7Scpp7GvKYbGCPtxopKYj+GWuciu8F7JC0h1DH Jfoe8zmmj/jwT2pMLwXgpAwN6ji4albLP2rhuKJWGL+zwYxfJxVk5Chr/2fzXCNu5otM qghaaetrdWYZ5wniHGsAQBZm0JeWehVCi/y8c8JjNzcJWFdKla0LEgTmyuJz2kNVzd37 7nVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HLT8Ja5M; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a9-20020a170902ecc900b001a21a336fcasi3901776plh.441.2023.04.20.23.15.14; Thu, 20 Apr 2023 23:15:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HLT8Ja5M; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231287AbjDUGGJ (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Fri, 21 Apr 2023 02:06:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233767AbjDUGFy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Apr 2023 02:05:54 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB656E92; Thu, 20 Apr 2023 23:05:49 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B0EA91FDDF; Fri, 21 Apr 2023 06:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682057117; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Piq20gmCbu/sfasT+BJykUx1CpQBqc0w9RDrikSeIvU=; b=HLT8Ja5MNTGaFTfOk3Pl7fzS2fkTGyqMim0UtWnJfwx4W0wMFVesGi94EVYD9cJSwYNGfE MEBBtiX5zqoaDxnFI23RHSMvo2+VjdDRStOru7jUoKg60r3DtrZh6dQAZscLuQdJMtdIrP 43fBZo+26MTt/VMZO//X6WsRVIE7FU8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682057117; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Piq20gmCbu/sfasT+BJykUx1CpQBqc0w9RDrikSeIvU=; b=v1kEqw5z6Bt0MQ0mGl4DaaDdmldtIaXqdn7cEdJVh41Yg1Xuh93MjYqPX6+9I0Q16hW3Q2 7ZmELlOgrL2BFOAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A32371390E; Fri, 21 Apr 2023 06:05:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +tHUJ50nQmRuZgAAMHmgww (envelope-from <dwagner@suse.de>); Fri, 21 Apr 2023 06:05:17 +0000 From: Daniel Wagner <dwagner@suse.de> To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni <kch@nvidia.com>, Shin'ichiro Kawasaki <shinichiro@fastmail.com>, Daniel Wagner <dwagner@suse.de> Subject: [PATCH REPOST blktests v2 3/9] common-xfs: Make size argument optional for _xfs_run_fio_verify_io Date: Fri, 21 Apr 2023 08:04:59 +0200 Message-Id: <20230421060505.10132-4-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421060505.10132-1-dwagner@suse.de> References: <20230421060505.10132-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763765363476810247?= X-GMAIL-MSGID: =?utf-8?q?1763765363476810247?= |
Series |
nvme testsuite runtime optimization
|
|
Commit Message
Daniel Wagner
April 21, 2023, 6:04 a.m. UTC
Make the size argument optional by reading the filesystem info. The
caller doesn't have to guess (or calculate) how big the max IO size.
The log data structure of XFS is reducing the capacity.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
common/xfs | 6 ++++++
tests/nvme/012 | 2 +-
tests/nvme/013 | 2 +-
tests/nvme/035 | 2 +-
4 files changed, 9 insertions(+), 3 deletions(-)
Comments
On 4/21/23 08:04, Daniel Wagner wrote: > Make the size argument optional by reading the filesystem info. The > caller doesn't have to guess (or calculate) how big the max IO size. > The log data structure of XFS is reducing the capacity. > > Signed-off-by: Daniel Wagner <dwagner@suse.de> > --- > common/xfs | 6 ++++++ > tests/nvme/012 | 2 +- > tests/nvme/013 | 2 +- > tests/nvme/035 | 2 +- > 4 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/common/xfs b/common/xfs > index 2c5d96164ac1..ec35599e017b 100644 > --- a/common/xfs > +++ b/common/xfs > @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { > > _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 > > + if [[ -z "${sz}" ]]; then > + local avail > + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" df --output=avail "${mount_dir}" | tail -1 > + sz="$(printf "%d" $((avail / 1024 - 1 )))m" sz=$((avail / 1024 - 1)) > + fi > + > _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" _run_fio_verify_io --size="${sz}m" --directory="${mount_dir}/" > > umount "${mount_dir}" >> "${FULL}" 2>&1 > diff --git a/tests/nvme/012 b/tests/nvme/012 > index e60082c2e751..c9d24388306d 100755 > --- a/tests/nvme/012 > +++ b/tests/nvme/012 > @@ -44,7 +44,7 @@ test() { > cat "/sys/block/${nvmedev}n1/uuid" > cat "/sys/block/${nvmedev}n1/wwid" > > - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" > + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" > > _nvme_disconnect_subsys "${subsys_name}" > > diff --git a/tests/nvme/013 b/tests/nvme/013 > index 9d60a7df4577..265b6968fd34 100755 > --- a/tests/nvme/013 > +++ b/tests/nvme/013 > @@ -41,7 +41,7 @@ test() { > cat "/sys/block/${nvmedev}n1/uuid" > cat "/sys/block/${nvmedev}n1/wwid" > > - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" > + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" > > _nvme_disconnect_subsys "${subsys_name}" > > diff --git a/tests/nvme/035 b/tests/nvme/035 > index eb1024edddbf..8b485bc8e682 100755 > --- a/tests/nvme/035 > +++ b/tests/nvme/035 > @@ -32,7 +32,7 @@ test_device() { > port=$(_nvmet_passthru_target_setup "${subsys}") > nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") > > - _xfs_run_fio_verify_io "${nsdev}" "900m" > + _xfs_run_fio_verify_io "${nsdev}" > > _nvme_disconnect_subsys "${subsys}" > _nvmet_passthru_target_cleanup "${port}" "${subsys}" Otherwise looks good. Cheers, Hannes
On Fri, Apr 21, 2023 at 08:27:35AM +0200, Hannes Reinecke wrote: > On 4/21/23 08:04, Daniel Wagner wrote: > > Make the size argument optional by reading the filesystem info. The > > caller doesn't have to guess (or calculate) how big the max IO size. > > The log data structure of XFS is reducing the capacity. > > > > Signed-off-by: Daniel Wagner <dwagner@suse.de> > > --- > > common/xfs | 6 ++++++ > > tests/nvme/012 | 2 +- > > tests/nvme/013 | 2 +- > > tests/nvme/035 | 2 +- > > 4 files changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/common/xfs b/common/xfs > > index 2c5d96164ac1..ec35599e017b 100644 > > --- a/common/xfs > > +++ b/common/xfs > > @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { > > _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 > > + if [[ -z "${sz}" ]]; then > > + local avail > > + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" > > df --output=avail "${mount_dir}" | tail -1 Sure, don't think it matters. > > + sz="$(printf "%d" $((avail / 1024 - 1 )))m" > > sz=$((avail / 1024 - 1)) I tried this but the devision is likely to return a floating point which fio doesn't like. Is there a way to tell bash to do a pure integer devision?
On Apr 21, 2023 / 08:54, Daniel Wagner wrote: > On Fri, Apr 21, 2023 at 08:27:35AM +0200, Hannes Reinecke wrote: > > On 4/21/23 08:04, Daniel Wagner wrote: > > > Make the size argument optional by reading the filesystem info. The > > > caller doesn't have to guess (or calculate) how big the max IO size. > > > The log data structure of XFS is reducing the capacity. > > > > > > Signed-off-by: Daniel Wagner <dwagner@suse.de> > > > --- > > > common/xfs | 6 ++++++ > > > tests/nvme/012 | 2 +- > > > tests/nvme/013 | 2 +- > > > tests/nvme/035 | 2 +- > > > 4 files changed, 9 insertions(+), 3 deletions(-) > > > > > > diff --git a/common/xfs b/common/xfs > > > index 2c5d96164ac1..ec35599e017b 100644 > > > --- a/common/xfs > > > +++ b/common/xfs > > > @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { > > > _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 > > > + if [[ -z "${sz}" ]]; then > > > + local avail > > > + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" > > > > df --output=avail "${mount_dir}" | tail -1 > > Sure, don't think it matters. > > > > + sz="$(printf "%d" $((avail / 1024 - 1 )))m" > > > > sz=$((avail / 1024 - 1)) > > I tried this but the devision is likely to return a floating point which fio > doesn't like. Is there a way to tell bash to do a pure integer devision? Hmm, AFAIK, bash arithmetic supports integer only. I tried below, and bash did not return floating value... $ avail=90000; echo $((avail/1024)) 87 Assuming bash arithmetic supports integer only, -1 will not be required in the calculation.
On Apr 21, 2023 / 08:04, Daniel Wagner wrote: > Make the size argument optional by reading the filesystem info. The > caller doesn't have to guess (or calculate) how big the max IO size. > The log data structure of XFS is reducing the capacity. > > Signed-off-by: Daniel Wagner <dwagner@suse.de> > --- > common/xfs | 6 ++++++ > tests/nvme/012 | 2 +- > tests/nvme/013 | 2 +- > tests/nvme/035 | 2 +- > 4 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/common/xfs b/common/xfs > index 2c5d96164ac1..ec35599e017b 100644 > --- a/common/xfs > +++ b/common/xfs > @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { > > _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 > > + if [[ -z "${sz}" ]]; then > + local avail > + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" > + sz="$(printf "%d" $((avail / 1024 - 1 )))m" > + fi > + > _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" > > umount "${mount_dir}" >> "${FULL}" 2>&1 > diff --git a/tests/nvme/012 b/tests/nvme/012 > index e60082c2e751..c9d24388306d 100755 > --- a/tests/nvme/012 > +++ b/tests/nvme/012 > @@ -44,7 +44,7 @@ test() { > cat "/sys/block/${nvmedev}n1/uuid" > cat "/sys/block/${nvmedev}n1/wwid" > > - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" > + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" > > _nvme_disconnect_subsys "${subsys_name}" > > diff --git a/tests/nvme/013 b/tests/nvme/013 > index 9d60a7df4577..265b6968fd34 100755 > --- a/tests/nvme/013 > +++ b/tests/nvme/013 > @@ -41,7 +41,7 @@ test() { > cat "/sys/block/${nvmedev}n1/uuid" > cat "/sys/block/${nvmedev}n1/wwid" > > - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" > + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" > > _nvme_disconnect_subsys "${subsys_name}" > As for nvme/012 and nvme/013, I observed the I/O size changes from 900m to 920m with this patch. This condition looks better for testing point of view. Good. > diff --git a/tests/nvme/035 b/tests/nvme/035 > index eb1024edddbf..8b485bc8e682 100755 > --- a/tests/nvme/035 > +++ b/tests/nvme/035 > @@ -32,7 +32,7 @@ test_device() { > port=$(_nvmet_passthru_target_setup "${subsys}") > nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") > > - _xfs_run_fio_verify_io "${nsdev}" "900m" > + _xfs_run_fio_verify_io "${nsdev}" On the other hand, this change for nvme/035 does not look good. It runs the test on TEST_DEV, which may take very long time without TIMEOUT config. > > _nvme_disconnect_subsys "${subsys}" > _nvmet_passthru_target_cleanup "${port}" "${subsys}" > -- > 2.40.0 >
On Fri, Apr 21, 2023 at 08:27:35AM +0200, Hannes Reinecke wrote: > > + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" > > df --output=avail "${mount_dir}" | tail -1 ok. > > + sz="$(printf "%d" $((avail / 1024 - 1 )))m" > > sz=$((avail / 1024 - 1)) > > > + fi > > + > > _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" > > _run_fio_verify_io --size="${sz}m" --directory="${mount_dir}/" $sz might already contain the 'm', so can't do this here.
> Hmm, AFAIK, bash arithmetic supports integer only. I tried below, and bash did > not return floating value... > > $ avail=90000; echo $((avail/1024)) > 87 > > Assuming bash arithmetic supports integer only, -1 will not be required in the > calculation. Can't remember how I ended up with the above. Anyway, works just fine without the printf.
> --- a/tests/nvme/035 > > +++ b/tests/nvme/035 > > @@ -32,7 +32,7 @@ test_device() { > > port=$(_nvmet_passthru_target_setup "${subsys}") > > nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") > > > > - _xfs_run_fio_verify_io "${nsdev}" "900m" > > + _xfs_run_fio_verify_io "${nsdev}" > > On the other hand, this change for nvme/035 does not look good. It runs the > test on TEST_DEV, which may take very long time without TIMEOUT config. I'll add the nvme_img_size argument here instead (nvme: Make test image size configurable)
On May 02, 2023 / 15:23, Daniel Wagner wrote: > > --- a/tests/nvme/035 > > > +++ b/tests/nvme/035 > > > @@ -32,7 +32,7 @@ test_device() { > > > port=$(_nvmet_passthru_target_setup "${subsys}") > > > nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") > > > > > > - _xfs_run_fio_verify_io "${nsdev}" "900m" > > > + _xfs_run_fio_verify_io "${nsdev}" > > > > On the other hand, this change for nvme/035 does not look good. It runs the > > test on TEST_DEV, which may take very long time without TIMEOUT config. > > I'll add the nvme_img_size argument here instead (nvme: Make test image size > configurable) If TEST_DEV has the size same as nvme_img_size, xfs log data will consume some part of the TEST_DEV, then _xfs_run_fio_verify_io with nvme_img_size will fail. I think the size argument of _xfs_run_fio_verify_io should be, min(size of TEST_DEV, nvm_img_size) - log data size of xfs But I'm not sure if we can do this calculation correctly. If the calculation is not possible, it would be the better to leave the hard coded constants (1GB for TEST_DEV size and 900mb as fio I/O size) in this test case, because nvme/035 is rather unique in the nvme group, which uses TEST_DEV.
On Wed, May 03, 2023 at 04:04:50AM +0000, Shinichiro Kawasaki wrote: > On May 02, 2023 / 15:23, Daniel Wagner wrote: > > > --- a/tests/nvme/035 > > > > +++ b/tests/nvme/035 > > > > @@ -32,7 +32,7 @@ test_device() { > > > > port=$(_nvmet_passthru_target_setup "${subsys}") > > > > nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") > > > > > > > > - _xfs_run_fio_verify_io "${nsdev}" "900m" > > > > + _xfs_run_fio_verify_io "${nsdev}" > > > > > > On the other hand, this change for nvme/035 does not look good. It runs the > > > test on TEST_DEV, which may take very long time without TIMEOUT config. > > > > I'll add the nvme_img_size argument here instead (nvme: Make test image size > > configurable) > > If TEST_DEV has the size same as nvme_img_size, xfs log data will consume some > part of the TEST_DEV, then _xfs_run_fio_verify_io with nvme_img_size will fail. > > I think the size argument of _xfs_run_fio_verify_io should be, > > min(size of TEST_DEV, nvm_img_size) - log data size of xfs > > But I'm not sure if we can do this calculation correctly. > > If the calculation is not possible, it would be the better to leave the hard > coded constants (1GB for TEST_DEV size and 900mb as fio I/O size) in this test > case, because nvme/035 is rather unique in the nvme group, which uses TEST_DEV. I've solved this by extending _xfs_run_fio_verify_io() to limit the max size of the io job: _xfs_run_fio_verify_io() { local mount_dir="/mnt/blktests" local bdev=$1 local sz=$2 local sz_mb local avail local avail_mb _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 avail="$(df --output=avail "${mount_dir}" | tail -1)" avail_mb="$((avail / 1024))" if [[ -z "${sz}" ]]; then sz_mb="${avail_mb}" else sz_mb="$(convert_to_mb "${sz}")" if [[ "${sz_mb}" -gt "${avail_mb}" ]]; then sz_mb="${avail_mb}" fi fi _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/" umount "${mount_dir}" >> "${FULL}" 2>&1 rm -fr "${mount_dir}" } Anyway, I'll send out the updated series shortly
diff --git a/common/xfs b/common/xfs index 2c5d96164ac1..ec35599e017b 100644 --- a/common/xfs +++ b/common/xfs @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 + if [[ -z "${sz}" ]]; then + local avail + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" + sz="$(printf "%d" $((avail / 1024 - 1 )))m" + fi + _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" umount "${mount_dir}" >> "${FULL}" 2>&1 diff --git a/tests/nvme/012 b/tests/nvme/012 index e60082c2e751..c9d24388306d 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -44,7 +44,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" diff --git a/tests/nvme/013 b/tests/nvme/013 index 9d60a7df4577..265b6968fd34 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -41,7 +41,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" diff --git a/tests/nvme/035 b/tests/nvme/035 index eb1024edddbf..8b485bc8e682 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -32,7 +32,7 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _xfs_run_fio_verify_io "${nsdev}" "900m" + _xfs_run_fio_verify_io "${nsdev}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}"