Messages in this thread | | | Date | Wed, 20 Oct 2010 14:33:49 -0700 | From | "H. Peter Anvin" <> | Subject | Re: [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
| |