From patchwork Tue Jul 28 10:14:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 11688855 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 E9A9413B6 for ; Tue, 28 Jul 2020 10:14:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2620207E8 for ; Tue, 28 Jul 2020 10:14:56 +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="Iitd9q3q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728511AbgG1KO4 (ORCPT ); Tue, 28 Jul 2020 06:14:56 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41078 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbgG1KO4 (ORCPT ); Tue, 28 Jul 2020 06:14:56 -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=1595931295; x=1627467295; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iiIeZiDX1QEz+itBrpo/ZaQ+TXtbtTS4gMusSZY7Kb4=; b=Iitd9q3q9KboDMN+GTy3MdFrXMebxoXzSKs87KZr+RSCu8XR+E8F2Q76 FJp3At5OExS1mHMK83EztNnDNm8JXm+2q0ehzJZIW6TF2kIId21dmPHGU RhjOE0nWWOgEhOYvbA5gZRHrVdx6iK6nfNMqo1VovXrPJPxXcIK18AnAr I6p2EcD+KVHn5D1q854LqI5PXyhl5g+KlGlTINMYlkKY1O/yqovZV64Z7 VtjRDR+hB0YDZ8FEO6AUTpHl3hN+9h67Q2R6dQOrDAh61ZlwAIFZSSsfF L/wqxt3lICof/pRkriGmmNiBMoK5Rk22+McPPsB7Awk4aXWg6rV2DV573 w==; IronPort-SDR: L0sUKBEN/4DupBCROB7kVi9++J+aU7x4ukeh6QwDfTZCADyf7jfDrbI41H+yBlcMO2xs9VTEyC US9OSNh4h+zTL8oGANKunZFohPoJrwG4z4gUT6yPI3xBM5xAj9kUxXy68uiqevOvvbwum/Vd+N 0rIKKA+0yGYFeGM3yupMif52VBK0AlzI8LqbEw4MTr1KoaoQI3o06mGqkB5mjNClZeaiUswJei dmPid+FXJijnCFTOBB1DiX92kVJTUPmKz2ZiFSPnlIAFwtWvAM46CAxvXtXCn+50y0N5hiCe23 ef4= X-IronPort-AV: E=Sophos;i="5.75,406,1589212800"; d="scan'208";a="143543034" 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; 28 Jul 2020 18:14:55 +0800 IronPort-SDR: nUr2XRsrua+Qr6gsJRn82FNaThb3mw4+5b8ruiIQAfxuBQMdGJOPVrG7r9drEwVL/eEf0ydHvv hl/wfLZZMohEW2KopaMkArBoJndPKzrWI= 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; 28 Jul 2020 03:03:04 -0700 IronPort-SDR: BiQJ9LEb0jPM+eA3XcyO0yyIUCfMdAUXTlDMZTEiYP/+f7W7LQH0SSeYofm1Wh3Gaq4C7tIlDf FWIPfg8mQ65w== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.87]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Jul 2020 03:14:54 -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/5] zbd/rc: Support zone capacity report by blkzone Date: Tue, 28 Jul 2020 19:14:48 +0900 Message-Id: <20200728101452.19309-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> References: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Linux kernel 5.9 zone descriptor interface added the new zone capacity field defining the range of sectors usable within a zone. The blkzone tool recently supported the zone capacity in its report zone feature. Modify the helper function _get_blkzone_report() to support the zone capacity field. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn Reviewed-by: Klaus Jensen --- tests/zbd/rc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/zbd/rc b/tests/zbd/rc index 3124693..dafd130 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -104,6 +104,7 @@ _put_sysfs_variable() { # until put function call. _get_blkzone_report() { local target_dev=${1} + local cap_idx wptr_idx conds_idx type_idx # Initialize arrays to store parsed blkzone reports. # Number of reported zones is set in REPORTED_COUNT. @@ -111,6 +112,7 @@ _get_blkzone_report() { # to simplify loop operation. ZONE_STARTS=() ZONE_LENGTHS=() + ZONE_CAPS=() ZONE_WPTRS=() ZONE_CONDS=() ZONE_TYPES=() @@ -123,6 +125,17 @@ _get_blkzone_report() { return $? fi + cap_idx=3 + wptr_idx=5 + conds_idx=11 + type_idx=13 + if grep -qe "cap 0x" "${TMP_REPORT_FILE}"; then + cap_idx=5 + wptr_idx=7 + conds_idx=13 + type_idx=15 + fi + local _IFS=$IFS local -i loop=0 IFS=$' ,:' @@ -130,9 +143,10 @@ _get_blkzone_report() { do ZONE_STARTS+=($((_tokens[1]))) ZONE_LENGTHS+=($((_tokens[3]))) - ZONE_WPTRS+=($((_tokens[5]))) - ZONE_CONDS+=($((${_tokens[11]%\(*}))) - ZONE_TYPES+=($((${_tokens[13]%\(*}))) + ZONE_CAPS+=($((_tokens[cap_idx]))) + ZONE_WPTRS+=($((_tokens[wptr_idx]))) + ZONE_CONDS+=($((${_tokens[conds_idx]%\(*}))) + ZONE_TYPES+=($((${_tokens[type_idx]%\(*}))) if [[ ${ZONE_TYPES[-1]} -eq ${ZONE_TYPE_CONVENTIONAL} ]]; then (( NR_CONV_ZONES++ )) fi @@ -150,6 +164,7 @@ _get_blkzone_report() { local -i max_idx=$((REPORTED_COUNT - 1)) ZONE_STARTS+=( $((ZONE_STARTS[max_idx] + ZONE_LENGTHS[max_idx])) ) ZONE_LENGTHS+=( "${ZONE_LENGTHS[max_idx]}" ) + ZONE_CAPS+=( "${ZONE_CAPS[max_idx]}" ) ZONE_WPTRS+=( "${ZONE_WPTRS[max_idx]}" ) ZONE_CONDS+=( "${ZONE_CONDS[max_idx]}" ) ZONE_TYPES+=( "${ZONE_TYPES[max_idx]}" ) @@ -160,6 +175,7 @@ _get_blkzone_report() { _put_blkzone_report() { unset ZONE_STARTS unset ZONE_LENGTHS + unset ZONE_CAPS unset ZONE_WPTRS unset ZONE_CONDS unset ZONE_TYPES From patchwork Tue Jul 28 10:14:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 11688857 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 50D8113B6 for ; Tue, 28 Jul 2020 10:14:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38B05207E8 for ; Tue, 28 Jul 2020 10:14:58 +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="OM5UzqqB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbgG1KO5 (ORCPT ); Tue, 28 Jul 2020 06:14:57 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41078 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbgG1KO5 (ORCPT ); Tue, 28 Jul 2020 06:14:57 -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=1595931296; x=1627467296; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WgMqeRKEoIHGJ6rjL4jdAWTvtm4BC32GS5ByI4+Z8qY=; b=OM5UzqqB/ENm8hH0qsx/obSqnoAZLLwZROqkqq7hoBXvSnU2n/JUUJMT EMB3dvONAzLSp+WG5Ek16KMpz+MHFm1wu+sCUgCsILzszYaRJ9bcD8Ij0 N0BKZ61dY/07HLcQq+iyPGnKL7nuF4MhdpeWjPbtofXiWJE0X9dpCP6r9 1dGvf9zpbuPIkgdGoAkSJAevLEGdOpmAuJ6JIqBrerVkekp5CU746AJsj BPeBS5Q8M0v5HvViWnhbW66bteoWP0QfDF5ocJEOeJEEXMdQ6ObZ1Q4a9 VGq7qzMzeTkNYeYc8EBHJ3hcFyqbKPCAi3xkCM3FsLFBzxCsZLeTtCux/ w==; IronPort-SDR: RV1atcyY9chgb4Q6jNsokWQYEL4F1PbcBB4ksGmcqyYUf5Dz0PnUuOZ+W5bg+LpoDKNbN10oKg sq2c5YwpI4CcIxhecnXNIwhfMcsm14MfjyOOQL3sYEv/zmP88HaUEEjef7zCOekHUY4tkVy/BD kP9NTZZ6WwKACu9CCPHQdwTJn4UX370W+ty6H6+RuS2GKaI9AFS0CBMl915/F+kSEi7L2I09yO +bFhiLrN2pm0lgU5aKHG+1W7gsXHMWYJpETxWiKRMRD1SaTkYDAC8rWqyxTPaSis4+UynOTDze pDY= X-IronPort-AV: E=Sophos;i="5.75,406,1589212800"; d="scan'208";a="143543038" 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; 28 Jul 2020 18:14:56 +0800 IronPort-SDR: ZksTMZDXgkUgJwjc4rvF3ctY4oAakDFfThCDZr0VklB/JPNG6ViPK4/6atm4HW97rS5pXg0N/R Y7PkvmbRxQ8vTuGYJ9CwBxOidb/sI3NAY= 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; 28 Jul 2020 03:03:06 -0700 IronPort-SDR: 4Tij4hoF8bW/jnJgVUDVvGT/r+1gfnsqS+VHR7wiIZ38A87ALBOxwKwsbUfRR5yf1vJGxGNo5L hva4TlhtUJ9A== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.87]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Jul 2020 03:14:55 -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/5] zbd/002: Check validity of zone capacity Date: Tue, 28 Jul 2020 19:14:49 +0900 Message-Id: <20200728101452.19309-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> References: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Linux kernel 5.9 zone descriptor interface added the new zone capacity field defining the range of sectors usable within a zone. Add a check to ensure that the zone capacity is smaller than or equal to the zone size. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn Reviewed-by: Klaus Jensen --- tests/zbd/002 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/zbd/002 b/tests/zbd/002 index e197827..a134434 100755 --- a/tests/zbd/002 +++ b/tests/zbd/002 @@ -24,6 +24,7 @@ _check_blkzone_report() { local -i cur_start=${ZONE_STARTS[0]} local -i next_start=0 local -i len=0 + local -i cap=0 local -i wptr=0 local -i cond=0 local -i zone_type=0 @@ -50,6 +51,7 @@ _check_blkzone_report() { next_start=${ZONE_STARTS[$((idx+1))]} len=${ZONE_LENGTHS[$idx]} + cap=${ZONE_CAPS[$idx]} wptr=${ZONE_WPTRS[$idx]} cond=${ZONE_CONDS[$idx]} zone_type=${ZONE_TYPES[$idx]} @@ -70,6 +72,13 @@ _check_blkzone_report() { return 1 fi + # Check zone capacity + if [[ ${cap} -gt ${len} ]]; then + echo -n "Zone capacity is invalid at zone ${idx}. " + echo "capacity: ${cap}, size: ${len}" + return 1 + fi + # Check write pointer if [[ ${wptr} -lt 0 || ${wptr} -gt ${len} ]]; then echo -n "Write pointer is invalid at zone ${idx}. " From patchwork Tue Jul 28 10:14:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 11688859 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 ECA0114DD for ; Tue, 28 Jul 2020 10:14:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4DFF207E8 for ; Tue, 28 Jul 2020 10:14:59 +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="pBptjkIq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728561AbgG1KO7 (ORCPT ); Tue, 28 Jul 2020 06:14:59 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41078 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbgG1KO6 (ORCPT ); Tue, 28 Jul 2020 06:14:58 -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=1595931298; x=1627467298; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f3IZ03vSoX2zAi2YKhqJXLiULty70QYy71aJYyx545o=; b=pBptjkIqKQuglS+lyg9K9q7bkkfkPT8BLfz4UXGSfX+gc4aJCBByycax dDtV+e2k1Uk6jiJmAjNoq5FsLVOqCV5S0yCb7sCAYS41t9M0mVe/yYcrW LSPfTFWx++XXC2GDJO58FLIunaNMmuHqZc5GA1i1C+ppK+GL33w6Su81p JmLPIGIMpu8vwWxm/Fs+V9tsPHHIixU/yyaVznkzGaefrwKFY+N+9Ao8Y IGql9+GMy48xUuRi/O947UqUdknuk1IIvlfu+mkhPdE/JCt9iGZCtYwVp 5Ht31uXRgmfB4YxiPjPMYIE8K1LCUKLbJy9j3onrKviyw3427q9Z0U7yd Q==; IronPort-SDR: 6xwXbtmq65lFXdRweR/TwajRdUtb6h33UcedxqJPxTDIkXjMJINXqfj+hHykFsxFhUOz2gR2yI 2DYtOTyYgpUDrYXwpRDIYyWfbwTw7EVpJJHDWdhqRjTjfqsgcjpWxgLryoBI4UdXBAgiFW6v9J kBKcXyrXTocnaHGMUDP2uhjoE5Qfu9AY2ybC7a+gdiiJsSTuAImfV+ovQCrDQGUa22jKNUs607 kQ63kflqrIZpbd6+Y5CROBnZa7LWHrryq+qjZ6JMrpd9+LE73NLp6EG6CG9GDA3gA6DGbpT4s6 C7Q= X-IronPort-AV: E=Sophos;i="5.75,406,1589212800"; d="scan'208";a="143543043" 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; 28 Jul 2020 18:14:58 +0800 IronPort-SDR: GTSePXyNUYolT/K8oqT2leLTTOYcQ8R4AIqlo8sNaKUmDEvCV6UAX3HMV9mrQgCeXU2k6apI9D +ZJSuNOhr+Y/klywzsu0OWEW4sBySd1lk= 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; 28 Jul 2020 03:03:07 -0700 IronPort-SDR: tqq49VyBYs9WfRCPlHX+R/u/kJcRxq/mR6TBCG/U/Iz5FbiZiXpXkG4/+Yz9l0LffstVeWt6GE vl9FCPVCuk5Q== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.87]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Jul 2020 03:14:57 -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/5] zbd/004: Check zone boundary writes using zones without zone capacity gap Date: Tue, 28 Jul 2020 19:14:50 +0900 Message-Id: <20200728101452.19309-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> References: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case zbd/004 checks zone boundary write handling by block layer using two contiguous sequential write required zones. This test is valid when the first zone has same zone capacity as zone size. However, if the zone has zone capacity smaller than zone size, the write in the zone beyond zone capacity limit causes write error and the test fails. To avoid the write error, find the two zones with first zone that has zone capacity same as zone size. If such zones are not found, skip the test case. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn Reviewed-by: Klaus Jensen --- tests/zbd/004 | 6 +++++- tests/zbd/rc | 11 +++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/zbd/004 b/tests/zbd/004 index ac0cf50..f09ee31 100755 --- a/tests/zbd/004 +++ b/tests/zbd/004 @@ -46,7 +46,11 @@ test_device() { # Find target sequential required zones and reset write pointers _get_blkzone_report "${TEST_DEV}" || return $? - idx=$(_find_two_contiguous_seq_zones) || return $? + if ! idx=$(_find_two_contiguous_seq_zones cap_eq_len); then + SKIP_REASON="No contiguous sequential write required zones" + _put_blkzone_report + return + fi _reset_zones "${TEST_DEV}" "${idx}" "2" # Confirm the zones are initialized diff --git a/tests/zbd/rc b/tests/zbd/rc index dafd130..3fd2d36 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -253,21 +253,28 @@ _find_sequential_zone_in_middle() { return 1 } -# Search zones and find two contiguous sequential required zones. +# Search zones and find two contiguous sequential write required zones. # Return index of the first zone of the found two zones. +# When the argument cap_eq_len is specified, find the two contiguous +# sequential write required zones with first zone that has zone capacity +# same as zone size. # Call _get_blkzone_report() beforehand. _find_two_contiguous_seq_zones() { + local cap_eq_len="${1}" local -i type_seq=${ZONE_TYPE_SEQ_WRITE_REQUIRED} for ((idx = NR_CONV_ZONES; idx < REPORTED_COUNT; idx++)); do if [[ ${ZONE_TYPES[idx]} -eq ${type_seq} && ${ZONE_TYPES[idx+1]} -eq ${type_seq} ]]; then + if [[ -n ${cap_eq_len} ]] && + ((ZONE_CAPS[idx] != ZONE_LENGTHS[idx])); then + continue + fi echo "${idx}" return 0 fi done - echo "Contiguous sequential write required zones not found" return 1 } From patchwork Tue Jul 28 10:14:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 11688861 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 7DB2013B6 for ; Tue, 28 Jul 2020 10:15:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64983207E8 for ; Tue, 28 Jul 2020 10:15:01 +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="GK7F+x7f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728663AbgG1KPA (ORCPT ); Tue, 28 Jul 2020 06:15:00 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41078 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbgG1KPA (ORCPT ); Tue, 28 Jul 2020 06:15:00 -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=1595931299; x=1627467299; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VaCNNGEe5OuQ6YDyy/3tXmiPAr5Ndjgz9QsiLcuEud4=; b=GK7F+x7fKA5ItYd5bCyrbEn2NQgHiLkpdl2BKD3+A/x8fmTBqkpmkehx Y5n0YHcFG905zXmmXxW13P1rQ7gb+MQSdBgBrJfydscILi8edoai0n3M9 JQG/idrASRo5DCMBu583ziRi+/S4zSY7IqwsEcW9lerhae0soqTK+zmaF AbaxnYWOZmUCu29D0Kzl90Das0V24sItqRp9fv7qjB1lF0af098OLgW/h RnTLl3bgRL6hATDvuB1xrbpYHIkRb/1pPu4MKu9hlbelO11CjSOpTq22G v1YUuUr+xnnpzrqW4trlL7BEV+w6hRIW9dCU1UTDt9eRN7yDggMx2Q7Fp g==; IronPort-SDR: tnRyt9ZIdpWpMf+uBXI7yFp0g/s3XnMExxLK3hykhGu0Y40pAozJp4Fg4mzdtri30PvK9WHp2P wJd0jNQbRRa5tUDlx0dFSbcTq/XjpgM9RksKip3w4LIcDS4dGimqwIlyotz2akbsOABB/+Hmup uBSwxJggx/PvEpbE2ubV/Mu84j2/lBMQh8PxQquUqzTAMXkyPE5MGcxjrAreuyIUG25pjwuC3g rDJTKQWfzsG3Xu1diMIsclmPB5cEt4gJPJbsG6f6pR0vYksfdhU7dbVmm+HkWYuajfcTWL9rE1 prE= X-IronPort-AV: E=Sophos;i="5.75,406,1589212800"; d="scan'208";a="143543047" 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; 28 Jul 2020 18:14:59 +0800 IronPort-SDR: 7Dz8nEYLBg7t8MsLIOmM+xiqFtM2HmQbOs38/eMbMuUCWs0B9KcVMJNqqn5oGoHzpQ4YqzMMxi IFaYhw2TzmE/5QT3vwCyeaU3GDW5vFtXM= 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; 28 Jul 2020 03:03:08 -0700 IronPort-SDR: 513hgTjlbOoCIVpIrG+2jXZI3aOY74qSyKjUGoNXYGkDnl3OD/jfZyPW4M9it1cGLb+ZzGWdHj QbywUPq3itvg== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.87]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Jul 2020 03:14:58 -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 4/5] zbd/005: Enable zonemode=zbd when zone capacity is less than zone size Date: Tue, 28 Jul 2020 19:14:51 +0900 Message-Id: <20200728101452.19309-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> References: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case zbd/005 runs fio to issue sequential write requests with high queue depth. This workload does not require zonemode=zbd for zones with zone capacity same as zone length. However, when the zone has smaller zone capacity than zone size, it issues write beyond zone capacity and triggers write errors. To allow fio skipping the writes beyond zone capacity, specify the option zonemode=zbd to fio when the test target zone has zone capacity smaller than zone size. Also remove unused sysfs access in the test case. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn Reviewed-by: Klaus Jensen --- tests/zbd/005 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/zbd/005 b/tests/zbd/005 index 65546a6..1e8962c 100755 --- a/tests/zbd/005 +++ b/tests/zbd/005 @@ -28,15 +28,21 @@ cleanup_fallback_device() { test_device() { local -i zone_idx local -i offset + local zbdmode="" echo "Running ${TEST_NAME}" - _get_sysfs_variable "${TEST_DEV}" || return $? _get_blkzone_report "${TEST_DEV}" || return $? zone_idx=$(_find_first_sequential_zone) || return $? offset=$((ZONE_STARTS[zone_idx] * 512)) + # If the test target zone has smaller zone capacity than zone size, + # enable zonemode=zbd to have fio handle the zone capacity limit. + if ((ZONE_CAPS[zone_idx] != ZONE_LENGTHS[zone_idx])); then + zbdmode="--zonemode=zbd" + fi + blkzone reset -o "${ZONE_STARTS[zone_idx]}" "${TEST_DEV}" _test_dev_queue_set scheduler deadline @@ -45,10 +51,9 @@ test_device() { FIO_PERF_FIELDS=("write io" "write iops") _fio_perf --filename="${TEST_DEV}" --name zbdwo --rw=write --direct=1 \ --ioengine=libaio --iodepth=128 --bs=256k \ - --offset="${offset}" + --offset="${offset}" ${zbdmode} _put_blkzone_report - _put_sysfs_variable echo "Test complete" } From patchwork Tue Jul 28 10:14:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 11688863 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 6C38613B6 for ; Tue, 28 Jul 2020 10:15:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52E1420714 for ; Tue, 28 Jul 2020 10:15:02 +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="M6dMKEZK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbgG1KPB (ORCPT ); Tue, 28 Jul 2020 06:15:01 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41078 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728632AbgG1KPB (ORCPT ); Tue, 28 Jul 2020 06:15:01 -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=1595931300; x=1627467300; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZcX1U0dicMsZFqsUVHG9A0vjQGjfz0c8b1BKlzUqbgI=; b=M6dMKEZKk8g9YrR8woRNBiPMPKWg/O/cpHWAvjGdJxiXbg8YD0aUxgLV dbJrVjhu0KpmpORzIoadr8ZoCOAD14ypljeTAaT12G3JzRvHUQyKVova2 U3dlhJXs/xrZKbNhF/LPNJt7ObF2SXBweWX1OstPOY86UZcvR+vF8Kc4c V3FU7WTlkhMQFDL5aZvZvP19eeCB3w/P1EaIP3aVdqbZaoq8WDnY+iJ5o fR5/JHvO95w33hIfGg+8C5itZ3QiU26EDyMDe4nz1BJAjcgQN8TL6nnNT wga/3bAbPRhE63Q/y3bod/eoIp+gSgMDnYbV8q1ei45HJMqlTyPaB8UK9 A==; IronPort-SDR: F1Kjvf0Ib42HguajpnU3EpJOvoRXbGgM+lDRRYhDXyFdfcZgJ36cvzjt5waUPtXe4xk7GynpGD NPakfYW355dqoVKtDZ6wSFTcfbQZGRx5IhirWxSNduv8R4GNpJE5P6/pATnBlmaYLJhda7uVTe 9wgqqNMUulXTpjHWyrzlNzB+qt7Ed05ddH0BkjnH2rUPJZUT/1Flimacdqtp21E3kCGdNy5Ysf PB3eCtgYlprPiigLWI6LwMfMdSazVzPqn0DJdydgb2m4OHMdMNPS+LsWdq5HS9WqMcpxyiRw10 QbA= X-IronPort-AV: E=Sophos;i="5.75,406,1589212800"; d="scan'208";a="143543054" 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; 28 Jul 2020 18:15:00 +0800 IronPort-SDR: dtjt41vwN2fdqWmxMdRAkAW2j/FV43FFy4zIaZ7/7voTr3nSeVIVb1PxFatxzQ/EWwfmH5Yx5t 8AWrIoRn5FvUX0zAHaLxQpGEG19tDVxUo= 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; 28 Jul 2020 03:03:10 -0700 IronPort-SDR: xK/DDdeIf1J4nw7AkynUmiAe6Cs4Bro2iIYXewuWxxH+WDF28YgjLgtKIfU1z8WjdqZmRquj4Z HgYDtHXNFNYg== WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.87]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Jul 2020 03:14:59 -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 5/5] zbd/002: Check write pointers only when zones have valid conditions Date: Tue, 28 Jul 2020 19:14:52 +0900 Message-Id: <20200728101452.19309-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> References: <20200728101452.19309-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Per ZBC, ZAC and ZNS specifications, when zones have condition "read only", "full" or "offline", the zones may not have valid write pointers. In such a case, do not check validity of write pointers. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn Reviewed-by: Klaus Jensen --- tests/zbd/002 | 7 +++++-- tests/zbd/rc | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/zbd/002 b/tests/zbd/002 index a134434..39c2ad5 100755 --- a/tests/zbd/002 +++ b/tests/zbd/002 @@ -80,9 +80,12 @@ _check_blkzone_report() { fi # Check write pointer - if [[ ${wptr} -lt 0 || ${wptr} -gt ${len} ]]; then + if ((cond != ZONE_COND_READ_ONLY && + cond != ZONE_COND_FULL && + cond != ZONE_COND_OFFLINE && + (wptr < 0 || wptr > len) )); then echo -n "Write pointer is invalid at zone ${idx}. " - echo "wp:${wptr}" + echo "wp:${wptr}, cond:${cond}" return 1 fi diff --git a/tests/zbd/rc b/tests/zbd/rc index 3fd2d36..1237363 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -41,7 +41,9 @@ export ZONE_TYPE_SEQ_WRITE_PREFERRED=3 export ZONE_COND_EMPTY=1 export ZONE_COND_IMPLICIT_OPEN=2 export ZONE_COND_CLOSED=4 +export ZONE_COND_READ_ONLY=13 export ZONE_COND_FULL=14 +export ZONE_COND_OFFLINE=15 export ZONE_TYPE_ARRAY=( [1]="CONVENTIONAL"