From patchwork Thu Oct 1 10:15:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 11811275 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 50BF092C for ; Thu, 1 Oct 2020 10:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2654B21481 for ; Thu, 1 Oct 2020 10:15:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="Y6dTUh+A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730378AbgJAKPf (ORCPT ); Thu, 1 Oct 2020 06:15:35 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:12424 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbgJAKPf (ORCPT ); Thu, 1 Oct 2020 06:15:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1601547334; x=1633083334; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LuItoBUpj2iUBhvJo6LKYvNcMYQxVP2fOX0Ya2+m6zA=; b=Y6dTUh+A1tctBfhrmLQ8EVoHnpKHSc3N0l0b+5T8ISG4478hOuVw2K8d oakmsUjce7+1oriHBFb9NhWzTYa6ZaGcTCwqcmX0b4Qy10c9QhbXOvqAw kwM/FpiXv/+JuT6suaumuSc8hRfSHTOVYfzj2RYQ8JwIhrEhgJ1ur9QbK iDfC9D715uk7NaHk1eVhdwwx/JxjvpqBkd84aacERuJW+yD0mVLHGjen9 dBzqvFHhkQXjZ7RaG3SDLMFP6433ccK4d4TWklyHQnsOO//2HuBD9BYoe zFIRyxO8Mbbu+LAbZI7IQj7DCXS7y8DXDBcouwH+9ZQJ25KybKE7NQgUg w==; IronPort-SDR: DWXNMgaGFoPAQ/OoX4zVDnHa+bYeB/LfSCZmWjcJerZr5UOLgtRjfIAuLF2YnBLwEYdVWrY/MY qyn8P+uPMJt/TFmLvufFHT2mzgXc7xmbcHNM+hB5KyvN2+uxwCOQCIPW04QiAA9kGEq0oUdicf HLHGMM/8yQWw+21mPnz5gdotHK444W6haPaRqk9bDUCmYgMogs8vMExh/oNTS9I+vYp6vM+BzF 7Z/eB2XihJ/LEq1NrjQWAFljLSz/5ZnkqcGqp5zx8gqvyEBvAogaVCQfImwJ+y5ZJTJjueVpx2 B3Y= X-IronPort-AV: E=Sophos;i="5.77,323,1596470400"; d="scan'208";a="258516731" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Oct 2020 18:15:34 +0800 IronPort-SDR: t3rBKHh1HP9CcaY1lghxK3zIYNk6WoXqQ9KTkJaYpuXi1AUhjjQdAXhZLzUmNsgfNoiIQK1odA MPZbn0MasI+Q== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 03:02:26 -0700 IronPort-SDR: bNAbVeLcLAykyjLhlQV5f3ef6R92c3BnKo7GrmhggytLnYYLH8e/ERNKGH/NXmmj0NQ4HpHau6 PH85+Y9MNyfA== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com ([10.149.52.189]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Oct 2020 03:15:34 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Chaitanya Kulkarni , Shinichiro Kawasaki Subject: [PATCH blktests 1/3] common/rc: Add _test_dev_max_active_zones() helper function Date: Thu, 1 Oct 2020 19:15:29 +0900 Message-Id: <20201001101531.333879-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001101531.333879-1-shinichiro.kawasaki@wdc.com> References: <20201001101531.333879-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Linux kernel 5.9 introduced a new sysfs attribute "max_active_zones". It is an attribute of zoned block devices which indicates the limit of zones in open or close status. To refer the attribute from test cases, introduce the helper function _test_dev_max_active_zones(). If the attribute is available, the function returns the attribute value. Otherwise, returns 0 to indicate that the device does not have the limit. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn --- common/rc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/rc b/common/rc index cdc0150..0589431 100644 --- a/common/rc +++ b/common/rc @@ -272,6 +272,14 @@ _test_dev_is_partition() { [[ -n ${TEST_DEV_PART_SYSFS} ]] } +_test_dev_max_active_zones() { + if [[ -r "${TEST_DEV_SYSFS}/queue/max_active_zones" ]]; then + _test_dev_queue_get max_active_zones + else + echo 0 + fi +} + _require_test_dev_is_partition() { if ! _test_dev_is_partition; then SKIP_REASON="${TEST_DEV} is not a partition device" From patchwork Thu Oct 1 10:15:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 11811277 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 F3AC092C for ; Thu, 1 Oct 2020 10:15:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3E472137B for ; Thu, 1 Oct 2020 10:15:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="oPNWeRkN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731067AbgJAKPh (ORCPT ); Thu, 1 Oct 2020 06:15:37 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:12424 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbgJAKPh (ORCPT ); Thu, 1 Oct 2020 06:15:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1601547336; x=1633083336; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PjV/fuPF8j0sDLv3WHDb7H2GvbKmuptcZe9Of96ZMFo=; b=oPNWeRkNA3eu3eOIk3QsCiOli47yAtXBpF677HrynIiwBuWil/OB0/fn OoqvWGUFPgKc6tZog4uno6kooe1EJeY3cqMXtD0R+xxpqE0owJ2RF3cEb 1+g/1dfbF20kXWGEpc2iTKUN7D/27ZDn9gEE6sW94dlij/F1a9zf5In6x HQrMwG4Z+BmMCG/lAsIiLMRYOuj0i9Y9qWNlD62327gpKGPI6Krvr+PBl hxtZF+DQohQOP3zrz8YtP8KCEWppWUx4Qrn9sq/0WJcrK53KLVUl8Q1gY x57Qazq1m0Gxr0neaGVub6h8DDmP0mQ39+ubRjb1N9a9Mbw9HlJH2wNih w==; IronPort-SDR: aMMj8cq0Ft3pBVG2Pe5Hf5KJ8+shSnWnJ9KYR9JwNHmfRdDsX/x8KlA2UmyPnbv7blYpkM2qRJ 1nHwQJoDF0XnNcbYk5ufYkInJsY9xkpmDWh5jO0MEsw4y9vFzWpv+VUq1xHRs2oJ/uFuv3YVkl Hhn8HyJLpmDqtrAd63fBP3OnEENQJm4aSzqqECi88oM9YyaoJ3aqHmdCIdiFGZmveZFOY0YT8z HreLY62NIng7vEXfPTm5LM47jeUiIrKwQNUnUYQIeid14Kq8QQlYagogh5TeDFH03znw/ivbjL dlE= X-IronPort-AV: E=Sophos;i="5.77,323,1596470400"; d="scan'208";a="258516738" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Oct 2020 18:15:36 +0800 IronPort-SDR: mHDHg0bqd/Ml1zq85eu5xI3NXG55rZzvX55HQW9dD2D1qFMQG+0yS1WGTT//yT3UXi65S56kc0 AkEHjt+LhrUw== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 03:02:27 -0700 IronPort-SDR: x+Nt+wNstSzPuUfxnVQq9SpMIJ/RAb+8g26qnfxjsQF8aAUhfMqLbGVZAItI1PglyMDIwKdymI qQovzXe4se7w== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com ([10.149.52.189]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Oct 2020 03:15:36 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Chaitanya Kulkarni , Shinichiro Kawasaki Subject: [PATCH blktests 2/3] block/004: Provide max_active_zones to fio command Date: Thu, 1 Oct 2020 19:15:30 +0900 Message-Id: <20201001101531.333879-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001101531.333879-1-shinichiro.kawasaki@wdc.com> References: <20201001101531.333879-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org If the test target devices is a zoned block device with max_active_zones limit, the fio command in block/004 opens zones beyond the limit and fails with I/O errors. To avoid the failure, pass the limit value to fio using --max_open_zones option. This option, which was introduced to fio together with zonemode=zbd, keeps the number of open zones within the specified value. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn --- tests/block/004 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/block/004 b/tests/block/004 index d181725..6eff6ce 100755 --- a/tests/block/004 +++ b/tests/block/004 @@ -21,19 +21,18 @@ device_requires() { test_device() { echo "Running ${TEST_NAME}" - local directio="" - local zbdmode="" + local -a opts=() if _test_dev_is_zoned; then _test_dev_queue_set scheduler deadline - directio="--direct=1" - zbdmode="--zonemode=zbd" + opts+=("--direct=1" "--zonemode=zbd") + opts+=("--max_open_zones=$(_test_dev_max_active_zones)") fi FIO_PERF_FIELDS=("write iops") _fio_perf --bs=4k --rw=randwrite --norandommap --fsync=1 \ --number_ios=256 --numjobs=64 --name=flushes \ - ${directio} ${zbdmode} --filename="$TEST_DEV" + "${opts[@]}" --filename="$TEST_DEV" echo "Test complete" } From patchwork Thu Oct 1 10:15:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 11811279 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 3E24D112E for ; Thu, 1 Oct 2020 10:15:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19CC321481 for ; Thu, 1 Oct 2020 10:15:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="f/++4sp/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731134AbgJAKPi (ORCPT ); Thu, 1 Oct 2020 06:15:38 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:12424 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbgJAKPi (ORCPT ); Thu, 1 Oct 2020 06:15:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1601547337; x=1633083337; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=slIAKLU442gX7UIrGpn0JbRb1Znj3t8bElJdZmFc6Ow=; b=f/++4sp/3SUsvcPXhQtLejxiO8YA1gYUbyvPEHd/jTBMke0+Z9q7Z68S jDVOad+aa8Oh5yAwuDPxTu7U5Tnu3WF2NrsQqy5g+UKyDE14YLTp29P+N cQdfHM8dpdlw9usvxHSm6T0RGDLJtRbe0FwhO5h8h0H+xYNWgLR+TeoUq ybnTRW0ZtxZruYNlw65JM98SHKzJe3xgndAKiog1PpYljKMc+jETxXHyW Z2kVDOWUQvDcP/K4BeCMttPLR3fi3q7pr0yXmHVriQCbF48f8m4x/hhDt kNse1oYuYRvQvH9DvAxi3mWcutzo2w1ilROE5Sw1lYUHkt6m93UIm2LJC A==; IronPort-SDR: +HZAmLQzfyPsuJUceP0pTbyr6PPa+zZbrxiVOxhH4v2EwuOxvwr1+AyMpXCk/DjGPPFHuOLCMM l6s5bmZlAruzi3Ed6FdcgtZr3FM6JS47Oz8EIgPw2DV1rUHNQFWgfGG7e5YSAywXaISaI24M9V rwbG/E+Bv8ObmLQ/C9QCEbaHlcJRucTNQiuglATLjf08P6H+hg7/+xl7mendzKFs/XLMobqsQh 0M2JMZsifOXIN0gcBwBI5geHzpWzpwHWTUUSQ9zfCALmOQ9mtW/XEw/kD6VA1+j4PWdYHqUvaD 2BE= X-IronPort-AV: E=Sophos;i="5.77,323,1596470400"; d="scan'208";a="258516746" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Oct 2020 18:15:37 +0800 IronPort-SDR: ershdsHMUdfTeXk6R9sFOrzcAfOBN1+BrIka6VWAekt6noaS0RzBiu5YLcmkw2IQ97u/mAZr96 YCr73/H9vCEg== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 03:02:29 -0700 IronPort-SDR: Ddnpk8cCwQDDlJgGePNjPdAgNDhEgmvrl1nw2q+SQ00qcnj/CaFzR8Xi+TftuyFpNc7Ry9Agf+ uPM2pyNR+9hg== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com ([10.149.52.189]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Oct 2020 03:15:37 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Chaitanya Kulkarni , Shinichiro Kawasaki Subject: [PATCH blktests 3/3] zbd/003: Reset zones when the test device has max_active_zones limit Date: Thu, 1 Oct 2020 19:15:31 +0900 Message-Id: <20201001101531.333879-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001101531.333879-1-shinichiro.kawasaki@wdc.com> References: <20201001101531.333879-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org When the test target device has the max_active_zones limit, write operations by test case zbd/003 may open zones beyond the limit and trigger write failures. To avoid the failure, check max_active_zones limit of the test target device. If the limit is valid, reset all zones of the device at test start to ensure that number of open zones does not exceed the limit. Signed-off-by: Shin'ichiro Kawasaki --- tests/zbd/003 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/zbd/003 b/tests/zbd/003 index 079be02..1e92e81 100755 --- a/tests/zbd/003 +++ b/tests/zbd/003 @@ -30,6 +30,11 @@ test_device() { echo "Running ${TEST_NAME}" + # When the test device has max_active_zone limit, reset all zones. This + # ensures the write operations in this test case do not open zones + # beyond the limit. + (($(_test_dev_max_active_zones))) && blkzone reset "${TEST_DEV}" + # Get physical block size as dd block size to meet zoned block device # requirement _get_sysfs_variable "${TEST_DEV}" || return $?