linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Gianni Tedesco <gxt@cs.nott.ac.uk>,
	arges@linux.vnet.ibm.com, Maynard Johnson <maynardj@us.ibm.com>,
	Vegard Nossum <vegard.nossum@gmail.com>,
	linux-kernel@vger.kernel.org, Fenghua Yu <fenghua.yu@intel.com>,
	Mike Travis <travis@sgi.com>
Subject: [PATCH] per_cpu: fix DEFINE_PER_CPU_SHARED_ALIGNED for modules
Date: Wed, 14 May 2008 07:18:23 +0200	[thread overview]
Message-ID: <482A761F.7020609@cosmosbay.com> (raw)
In-Reply-To: <4829AFCB.9090801@cosmosbay.com>

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

Andrew,

A typo was included in the patch I sent yesterday, since I was testing :

#ifdef CONFIG_MODULES

while the intention was to test

#ifdef MODULE

So that all SHARED_ALIGNED vmlinux percpu variables still are in the 
special section.
The fix is only needed when compiling modules.

Thank you

[PATCH] per_cpu: fix DEFINE_PER_CPU_SHARED_ALIGNED for modules

Current module loader lookups ".data.percpu" ELF section to perform
per_cpu relocation. But DEFINE_PER_CPU_SHARED_ALIGNED()
uses another section (".data.percpu.shared_aligned"), currently only
handled in vmlinux.lds, not by module loader.

To correct this problem, instead of adding logic into module loader,
or using at build time a module.lds file for all arches to group
".data.percpu.shared_aligned"  into ".data.percpu",
just use ".data.percpu" for modules.

Alignment requirements are correctly handled by ld and module loader.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
---
include/linux/percpu.h |    8 +++++++-
1 files changed, 7 insertions(+), 1 deletion(-)


[-- Attachment #2: percpu_shared_aligned.patch --]
[-- Type: text/plain, Size: 688 bytes --]

diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index d746a2a..4cdd393 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -13,8 +13,14 @@
 	__attribute__((__section__(".data.percpu")))			\
 	PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
 
+#ifdef MODULE
+#define SHARED_ALIGNED_SECTION ".data.percpu"
+#else
+#define SHARED_ALIGNED_SECTION ".data.percpu.shared_aligned"
+#endif
+
 #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name)			\
-	__attribute__((__section__(".data.percpu.shared_aligned")))	\
+	__attribute__((__section__(SHARED_ALIGNED_SECTION)))		\
 	PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name		\
 	____cacheline_aligned_in_smp
 #else

      reply	other threads:[~2008-05-14  5:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 12:02 oprofile BUG() in current kernel Gianni Tedesco
2008-05-12 12:19 ` Vegard Nossum
2008-05-12 13:31   ` Gianni Tedesco
2008-05-12 14:11     ` Maynard Johnson
2008-05-12 16:38       ` Chris J Arges
2008-05-13  8:40         ` Andrew Morton
2008-05-13  9:01           ` Vegard Nossum
2008-05-13  9:41           ` Gianni Tedesco
2008-05-13 10:25             ` Eric Dumazet
2008-05-13 10:59               ` Gianni Tedesco
     [not found]                 ` <482986B3.1090601@cosmosbay.com>
2008-05-13 14:38                   ` Gianni Tedesco
2008-05-13 15:23               ` Andrew Morton
2008-05-13 15:12             ` [PATCH] per_cpu: fix DEFINE_PER_CPU_SHARED_ALIGNED for modules Eric Dumazet
2008-05-14  5:18               ` Eric Dumazet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=482A761F.7020609@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@linux-foundation.org \
    --cc=arges@linux.vnet.ibm.com \
    --cc=fenghua.yu@intel.com \
    --cc=gxt@cs.nott.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maynardj@us.ibm.com \
    --cc=travis@sgi.com \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).