On Sat, Oct 17, 2009 at 11:27:04PM +0200, Michael Monnerie wrote:
> On Freitag 16 Oktober 2009 Eric Sandeen wrote:
> > Actually -ssize=4k is just fine even on 512 sector disks.
> Oh funny. So what's the meaning of this argument then? Or why would one
> set it to 4k? What's the diff with 512b?
A hardware sector is the atomic unit of IO. 4k sectors on 512b
hardware sectors means that a single 4k filesystem sector write is
not necessarily atomic. This can lead to problems with torn writes
at power loss or sub-filesystem-sector data loss/corruption when a
hardware sector goes bad. In general, these are detected no
differently to the same sector loss on a 512b filesystem sector
IIRC, the main reason for 4k sectors on MD RAID5/6 is that changing
the IO alignment from 4k to 512 byte IOs (i.e. sub-page sized)
causes MD to flush and invalidate the stripe cache. Hence every
time XFS writes a super block, AGF, AGFL or AGI, things go much
slower because of this flush/invalidate. By setting the sector size
to 4k, the SB/AGF/AGFL/AGI are all 4k in size and hence IO alignment
never changes and hence performance remains good.