Re: [PATCH] x86/i386: make sure stack-protector segment base is cachealigned

From: Jeremy Fitzhardinge
Date: Thu Sep 03 2009 - 17:31:52 EST

On 09/03/09 14:07, Eric Dumazet wrote:
> I was referring to .data.percpu alignement requirements, not to false sharing.

Yes, I know. But the intent of DECLARE_PER_CPU_SHARED_ALIGNED is to
avoid false sharing, and so it does no alignment when CONFIG_SMP isn't
enabled. We need alignment regardless.

> When we put a object with an align(64) requirement into a section, linker
> has to put this 2**6 alignment in resulting section.
> When several .o are linked together, linker has to take the biggest alignement,
> and has to put holes.
> Check .data.percpu size in vmlinux before and after your patch, to make sure
> it doesnt grow too much :)
> therefore, ____cacheline_aligned objects should be placed in
> .data.percpu.shared_aligned

That section doesn't exist without SMP. (Well,

Anyway, this should sort it out.