mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jan Beulich <jbeulich@novell.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] __cpuinitconst and __devinitconst
Date: Fri, 11 Jan 2008 20:44:28 +0100	[thread overview]
Message-ID: <20080111194428.GB29189@uranus.ravnborg.org> (raw)
In-Reply-To: <47873D11.76E4.0078.0@novell.com>

Hi Jan.

On Fri, Jan 11, 2008 at 08:55:29AM +0000, Jan Beulich wrote:
> Since __cpuinitdata/__devinitdata don't allow const to be specified with
> them (otherwise .init.data sections with and without the writeable attribute
> will be generated by the compiler), and since __devinitdata except for
> embedded systems evaluates to <empty> unconditionally and
> __cpuinitdata at least in most production kernel configurations also
> likely evaluates to <empty>, it seems appropriate to add an additional
> attribute allowing the respective objects to end up in .rodata rather than
> .data when not used at initialization time only.

How about a slightly diffrent approach...
Consider
__cpuinitconst => function is placed in section .init.const.text
__devinitconst => function is placed in section .init.const.text

Then we in the linker scrip can distingush between the two
and locate the sections as appropriate.

This will require some updates to modpost but are align with an
idea I have had for a while.
All of the following should have dedicated sections associated
unconditionally:

__init
__cpuinit
__meminit
__initdata
__cpuinitdata
__meminitdata

And then in the linker script we decide what to do with the section.
In the built-in case we put them in the "to-be-discarded" section.
In the module case we put them as today.

The primary tasks needed to accomplish this is:
1) Update all arch linker scripts (and some of them looks ugly)
2) Teach modpost about the new sections

If you following the suggestion above this is a simple step
in this direction which would be good.

Comments?

	Sam

  reply	other threads:[~2008-01-11 19:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11  8:55 Jan Beulich
2008-01-11 19:44 ` Sam Ravnborg [this message]
2008-01-12 20:56   ` Sam Ravnborg
2008-01-13  7:30     ` Sam Ravnborg
2008-01-13 21:42       ` Sam Ravnborg
2008-01-14  8:33         ` Jan Beulich
2008-01-14  9:17           ` Sam Ravnborg
2008-01-14  9:25             ` Jan Beulich
2008-01-14  9:43               ` Sam Ravnborg

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=20080111194428.GB29189@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®