Re: [PATCH] alpha: fix percpu build breakage
From: Ivan Kokshaysky
Date: Sun Jun 28 2009 - 07:39:58 EST
On Sun, Jun 28, 2009 at 09:49:56AM +0900, Tejun Heo wrote:
> alpha percpu access requires custom SHIFT_PERCPU_PTR() definition for
> modules to work around addressing range limitation. This is done via
> generating inline assembly using C preprocessing which forces the
> assembler to generate external reference. This happens behind the
> compiler's back and makes the compiler think that static percpu
> variables in modules are unused.
>
> This used to be worked around by using __unused attribute for percpu
> variables which prevent the compiler from omitting the variable;
> however, recent declare/definition attribute unification change broke
> this as __used can't be used for declaration. Also, in the process,
> PER_CPU_ATTRIBUTES definition in alpha percpu.h got broken.
>
> This patch adds PER_CPU_DEF_ATTRIBUTES which is only used for
> definitions and make alpha use it to add __used for percpu variables
> in modules. This also fixes the PER_CPU_ATTRIBUTES double definition
> bug.
Thanks! I was going to suggest similar patch, but you've beaten
me to it ;-)
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Acked-by: Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>
As for upcoming percpu patchset, can we similarly move the __weak attribute
to PER_CPU_DEF_ATTRIBUTES? I don't feel really comfortable with an
"extern __weak" combination - it may not work with future compilers...
Ivan.
--
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/