All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] percpu: unify input section names
@ 2011-03-31 19:52 Mike Frysinger
  2011-03-31 19:52 ` [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-03-31 19:52 UTC (permalink / raw)
  To: linux-kernel, Tejun Heo; +Cc: uclinux-dist-devel

The two percpu helper macros have the section names duplicated.  So create
a new define to merge the two.  This also allows arches who need to link
things more directly themselves to avoid duplicating the input sections in
their linker script.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 include/asm-generic/vmlinux.lds.h |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fe77e33..7531278 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -682,6 +682,22 @@
 	}
 
 /**
+ * PERCPU_INPUT - the percpu input sections
+ *
+ * The core percpu section names and core symbols which do not rely
+ * directly upon load addresses.
+ */
+#define PERCPU_INPUT							\
+	VMLINUX_SYMBOL(__per_cpu_start) = .;				\
+	*(.data..percpu..first)						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data..percpu..page_aligned)					\
+	*(.data..percpu..readmostly)					\
+	*(.data..percpu)						\
+	*(.data..percpu..shared_aligned)				\
+	VMLINUX_SYMBOL(__per_cpu_end) = .;
+
+/**
  * PERCPU_VADDR - define output section for percpu area
  * @vaddr: explicit base address (optional)
  * @phdr: destination PHDR (optional)
@@ -704,14 +720,7 @@
 	VMLINUX_SYMBOL(__per_cpu_load) = .;				\
 	.data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load)		\
 				- LOAD_OFFSET) {			\
-		VMLINUX_SYMBOL(__per_cpu_start) = .;			\
-		*(.data..percpu..first)					\
-		. = ALIGN(PAGE_SIZE);					\
-		*(.data..percpu..page_aligned)				\
-		*(.data..percpu..readmostly)				\
-		*(.data..percpu)					\
-		*(.data..percpu..shared_aligned)			\
-		VMLINUX_SYMBOL(__per_cpu_end) = .;			\
+		PERCPU_INPUT						\
 	} phdr								\
 	. = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);
 
@@ -732,14 +741,7 @@
 	. = ALIGN(align);						\
 	.data..percpu	: AT(ADDR(.data..percpu) - LOAD_OFFSET) {	\
 		VMLINUX_SYMBOL(__per_cpu_load) = .;			\
-		VMLINUX_SYMBOL(__per_cpu_start) = .;			\
-		*(.data..percpu..first)					\
-		. = ALIGN(PAGE_SIZE);					\
-		*(.data..percpu..page_aligned)				\
-		*(.data..percpu..readmostly)				\
-		*(.data..percpu)					\
-		*(.data..percpu..shared_aligned)			\
-		VMLINUX_SYMBOL(__per_cpu_end) = .;			\
+		PERCPU_INPUT						\
 	}
 
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define
  2011-03-31 19:52 [PATCH 1/2] percpu: unify input section names Mike Frysinger
@ 2011-03-31 19:52 ` Mike Frysinger
  2011-03-31 19:55   ` [uclinux-dist-devel] " Mike Frysinger
  2011-04-01  7:29 ` [PATCH 1/2] percpu: unify input section names Tejun Heo
  2011-04-01 22:15 ` [PATCH 1/2 v2] " Mike Frysinger
  2 siblings, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2011-03-31 19:52 UTC (permalink / raw)
  To: linux-kernel, Tejun Heo; +Cc: uclinux-dist-devel

The Blackfin percpu input sections are outdated, so rather than update
them, drop them completely and use the new common define.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/kernel/vmlinux.lds.S |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 0e38042..bc0bf76 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -155,14 +155,8 @@ SECTIONS
 		SECURITY_INITCALL
 		INIT_RAM_FS
 
-		. = ALIGN(4);
 		___per_cpu_load = .;
-		___per_cpu_start = .;
-		*(.data.percpu.first)
-		*(.data.percpu.page_aligned)
-		*(.data.percpu)
-		*(.data.percpu.shared_aligned)
-		___per_cpu_end = .;
+		PERCPU_INPUT
 
 		EXIT_DATA
 		__einitdata = .;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [uclinux-dist-devel] [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define
  2011-03-31 19:52 ` [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define Mike Frysinger
@ 2011-03-31 19:55   ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-03-31 19:55 UTC (permalink / raw)
  To: linux-kernel, Tejun Heo; +Cc: uclinux-dist-devel

On Thu, Mar 31, 2011 at 15:52, Mike Frysinger wrote:
> The Blackfin percpu input sections are outdated, so rather than update
> them, drop them completely and use the new common define.

Tejun: btw, i'm not expecting you to merge this one.  it's just an
example of why we need this common code change.  once the
vmlinux.lds.h patch is merged, i can run this through my tree like
normal.
-mike

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] percpu: unify input section names
  2011-03-31 19:52 [PATCH 1/2] percpu: unify input section names Mike Frysinger
  2011-03-31 19:52 ` [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define Mike Frysinger
@ 2011-04-01  7:29 ` Tejun Heo
  2011-04-01 22:15 ` [PATCH 1/2 v2] " Mike Frysinger
  2 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2011-04-01  7:29 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-kernel, uclinux-dist-devel

On Thu, Mar 31, 2011 at 03:52:01PM -0400, Mike Frysinger wrote:
> The two percpu helper macros have the section names duplicated.  So create
> a new define to merge the two.  This also allows arches who need to link
> things more directly themselves to avoid duplicating the input sections in
> their linker script.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Looks good to me but can you please rebase it on top of the following
branch?

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git fixes-2.6.39

You'll probably need to add @cacheline to the macro.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2 v2] percpu: unify input section names
  2011-03-31 19:52 [PATCH 1/2] percpu: unify input section names Mike Frysinger
  2011-03-31 19:52 ` [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define Mike Frysinger
  2011-04-01  7:29 ` [PATCH 1/2] percpu: unify input section names Tejun Heo
@ 2011-04-01 22:15 ` Mike Frysinger
  2011-04-03 23:44   ` Tejun Heo
  2 siblings, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2011-04-01 22:15 UTC (permalink / raw)
  To: linux-kernel, Tejun Heo; +Cc: uclinux-dist-devel

The two percpu helper macros have the section names duplicated.  So create
a new define to merge the two.  This also allows arches who need to link
things more directly themselves to avoid duplicating the input sections in
their linker script.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v2
	- rebased onto latest mainline

 include/asm-generic/vmlinux.lds.h |   44 ++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 32c45e5..bf90fbc 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -688,6 +688,28 @@
 	}
 
 /**
+ * PERCPU_INPUT - the percpu input sections
+ * @cacheline: cacheline size
+ *
+ * The core percpu section names and core symbols which do not rely
+ * directly upon load addresses.
+ *
+ * @cacheline is used to align subsections to avoid false cacheline
+ * sharing between subsections for different purposes.
+ */
+#define PERCPU_INPUT(cacheline)						\
+	VMLINUX_SYMBOL(__per_cpu_start) = .;				\
+	*(.data..percpu..first)						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data..percpu..page_aligned)					\
+	. = ALIGN(cacheline);						\
+	*(.data..percpu..readmostly)					\
+	. = ALIGN(cacheline);						\
+	*(.data..percpu)						\
+	*(.data..percpu..shared_aligned)				\
+	VMLINUX_SYMBOL(__per_cpu_end) = .;
+
+/**
  * PERCPU_VADDR - define output section for percpu area
  * @cacheline: cacheline size
  * @vaddr: explicit base address (optional)
@@ -715,16 +737,7 @@
 	VMLINUX_SYMBOL(__per_cpu_load) = .;				\
 	.data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load)		\
 				- LOAD_OFFSET) {			\
-		VMLINUX_SYMBOL(__per_cpu_start) = .;			\
-		*(.data..percpu..first)					\
-		. = ALIGN(PAGE_SIZE);					\
-		*(.data..percpu..page_aligned)				\
-		. = ALIGN(cacheline);					\
-		*(.data..percpu..readmostly)				\
-		. = ALIGN(cacheline);					\
-		*(.data..percpu)					\
-		*(.data..percpu..shared_aligned)			\
-		VMLINUX_SYMBOL(__per_cpu_end) = .;			\
+		PERCPU_INPUT(cacheline)					\
 	} phdr								\
 	. = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);
 
@@ -745,16 +758,7 @@
 	. = ALIGN(align);						\
 	.data..percpu	: AT(ADDR(.data..percpu) - LOAD_OFFSET) {	\
 		VMLINUX_SYMBOL(__per_cpu_load) = .;			\
-		VMLINUX_SYMBOL(__per_cpu_start) = .;			\
-		*(.data..percpu..first)					\
-		. = ALIGN(PAGE_SIZE);					\
-		*(.data..percpu..page_aligned)				\
-		. = ALIGN(cacheline);					\
-		*(.data..percpu..readmostly)				\
-		. = ALIGN(cacheline);					\
-		*(.data..percpu)					\
-		*(.data..percpu..shared_aligned)			\
-		VMLINUX_SYMBOL(__per_cpu_end) = .;			\
+		PERCPU_INPUT(cacheline)					\
 	}
 
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 v2] percpu: unify input section names
  2011-04-01 22:15 ` [PATCH 1/2 v2] " Mike Frysinger
@ 2011-04-03 23:44   ` Tejun Heo
  2011-05-24  1:46     ` [uclinux-dist-devel] " Mike Frysinger
  0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2011-04-03 23:44 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-kernel, uclinux-dist-devel

On Fri, Apr 01, 2011 at 06:15:34PM -0400, Mike Frysinger wrote:
> The two percpu helper macros have the section names duplicated.  So create
> a new define to merge the two.  This also allows arches who need to link
> things more directly themselves to avoid duplicating the input sections in
> their linker script.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Applied to percpu#fixes-2.6.39.  I'll push the branch to Linus
soonish.  It is a stable branch so please feel free to pull from it if
necessary.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git fixes-2.6.39

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [uclinux-dist-devel] [PATCH 1/2 v2] percpu: unify input section names
  2011-04-03 23:44   ` Tejun Heo
@ 2011-05-24  1:46     ` Mike Frysinger
  2011-05-24  9:37       ` Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2011-05-24  1:46 UTC (permalink / raw)
  To: Tejun Heo; +Cc: uclinux-dist-devel, linux-kernel

On Sun, Apr 3, 2011 at 19:44, Tejun Heo wrote:
> On Fri, Apr 01, 2011 at 06:15:34PM -0400, Mike Frysinger wrote:
>> The two percpu helper macros have the section names duplicated.  So create
>> a new define to merge the two.  This also allows arches who need to link
>> things more directly themselves to avoid duplicating the input sections in
>> their linker script.
>>
>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> Applied to percpu#fixes-2.6.39.  I'll push the branch to Linus
> soonish.  It is a stable branch so please feel free to pull from it if
> necessary.
>
>  git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git fixes-2.6.39

i dont see this in mainline for 2.6.40-rc1 either ?
-mike

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [uclinux-dist-devel] [PATCH 1/2 v2] percpu: unify input section names
  2011-05-24  1:46     ` [uclinux-dist-devel] " Mike Frysinger
@ 2011-05-24  9:37       ` Tejun Heo
  0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2011-05-24  9:37 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: uclinux-dist-devel, linux-kernel

Hello,

On Tue, May 24, 2011 at 3:46 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> i dont see this in mainline for 2.6.40-rc1 either ?

Just sent pull request.  Was waiting for more fixes and waited too long.

Thank you.

-- 
tejun

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-24  9:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 19:52 [PATCH 1/2] percpu: unify input section names Mike Frysinger
2011-03-31 19:52 ` [PATCH 2/2] Blackfin: use new common PERCPU_INPUT define Mike Frysinger
2011-03-31 19:55   ` [uclinux-dist-devel] " Mike Frysinger
2011-04-01  7:29 ` [PATCH 1/2] percpu: unify input section names Tejun Heo
2011-04-01 22:15 ` [PATCH 1/2 v2] " Mike Frysinger
2011-04-03 23:44   ` Tejun Heo
2011-05-24  1:46     ` [uclinux-dist-devel] " Mike Frysinger
2011-05-24  9:37       ` Tejun Heo

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.