# Re: \[PATCH v4\] slob: add size header to all allocations

- From: Christoph Lameter \<cl@gentwo.org\>
- Date: 2021-11-30 09:41:19 
- List: linux-doc
- Page: https://ratatoskr.run/linux-doc/2021/11/1591073
- Thread: https://ratatoskr.run/linux-mm/2021/09/1526292/t.md

```text
On Mon, 29 Nov 2021, Rustam Kovhaev wrote:

> > I'm not sure that helps.
> > The header can't share a cache line with the previous item (because it
> > might be mapped for DMA) so will always take a full cache line.
>
> I thought that DMA API allocates buffers that are larger than page size.
> DMA pool seems to be able to give out smaller buffers, but underneath it
> seems to be calling page allocator.
> The SLOB objects that have this header are all less than page size, and
> they cannot end up in DMA code paths, or can they?

kmalloc slab allocations must return dmaable memory. If the underlying
hardware can only dma to a cache line border then all objects must be
aligned that way.

```
