mbox series

[blktests,v2,00/16] Implement zoned block device support

Message ID 20190110093725.32675-1-shinichiro.kawasaki@wdc.com (mailing list archive)
Headers show
Series Implement zoned block device support | expand

Message

Shin'ichiro Kawasaki Jan. 10, 2019, 9:37 a.m. UTC
The current blktests infrastucture and test cases do not support zoned block
devices and no specific test cases exist to test these block devices special
features (zone report and reset, sequential write constraint). This patch series
implement this missing support.

The series addresses two aspects: the first 7 patches introduce changes to the
common scripts and configuration are introduced to allow existing test cases to
run against a null_blk device with zone mode enabled (new ZONED config variable)
or for these test cases to be skipped if a test declare itself as not zoned
compliant. Helper functions are introduced to facilitate checking a device
zone model.

The second part, composed of the last 9 patches, introduce the new zbd test
group to cover zoned block device specific test cases. All these test cases are
implemented using the test_device() function so that target devices can be
specified in the TEST_DEVS config variable, to cover a variety of zoned block
devices: physical real drives, partitions and dm-linear setups on top of zoned
block devices, etc. Furthermore, using the infrastructure changes of the first
part, the TEST_DEVS definition can be left empty, resulting in the zbd test
cases to be run against an automatically created null_blk device with zoned
mode enabled.

5 test cases are added to the new zbd test group to check the kernel ioctl and
sysfs interface, zone report operation, zone reset and write command handling.
These tests are simple but only a start. We will in the future send more test
cases to cover at least the regressions and bugs found and fixed in the zoned
block device code since its introduction with kernel 4.10.

Another still to be added part is support for host-managed ZBC emulation in
scsi-debug to further improve test coverage without requiring a physical SMR
disk. This work is ongoing and will be added to blktests once the relevant
scsi-debug changes are accepted in the kernel.

Changes from v1:
* Fixed _test_dev_is_zoned
* Added _have_fio_zbd_zonemode
* Added patch 10 to move _dd to common/rc
* Addressed various nit commented on the list

Masato Suzuki (6):
  tests: Introduce zbd test group
  zbd/001: sysfs and ioctl consistency test
  zbd/002: report zone test
  zbd/003: Test sequential zones reset
  zbd/004: Check write split accross sequential zones
  zbd/005: Test write ordering

Shin'ichiro Kawasaki (10):
  config: Introduce ZONED variable
  common: Introduce _test_dev_is_zoned() helper function
  common: Move set_scheduler() function definition
  common: Introduce _have_fio_zbd_zonemode() helper function
  block/004: Adjust fio conditions for zoned block device
  block/013: Skip for zoned block devices
  block/018,024: Skip when ZONED is set
  check: Introduce group_exit() function
  src: Introduce zbdioctl program
  common: Introduce _dd() helper function

 Documentation/running-tests.md |  11 ++
 check                          |   6 +
 common/fio                     |  12 ++
 common/multipath-over-rdma     |  24 ----
 common/null_blk                |  23 +++-
 common/rc                      |  63 ++++++++++
 src/.gitignore                 |   1 +
 src/Makefile                   |   3 +-
 src/zbdioctl.c                 |  83 +++++++++++++
 tests/block/004                |  18 ++-
 tests/block/013                |   9 ++
 tests/block/018                |   2 +-
 tests/block/024                |   2 +-
 tests/zbd/001                  |  66 ++++++++++
 tests/zbd/001.out              |   2 +
 tests/zbd/002                  |  99 +++++++++++++++
 tests/zbd/002.out              |   2 +
 tests/zbd/003                  |  69 +++++++++++
 tests/zbd/003.out              |   2 +
 tests/zbd/004                  |  81 ++++++++++++
 tests/zbd/004.out              |   2 +
 tests/zbd/005                  |  59 +++++++++
 tests/zbd/005.out              |   2 +
 tests/zbd/rc                   | 219 +++++++++++++++++++++++++++++++++
 24 files changed, 831 insertions(+), 29 deletions(-)
 create mode 100644 src/zbdioctl.c
 create mode 100755 tests/zbd/001
 create mode 100644 tests/zbd/001.out
 create mode 100755 tests/zbd/002
 create mode 100644 tests/zbd/002.out
 create mode 100755 tests/zbd/003
 create mode 100644 tests/zbd/003.out
 create mode 100755 tests/zbd/004
 create mode 100644 tests/zbd/004.out
 create mode 100755 tests/zbd/005
 create mode 100644 tests/zbd/005.out
 create mode 100644 tests/zbd/rc

