qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/7] Add support for zoned device
@ 2022-08-26 15:15 Sam Li
  2022-08-29 19:43 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Li @ 2022-08-26 15:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: stefanha, damien.lemoal, Dmitry.Fomichev, hare, qemu-block,
	hreitz, eblake, armbru, fam, kwolf, Sam Li

Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones
that are larger than the LBA size. It can only allow sequential writes, which
reduces write amplification in SSD, leading to higher throughput and increased
capacity. More details about ZBDs can be found at:

https://zonedstorage.io/docs/introduction/zoned-storage

The zoned device support aims to let guests (virtual machines) access zoned
storage devices on the host (hypervisor) through a virtio-blk device. This
involves extending QEMU's block layer and virtio-blk emulation code.  In its
current status, the virtio-blk device is not aware of ZBDs but the guest sees
host-managed drives as regular drive that will runs correctly under the most
common write workloads.

This patch series extend the block layer APIs with the minimum set of zoned
commands that are necessary to support zoned devices. The commands are - Report
Zones, four zone operations and Zone Append (developing).

It can be tested on a null_blk device using qemu-io or qemu-iotests. For
example, the command line for zone report using qemu-io is:
$ path/to/qemu-io --image-opts -n driver=zoned_host_device,filename=/dev/nullb0
-c "zrp offset nr_zones"

v8:
- address review comments
  * solve patch conflicts and merge sysfs helper funcations into one patch
  * add cache.direct=on check in config

v7:
- address review comments
  * modify sysfs attribute helper funcations
  * move the input validation and error checking into raw_co_zone_* function
  * fix checks in config

v6:
- drop virtio-blk emulation changes
- address Stefan's review comments
  * fix CONFIG_BLKZONED configs in related functions
  * replace reading fd by g_file_get_contents() in get_sysfs_str_val()
  * rewrite documentation for zoned storage

v5:
- add zoned storage emulation to virtio-blk device
- add documentation for zoned storage
- address review comments
  * fix qemu-iotests
  * fix check to block layer
  * modify interfaces of sysfs helper functions
  * rename zoned device structs according to QEMU styles
  * reorder patches

v4:
- add virtio-blk headers for zoned device
- add configurations for zoned host device
- add zone operations for raw-format
- address review comments
  * fix memory leak bug in zone_report
  * add checks to block layers
  * fix qemu-iotests format
  * fix sysfs helper functions

v3:
- add helper functions to get sysfs attributes
- address review comments
  * fix zone report bugs
  * fix the qemu-io code path
  * use thread pool to avoid blocking ioctl() calls

v2:
- add qemu-io sub-commands
- address review comments
  * modify interfaces of APIs

v1:
- add block layer APIs resembling Linux ZoneBlockDevice ioctls

Sam Li (7):
  include: add zoned device structs
  file-posix: introduce helper funcations for sysfs attributes
  block: add block layer APIs resembling Linux ZonedBlockDevice ioctls
  raw-format: add zone operations to pass through requests
  config: add check to block layer
  qemu-iotests: test new zone operations
  docs/zoned-storage: add zoned device documentation

 block.c                                |  14 +
 block/block-backend.c                  |  51 +++
 block/file-posix.c                     | 460 +++++++++++++++++++++++--
 block/io.c                             |  41 +++
 block/raw-format.c                     |  14 +
 docs/devel/zoned-storage.rst           |  41 +++
 docs/system/qemu-block-drivers.rst.inc |   6 +
 include/block/block-common.h           |  43 +++
 include/block/block-io.h               |   7 +
 include/block/block_int-common.h       |  29 ++
 include/block/raw-aio.h                |   6 +-
 include/sysemu/block-backend-io.h      |  17 +
 meson.build                            |   1 +
 qapi/block-core.json                   |   8 +-
 qemu-io-cmds.c                         | 143 ++++++++
 tests/qemu-iotests/tests/zoned.out     |  53 +++
 tests/qemu-iotests/tests/zoned.sh      |  86 +++++
 17 files changed, 980 insertions(+), 40 deletions(-)
 create mode 100644 docs/devel/zoned-storage.rst
 create mode 100644 tests/qemu-iotests/tests/zoned.out
 create mode 100755 tests/qemu-iotests/tests/zoned.sh

