lkml.org 
[lkml]   [2010]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] ad7877: keep dma rx buffers in seperate cache lines
On Tue, 11 May 2010, Pekka Enberg wrote:

> > The data is kmalloced, kmalloc aligns on cacheline boundary AFAIK which
> > means that next kmalloc data chunk will not share "our" cacheline.
>
> No, there are no such guarantees. kmalloc() aligns on
> ARCH_KMALLOC_MINALIGN or ARCH_SLAB_MINALIGN depending on which is
> bigger but beyond that, there are no guarantees. You can, of course,
> use kmem_cache_create() with SLAB_HWCACHE_ALIGN to align on cacheline
> boundary.

Note the difference between kmalloc aligment and the alignment of manually
created slabs.

Kmalloc data is often aligned on cacheline boundary due to the allocator
methods of placing data in pages. But there is no guarantee that this will
always be the case. In particular if slab debugging is on then the
alignments become different.



\
 
 \ /
  Last update: 2010-05-12 10:17    [W:0.438 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site