[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CBF603D.5040808@zytor.com>
Date: Wed, 20 Oct 2010 14:33:49 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: Shaohua Li <shaohua.li@...el.com>,
lkml <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
Andi Kleen <andi@...stfloor.org>,
"Chen, Tim C" <tim.c.chen@...el.com>
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
--
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