From patchwork Wed Jul 19 07:15:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13318406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59196EB64DA for ; Wed, 19 Jul 2023 07:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbjGSHPS (ORCPT ); Wed, 19 Jul 2023 03:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjGSHPQ (ORCPT ); Wed, 19 Jul 2023 03:15:16 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66026E43 for ; Wed, 19 Jul 2023 00:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1689750913; x=1721286913; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G09vDse7zEvj0+oVciZKEnyas4RKYuUwRXOFND9n7Po=; b=KPGG5UlU301/N/pL4Ff64IWxFdfVHZ5q8qnVTyItTmk1vNVvAdSX/YYU 205e+KaloCV/ugC1xqL+5IozIc6/+zUfNjjWkfGcW1AOgQj6c4jsnUHbp k7XIs/vcT6CBTUKk/PYTq4ubeFa9F7swfZeu/IDLPN5/c76jaBVVKonGT AoaVhFE8Ykwum0gwl3OWi94Af3UpKCnWqnAV1j5VMWWt7ZwgEGswswoVS 5ZyyDRMH5PwI2MwHIx7oox6Su7PZqsQZtBgnxy7KNw0fD1dmincepfo1p IUOcP2Zr3IkW5894NiYw/9xAnYJ6GxT//HV3sON6bJyceYgJuuugvvBm7 g==; X-IronPort-AV: E=Sophos;i="6.01,216,1684771200"; d="scan'208";a="238846515" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2023 15:15:12 +0800 IronPort-SDR: myQcDpxsY2pMrRbfLmGsFc/WQ0xgUEAwTM0r2QkmtllVIVRbpRLgiS1qU3RdvUePa/d2E19Iop cpOy0PcH2L3zYeFzTzYO7/txsISLp//iS0b7pLjTyT/0NFrbWuD7v7VxcF7+w8ZxNsDzuNuU1b JVVfPDrp8AasjsscPF2z9G0LUelOjraKr/wBVd8sYEgMLpuPxlJa/d/AvijxjwQjF4+dLBbZTX Lrgs4X7EU7lE8LsSd3mStaLNgiQzzpLQyqcK+ic+FxO6s6Ao4p4KG0OeIVT3txPkfyKmXLrwWK xSM= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Jul 2023 23:23:24 -0700 IronPort-SDR: SnTCgq74RsPYr51cHOs6U1bvbNVS2agXymhORRqAOG7AOgHboUBekQGLj60bDWm6c2YdDTZ63z /pGUKU4oNFYjVmDhBMnXXKoe/rXvnLymS5yKPTtEnk9SSiucUPUqGLGJeyfxwaS27S97goHdjD servZtGY1VEIv3ziqBsQTkr472iUsEOGUVEDOMirp+iMU6779vPLW5c9se3o23yWJVjQCgx7Pn gCRprYEr6dxYO7sU0qfxpLGzB6Q2lRL5N0Af7dGdcfEbMJErwGI6ESvf0wco1eEYiTOMc8QWqB 44c= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.55]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jul 2023 00:15:11 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: Shin'ichiro Kawasaki Subject: [PATCH blktests 1/6] check, common/rc: save sysfs attribute path Date: Wed, 19 Jul 2023 16:15:05 +0900 Message-Id: <20230719071510.530623-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> References: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Current implementation saves sysfs attributes under queue/ directory in the associative array TEST_DEV_QUEUE_SAVED using attribute file names as keys. The saved attributes are restored after each test case run. When TEST_DEV is a device-mapper, this attribute restore does not cover attributes of device-mapper destination devices. As a preparation to cover the destination devices, use path of the attributes as keys instead of file names. Also rename the associative array TEST_DEV_QUEUE_SAVED to SYSFS_QUEUE_SAVED. Signed-off-by: Shin'ichiro Kawasaki --- check | 10 +++++----- common/rc | 12 +++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/check b/check index 8eaf5c6..e5697c6 100755 --- a/check +++ b/check @@ -314,10 +314,10 @@ _cleanup() { fi local key value - for key in "${!TEST_DEV_QUEUE_SAVED[@]}"; do - value="${TEST_DEV_QUEUE_SAVED["$key"]}" - echo "$value" >"${TEST_DEV_SYSFS}/queue/${key}" - unset "TEST_DEV_QUEUE_SAVED[$key]" + for key in "${!SYSFS_QUEUE_SAVED[@]}"; do + value="${SYSFS_QUEUE_SAVED["$key"]}" + echo "$value" >"${key}" + unset "SYSFS_QUEUE_SAVED[$key]" done if [[ "${RESTORE_CPUS_ONLINE:-}" ]]; then @@ -336,7 +336,7 @@ _call_test() { local seqres="${RESULTS_DIR}/${TEST_NAME}" # shellcheck disable=SC2034 FULL="${seqres}.full" - declare -A TEST_DEV_QUEUE_SAVED + declare -A SYSFS_QUEUE_SAVED declare -A LAST_TEST_RUN _read_last_test_run diff --git a/common/rc b/common/rc index 90122c0..4984100 100644 --- a/common/rc +++ b/common/rc @@ -284,12 +284,14 @@ _test_dev_queue_get() { } _test_dev_queue_set() { - # For bash >=4.3 we'd write if [[ ! -v TEST_DEV_QUEUE_SAVED["$1"] ]]. - if [[ -z ${TEST_DEV_QUEUE_SAVED["$1"]} && - ${TEST_DEV_QUEUE_SAVED["$1"]-unset} == unset ]]; then - TEST_DEV_QUEUE_SAVED["$1"]="$(_test_dev_queue_get "$1")" + local path="${TEST_DEV_SYSFS}/queue/$1" + + # For bash >=4.3 we'd write if [[ ! -v SYSFS_QUEUE_SAVED["$path"] ]]. + if [[ -z ${SYSFS_QUEUE_SAVED["$path"]} && + ${SYSFS_QUEUE_SAVED["$path"]-unset} == unset ]]; then + SYSFS_QUEUE_SAVED["$path"]="$(_test_dev_queue_get "$1")" fi - echo "$2" >"${TEST_DEV_SYSFS}/queue/$1" + echo "$2" >"$path" } _require_test_dev_is_pci() { From patchwork Wed Jul 19 07:15:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13318409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47165C001DE for ; Wed, 19 Jul 2023 07:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbjGSHPW (ORCPT ); Wed, 19 Jul 2023 03:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjGSHPQ (ORCPT ); Wed, 19 Jul 2023 03:15:16 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1CA1E47 for ; Wed, 19 Jul 2023 00:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1689750914; x=1721286914; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3fF1NGMIcRWVjBOewH3fuROA4CJqtnPUQFzIkVwHVm8=; b=cQMqrSHdrMGIoxbVQbHRzDEryM+0FkvabRAn4jDsUd8CBvm9ERb+S3ZJ w1cY8PYNeaeKRNnlsmYO78ZTDby8GQHnZhjDylq1Tf1+9cSonQ61hCnta uaWNkKSRQQVDabNax7Ow7Sk1jZUw8uxz5fK09PIadFtdj32jyKYi54zdY kDaxbGIFvr87xH8l0zsnEFx6CW/fSgYMBWHQHUyh1VEv9Q7sP+SI4gfuY y/2CkdK4B0DGHjSDfGWj32kWWlUbxtjRQnqHPyJbHZB44NNHoTOZTcNBa Sd5kOljEeTxBMFv2N1U1mdMYuvxwyGqpncaLS0GRTaEs0a15KGmRrzfdh Q==; X-IronPort-AV: E=Sophos;i="6.01,216,1684771200"; d="scan'208";a="238846517" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2023 15:15:12 +0800 IronPort-SDR: T5ashRWuF20qy9+30nKI+IMmv8UiOmdy+iS/2GsnJMbXljtKANAXlFcNuvU84bADz7ssA9Us3H 3RtPTAk6IGqR/fCQpPEXJaJ8+ANKRjIU+uEjtaCoyEHwCTOTmymvz5oS77HjWyBhcedxn4kOaY ahzdI9SsCLugn4raZzy4SAH37EAh1rKhLjfbowNepeqQQlIQehj6oB5JN+L0/XMjqVdO0Ajzpi OK8OkHb1eRR3HE9UPIRJYQgWG+N2GKvWZHjkrW/hKYQC151bTOZs+ojkJS+ZelqT3V7qXt9zxZ INc= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Jul 2023 23:23:24 -0700 IronPort-SDR: jIcVTulS4JZ487tzqYQdpZ/JGLIYXAGGYvKxyB9Tj7/R6DfUZ16Pqbz6rBKSHZgbVxVglpE0u2 1N4BnTLOm/XZqBgVWYbZ+82YRsw/IVWFUI1B3NVc4sdK7t2QC/JXd4Qt6mXkqgcqovq9VoPXU3 ZImBRVv/ede1wCcXw39s/FD/A5K3kwLuOfx0JyoBKmO4EnN/Qaa95gv6/Qmpy1PJTaf5N1m4jL 9z77eCVpS7Rlv6M9+kJgiRpdMKe1hILTI2SbmdEqPhHZV5LQSC6oqG7cpS9syajikidbUdbsvJ 2h8= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.55]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jul 2023 00:15:12 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: Shin'ichiro Kawasaki Subject: [PATCH blktests 2/6] common/dm: add script file for device-mapper functions Date: Wed, 19 Jul 2023 16:15:06 +0900 Message-Id: <20230719071510.530623-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> References: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Create a new script file common/dm and move two helper functions for device-mapper from tests/zbd/rc. Signed-off-by: Shin'ichiro Kawasaki --- common/dm | 23 +++++++++++++++++++++++ tests/zbd/rc | 19 +------------------ 2 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 common/dm diff --git a/common/dm b/common/dm new file mode 100644 index 0000000..85e1ed9 --- /dev/null +++ b/common/dm @@ -0,0 +1,23 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2023 Western Digital Corporation or its affiliates. +# +# scsi_debug helper functions. + +_test_dev_is_dm() { + [[ -r "${TEST_DEV_SYSFS}/dm/name" ]] +} + +# Get device file path from the device ID "major:minor". +_get_dev_path_by_id() { + for d in /sys/block/* /sys/block/*/*; do + if [[ ! -r "${d}/dev" ]]; then + continue + fi + if [[ "${1}" == "$(<"${d}/dev")" ]]; then + echo "/dev/${d##*/}" + return 0 + fi + done + return 1 +} diff --git a/tests/zbd/rc b/tests/zbd/rc index 2e370f0..ffe3f6c 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -6,6 +6,7 @@ . common/rc . common/null_blk +. common/dm # # Test requirement check functions @@ -281,10 +282,6 @@ _find_two_contiguous_seq_zones() { return 1 } -_test_dev_is_dm() { - [[ -r "${TEST_DEV_SYSFS}/dm/name" ]] -} - _require_test_dev_is_logical() { if ! _test_dev_is_partition && ! _test_dev_is_dm; then SKIP_REASONS+=("$TEST_DEV is not a logical device") @@ -307,20 +304,6 @@ _test_dev_has_dm_map() { return 0 } -# Get device file path from the device ID "major:minor". -_get_dev_path_by_id() { - for d in /sys/block/* /sys/block/*/*; do - if [[ ! -r "${d}/dev" ]]; then - continue - fi - if [[ "${1}" == "$(<"${d}/dev")" ]]; then - echo "/dev/${d##*/}" - return 0 - fi - done - return 1 -} - # Given sector of TEST_DEV, return the device which contain the sector and # corresponding sector of the container device. _get_dev_container_and_sector() { From patchwork Wed Jul 19 07:15:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13318411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F276EB64DA for ; Wed, 19 Jul 2023 07:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbjGSHPZ (ORCPT ); Wed, 19 Jul 2023 03:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjGSHPS (ORCPT ); Wed, 19 Jul 2023 03:15:18 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F8AEE43 for ; Wed, 19 Jul 2023 00:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1689750918; x=1721286918; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3uLN/bf/CwY5QdaY046syQAVGUa8EIplLl09TzUIT9M=; b=quE1JPAdR3FoI4jFFit/Czs+oraaFyJtU67VG6Qeb8Ynke2cqlaaA4KA 1jj+/uYoIJeCwsysb9pGWLEmNBwGYc1AzeSfc1SOIuh1uE2WFNAlwmBuu QBO1an+s1ZkMWaahR46aXdmJaE2zNThPXt57pft0qEKj8HGQfFcMNsAmd Kc9bNML9hQVivQCGnrpyhT6ObNNWDzapZdrBPhi4+DsUF1JVLHRmcwU/P eOn8KELoD2YSC/0A7PXBhabSzAlQI1qGdEm8JEYdBOXZ49ip30XXDvyBZ VbEwTQ+eFcuWvtuzbisvmcwzcNvzsrKags/rLJ27uj59K7WVJ53KaIG1/ Q==; X-IronPort-AV: E=Sophos;i="6.01,216,1684771200"; d="scan'208";a="238846530" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2023 15:15:17 +0800 IronPort-SDR: ikWBoOr71qAoO1ygusZ+wL1WVwNlrK1023Mw8rgCYNhNmm/bpv2T8EYqgb2gPFsFBLUeeE292Q C2kSK9Xt/jMLtB+vRrUm0asTUXMBYcsiXRPS88v04o3eP+0RJS5Vd8eDzpLyqYDbEq10WVEqF3 cN/DqLd6q2gBsMYCdeuhR41nNe9wnDcAxiAWyvvazvSSfa55YHhpQDQ2Lav/Z+i/9OpDrm6mjU 2JQgnBfTfggmxJO2PJQJGlf6NLesuy8dJFrrH0D5wEvtzbb3Bhn1T30M2E2JgbQUloz4trGUkP I2Q= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Jul 2023 23:23:25 -0700 IronPort-SDR: OVLPoeUiukHrHWd9T07cHYIvUItZsX+2RH/9FFw5S4rnIeW0O5fcHKGK/i1ITuzxOY054PIliW xhqQ5FTrsjuNWotZLSwLvwCq/ZighJpHdsLs61YC+C4F4mgViJ7PnIRvbSJbsJtEOY5b3/zd2l Xks7zrI2L3h8SkYQNspO9axg4PGp4Iv7MMpQbri6/ent4j94d9m42aMpUQPsivwV7AdiLJ/AJK XzNFpZfwjXrxVt6EcqgsnThkP1bRGrq4OdsQTkoTh7XRqCpxt1U9OD0HGsovKwhr5YvKZvwgXm qWg= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.55]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jul 2023 00:15:13 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: Shin'ichiro Kawasaki Subject: [PATCH blktests 3/6] common/{rc,dm}: introduce functions to set scheduler of dm destinations Date: Wed, 19 Jul 2023 16:15:07 +0900 Message-Id: <20230719071510.530623-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> References: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Since version v6.5, kernel no longer provides scheduler sysfs attribute of bio based device-mapper. If TEST_DEV is a bio based device-mapper and the test case requires specific scheduler, it is required to modify sysfs attributes of destination devices instead of TEST_DEV. To set scheduler to the sysfs attribute of destination devices, add the helper function _dm_destination_dev_set_scheduler. It saves the original scheduler value in the associative array SYSFS_QUEUE_SAVED so that it is restored at each test case end. Also add _test_dev_set_scheduler which sets scheduler regardless whether TEST_DEV is a bio based device-mapper or not. Signed-off-by: Shin'ichiro Kawasaki --- common/dm | 21 +++++++++++++++++++++ common/rc | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/common/dm b/common/dm index 85e1ed9..14f4265 100644 --- a/common/dm +++ b/common/dm @@ -21,3 +21,24 @@ _get_dev_path_by_id() { done return 1 } + +_dm_destination_dev_set_scheduler() { + local dest_dev_id dest_dev path + + while read -r dest_dev_id; do + if ! dest_dev=$(_get_dev_path_by_id "${dest_dev_id}"); then + continue + fi + path=${dest_dev/dev/sys\/block}/queue/scheduler + if [[ ! -w ${path} ]]; then + echo "Can not set scheduler of device mapper destination: ${dest_dev}" + continue + fi + if [[ ${SYSFS_QUEUE_SAVED["$path"]-unset} == unset ]]; then + SYSFS_QUEUE_SAVED["$path"]="$(sed \ + -e 's/.*\[//' -e 's/\].*//' "${path}")" + fi + echo "${1}" > "${path}" + done < <(dmsetup table "$(<"${TEST_DEV_SYSFS}/dm/name")" | + sed -n 's/.* \([0-9]*:[0-9]*\).*/\1/p') +} diff --git a/common/rc b/common/rc index 4984100..52d1602 100644 --- a/common/rc +++ b/common/rc @@ -10,6 +10,7 @@ shopt -s extglob # Include fio helpers by default. . common/fio . common/cgroup +. common/dm # If a test runs multiple "subtests", then each subtest should typically run # for TIMEOUT / number of subtests. @@ -294,6 +295,14 @@ _test_dev_queue_set() { echo "$2" >"$path" } +_test_dev_set_scheduler() { + if [[ -w "${TEST_DEV_SYSFS}/queue/scheduler" ]]; then + _test_dev_queue_set scheduler "$1" + elif _test_dev_is_dm; then + _dm_destination_dev_set_scheduler "$1" + fi +} + _require_test_dev_is_pci() { if ! readlink -f "$TEST_DEV_SYSFS/device" | grep -q pci; then # nvme needs some special casing From patchwork Wed Jul 19 07:15:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13318408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0230FC0015E for ; Wed, 19 Jul 2023 07:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbjGSHPV (ORCPT ); Wed, 19 Jul 2023 03:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjGSHPQ (ORCPT ); Wed, 19 Jul 2023 03:15:16 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E693E69 for ; Wed, 19 Jul 2023 00:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1689750916; x=1721286916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VyX0+ZkhZwbxaoy8Ni9gLqUxYr9nhG9rSMR/Z0bCLVE=; b=Sqi15MSd4TgAJcJd/eEkv/hxskQXyr2548h6Ea0dLq5b1JY73S1Hs/8P zURlJZaJkg+D6YnGty4PipsXHjoa0g+d1XBF/G4VJPP4RD3spRUdES+2a spe15m3OrRd3XXZ8stpT+Zmo1SrpTMBZQQQNJNzgJdiCOKiFvNl1p8G9u /v5CyC7XzqS3yl4zBY0ARz8fuzoMQarEwv6846MnwqdHGvzqzbkc81byK 1Nd0ypcGrP0UhyuBUF/oo50IKcRGrzHep7qwWQV/PUE7D6mEPA1XtD/8G kZ4hLWhjPJTGp5113Iv7GwIJQ8UB+h/RK9zyU44ugVETma+R6Ye2GfxGl w==; X-IronPort-AV: E=Sophos;i="6.01,216,1684771200"; d="scan'208";a="238846520" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2023 15:15:14 +0800 IronPort-SDR: WvE+zokGfQzTWmwLyXkU0eso/YjdjLFeNXnNrPwAeuN9RQvXaWn0UiRx4YV0BBiPM25EKOP2pM brkc7gZVxlsemy3sHOr/Tbwa/kag6S6TdPbrhJQrXsAvvzEyVOy40DF7uVvrjYdK7vwEsoD/5E x2Yw2wIVrGKIcpwGafw8+dspTKlfbv6i30lRgtRgwgfxgg4oFM8XLiMfKuZ4Ox4fmpnmrKg97t k5fKPo89ZS8yM9O9np9oRnsas47309vWaon9zqWGy7CBPbWQNOlQnBXEirfNGWA1WFeiF/PlJ7 Hhs= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Jul 2023 23:29:06 -0700 IronPort-SDR: BGvZT+FmYj2MvNoVpYe2D3ZBqFamJYiexF3pvis6kJSpHXmVfvQ19v9K9ZyWC+eRwom4s7+rFF KcRph/eVVWZyF+mqnG5NS4A93Nmp99EfP6vsA5z/Nap0vcapR0yhKeqX/ETEQf1/NNMk009vIc NNLPQW2VASeXfO4AIkEnON7cVnKVQK+FM8bpO6BQdMDq8koooihohHaGV9RxIZngL3O7frc3UN QkErpzFxDm3T3aNPDcl0VPtZtWfMyyjdptZE4Yyogmejf+OMgAf6droONeI/fkeefy8TQUT917 25I= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.55]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jul 2023 00:15:13 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: Shin'ichiro Kawasaki Subject: [PATCH blktests 4/6] common/rc: introduce _require_test_dev_sysfs Date: Wed, 19 Jul 2023 16:15:08 +0900 Message-Id: <20230719071510.530623-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> References: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case block/005 requires TEST_DEV to have the queue/scheduler sysfs attribute. However, kernel no longer provides the attribute since version 6.5. Add the helper function _require_test_dev_sysfs to check the requirement. Signed-off-by: Shin'ichiro Kawasaki --- common/rc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/rc b/common/rc index 52d1602..caaa49c 100644 --- a/common/rc +++ b/common/rc @@ -256,6 +256,14 @@ _test_dev_is_rotational() { [[ $(cat "${TEST_DEV_SYSFS}/queue/rotational") -ne 0 ]] } +_require_test_dev_sysfs() { + if [[ ! -e "${TEST_DEV_SYSFS}/$1" ]]; then + SKIP_REASONS+=("${TEST_DEV} does not have sysfs attribute $1") + return 1 + fi + return 0 +} + _require_test_dev_is_rotational() { if ! _test_dev_is_rotational; then SKIP_REASONS+=("$TEST_DEV is not rotational") From patchwork Wed Jul 19 07:15:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13318410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA2CEC001E0 for ; Wed, 19 Jul 2023 07:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjGSHPX (ORCPT ); Wed, 19 Jul 2023 03:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjGSHPR (ORCPT ); Wed, 19 Jul 2023 03:15:17 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF88E1735 for ; Wed, 19 Jul 2023 00:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1689750916; x=1721286916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Muv7okmANNU+PV9/u8DFacQ6U9dpbwAvw/i9eTSpfm4=; b=WwknIPsWl1gM6q0ts4HTAQT7uNa+5DA5/7Nj14Y/UbN//LZOdU09hRo6 HUBE399pErcX07poaKG52qjH2IanzrJ95fox1IDlI10Ni+LqUY/ly407A yja3WQSs/1ru8wKp/gksFmBD3RPIBfE91QKED4B9WL9bnlRdNCw46waFp uuUrf9cRtBzWhIcdO8CjaRUbp0ZkwS5V4ESKA0J/W73VvLx7MNxhNvgmX UyR3V2G2NtIJx9XJRygxguZXfoGnOqEQQ0LoPD++vjLhSnx1aQHpkUaja R7n0BbFR9TALuf7EKDIy7o5Klp9yxrNyzN2FtnbkKOZfg7OY7U0xH39lf g==; X-IronPort-AV: E=Sophos;i="6.01,216,1684771200"; d="scan'208";a="238846523" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2023 15:15:16 +0800 IronPort-SDR: nVMZeeTDWSjGqb9mReecdvFWV4HAwZMG9mPQ0QjdmRMIFtWLDWHPD3fQPf9ezwSPKA2aYybzQA 64ge7gZjC3n+B+m9rudRLyj9LOjbhpjO18RCo6UXBti3RUWiZmPiynXS50qHiuDJ/J8bNazUCE P0yPGq+soOWKCBcK2hHVZ+TPY/Tk9Ol7OH3tRlmr6B7KM2MnDokGl2uuD0qEWXZWujnkcnjJjw iKBrBZn+3yVuy6XntW6WYUZpg2k5gpRQxLVFqKdtUTgA6zx+QVtvhpPs+wAUSuyw+DL5j8dHGF s5U= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Jul 2023 23:29:08 -0700 IronPort-SDR: Le8lJIjP92WtraEW9tHcNbFnaSZkNo7oGorcH6OlGtsKvelIawnRWStoYYKCwK1f44B5ZiQ9qQ 2vWfU3xGnKvnIK5n3AYHs7ne4lUOAtP+EzxlQgkVmuJyEWkk3aztqw+NgQpsvY4tby57xDzk3f 1WyzGNdeVNmU+279v47ey/9Rv9G6Qoe0cSomLMw8u+/uGn+/qTIDNyDubXjITxdTpHFrwSLXUt q3CEPLTcnrLsLzAmo0RSW7jc9y1NKqdBf4dlv00VRfmORRiGjG0oqGYX4xVAWrRLb2vO4k9pdm 58s= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.55]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jul 2023 00:15:14 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: Shin'ichiro Kawasaki Subject: [PATCH blktests 5/6] block/004, zbd/{005,006}: call _test_dev_set_scheduler Date: Wed, 19 Jul 2023 16:15:09 +0900 Message-Id: <20230719071510.530623-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> References: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test cases block/004, zbd/005 and zbd/006 do write to zoned block devices which require mq-deadline scheduler. When TEST_DEV is a bio based device-mapper, mq-deadline scheduler shall be set to destination devices. For this purpose, call _test_dev_set_scheduler instead of _test_dev_queue_set. Signed-off-by: Shin'ichiro Kawasaki --- tests/block/004 | 2 +- tests/zbd/005 | 2 +- tests/zbd/006 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/block/004 b/tests/block/004 index a7cec95..63484a4 100755 --- a/tests/block/004 +++ b/tests/block/004 @@ -24,7 +24,7 @@ test_device() { local -a opts=() if _test_dev_is_zoned; then - _test_dev_queue_set scheduler deadline + _test_dev_set_scheduler deadline opts+=("--direct=1" "--zonemode=zbd") opts+=("--max_open_zones=$(_test_dev_max_open_active_zones)") fi diff --git a/tests/zbd/005 b/tests/zbd/005 index a7fb175..4aa1ab5 100755 --- a/tests/zbd/005 +++ b/tests/zbd/005 @@ -48,7 +48,7 @@ test_device() { blkzone reset -o "${ZONE_STARTS[zone_idx]}" "${TEST_DEV}" - _test_dev_queue_set scheduler deadline + _test_dev_set_scheduler deadline : "${TIMEOUT:=30}" FIO_PERF_FIELDS=("write io" "write iops") diff --git a/tests/zbd/006 b/tests/zbd/006 index b745acd..2db0e9b 100755 --- a/tests/zbd/006 +++ b/tests/zbd/006 @@ -38,7 +38,7 @@ test_device() { blkzone reset -o "${ZONE_STARTS[zone_idx]}" "${TEST_DEV}" - _test_dev_queue_set scheduler deadline + _test_dev_set_scheduler deadline : "${TIMEOUT:=30}" FIO_PERF_FIELDS=("write io" "write iops") From patchwork Wed Jul 19 07:15:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13318412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A274C001DC for ; Wed, 19 Jul 2023 07:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjGSHPY (ORCPT ); Wed, 19 Jul 2023 03:15:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjGSHPR (ORCPT ); Wed, 19 Jul 2023 03:15:17 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BBC1736 for ; Wed, 19 Jul 2023 00:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1689750916; x=1721286916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WERDZROZ8kUNfcKK8O+apK3tBjtGrS7Ji1//OKmLZzY=; b=kmmSHts+mm+hZJrKeA/Hn2wzLI7wOI9cslO6qoZ/BZ6/wwNtL7cZ9AMw p3Y4YCVVkGsnL7/5BnkeloF+U7NYKfWXNE7zUAhywKkPFSPta6D3XZM6T nFck3YUV4tesfcvgYI1UEmqKMY/nujZLBbiiWXWrCmLOUFw3R1h9tgfPF 8YYrgaNSbZ41cFOdrCBUTiKgHo70PhYIzBHO9qIacPGcRSzal408721kI bBgaiTAUjJr2Zr9Ce1UyyJEp4jzyUxRLZ76OvEFcaq+muDMLXA0RitJWs OjGKN1Nxn80o7WedzFKgIIf8M5yUCMaKrJyMTvRT9LEQGt0fR9MwaWpdi Q==; X-IronPort-AV: E=Sophos;i="6.01,216,1684771200"; d="scan'208";a="238846525" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2023 15:15:16 +0800 IronPort-SDR: qziA6LpH01vvy0hmxnhUq7bNyY6+43e4be6BgTzrtT6GRkRPZTjsiBpmHvu+QNALxta45BFues CdTygJAwypwOqb1wJEucPuW+icUOcccO2uQJ3FMr99/cRYHFQE3d/Q6ylKXdrP572ImHEHOntK lDdSNcSktUS8b33Pf3kFno6ZxnVxjvo072YQhQp/fc54ILSlYshuOyd3jQvZI/05YmnkxWNuYL fYv/b11IRFkZLti/qmYawlt5S7Emv3N/7oqon4Z/Mt5ewUQApu7jkkr/VZe3ziwTnk0cRHGQAj FkM= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Jul 2023 23:29:08 -0700 IronPort-SDR: dvCXn4AvVLWl9E8H2Bj1MD1XpKA/nY6dTUN6c9bYEbJv9jkd2r0xHSvWFBxGciwGun1XwU0Yvq U8sj9yRU7TEOtfqVTjfDbr3UWQsWorEdjW3NHK6gnkKqxSKS5FAyuU25YSzgql7FAZ1GliMMtU GsaI8VcpQLaRJ5kbZM0UVNrJNRHk3l+q9DrSpkep0IVAUuGLqwDcZ/k4NdWqJNHw5XMbb3FlMs +neVSZaHREyIE8EwRdTdVFfCpm+iBIavjuTEbsHtXRqxvVhq7gR1iTYSxpfd4BTlL2co66TS+Y egk= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.53.55]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jul 2023 00:15:15 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: Shin'ichiro Kawasaki Subject: [PATCH blktests 6/6] block/005: require queue/scheduler sysfs attribute Date: Wed, 19 Jul 2023 16:15:10 +0900 Message-Id: <20230719071510.530623-7-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> References: <20230719071510.530623-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case block/005 does "switch schedulers while doing IO" then it requires the queue/scheduler sysfs attribute. Check that requirement. Signed-off-by: Shin'ichiro Kawasaki --- tests/block/005 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/block/005 b/tests/block/005 index bd04a00..6a58da0 100755 --- a/tests/block/005 +++ b/tests/block/005 @@ -14,6 +14,10 @@ requires() { _have_fio } +device_requires() { + _require_test_dev_sysfs queue/scheduler +} + test_device() { echo "Running ${TEST_NAME}"