Re: block: DMA alignment of IO buffer allocated from slab

From: Christoph Hellwig
Date: Thu Sep 20 2018 - 02:32:30 EST


On Thu, Sep 20, 2018 at 09:28:37AM +0800, Ming Lei wrote:
> > has e.g. PAGE_SIZE alignment requirement (this would likely imply that
> > it's sector size is also not 512 I guess)?
>
> Yeah, that can be true if one controller has 4k-byte sector size, also
> its DMA alignment is 4K. But there shouldn't be cases in which the two
> doesn't match.

The general block storage worlds is that devices always need to have
an alignment requirement <= minimum LBAs size. If they don't they'll
need to bounce buffer (in the driver!).