From: Sam Ravnborg <sam@ravnborg.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Zeev Tarantov <zeev.tarantov@gmail.com>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH] tracing: properly align linker defined symbols
Date: Sun, 11 Jul 2010 08:07:23 +0200 [thread overview]
Message-ID: <20100711060723.GA16125@merkur.ravnborg.org> (raw)
In-Reply-To: <AANLkTindHPEQHhmrB562ZlFZMtAIN-S6yMmT7zubS2D_@mail.gmail.com>
On Sat, Jul 10, 2010 at 03:25:02PM -0700, Linus Torvalds wrote:
> On Fri, Jul 9, 2010 at 11:35 PM, Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > We define a number of symbols in the linker scipt like this:
> >
> > __start_syscalls_metadata = .;
> > *(__syscalls_metadata)
> >
> > But we do not know the alignment of "." when we assign
> > the __start_syscalls_metadata symbol.
> > gcc started to uses bigger alignment for structs (32 bytes),
> > so we saw situations where the linker due to alignment
> > constraints increased the value of "." after the symbol assignment.
>
> Ok, why not clean this up a bit more, and use a helper macro for this
> pattern. There's a fair number of users of that kind of pattern, so
> that actually removes a few lines.
>
> Here's an example patch. Untested. Whatever. But just this part
>
> 1 files changed, 21 insertions(+), 31 deletions(-)
>
> says to me that it's a good idea, and there are other cases that could
> use the new SYMBOL_SECTION() helper.
>
> What do people think?
Looks good.
I especially like how we with this standardize on the alignment.
I will make sure a working version hits next merge window.
A few comments.
+#define SYMBOL_SECTION(name, section) \
+ . = ALIGN(32); \
+ VMLINUX_SYMBOL(__start_##section) = .; \
+ *(name) \
+ VMLINUX_SYMBOL(__stop_##section) = .;
The arguments to this macro is confusing.
Something like this:
#define SYMBOL_SECTION(section, symbol_suffix)
To encourage people to use the section name as suffix
the __start / __stop variables we could
introduce an additional define:
#define SYMBOL_SECTION(section) SYMBOL_SECTION_SUFFIX(section, section)
#define SYMBOL_SECTION_SUFFIX(section, symbol_suffix) \
+ . = ALIGN(32); \
+ VMLINUX_SYMBOL(__start_##symbol_suffix) = .; \
+ *(section) \
+ VMLINUX_SYMBOL(__stop_##symbol_suffix) = .;
I will update the patch to reflect this (+ the fix you pointed out).
But it will wait until Steven has decided what patch to forward
to fix the discussed regression.
Sam
next prev parent reply other threads:[~2010-07-11 6:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-09 19:56 [PATCH][GIT PULL][for 2.6.35] tracing: Add alignment to syscall metadata declarations Steven Rostedt
2010-07-09 20:18 ` Ingo Molnar
2010-07-09 20:33 ` Sam Ravnborg
2010-07-09 20:46 ` Steven Rostedt
2010-07-09 20:53 ` Sam Ravnborg
2010-07-09 21:05 ` Steven Rostedt
2010-07-09 21:56 ` Sam Ravnborg
2010-07-09 22:02 ` Sam Ravnborg
2010-07-09 21:25 ` Linus Torvalds
2010-07-10 0:22 ` Steven Rostedt
2010-07-10 6:35 ` [PATCH] tracing: properly align linker defined symbols Sam Ravnborg
2010-07-10 10:18 ` Zeev Tarantov
2010-07-10 11:34 ` Steven Rostedt
2010-07-10 13:06 ` Zeev Tarantov
2010-07-10 13:48 ` Sam Ravnborg
2010-07-10 15:36 ` Zeev Tarantov
2010-07-10 13:49 ` Sam Ravnborg
2010-07-10 22:25 ` Linus Torvalds
2010-07-10 22:27 ` Linus Torvalds
2010-07-11 6:07 ` Sam Ravnborg [this message]
2010-07-15 15:05 ` Sam Ravnborg
2010-07-15 15:15 ` Steven Rostedt
2010-07-15 18:31 ` Sam Ravnborg
2010-07-22 11:51 ` [tip:perf/urgent] tracing: Properly " tip-bot for Sam Ravnborg
2010-07-10 9:45 ` [PATCH][GIT PULL][for 2.6.35] tracing: Add alignment to syscall metadata declarations Zeev Tarantov
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=20100711060723.GA16125@merkur.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjw@sisk.pl \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
--cc=zeev.tarantov@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
all inboxes | Powered by JetHome®