Comments

Omar Sandoval Jan. 17, 2019, 2:16 a.m. UTC | #1
On Thu, Jan 10, 2019 at 06:37:09PM +0900, Shin'ichiro Kawasaki wrote:
> The current blktests infrastucture and test cases do not support zoned block
> devices and no specific test cases exist to test these block devices special
> features (zone report and reset, sequential write constraint). This patch series
> implement this missing support.
> 
> The series addresses two aspects: the first 7 patches introduce changes to the
> common scripts and configuration are introduced to allow existing test cases to
> run against a null_blk device with zone mode enabled (new ZONED config variable)
> or for these test cases to be skipped if a test declare itself as not zoned
> compliant. Helper functions are introduced to facilitate checking a device
> zone model.
> 
> The second part, composed of the last 9 patches, introduce the new zbd test
> group to cover zoned block device specific test cases. All these test cases are
> implemented using the test_device() function so that target devices can be
> specified in the TEST_DEVS config variable, to cover a variety of zoned block
> devices: physical real drives, partitions and dm-linear setups on top of zoned
> block devices, etc. Furthermore, using the infrastructure changes of the first
> part, the TEST_DEVS definition can be left empty, resulting in the zbd test
> cases to be run against an automatically created null_blk device with zoned
> mode enabled.
> 
> 5 test cases are added to the new zbd test group to check the kernel ioctl and
> sysfs interface, zone report operation, zone reset and write command handling.
> These tests are simple but only a start. We will in the future send more test
> cases to cover at least the regressions and bugs found and fixed in the zoned
> block device code since its introduction with kernel 4.10.
> 
> Another still to be added part is support for host-managed ZBC emulation in
> scsi-debug to further improve test coverage without requiring a physical SMR
> disk. This work is ongoing and will be added to blktests once the relevant
> scsi-debug changes are accepted in the kernel.
> 
> Changes from v1:
> * Fixed _test_dev_is_zoned
> * Added _have_fio_zbd_zonemode
> * Added patch 10 to move _dd to common/rc
> * Addressed various nit commented on the list
> 
> Masato Suzuki (6):
>   tests: Introduce zbd test group
>   zbd/001: sysfs and ioctl consistency test
>   zbd/002: report zone test
>   zbd/003: Test sequential zones reset
>   zbd/004: Check write split accross sequential zones
>   zbd/005: Test write ordering
> 
> Shin'ichiro Kawasaki (10):
>   config: Introduce ZONED variable
>   common: Introduce _test_dev_is_zoned() helper function
>   common: Move set_scheduler() function definition
>   common: Introduce _have_fio_zbd_zonemode() helper function
>   block/004: Adjust fio conditions for zoned block device
>   block/013: Skip for zoned block devices
>   block/018,024: Skip when ZONED is set
>   check: Introduce group_exit() function
>   src: Introduce zbdioctl program
>   common: Introduce _dd() helper function

Hi,

Thanks so much for the contribution. It'll be great to have some tests
for zoned block devices.

One thing I'm not a huge fan of is that setting the ZONED mode hijacks
the existing tests to be ZBD tests. When I'm doing a full test run, I'd
like to run those tests in both modes without running the rest of the
test suite twice.

Instead, what if we added a per-test setting like CAN_BE_ZONED and a
global config RUN_ZONED_TESTS? If those are both set, we run it once in
normal mode and once in zoned mode. This also avoids having to blacklist
tests which don't support zoned mode (although we'll have to remember to
whitelist tests that would work on a zoned device).

The functionality for falling back to null_blk if no devices are
specified is nifty. It'd be nice to have that as generic functionality
instead of specific to the zbd group. Something like a per-test
fallback_device() function which sets up the fallback test device. It'd
probably also need a cleanup_fallback_device().

Let me know your thoughts.

