tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: write alignment matters?

On Wed, Jun 22, 2011 at 11:28:37AM -0400, der Mouse wrote:
> >> [...disk buffer alignment issues...]
> > I suspect most disk controllers will have issues if the buffer is not
> > aligned on at [least] 16bits.
> Perhaps.  In such cases, something else in the I/O stack - the device
> driver, most likely, since this is a device-hardware issue - has to
> compensate.  Paying an extra copy penalty for a misaligned buffer may
> be annoying, but it's better than getting I/O errors or other weird
> violation of the interface's semantics.

You have to use multiple of the sector size here (usually 512 bytes,
but can be 4k now) so I don't find it unreasonable to also expect the
buffer to be aligned on the machine's natural integer size.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index