-- 
2.37.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v8 0/7] Add support for zoned device
  2022-08-26 15:15 [PATCH v8 0/7] Add support for zoned device Sam Li
@ 2022-08-29 19:43 ` Stefan Hajnoczi
  2022-08-30  0:37   ` Sam Li
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2022-08-29 19:43 UTC (permalink / raw)
  To: Sam Li
  Cc: qemu-devel, damien.lemoal, Dmitry.Fomichev, hare, qemu-block,
	hreitz, eblake, armbru, fam, kwolf

[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]

On Fri, Aug 26, 2022 at 11:15:29PM +0800, Sam Li wrote:
> Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones
> that are larger than the LBA size. It can only allow sequential writes, which
> reduces write amplification in SSD, leading to higher throughput and increased
> capacity. More details about ZBDs can be found at:
> 
> https://zonedstorage.io/docs/introduction/zoned-storage
> 
> The zoned device support aims to let guests (virtual machines) access zoned
> storage devices on the host (hypervisor) through a virtio-blk device. This
> involves extending QEMU's block layer and virtio-blk emulation code.  In its
> current status, the virtio-blk device is not aware of ZBDs but the guest sees
> host-managed drives as regular drive that will runs correctly under the most
> common write workloads.
> 
> This patch series extend the block layer APIs with the minimum set of zoned
> commands that are necessary to support zoned devices. The commands are - Report
> Zones, four zone operations and Zone Append (developing).
> 
> It can be tested on a null_blk device using qemu-io or qemu-iotests. For
> example, the command line for zone report using qemu-io is:
> $ path/to/qemu-io --image-opts -n driver=zoned_host_device,filename=/dev/nullb0
> -c "zrp offset nr_zones"
> 
> v8:
> - address review comments
>   * solve patch conflicts and merge sysfs helper funcations into one patch
>   * add cache.direct=on check in config

Hi Sam,
I have left a few comments.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v8 0/7] Add support for zoned device
  2022-08-29 19:43 ` Stefan Hajnoczi
@ 2022-08-30  0:37   ` Sam Li
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Li @ 2022-08-30  0:37 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Dmitry Fomichev, Hannes Reinecke, qemu block,
	Hanna Reitz, Eric Blake, Markus Armbruster, Fam Zheng, Kevin Wolf,
	Damien Le Moal

Stefan Hajnoczi <stefanha@redhat.com> 于2022年8月30日周二 03:44写道:
>
> On Fri, Aug 26, 2022 at 11:15:29PM +0800, Sam Li wrote:
> > Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones
> > that are larger than the LBA size. It can only allow sequential writes, which
> > reduces write amplification in SSD, leading to higher throughput and increased
> > capacity. More details about ZBDs can be found at:
> >
> > https://zonedstorage.io/docs/introduction/zoned-storage
> >
> > The zoned device support aims to let guests (virtual machines) access zoned
> > storage devices on the host (hypervisor) through a virtio-blk device. This
> > involves extending QEMU's block layer and virtio-blk emulation code.  In its
> > current status, the virtio-blk device is not aware of ZBDs but the guest sees
> > host-managed drives as regular drive that will runs correctly under the most
> > common write workloads.
> >
> > This patch series extend the block layer APIs with the minimum set of zoned
> > commands that are necessary to support zoned devices. The commands are - Report
> > Zones, four zone operations and Zone Append (developing).
> >
> > It can be tested on a null_blk device using qemu-io or qemu-iotests. For
> > example, the command line for zone report using qemu-io is:
> > $ path/to/qemu-io --image-opts -n driver=zoned_host_device,filename=/dev/nullb0
> > -c "zrp offset nr_zones"
> >
> > v8:
> > - address review comments
> >   * solve patch conflicts and merge sysfs helper funcations into one patch
> >   * add cache.direct=on check in config
>
> Hi Sam,
> I have left a few comments.

That's great! Thanks for reviewing. I'll send a revision soon.

Sam


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-30  0:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-26 15:15 [PATCH v8 0/7] Add support for zoned device Sam Li
2022-08-29 19:43 ` Stefan Hajnoczi
2022-08-30  0:37   ` Sam Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).