Do we need an opt-in for file systems use of hw atomic writes?
Darrick J. Wong
djwong at kernel.org
Tue Aug 19 07:43:47 PDT 2025
On Tue, Aug 19, 2025 at 03:36:33PM +0100, John Garry wrote:
> On 19/08/2025 14:39, Christoph Hellwig wrote:
> > On Tue, Aug 19, 2025 at 12:42:01PM +0100, John Garry wrote:
> > > nothing has been happening on this thread for a while. I figure that it is
> > > because we have no good or obvious options.
> > >
> > > I think that it's better deal with the NVMe driver handling of AWUPF first,
> > > as this applies to block fops as well.
> > >
> > > As for the suggestion to have an opt-in to use AWUPF, you wrote above that
> > > users may not know when to enable this opt-in or not.
> > >
> > > It seems to me that we can give the option, but clearly label that it is
> > > potentially dangerous. Hopefully the $RANDOMUSER with the $CHEAPO SSD will
> > > be wise and steer clear.
> > >
> > > If we always ignore AWUPF, I fear that lots of sound NVMe implementations
> > > will be excluded from HW atomics.
> >
> > I think ignoring AWUPF is a good idea, but I've also hard some folks
> > not liking that.
>
> Disabling reading AWUPF would be the best way to know that for sure :)
What is the likelihood of convincing the nvme standards folks to add a
new command for write-untorn that doesn't just silently fail if you get
the parameters wrong?
> > The reason why I prefer a mount option is because we add that to fstab
> > and the kernel command line easily. For block layer or driver options
> > we'd either need a sysfs file which is always annoying to apply at boot
> > time,
(Yuck, mount options, look how poorly that went for dax= ;))
> Could system-udev auto enable for us via sysfs file or ioctl?
Userspace controllable sysfs configuration knobs like discard_max_bytes
and discard_max_hw_bytes work well with that model. The nvme layer can
set atomic_write_bytes to zero by default, and a udev rule can change it
up to atomic_write_max_hw_bytes.
That's not /so/ bad if you can either get the udev rulefile merged into
systemd, or dropped in via clod-init or something.
--D
> > or a module option which has the downside of applying to all
> > devices.
>
> About the mount option, I suppose that it won't do much harm - it's just a
> bit of extra work to configure.
>
> I just fear that admins will miss enabling it or not enable it out of doubt
> and users won't see the benefit of HW atomics.
>
>
>
More information about the Linux-nvme
mailing list