From patchwork Wed May 3 08:02:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 89619 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1156344vqo; Wed, 3 May 2023 01:12:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7OlBWU0M/KZxs9Wm5UcxU17voIc+kBopPBUA7NuAqZCX0ArthAvihajGD16uydX64v6FXx X-Received: by 2002:a05:6a20:9d91:b0:d3:78ab:77c3 with SMTP id mu17-20020a056a209d9100b000d378ab77c3mr20097529pzb.48.1683101556682; Wed, 03 May 2023 01:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683101556; cv=none; d=google.com; s=arc-20160816; b=rTEe2fDKZAlPwffR+LXdE8b12nu4hQCLZYEYSHtkTCAEm1P+9Ar+O8AJhRkAS8P1VH jCRWnWFBAw44yu/AeAwDKrx3XvsdMQhXoGXV1iD1h7/yBRJMMAP9k1+8vvYzxA00nDkj FlZJPtzOjfliP0f7xFXvWLApIXMF+XRnDScmsbiZ5JMEM/0R8ka/l/ZjFic4NibogxwV vUpyVhJ2+g+pd0dj94owdX5+Aw3KiWTjX+xoiEC2cD9cXbEMEv/MhGnCvcQ2XlHMViry SXHRYr9g9XU/fjjvuq6o61Kf/XxkXPAz6q/9l3q9NXasranh9jE1p9ndu54sJo0CwMLS otdg== 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=OHyLoSeY6bQ/dWfNCp2pJm0/BcIAe4YZOdyK2WISgIM=; b=k1BiqziJcdsMjD09iSDNGUyFUX/Z6e5ewk5aAH3sU+yfXIh39a8THrVil7UcCENf/y LzRunypkUMA/DRRG89uTsOp+q9mkNINHHsIkFCKPNIDsKtuYbnJ5gh56BgnzGaR+Ppxr 6j9/T/EC8FFGEJrqISKnMGaTAVUWYMindoQYSDUw4IvO+CgLjcHemgdEc32IxxgVSNzt +2aQSdiY0e9nKOK/Qjbw88NT3KPifMPf8YXL2+QncA7jp1oymqpD1wGJcAO6TvpbuQ5F Q9r3c506hharyFP+Gk+9ghfBNHoFpx8+BQbWA/+Km9kd+fy+WCU/KYQ8rXIi/lyG8Sjh vrgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=f3nOzPgq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 l65-20020a639144000000b0051f7686dfb7si32319154pge.189.2023.05.03.01.12.24; Wed, 03 May 2023 01:12:36 -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=f3nOzPgq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S229834AbjECID0 (ORCPT + 99 others); Wed, 3 May 2023 04:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjECIDN (ORCPT ); Wed, 3 May 2023 04:03:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3FCA1716; Wed, 3 May 2023 01:03:12 -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-out1.suse.de (Postfix) with ESMTPS id 8A71921D04; Wed, 3 May 2023 08:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683100991; 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=OHyLoSeY6bQ/dWfNCp2pJm0/BcIAe4YZOdyK2WISgIM=; b=f3nOzPgqtMoGfGKUson9CJmdn1/wwMpH0YXr3JSHfjDI/HRASmNz349PqaRZTYuIwlQkUM HWm0xIVnr8CU+fduiQiLan9Rnoc9pbansSCRyZc/J02HeQGdxUc29eZtrLuhe43SiyHs89 rsep41uspNt3NUT9LGl6+hc/Jd08cWI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683100991; 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=OHyLoSeY6bQ/dWfNCp2pJm0/BcIAe4YZOdyK2WISgIM=; b=G4aoxJpgAAjFOBndkq6a4W5bppQvIZWy0v1cVsnPyvP0G1TxIaziNOQ2sljJ5m+Ny0tiio K8REybhEj7KRziBw== 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 7E0861331F; Wed, 3 May 2023 08:03:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id O7J2Hj8VUmQxYgAAMHmgww (envelope-from ); Wed, 03 May 2023 08:03:11 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Hannes Reinecke , Daniel Wagner Subject: [PATCH blktests v3 03/12] common/xfs: Make size argument optional for _xfs_run_fio_verify_io Date: Wed, 3 May 2023 10:02:49 +0200 Message-Id: <20230503080258.14525-4-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230503080258.14525-1-dwagner@suse.de> References: <20230503080258.14525-1-dwagner@suse.de> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764859897615821729?= X-GMAIL-MSGID: =?utf-8?q?1764859897615821729?= 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 Reviewed-by: Chaitanya Kulkarni --- common/xfs | 14 +++++++++++++- tests/nvme/012 | 2 +- tests/nvme/013 | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/common/xfs b/common/xfs index 2c5d96164ac1..413c2820ffaf 100644 --- a/common/xfs +++ b/common/xfs @@ -24,10 +24,22 @@ _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 - _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" + 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}")" + fi + + _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/" umount "${mount_dir}" >> "${FULL}" 2>&1 rm -fr "${mount_dir}" 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}"