qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Sam Li <faithilikerun@gmail.com>
Cc: qemu-devel@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-block@nongnu.org, damien.lemoal@opensource.wdc.com,
	hare@suse.de, "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Fam Zheng" <fam@euphon.net>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	dmitry.fomichev@wdc.com, "Thomas Huth" <thuth@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v16 0/8] Add support for zoned device
Date: Thu, 16 Mar 2023 13:57:48 -0400	[thread overview]
Message-ID: <20230316175748.GA63600@fedora> (raw)
In-Reply-To: <20230310102403.61347-1-faithilikerun@gmail.com>

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

On Fri, Mar 10, 2023 at 06:23:55PM +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.
> 
> There has been a debate on whethre introducing new zoned_host_device BlockDriver
> specifically for zoned devices. In the end, it's been decided to stick to
> existing host_device BlockDriver interface by only adding new zoned operations
> inside it. The benefit of that is to avoid further changes - one example is
> command line syntax - to the applications like Libvirt using QEMU zoned
> emulation.
> 
> It can be tested on a null_blk device using qemu-io or qemu-iotests. For
> example, to test zone report using qemu-io:
> $ path/to/qemu-io --image-opts -n driver=host_device,filename=/dev/nullb0
> -c "zrp offset nr_zones"
> 
> v16:
> - update zoned_host device name to host_device [Stefan]
> - fix probing zoned device blocksizes [Stefan]
> - Use empty fields instead of changing struct size of BlkRwCo [Kevin, Stefan]
> 
> v15:
> - drop zoned_host_device BlockDriver
> - add zoned device option to host_device driver instead of introducing a new
>   zoned_host_device BlockDriver [Stefan]
> 
> v14:
> - address Stefan's comments of probing block sizes
> 
> v13:
> - add some tracing points for new zone APIs [Dmitry]
> - change error handling in zone_mgmt [Damien, Stefan]
> 
> v12:
> - address review comments
>   * drop BLK_ZO_RESET_ALL bit [Damien]
>   * fix error messages, style, and typos[Damien, Hannes]
> 
> v11:
> - address review comments
>   * fix possible BLKZONED config compiling warnings [Stefan]
>   * fix capacity field compiling warnings on older kernel [Stefan,Damien]
> 
> v10:
> - address review comments
>   * deal with the last small zone case in zone_mgmt operations [Damien]
>   * handle the capacity field outdated in old kernel(before 5.9) [Damien]
>   * use byte unit in block layer to be consistent with QEMU [Eric]
>   * fix coding style related problems [Stefan]
> 
> v9:
> - address review comments
>   * specify units of zone commands requests [Stefan]
>   * fix some error handling in file-posix [Stefan]
>   * introduce zoned_host_devcie in the commit message [Markus]
> 
> 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 (8):
>   include: add zoned device structs
>   file-posix: introduce helper functions 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
>   block: add some trace events for new block layer APIs
>   docs/zoned-storage: add zoned device documentation
> 
>  block.c                                |  19 ++
>  block/block-backend.c                  | 133 ++++++++
>  block/file-posix.c                     | 446 +++++++++++++++++++++++--
>  block/io.c                             |  41 +++
>  block/raw-format.c                     |  18 +
>  block/trace-events                     |   2 +
>  docs/devel/zoned-storage.rst           |  43 +++
>  docs/system/qemu-block-drivers.rst.inc |   6 +
>  include/block/block-common.h           |  43 +++
>  include/block/block-io.h               |   9 +
>  include/block/block_int-common.h       |  29 ++
>  include/block/raw-aio.h                |   6 +-
>  include/sysemu/block-backend-io.h      |  18 +
>  meson.build                            |   4 +
>  qemu-io-cmds.c                         | 149 +++++++++
>  tests/qemu-iotests/tests/zoned.out     |  53 +++
>  tests/qemu-iotests/tests/zoned.sh      |  86 +++++
>  17 files changed, 1068 insertions(+), 37 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.39.2
> 

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

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

      parent reply	other threads:[~2023-03-16 17:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 10:23 [PATCH v16 0/8] Add support for zoned device Sam Li
2023-03-10 10:23 ` [PATCH v16 1/8] include: add zoned device structs Sam Li
2023-03-13 23:38   ` Dmitry Fomichev
2023-03-10 10:23 ` [PATCH v16 2/8] file-posix: introduce helper functions for sysfs attributes Sam Li
2023-03-10 10:23 ` [PATCH v16 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls Sam Li
2023-03-13 23:39   ` Dmitry Fomichev
2023-03-10 10:23 ` [PATCH v16 4/8] raw-format: add zone operations to pass through requests Sam Li
2023-03-10 10:24 ` [PATCH v16 5/8] config: add check to block layer Sam Li
2023-03-10 10:24 ` [PATCH v16 6/8] qemu-iotests: test new zone operations Sam Li
2023-03-10 10:24 ` [PATCH v16 7/8] block: add some trace events for new block layer APIs Sam Li
2023-03-13 23:40   ` Dmitry Fomichev
2023-03-10 10:24 ` [PATCH v16 8/8] docs/zoned-storage: add zoned device documentation Sam Li
2023-03-16 17:57 ` Stefan Hajnoczi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230316175748.GA63600@fedora \
    --to=stefanha@redhat.com \
    --cc=berrange@redhat.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=dmitry.fomichev@wdc.com \
    --cc=faithilikerun@gmail.com \
    --cc=fam@euphon.net \
    --cc=hare@suse.de \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).