mbox series

[v4,0/4] ublk: add zoned storage support

Message ID 20230628190649.11233-1-nmi@metaspace.dk (mailing list archive)
Headers show
Series ublk: add zoned storage support | expand

Message

Andreas Hindborg June 28, 2023, 7:06 p.m. UTC
From: Andreas Hindborg <a.hindborg@samsung.com>

Hi All,

This patch set adds zoned storage support to `ublk`. The first two patches does
some house cleaning in preparation for the last two patches. The third patch
adds support for report_zones and the following operations:

 - REQ_OP_ZONE_OPEN
 - REQ_OP_ZONE_CLOSE
 - REQ_OP_ZONE_FINISH
 - REQ_OP_ZONE_RES

The last patch adds support for REQ_OP_ZONE_APPEND.

v3 [2] -> v4 changes:
 - Split up v3 patches
 - Add zone append support
 - Change order of variables in `ublk_report_zones`

Read/write and zone operations are tested with zenfs [3].

The zone append path is tested with fio -> zonefs -> ublk -> null_blk.

The implementation of zone append requires ublk user copy feature, and therefore
the series is based on branch for-next (6afa337a3789) of [4].

[1] https://github.com/metaspace/ubdsrv/commit/7de0d901c329fde7dc5a2e998952dd88bf5e668b
[2] https://lore.kernel.org/linux-block/20230316145539.300523-1-nmi@metaspace.dk/
[3] https://github.com/westerndigitalcorporation/zenfs
[4] https://git.kernel.dk/linux.git

Andreas Hindborg (4):
  ublk: change ublk IO command defines to enum
  ublk: move types to shared header file
  ublk: enable zoned storage support
  ublk: add zone append

 MAINTAINERS                    |   2 +
 drivers/block/Kconfig          |   4 +
 drivers/block/Makefile         |   4 +-
 drivers/block/ublk_drv-zoned.c | 155 +++++++++++++++++++++++++++++++++
 drivers/block/ublk_drv.c       | 150 +++++++++++++++++++------------
 drivers/block/ublk_drv.h       |  71 +++++++++++++++
 include/uapi/linux/ublk_cmd.h  |  38 ++++++--
 7 files changed, 363 insertions(+), 61 deletions(-)
 create mode 100644 drivers/block/ublk_drv-zoned.c
 create mode 100644 drivers/block/ublk_drv.h


base-commit: 3261ea42710e9665c9151006049411bd23b5411f

Comments

aravind.ramesh@opensource.wdc.com June 30, 2023, 10:33 a.m. UTC | #1
> On 29/06/23, 12:37 AM, "Andreas Hindborg" <nmi@metaspace.dk
> <mailto:nmi@metaspace.dk>> wrote:
> 
> 
> From: Andreas Hindborg <a.hindborg@samsung.com 
> <mailto:a.hindborg@samsung.com>>
> 
> 
> Hi All,
> 
> 
> This patch set adds zoned storage support to `ublk`. The first two 
> patches does
> some house cleaning in preparation for the last two patches. The third 
> patch
> adds support for report_zones and the following operations:
> 

Just to clarify, we do need you ublk user space patches
to create a ublk device node (with these patches in kernel), right ?

> 
> - REQ_OP_ZONE_OPEN
> - REQ_OP_ZONE_CLOSE
> - REQ_OP_ZONE_FINISH
> - REQ_OP_ZONE_RES

REQ_OP_ZONE_RESET

> 
> 
> The last patch adds support for REQ_OP_ZONE_APPEND.
> 
> 
> v3 [2] -> v4 changes:
> - Split up v3 patches
> - Add zone append support
> - Change order of variables in `ublk_report_zones`
> 
> 
> Read/write and zone operations are tested with zenfs [3].
> 
> 
> The zone append path is tested with fio -> zonefs -> ublk -> null_blk.
> 
> 
> The implementation of zone append requires ublk user copy feature, and 
> therefore
> the series is based on branch for-next (6afa337a3789) of [4].
> 
> 
> [1]
> https://github.com/metaspace/ubdsrv/commit/7de0d901c329fde7dc5a2e998952dd88bf5e668b
> <https://github.com/metaspace/ubdsrv/commit/7de0d901c329fde7dc5a2e998952dd88bf5e668b>
> [2]
> https://lore.kernel.org/linux-block/20230316145539.300523-1-nmi@metaspace.dk
> <mailto:20230316145539.300523-1-nmi@metaspace.dk>/
> [3] https://github.com/westerndigitalcorporation/zenfs
> <https://github.com/westerndigitalcorporation/zenfs>
> [4] https://git.kernel.dk/linux.git <https://git.kernel.dk/linux.git>
> 
> 
> Andreas Hindborg (4):
> ublk: change ublk IO command defines to enum
> ublk: move types to shared header file
> ublk: enable zoned storage support
> ublk: add zone append
> 
> 
> MAINTAINERS | 2 +
> drivers/block/Kconfig | 4 +
> drivers/block/Makefile | 4 +-
> drivers/block/ublk_drv-zoned.c | 155 +++++++++++++++++++++++++++++++++
> drivers/block/ublk_drv.c | 150 +++++++++++++++++++------------
> drivers/block/ublk_drv.h | 71 +++++++++++++++
> include/uapi/linux/ublk_cmd.h | 38 ++++++--
> 7 files changed, 363 insertions(+), 61 deletions(-)
> create mode 100644 drivers/block/ublk_drv-zoned.c
> create mode 100644 drivers/block/ublk_drv.h
> 
> 
> 
> 
> base-commit: 3261ea42710e9665c9151006049411bd23b5411f

