From: David Woodhouse <dwmw2@infradead.org>
To: Gilad Ben-Yossef <gilad@codefidence.com>
Cc: 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 09:20:22 +0100 [thread overview]
Message-ID: <1213777222.26255.1161.camel@pmac.infradead.org> (raw)
In-Reply-To: <4858AF6D.7040808@codefidence.com>
On Wed, 2008-06-18 at 09:47 +0300, Gilad Ben-Yossef wrote:
> This may sound like a stupid question, but why are you compiling the
> modules statically?
I wondered that.
One potential reason to avoid modules is that they waste RAM -- you have
to allocate an integral number of pages for each one, which means an
average of 2KiB wasted for each module you load. Although that isn't
much, it's not zero either. It might be possible to optimise that by
'packing' module allocations, if you're careful about it.
Also, on some architectures modules have historically been less
efficient because when kernel and module text are too far apart in the
virtual address space, you have to insert trampolines for all calls
between them. I believe this used to be the case on ARM, but it got
fixed by moving stuff around? It's only v850 which still does this
AFAICT.
Do we actually manage to free inittext/initdata from modules on all
architectures now? The comments in <linux/init.h> suggest not, but I
think they lie -- it looks like like kernel/module.c will handle that
entirely generically for sections named ".init*" -- it'll allocate space
for those sections in a separate module_alloc() call, and free them
itself. (Do bear this in mind, if you take the above suggestion about
packing in module_alloc().)
So the only real reason I can see to avoid modules in the _current_
kernel would be the wasted RAM, which should be something we can
address. Tim, have I missed something? What _were_ your reasons for
avoiding modules, and can we do something about those instead of trying
to defer the initialisation of in-kernel code?
Delaying init of certain modules seems like a poor man's substitute for
a properly multi-threaded startup....
--
dwmw2
next prev parent reply other threads:[~2008-06-18 8:20 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 [this message]
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
-- 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=1213777222.26255.1161.camel@pmac.infradead.org \
--to=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).