Re: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW

From: John Garry

Date: Tue Nov 24 2026 - 03:33:13 EST


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.

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.

If so, why do we
need this at the fs level? If not, why isn't it the hardware atomic
write behaviour configurable at the bdev level?

Thanks,
John