Regards,
Aravind
Andreas Hindborg June 30, 2023, 2:26 p.m. UTC | #2
aravind.ramesh@opensource.wdc.com writes:

>> On 29/06/23, 12:37 AM, "Andreas Hindborg" <nmi@metaspace.dk
>> <mailto:nmi@metaspace.dk>> wrote:
>> From: Andreas Hindborg <a.hindborg@samsung.com
>> <mailto:a.hindborg@samsung.com>>
>> Hi All,
>> This patch set adds zoned storage support to `ublk`. The first two patches
>> does
>> some house cleaning in preparation for the last two patches. The third patch
>> adds support for report_zones and the following operations:
>> 
>
> Just to clarify, we do need you ublk user space patches
> to create a ublk device node (with these patches in kernel), right ?

I provide an example implementation. I put a link in the cover letter,
but I think the sentence referring to the link got lost, thanks for
pointing out.

https://github.com/metaspace/ubdsrv/commit/7de0d901c329fde7dc5a2e998952dd88bf5e668b

This implementation is based on Ming's ubdsrv code. You do not need to
use this one, you can write your own. I am also working on an
implementation in Rust, but that is still very early. I think Ming is
also writing a Rust library for user space ublk devices.

But currently my patched ubdsrv is the only user space implementation
supporting zoned ublk devices (with the loop and null targets).

>
>> - REQ_OP_ZONE_OPEN
>> - REQ_OP_ZONE_CLOSE
>> - REQ_OP_ZONE_FINISH
>> - REQ_OP_ZONE_RES
>
> REQ_OP_ZONE_RESET

Thanks!

>
>> The last patch adds support for REQ_OP_ZONE_APPEND.
>> v3 [2] -> v4 changes:
>> - Split up v3 patches
>> - Add zone append support
>> - Change order of variables in `ublk_report_zones`
>> Read/write and zone operations are tested with zenfs [3].
>> The zone append path is tested with fio -> zonefs -> ublk -> null_blk.
>> The implementation of zone append requires ublk user copy feature, and
>> therefore
>> the series is based on branch for-next (6afa337a3789) of [4].
>> [1]
>> https://github.com/metaspace/ubdsrv/commit/7de0d901c329fde7dc5a2e998952dd88bf5e668b
>> <https://github.com/metaspace/ubdsrv/commit/7de0d901c329fde7dc5a2e998952dd88bf5e668b>
>> [2]
>> https://lore.kernel.org/linux-block/20230316145539.300523-1-nmi@metaspace.dk
>> <mailto:20230316145539.300523-1-nmi@metaspace.dk>/
>> [3] https://github.com/westerndigitalcorporation/zenfs
>> <https://github.com/westerndigitalcorporation/zenfs>
>> [4] https://git.kernel.dk/linux.git <https://git.kernel.dk/linux.git>
>> Andreas Hindborg (4):
>> ublk: change ublk IO command defines to enum
>> ublk: move types to shared header file
>> ublk: enable zoned storage support
>> ublk: add zone append
>> MAINTAINERS | 2 +
>> drivers/block/Kconfig | 4 +
>> drivers/block/Makefile | 4 +-
>> drivers/block/ublk_drv-zoned.c | 155 +++++++++++++++++++++++++++++++++
>> drivers/block/ublk_drv.c | 150 +++++++++++++++++++------------
>> drivers/block/ublk_drv.h | 71 +++++++++++++++
>> include/uapi/linux/ublk_cmd.h | 38 ++++++--
>> 7 files changed, 363 insertions(+), 61 deletions(-)
>> create mode 100644 drivers/block/ublk_drv-zoned.c
>> create mode 100644 drivers/block/ublk_drv.h
>> base-commit: 3261ea42710e9665c9151006049411bd23b5411f
>
> Regards,
> Aravind