Re: [PATCH 2/5] percpu: Refactor percpu.h

From: Tony Luck
Date: Thu Feb 05 2009 - 17:31:02 EST


On Sun, Jan 18, 2009 at 4:52 PM, Brian Gerst <brgerst@xxxxxxxxx> wrote:
> Refactor the DEFINE_PER_CPU_* macros and add .data.percpu.first
> section.
>
> Signed-off-by: Brian Gerst <brgerst@xxxxxxxxx>

> diff --git a/include/linux/percpu.h b/include/linux/percpu.h
> index 9f2a375..0e24202 100644
> --- a/include/linux/percpu.h
> +++ b/include/linux/percpu.h
...

> +#define DEFINE_PER_CPU_SECTION(type, name, section) \
> + __attribute__((__section__(PER_CPU_BASE_SECTION section))) \
> PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name

Brian,

This causes errors for CONFIG_SMP=n builds on ia64. If you look
at arch/ia64/include/asm/percpu.h you'll see that the !SMP case has


#define PER_CPU_ATTRIBUTES __attribute__((__section__(".data.percpu")))

So we end up with section attributes of both ".data" and
".data.percpu" for every
DEFINE_PER_CPU used. The compiler doesn't like that at all :-(


Perhaps PER_CPU_BASE_SECTION needs to be defined by <asm/percpu.h>
so ia64 can avoid the section conflict?

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/