linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Adrian Bunk <bunk@kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Gilad Ben-Yossef <gilad@codefidence.com>,
	Tim Bird <tim.bird@am.sony.com>,
	linux-embedded <linux-embedded@vger.kernel.org>
Subject: Re: Recommendation for activating a deferred module init in the kernel
Date: Wed, 18 Jun 2008 10:56:40 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0806181042320.2982@xanadu.home> (raw)
In-Reply-To: <Pine.LNX.4.64.0806181336410.13297@vixen.sonytel.be>

On Wed, 18 Jun 2008, Geert Uytterhoeven wrote:

> On Wed, 18 Jun 2008, Adrian Bunk wrote:
> > On Wed, Jun 18, 2008 at 10:59:50AM +0100, David Woodhouse wrote:
> > > On Wed, 2008-06-18 at 10:57 +0200, Geert Uytterhoeven wrote:
> > > > On Wed, 18 Jun 2008, Adrian Bunk wrote:
> > > > > You miss the size increase imposed by CONFIG_MODULES=y.
> > > > > 
> > > > > E.g. setting CONFIG_MODULES=y in the arm collie_defconfig will
> > > > > increase the size of vmlinux by 14% (sic).
> > > > > 
> > > > > I haven't investigated why it takes that much space, but stuff like 
> > > > > kernel/module.o taking 23kB and each EXPORT_SYMBOL requiring a few
> > > > > bytes simply cannot be completely eliminated.
> > > > 
> > > > Sounds like we need a tool that strips out the unneeded symbols, given a list
> > > > of modules?
> > > 
> > > And do the --gc-sections step again after that... :)
> > 
> > But even after all optimizations CONFIG_MODULES=y will still cause a 
> > significant additional cost [1] when thinking in the dimensions of 
> > Tim's "the 30 or so Linux-tiny patches that I use get me about 110k of 
> > reductions.  For me, this is about 5% of my kernel size" statement in 
> > another thread.
> > 
> > [1] as I said, kernel/module.o alone takes 23kB
> 
> Which could be freed after the last module has been loaded?

Even if you free the module loading infrastructure afterwards, you still 
have to carry it in flash for both the kernel part and the user part.  
And the whole process (having to sort out module loading in user space, 
etc.) is still more complex than not having to load modules at all. Many 
embedded designs have fixed hardware configuration and purpose which 
makes dynamic module loading an unnecessary bloat.

Having the kernel span a parallel thread with a lower priority to 
initialize drivers could be a much simpler solution in terms of size and 
speed.  This way the init process could run early, and devices would 
become available eventually just as if corresponding modules were 
loaded.

The only difficulty is to properly determine how to distinguish between 
drivers that have to be initialized early in order to mount the root fs 
and the others that can wait.


Nicolas

  reply	other threads:[~2008-06-18 14:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18  6:47 Recommendation for activating a deferred module init in the kernel Gilad Ben-Yossef
2008-06-18  8:20 ` David Woodhouse
2008-06-18  8:32   ` David Woodhouse
2008-06-18  8:52   ` Adrian Bunk
2008-06-18  8:57     ` Geert Uytterhoeven
2008-06-18  9:59       ` David Woodhouse
2008-06-18 10:33         ` Adrian Bunk
2008-06-18 10:41           ` David Woodhouse
2008-06-18 11:37           ` Geert Uytterhoeven
2008-06-18 14:56             ` Nicolas Pitre [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-17 18:23 Tim Bird
2008-06-17 18:51 ` David VomLehn
2008-06-17 19:07 ` Jörn Engel
2008-06-17 19:22   ` Jim Freeman
2008-06-17 20:06     ` Tim Bird
2008-06-17 19:52   ` Tim Bird
2008-06-17 19:55     ` Tim Bird
2008-06-17 20:23       ` Jörn Engel
2008-06-17 20:35         ` Josh Boyer
2008-06-17 22:48           ` Stefan Richter
2008-06-18  0:03             ` Johannes Stezenbach
2008-06-18  0:10               ` Stefan Richter
2008-06-18  9:38                 ` Johannes Stezenbach
2008-06-17 20:19     ` Jörn Engel
2008-06-18 12:38 ` Amol Lad
     [not found] ` <4858A659.8030502@codefidence.com>
2008-06-18 16:08   ` Tim Bird
     [not found]     ` <4859ECF3.3000500@codefidence.com>
2008-06-19 17:58       ` Tim Bird
2008-06-22  7:08         ` Gilad Ben-Yossef
2008-06-23 17:40           ` Tim Bird
2008-07-01 14:20             ` Gilad Ben-Yossef

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=alpine.LFD.1.10.0806181042320.2982@xanadu.home \
    --to=nico@cam.org \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=bunk@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=gilad@codefidence.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=tim.bird@am.sony.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;
as well as URLs for NNTP newsgroup(s).