What should we do about the nvme atomics mess?
Ming Lei
ming.lei at redhat.com
Mon Jul 7 18:27:06 PDT 2025
On Mon, Jul 07, 2025 at 04:18:34PM +0200, Christoph Hellwig wrote:
> Hi all,
>
> I'm a bit lost on what to do about the sad state of NVMe atomic writes.
>
> As a short reminder the main issues are:
>
> 1) there is no flag on a command to request atomic (aka non-torn)
> behavior, instead writes adhering to the atomicy requirements will
> never be torn, and writes not adhering them can be torn any time.
> This differs from SCSI where atomic writes have to be be explicitly
> requested and fail when they can't be satisfied
> 2) the original way to indicate the main atomicy limit is the AWUPF
> field, which is in Identify Controller, but specified in logical
> blocks which only exist at a namespace layer. This a) lead to
If controller-wide AWUPF is a must property, the length has to be aligned
with block size.
> various problems because the limit is a mess when namespace have
> different logical block sizes, and it b) also causes additional
> issues because NVMe allows it to be different for different
> controllers in the same subsystem.
The spec mentioned clearly that controller AWUPF should be supported by
any namespace format:
```
Atomic Write Unit Power Fail (AWUPF): This field indicates the size of the write
operation guaranteed to be written atomically to the NVM across all namespaces
with any supported namespace format during a power fail or error condition.
```
So I am wondering why nvme driver can't validate NAWUN against AWUPF?
Thanks,
Ming
More information about the Linux-nvme
mailing list