Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-82017

Enable passing through atomic block writes in the Virt stack

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Add atomic block write support to Virt stack
    • Hide
      • libvirt domain XML offers a way to enable/disable atomic block writes.
      • statx(2) STATX_WRITE_ATOMIC inside the guest reports the atomic block write information that was configured on the QEMU command-line.
      • fio with the atomic=1 option succeeds on virtio-scsi and virtio-blk devices that have atomic block writes enabled.
      Show
      libvirt domain XML offers a way to enable/disable atomic block writes. statx(2) STATX_WRITE_ATOMIC inside the guest reports the atomic block write information that was configured on the QEMU command-line. fio with the atomic=1 option succeeds on virtio-scsi and virtio-blk devices that have atomic block writes enabled.
    • Low
    • Red Hat Enterprise Linux
    • rhel-virt-storage
    • ssg_virtualization
    • False
    • Hide

      None

      Show
      None
    • Unspecified
    • Unspecified
    • Unspecified

      Description

      As a user I would like my guest workloads to take advantage of atomic block write hardware support so that performance is improved for database transactions and other write workloads.

      Linux has exposed atomic block write support to userspace so that databases and other applications can improve performance or rely on concurrent I/O patterns that require atomicity.

      An LWN article explains the feature here:
      https://lwn.net/SubscriberLink/1009298/deb094869db6b05f/

      Atomic block writes are already defined in the NVMe and SCSI specs. The virtio-blk interface does not support atomic block writes as of March 2025.

      Linux applications can take advantage of atomic block writes by passing the RWF_ATOMIC flag to pwritev2(2), io_uring, or libaio. They can detect atomic block write support with the statx(2) STATX_WRITE_ATOMIC flag.

      Use fio's atomic=1 option with the pvsync2, libaio, or io_uring ioengines for functional testing.

      The Virt stack is affected as follows:

      • QEMU must set the RWF_ATOMIC flag for writes in file-posix (pwritev2(2), libaio, io_uring).
      • QEMU scsi-hd devices need a new parameter that configures the atomic block write information reported to the guest.
      • The virtio-blk specification must be extended to support atomic block writes and this new spec must be implemented in QEMU's virtio-blk device model, including a new device parameter that configures the atomic block write information reported to the guest.
      • The Linux virtio_blk driver must be extended to implement the new virtio-blk spec allowing atomic block writes.
      • libvirt must configure scsi-hd and virtio-blk devices with the new parameter. Explicit configuration rather than auto-detection is necessary so that live migration can be supported (the destination machine may support larger atomic block writes but the guest must not see any change across live migration).
      • CNV can enable this feature where it does not hinder live migration requirements. Availability can be detected using statx(2) on the disk image file.

      What SSTs and Layered Product teams should review this?

      Virt Storage SST

              shajnocz@redhat.com Stefan Hajnoczi
              shajnocz@redhat.com Stefan Hajnoczi
              virt-maint virt-maint
              qing wang qing wang
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: