lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 02/41] cpu alloc: The allocator
On Fri, 30 May 2008, Eric Dumazet wrote:

> > +static DEFINE_PER_CPU(UNIT_TYPE, area[UNITS]);
> >
> area[] is not guaranteed to be aligned on anything but 4 bytes.
>
> If someone then needs to call cpu_alloc(8, GFP_KERNEL, 8), it might get an non
> aligned result.
>
> Either you should add an __attribute__((__aligned__(PAGE_SIZE))),
> or take into account the real address of area[] in cpu_alloc() to avoid waste
> of up to PAGE_SIZE bytes
> per cpu.

I think cacheline aligning should be sufficient. People should not
allocate large page aligned objects here.


\
 
 \ /
  Last update: 2008-05-30 07:25    [W:0.140 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site