lkml.org 
[lkml]   [2010]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2]percpu: introduce read mostly percpu API
On 10/19/2010 10:18 PM, Eric Dumazet wrote:
>
> We can see many holes because of 2^5 alignments of
> individual .o .data..percpu sections.
>
> find . -name "*.o"|xargs objdump -h|grep percpu
>
> Linker promotes a section alignment from natural alignment to 2^5 as
> soon as the size reaches 2^5
>
> For example in net/ipv4/route.o, we have a per_cpu structure
> (rt_cache_stat), that is an array of 16 integers. The natural alignement
> should be 4 (alignof(int)), but we get :
>
> # objdump -h net/ipv4/route.o|grep percpu
> 19 .data..percpu 00000040 0000000000000000 0000000000000000 00007a80 2**5
>
> For a section replicated N times, this really is a concern.
>

That wouldn't be the linker, that would be the compiler or assembler
-- I suspect it's the compiler -- and that needs to be fixed.

To reduce linker-induced padding, we may want to use SORT_BY_ALIGNMENT()
in the linker script.

-hpa


\
 
 \ /
  Last update: 2010-10-20 23:37    [W:0.413 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site