Re: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW
From: Dave Chinner
Date: Tue Nov 24 2026 - 15:05:40 EST
On Tue, Nov 24, 2026 at 08:32:56AM +0000, John Garry wrote:
> On 11/23/26 20:11, Dave Chinner wrote:
> > > The intended use is a controlled comparison of hardware-backed and
> > > software-backed RWF_ATOMIC writes on the same hardware, without having
> > > to construct misaligned mappings to trigger fallback. The existing
> > > DEBUG-only always_cow control also affects ordinary writes, which
> > > changes the workload being compared.
> > Ok, so you want it for your test/dev environment, not production?
> >
> > I thought we could already change the block device characteristics (i.e. support hw
> > atomic wirite or not) at the block device level?
>
> The block layer just accepts whatever atomic properties is reported by the
> block driver and there is no method in the block layer to change these
> limits or turn them off.
Isn't that a bit of an oversight? Lots of the hardware related IO
capabilities are configurable in the bdev queue (e.g. max io sizes,
max discard/unmap sizes, max queue depth, etc).
Sure, they are initially populated by the hardware values, but the
user can then override them (e.g. via udev rules) and that means we
don't have need to add 'override the <bdev queue property>'
management interfaces to every filesystem that supports those
specific bdev hardware offloads.
> Then for the only block drivers which today support atomic - NVMe and SCSI -
> similarly these we just use the atomic limits reported in the disk.
That seems to be inconsistent with how we manage other hardware
offload size limits on block devices. These are -not- filesystem
properties, and we should not be trying to manage them at the
filesystem level.
-Dave.
--
Dave Chinner
dgc@xxxxxxxxxx