Re: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW
From: Dave Chinner
Date: Mon Nov 23 2026 - 15:11:23 EST
On Sat, Nov 21, 2026 at 03:47:32PM +0000, Wayne Gao wrote:
>
>
> Hardware-capable devices normally prefer hardware atomic writes, making
> it difficult to exercise the software CoW path deterministically without
> changing file layouts or affecting ordinary writes.
Why would we want to do this at runtime on production systems?
....
> 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? 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?
i.e. I don't understand why 'unmount; change bdev setting; mount' is
the obvious answer for back-to-back behavioural characterisation on
the same hardware and filesystem with different configurations?
Cheers,
Dave.
--
Dave Chinner
dgc@xxxxxxxxxx