Messages in this thread | | | Date | Sun, 28 Jun 2009 15:39:40 +0400 | From | Ivan Kokshaysky <> | Subject | Re: [PATCH] alpha: fix percpu build breakage |
| |
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@kernel.org>
Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
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.
| |