* + alpha-fix-percpu-build-breakage.patch added to -mm tree
@ 2009-06-28 1:07 akpm
2009-06-29 22:36 ` maximilian attems
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2009-06-28 1:07 UTC (permalink / raw)
To: mm-commits; +Cc: tj, ink, max, rth
The patch titled
alpha: fix percpu build breakage
has been added to the -mm tree. Its filename is
alpha-fix-percpu-build-breakage.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: alpha: fix percpu build breakage
From: Tejun Heo <tj@kernel.org>
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.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: maximilian attems <max@stro.at>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/alpha/include/asm/percpu.h | 6 +++---
include/asm-generic/percpu.h | 4 ++++
include/linux/percpu-defs.h | 3 ++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff -puN arch/alpha/include/asm/percpu.h~alpha-fix-percpu-build-breakage arch/alpha/include/asm/percpu.h
--- a/arch/alpha/include/asm/percpu.h~alpha-fix-percpu-build-breakage
+++ a/arch/alpha/include/asm/percpu.h
@@ -30,7 +30,7 @@ extern unsigned long __per_cpu_offset[NR
#ifndef MODULE
#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
-#define PER_CPU_ATTRIBUTES
+#define PER_CPU_DEF_ATTRIBUTES
#else
/*
* To calculate addresses of locally defined variables, GCC uses 32-bit
@@ -49,7 +49,7 @@ extern unsigned long __per_cpu_offset[NR
: "=&r"(__ptr), "=&r"(tmp_gp)); \
(typeof(&per_cpu_var(var)))(__ptr + (offset)); })
-#define PER_CPU_ATTRIBUTES __used
+#define PER_CPU_DEF_ATTRIBUTES __used
#endif /* MODULE */
@@ -71,7 +71,7 @@ extern unsigned long __per_cpu_offset[NR
#define __get_cpu_var(var) per_cpu_var(var)
#define __raw_get_cpu_var(var) per_cpu_var(var)
-#define PER_CPU_ATTRIBUTES
+#define PER_CPU_DEF_ATTRIBUTES
#endif /* SMP */
diff -puN include/asm-generic/percpu.h~alpha-fix-percpu-build-breakage include/asm-generic/percpu.h
--- a/include/asm-generic/percpu.h~alpha-fix-percpu-build-breakage
+++ a/include/asm-generic/percpu.h
@@ -97,4 +97,8 @@ extern void setup_per_cpu_areas(void);
#define PER_CPU_ATTRIBUTES
#endif
+#ifndef PER_CPU_DEF_ATTRIBUTES
+#define PER_CPU_DEF_ATTRIBUTES
+#endif
+
#endif /* _ASM_GENERIC_PERCPU_H_ */
diff -puN include/linux/percpu-defs.h~alpha-fix-percpu-build-breakage include/linux/percpu-defs.h
--- a/include/linux/percpu-defs.h~alpha-fix-percpu-build-breakage
+++ a/include/linux/percpu-defs.h
@@ -24,7 +24,8 @@
#define DEFINE_PER_CPU_SECTION(type, name, section) \
__attribute__((__section__(PER_CPU_BASE_SECTION section))) \
- PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
+ PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \
+ __typeof__(type) per_cpu__##name
/*
* Variant on the per-CPU variable declaration/definition theme used for
_
Patches currently in -mm which might be from tj@kernel.org are
alpha-fix-percpu-build-breakage.patch
alpha-fix-2630-smp-build.patch
alpha-dont-implement-per_cpu_attributes.patch
linux-next.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: + alpha-fix-percpu-build-breakage.patch added to -mm tree
2009-06-28 1:07 + alpha-fix-percpu-build-breakage.patch added to -mm tree akpm
@ 2009-06-29 22:36 ` maximilian attems
0 siblings, 0 replies; 2+ messages in thread
From: maximilian attems @ 2009-06-29 22:36 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, tj, ink, rth, stable
On Sat, 27 Jun 2009, akpm@linux-foundation.org wrote:
>
> The patch titled
> alpha: fix percpu build breakage
> has been added to the -mm tree. Its filename is
> alpha-fix-percpu-build-breakage.patch
>
> Before you just go and hit "reply", please:
> a) Consider who else should be cc'ed
> b) Prefer to cc a suitable mailing list as well
> c) Ideally: find the original patch on the mailing list and do a
> reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
> See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
> out what to do about this
>
> The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
>
> ------------------------------------------------------
> Subject: alpha: fix percpu build breakage
> From: Tejun Heo <tj@kernel.org>
>
> 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.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: maximilian attems <max@stro.at>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> arch/alpha/include/asm/percpu.h | 6 +++---
> include/asm-generic/percpu.h | 4 ++++
> include/linux/percpu-defs.h | 3 ++-
> 3 files changed, 9 insertions(+), 4 deletions(-)
verified that all Debian alpha images build fine with aboves patch.
thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-29 22:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-28 1:07 + alpha-fix-percpu-build-breakage.patch added to -mm tree akpm
2009-06-29 22:36 ` maximilian attems
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.