Thanks!
Chaitanya Kulkarni Jan. 17, 2019, 5:15 a.m. UTC | #2
From: Omar Sandoval <osandov@osandov.com>
Sent: Wednesday, January 16, 2019 6:16 PM
To: Shinichiro Kawasaki
Cc: linux-block@vger.kernel.org; Omar Sandoval; Masato Suzuki; Jens Axboe; Matias Bjorling; Hannes Reinecke; Mike Snitzer; Martin K . Petersen; Chaitanya Kulkarni
Subject: Re: [PATCH blktests v2 00/16] Implement zoned block device support
  
 
On Thu, Jan 10, 2019 at 06:37:09PM +0900, Shin'ichiro Kawasaki wrote:
> The current blktests infrastucture and test cases do not support zoned block
> devices and no specific test cases exist to test these block devices special
> features (zone report and reset, sequential write constraint). This patch series
> implement this missing support.
> 
> The series addresses two aspects: the first 7 patches introduce changes to the
> common scripts and configuration are introduced to allow existing test cases to
> run against a null_blk device with zone mode enabled (new ZONED config variable)
> or for these test cases to be skipped if a test declare itself as not zoned
> compliant. Helper functions are introduced to facilitate checking a device
> zone model.
> 
> The second part, composed of the last 9 patches, introduce the new zbd test
> group to cover zoned block device specific test cases. All these test cases are
> implemented using the test_device() function so that target devices can be
> specified in the TEST_DEVS config variable, to cover a variety of zoned block
> devices: physical real drives, partitions and dm-linear setups on top of zoned
> block devices, etc. Furthermore, using the infrastructure changes of the first
> part, the TEST_DEVS definition can be left empty, resulting in the zbd test
> cases to be run against an automatically created null_blk device with zoned
> mode enabled.
> 
> 5 test cases are added to the new zbd test group to check the kernel ioctl and
> sysfs interface, zone report operation, zone reset and write command handling.
> These tests are simple but only a start. We will in the future send more test
> cases to cover at least the regressions and bugs found and fixed in the zoned
> block device code since its introduction with kernel 4.10.
> 
> Another still to be added part is support for host-managed ZBC emulation in
> scsi-debug to further improve test coverage without requiring a physical SMR
> disk. This work is ongoing and will be added to blktests once the relevant
> scsi-debug changes are accepted in the kernel.
> 
> Changes from v1:
> * Fixed _test_dev_is_zoned
> * Added _have_fio_zbd_zonemode
> * Added patch 10 to move _dd to common/rc
> * Addressed various nit commented on the list
> 
> Masato Suzuki (6):
>   tests: Introduce zbd test group
>   zbd/001: sysfs and ioctl consistency test
>   zbd/002: report zone test
>   zbd/003: Test sequential zones reset
>   zbd/004: Check write split accross sequential zones
>   zbd/005: Test write ordering
> 
> Shin'ichiro Kawasaki (10):
>   config: Introduce ZONED variable
>   common: Introduce _test_dev_is_zoned() helper function
>   common: Move set_scheduler() function definition
>   common: Introduce _have_fio_zbd_zonemode() helper function
>   block/004: Adjust fio conditions for zoned block device
>   block/013: Skip for zoned block devices
>   block/018,024: Skip when ZONED is set
>   check: Introduce group_exit() function
>   src: Introduce zbdioctl program
>   common: Introduce _dd() helper function

Hi,

Thanks so much for the contribution. It'll be great to have some tests
for zoned block devices.

One thing I'm not a huge fan of is that setting the ZONED mode hijacks
the existing tests to be ZBD tests. When I'm doing a full test run, I'd
like to run those tests in both modes without running the rest of the
test suite twice.

Instead, what if we added a per-test setting like CAN_BE_ZONED and a
global config RUN_ZONED_TESTS? If those are both set, we run it once in
normal mode and once in zoned mode. This also avoids having to blacklist
tests which don't support zoned mode (although we'll have to remember to
whitelist tests that would work on a zoned device).

The functionality for falling back to null_blk if no devices are
specified is nifty. It'd be nice to have that as generic functionality
instead of specific to the zbd group. Something like a per-test
fallback_device() function which sets up the fallback test device. It'd
probably also need a cleanup_fallback_device().


[CK] Sounds good to me, we can make this as a prep patch-series and use the
functionality for this series.


I wonder will that be applicable to all the test cases?
Do we need more generic functionality into the null_blk so that we can use null_blk
by default? 


Shinichiro what do you think about this?

Let me know your thoughts.

Thanks!
Shin'ichiro Kawasaki Jan. 17, 2019, 6:06 a.m. UTC | #3
Hi Omar,

