File system blocks alignment

Poul-Henning Kamp phk at
Fri Dec 25 11:39:26 UTC 2009

In message <4B349ABF.2070800 at>, Alexander Motin writes:

>The difference is quite significant. Unaligned RAID0 access causes two
>disks involved in it's handling, while aligned one leaves one of disks
>free for another request, doubling performance.

You will find RAID5 writes to be an even better test:  Optimal filesystem
block-size is a RAID5 stripe width, and if you do not get the offset
right you instantly loose at least 50% of your write bandwidth.  My
practical experience says oftem more like 75% is lost.

>As we have now mechanism for reporting stripe size and offset for any
>partition to user-level, it should be easy to make disk partitioning and
>file system creation tools to use it automatically.

For MBR's there are compat requirement worries, slices must be track
aligned for strict compat with (old ?) funky bioses.   BSDlabel
have no such fine details, so that is probably the best place to
align to stripe offsets.

Be aware that stripe-widths may be ridiculously large: you should
not use them as blocksizes, just make sure that blocksizes divide
cleanly into them.

>Stripe size/offset reporting now supported by ada and mmcsd disk drivers
>and most of GEOM modules. It would be nice to fetch that info from
>hardware RAIDs also, where possible.


Good work, keep at it!


Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the freebsd-current mailing list