From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Joe Perches <joe@perches.com>
Cc: Mathias Krause <minipli@googlemail.com>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code
Date: Tue, 24 Jun 2014 16:31:08 +0200 [thread overview]
Message-ID: <87egyeqt03.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <1403505219.18747.37.camel@joe-AO725> (Joe Perches's message of "Sun, 22 Jun 2014 23:33:39 -0700")
Joe Perches <joe@perches.com> writes:
> On Mon, 2014-06-23 at 08:23 +0200, Mathias Krause wrote:
>> On 23 June 2014 00:56, Joe Perches <joe@perches.com> wrote:
>> > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote:
>> >> [...] patch 2 adds some syntactical sugar for the most popular use
>> >> case, by providing pr_<level> alike macros, namely pi_<level> for __init
>> >> code and pe_<level> for __exit code. This hides the use of the marker
>> >> macros behind the commonly known printing functions -- with just a
>> >> single character changed.
>> >>
>> >> Patch 3 exemplarily changes all strings and format strings in
>> >> arch/x86/kernel/acpi/boot.c to use the new macros. It also addresses a
>> >> few styling issues, though. But this already leads to ~1.7 kB of r/o
>> >> data moved to the .init.rodata section, marking it for release after
>> >> init.
>> >>
>> >> [...]
>> >
>> > I once proposed a similar thing.
>> >
>> > https://lkml.org/lkml/2009/7/21/421
>> >
>> > Matt Mackall replied
>> >
>> > https://lkml.org/lkml/2009/7/21/463
>> >
>>
>> Thanks for the pointers. Have you looked at patch 2 and 3? I don't
>> think it makes the printk() case ugly. In fact, using pi_<level>()
>> should be no less readable then pr_<level>, no?
>
> I don't think it's particularly less readable, but I
> do think using the plug-in mechanism might be a better
> option as it would need no manual markings at all.
gcc already seems to contain infrastructure for this kind of thing, so
maybe it doesn't even require a plugin, but simply a little coordination
with the gcc folks. This snippet from gcc internals seems relevant:
-- Target Hook: section * TARGET_ASM_FUNCTION_RODATA_SECTION (tree
DECL)
Return the readonly data section associated with 'DECL_SECTION_NAME
(DECL)'. The default version of this function selects
'.gnu.linkonce.r.name' if the function's section is
'.gnu.linkonce.t.name', '.rodata.name' if function is in
'.text.name', and the normal readonly-data section otherwise.
Rasmus
next prev parent reply other threads:[~2014-06-24 14:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-22 22:46 [RFC PATCH 0/3] Mark literal strings in __init / __exit code Mathias Krause
2014-06-22 22:46 ` [RFC PATCH 1/3] init.h: Add __init_str / __exit_str macros Mathias Krause
2014-06-24 19:43 ` Joe Perches
2014-06-24 20:13 ` Mathias Krause
2014-06-22 22:46 ` [RFC PATCH 2/3] printk: Provide pi_<level> / pe_<level> macros for __init / __exit code Mathias Krause
2014-06-22 22:46 ` [RFC PATCH 3/3] x86, acpi: Mark __init strings as such Mathias Krause
2014-06-22 22:56 ` [RFC PATCH 0/3] Mark literal strings in __init / __exit code Joe Perches
2014-06-23 6:23 ` Mathias Krause
2014-06-23 6:33 ` Joe Perches
2014-06-24 14:31 ` Rasmus Villemoes [this message]
2014-06-24 19:13 ` Mathias Krause
2014-06-24 19:37 ` Joe Perches
2014-06-24 20:10 ` Mathias Krause
2014-06-24 20:30 ` Joe Perches
2014-06-24 20:41 ` Mathias Krause
2014-06-24 20:57 ` Joe Perches
2014-06-24 21:06 ` Mathias Krause
2014-06-24 21:45 ` Joe Perches
2014-06-25 5:55 ` Mathias Krause
2014-06-25 7:35 ` Rasmus Villemoes
2014-06-25 7:48 ` Joe Perches
2014-06-25 8:34 ` Mathias Krause
2014-06-25 11:22 ` Joe Perches
2014-06-25 8:17 ` Mathias Krause
2014-06-23 1:30 ` Joe Perches
2014-06-23 6:29 ` Mathias Krause
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=87egyeqt03.fsf@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=minipli@googlemail.com \
--cc=rjw@rjwysocki.net \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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).