On 1/17/19 11:16 AM, Omar Sandoval wrote:
> On Thu, Jan 10, 2019 at 06:37:09PM +0900, Shin'ichiro Kawasaki wrote:
>> The current blktests infrastucture and test cases do not support zoned block
>> devices and no specific test cases exist to test these block devices special
>> features (zone report and reset, sequential write constraint). This patch series
>> implement this missing support.
>>
>> The series addresses two aspects: the first 7 patches introduce changes to the
>> common scripts and configuration are introduced to allow existing test cases to
>> run against a null_blk device with zone mode enabled (new ZONED config variable)
>> or for these test cases to be skipped if a test declare itself as not zoned
>> compliant. Helper functions are introduced to facilitate checking a device
>> zone model.
>>
>> The second part, composed of the last 9 patches, introduce the new zbd test
>> group to cover zoned block device specific test cases. All these test cases are
>> implemented using the test_device() function so that target devices can be
>> specified in the TEST_DEVS config variable, to cover a variety of zoned block
>> devices: physical real drives, partitions and dm-linear setups on top of zoned
>> block devices, etc. Furthermore, using the infrastructure changes of the first
>> part, the TEST_DEVS definition can be left empty, resulting in the zbd test
>> cases to be run against an automatically created null_blk device with zoned
>> mode enabled.
>>
>> 5 test cases are added to the new zbd test group to check the kernel ioctl and
>> sysfs interface, zone report operation, zone reset and write command handling.
>> These tests are simple but only a start. We will in the future send more test
>> cases to cover at least the regressions and bugs found and fixed in the zoned
>> block device code since its introduction with kernel 4.10.
>>
>> Another still to be added part is support for host-managed ZBC emulation in
>> scsi-debug to further improve test coverage without requiring a physical SMR
>> disk. This work is ongoing and will be added to blktests once the relevant
>> scsi-debug changes are accepted in the kernel.
>>
>> Changes from v1:
>> * Fixed _test_dev_is_zoned
>> * Added _have_fio_zbd_zonemode
>> * Added patch 10 to move _dd to common/rc
>> * Addressed various nit commented on the list
>>
>> Masato Suzuki (6):
>>    tests: Introduce zbd test group
>>    zbd/001: sysfs and ioctl consistency test
>>    zbd/002: report zone test
>>    zbd/003: Test sequential zones reset
>>    zbd/004: Check write split accross sequential zones
>>    zbd/005: Test write ordering
>>
>> Shin'ichiro Kawasaki (10):
>>    config: Introduce ZONED variable
>>    common: Introduce _test_dev_is_zoned() helper function
>>    common: Move set_scheduler() function definition
>>    common: Introduce _have_fio_zbd_zonemode() helper function
>>    block/004: Adjust fio conditions for zoned block device
>>    block/013: Skip for zoned block devices
>>    block/018,024: Skip when ZONED is set
>>    check: Introduce group_exit() function
>>    src: Introduce zbdioctl program
>>    common: Introduce _dd() helper function
> 
> Hi,
> 
> Thanks so much for the contribution. It'll be great to have some tests
> for zoned block devices.

Thank you very much for your review.

> One thing I'm not a huge fan of is that setting the ZONED mode hijacks
> the existing tests to be ZBD tests. When I'm doing a full test run, I'd
> like to run those tests in both modes without running the rest of the
> test suite twice.
> 
> Instead, what if we added a per-test setting like CAN_BE_ZONED and a
> global config RUN_ZONED_TESTS? If those are both set, we run it once in
> normal mode and once in zoned mode. This also avoids having to blacklist
> tests which don't support zoned mode (although we'll have to remember to
> whitelist tests that would work on a zoned device).

Yes, that would work too. And the CAN_BE_ZONED per-test case setting can also 
control if the test should be executed against a specified zoned device or not. 
Will make these changes.

 >
> The functionality for falling back to null_blk if no devices are
> specified is nifty. It'd be nice to have that as generic functionality
> instead of specific to the zbd group. Something like a per-test
> fallback_device() function which sets up the fallback test device. It'd
> probably also need a cleanup_fallback_device().

Good idea. Instead of the entire group fallback device, it becomes per test 
case. Will make the changes.

> 
> Let me know your thoughts.
> 
> Thanks!
>