linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Krause <minipli@googlemail.com>
To: Joe Perches <joe@perches.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	"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: Wed, 25 Jun 2014 07:55:47 +0200	[thread overview]
Message-ID: <CA+rthh8anKnxA7XuZb4BHB4a7w=Oo3LhUuD2UOwGfv2SGxLs0w@mail.gmail.com> (raw)
In-Reply-To: <1403646310.29061.61.camel@joe-AO725>

On 24 June 2014 23:45, Joe Perches <joe@perches.com> wrote:
> On Tue, 2014-06-24 at 23:06 +0200, Mathias Krause wrote:
>> On 24 June 2014 22:57, Joe Perches <joe@perches.com> wrote:
>> > On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote:
>> >> And all of those strings should be in the .rodata section, now. But
>> >> why you're asking?
>> > Because now they will be duplicated in .rodata
>> > and the __init section no?
>> No. A string marked with __init_str() will only life in the
>> .init.rodata section. No duplication.
>
> Unless the same string is used in another bit
> of code.  Then there's duplication.

Rather, unless the same string gets used in an __init and a non-__init
section of the same compilation unit. Otherwise it would be only in
one section. But having the same string used in two sections of the
same compilation unit should be a rather rare case. Merging strings
across multiple compilation units does not happen, anyway -- not now,
not with the new macros.

>
>> Having duplicated strings in .rodata and .init.rodata is also no
>> problem as the latter will be freed.
>
> They increase image size.

But as this is a rare case, it shouldn't matter, really. The
compression should compensate that, compressing multiple occurrences
of the same string efficiently.

In the more likely case, strings used only in __init code, we would
have no image size increase but an increase of free memory after
initialization.


Thanks,
Mathias

  reply	other threads:[~2014-06-25  5:55 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
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 [this message]
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='CA+rthh8anKnxA7XuZb4BHB4a7w=Oo3LhUuD2UOwGfv2SGxLs0w@mail.gmail.com' \
    --to=minipli@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mingo@redhat.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).