On Mon, 3 Feb 2025, Martin K. Petersen wrote: > > Mikulas, > > > Do you think that SSDs benefit from more alignment than 4K? > > It really depends on the SSD. > > > If you have some SSD that has higher IOPS with alignment larger than > > 4K, let me know. > > Absolutely. > > There are devices out there reporting characteristics that are not > intuitively correct. I.e. not obvious powers of two due to internal > striping or allocation units. Some devices prefer an alignment of 768KB, > for instance. Also, wide RAID stripes can end up causing peculiar > alignment to be reported. Surely that RAID4/5/6 performs better when you write a full stripe. But I'd like to know whether individual SSDs have increased IOPS when the request size is increased. The write tests that I did (some years ago, I don't remember the details) showed that SSDs have the best write IOPS for 4k requests. For smaller requests they perform worse (because of read-modify-write), for larger requests they also have slightly less IOPS (because they write more data per request). If there is some particular SSD that has more write IOPS for 8k requests than for 4k requests, I'd like to know about it - out of curiosity. When I was developing dm-integrity, I just aligned metadata and data on 4k boundary, regardless of what the underlying device advertised. > Instead of assuming that 4KB is the correct value for all devices, I'd > rather address the cases where one particular device is reporting > something wrong. The patch that I made tries to round down optimal IO size to 4k, it doesn't force optimal IO size to be 4k. > I'm willing to entertain having a quirk to ignore reported values of > 0xffff (have also seen 0xfffe) for USB-ATA bridge devices. But I don't > think we should blindly distrust what devices using other transport > classes happen to report, it's usually only USB bridges that are spewing > nonsense. Which is why we typically avoid trying to make sense of VPD > pages on USB in the first place. Mikulas