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: Tue, 13 May 2008 17:12:11 +0200	[thread overview]
Message-ID: <4829AFCB.9090801@cosmosbay.com> (raw)
In-Reply-To: <1210671688.3472.10.camel@dao.KWGR614>

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

Andrew,

This patch is a follow up to thread initiated by Gianni Tedesco
in http://marc.info/?l=linux-kernel&m=121059431214889&w=2
(oprofile BUG() in current kernel.)

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: 696 bytes --]

diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index d746a2a..0bb9e91 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 CONFIG_MODULES
+#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

  parent reply	other threads:[~2008-05-13 15:12 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             ` Eric Dumazet [this message]
2008-05-14  5:18               ` [PATCH] per_cpu: fix DEFINE_PER_CPU_SHARED_ALIGNED for modules Eric Dumazet

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=4829AFCB.9090801@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).