All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-omap@vger.kernel.org, Thomas Petazzoni <tpetazzoni@ti.com>,
	Thomas Petazzoni <t-petazzoni@ti.com>
Subject: Re: [PATCH 1/6] Add infrastructure for conditional code and data sections
Date: Tue, 21 Dec 2010 11:27:35 -0800	[thread overview]
Message-ID: <20101221192735.GG5829@atomide.com> (raw)
In-Reply-To: <1292955604-8809-2-git-send-email-thomas.petazzoni@free-electrons.com>

* Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [101221 10:20]:
> From: Thomas Petazzoni <tpetazzoni@ti.com>
> 
> WARNING: This is only a proof-of-concept, there are many known
> issues. The sole purpose of this patch is to get some feedback on
> whether the idea is useful or not, and whether it's worth cleaning up
> the remaining issues.
> 
> A trend in the kernel support for SoC is to build a single kernel that
> works accross a wide range of SoC inside a SoC family, or even in the
> future SoC of different families.
> 
> While this is very interesting to reduce the number of kernel images
> needed to support a large number of hardware platforms, it allows
> means that the kernel image size is increasing. Portions of code and
> data are specific to a given SoC (clock structures, hwmod structures
> on OMAP, etc.) and only the portion relevant for the current SoC the
> kernel is running on is actually useful. The rest of the code and data
> remains in memory forever.
> 
> While __init and __initdata can solve some of those cases, it is not
> necessarly easy to use, since the code/data that is actually useful
> needs to be copied so that it is kept after the init memory cleanup.
> 
> Therefore, we introduce an infrastructure that allows to put code and
> data into specific sections, called "conditional sections". All those
> sections are compiled into the final kernel image, but at runtime, by
> calling a function, we can get rid of the unused sections.

Great, something is certainly needed to free the unused memory.
 
> For example, on OMAP, you can declare data as being omap2 specific
> this way:
> 
>    static int __omap2_data foobar;
> 
> Then, in the board code of an OMAP3 or OMAP4 platform, you can call:
> 
>    free_unused_cond_section("omap2");

Sounds like this could be done after the cpu detection automatically?

I don't know what the section limitations are, but it would be nice
to have a separate section for each machine.. Then we could just
"free_unused_machines()" during the init.. :)

Tony

  reply	other threads:[~2010-12-21 19:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 18:19 [RFC] Infrastructure for dynamic removal of code and data sections Thomas Petazzoni
2010-12-21 18:19 ` [PATCH 1/6] Add infrastructure for conditional " Thomas Petazzoni
2010-12-21 19:27   ` Tony Lindgren [this message]
2010-12-21 22:00     ` Thomas Petazzoni
2010-12-22 18:28       ` Tony Lindgren
2010-12-22 18:42         ` Thomas Petazzoni
2010-12-22 19:02           ` Tony Lindgren
2010-12-23 12:31         ` Aaro Koskinen
2010-12-23 12:44           ` Thomas Petazzoni
2010-12-23 18:02           ` Tony Lindgren
2011-01-03  3:37   ` Paul Walmsley
2011-01-03  8:08     ` Paul Walmsley
2010-12-21 18:20 ` [PATCH 2/6] omap: add macros to mark SoC-specific data/code Thomas Petazzoni
2010-12-21 18:20 ` [PATCH 4/6] omap3: mark some data as omap3-specific Thomas Petazzoni
2010-12-21 18:20 ` [PATCH 5/6] omap4: mark some data as omap4-specific Thomas Petazzoni
2010-12-21 18:20 ` [PATCH 6/6] omap3: beagle: get rid of unused omap2/omap4 specific code/data Thomas Petazzoni
2010-12-21 19:15   ` Menon, Nishanth
2010-12-21 21:57     ` Thomas Petazzoni

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=20101221192735.GG5829@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=t-petazzoni@ti.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tpetazzoni@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.