[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <483F96A8.7060309@cosmosbay.com>
Date: Fri, 30 May 2008 07:54:48 +0200
From: Eric Dumazet <dada1@...mosbay.com>
To: Christoph Lameter <clameter@....com>
Cc: akpm@...ux-foundation.org, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org, David Miller <davem@...emloft.net>,
Peter Zijlstra <peterz@...radead.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Mike Travis <travis@....com>
Subject: Re: [patch 02/41] cpu alloc: The allocator
Christoph Lameter a écrit :
> 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.
>
>
>
Hum, maybe, but then we broke modules that might request up to PAGE_SIZE
alignement for their percpu section,
if I read your 3rd patch correctly.
Taking into account the ((unsigned long)area & (PAGE_SIZE-1)) offset in
cpu_alloc()
should give up to PAGE_SIZE alignment for free.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists