On 2/12/24 17:39, John Garry wrote: > On 12/02/2024 10:54, Nilay Shroff wrote: >> >> Shall we ensure here that we don't cross max limit of atomic write supported by >> >> device? It seems that if the boundary size is not advertized by the device >> >> (in fact, I have one NVMe drive which has boundary size zero i.e. nabo/nabspf/ >> >> nawupf are all zero but awupf is non-zero) then we (unconditionally) allow >> >> merging. > > BTW, if you don't mind, can you share awupf value and device model? I have been on the search for NVMe devices which support atomic writes (with non-zero PF reported value). All I have is a M.2 card which has a 4KB PF atomic write value. > > But if this is private info, then ok. > > Thanks, > John Yeah sure. Below are the details about NVMe: # lspci 0040:01:00.0 Non-Volatile memory controller: KIOXIA Corporation Device 0025 (rev 01) # nvme id-ctrl /dev/nvme0 -H NVME Identify Controller: vid : 0x1e0f ssvid : 0x1014 sn : Z130A00LTGZ8 mn : 800GB NVMe Gen4 U.2 SSD fr : REV.C9S2 [...] awun : 65535 awupf : 63 [...] # nvme id-ns /dev/nvme0n1 -H NVME Identify Namespace 1: nsze : 0x18ffff3 ncap : 0x18ffff3 nuse : 0 nsfeat : 0x14 [4:4] : 0x1 NPWG, NPWA, NPDG, NPDA, and NOWS are Supported [3:3] : 0 NGUID and EUI64 fields if non-zero, Reused [2:2] : 0x1 Deallocated or Unwritten Logical Block error Supported [1:1] : 0 Namespace uses AWUN, AWUPF, and ACWU [0:0] : 0 Thin Provisioning Not Supported [...] nawun : 0 nawupf : 0 nacwu : 0 nabsn : 0 nabo : 0 nabspf : 0 [...] LBA Format 0 : Metadata Size: 0 bytes - Data Size: 4096 bytes - Relative Performance: 0 Best (in use) LBA Format 1 : Metadata Size: 8 bytes - Data Size: 4096 bytes - Relative Performance: 0 Best LBA Format 2 : Metadata Size: 0 bytes - Data Size: 512 bytes - Relative Performance: 0 Best LBA Format 3 : Metadata Size: 8 bytes - Data Size: 512 bytes - Relative Performance: 0 Best LBA Format 4 : Metadata Size: 64 bytes - Data Size: 4096 bytes - Relative Performance: 0 Best LBA Format 5 : Metadata Size: 8 bytes - Data Size: 512 bytes - Relative Performance: 0 Best As shown above, I am using KIOXIA NVMe. This NVMe has one namespace created(nvme0n1). The nsfeat reports that this namespace uses AWUN, AWUPF, and ACWU.The awupf for this NVMe is 63. As awupf is 0's based value, it's actually 64. The configured LBA for the namespace (in use) is 4096 bytes and so that means that this NVMe supports writing 262144 (64*4096) bytes of data atomically during power failure. Further, please note that on this NVMe we have nawupf/nabspf/nabo all set to zero. Let me know if you need any other details. And BTW, if you want I could help you with anything you'd like to test on this NVMe. Thanks, --Nilay