netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christer Weinigel <christer@weinigel.se>
To: Jamie Lokier <jamie@shareable.org>
Cc: Neil Horman <nhorman@tuxdriver.com>,
	David Miller <davem@davemloft.net>,
	shemminger@vyatta.com, s.hauer@pengutronix.de, yanok@emcraft.com,
	linux-arm-kernel@lists.arm.linux.org.uk, netdev@vger.kernel.org,
	wd@denx.de, dzu@denx.de
Subject: Re: [PATCH] dnet: Dave DNET ethernet controller driver
Date: Fri, 13 Mar 2009 00:42:41 +0100	[thread overview]
Message-ID: <49B99DF1.9000509@weinigel.se> (raw)
In-Reply-To: <20090312215919.GA19200@shareable.org>

Jamie Lokier wrote:

> Neil Horman wrote:
>> I've not looked at the figures lately, but how much space does the
>> dhcp client and nfs root code take up in the kernel these days?
> 
> About 4k apparently.  See the difference from "400k compressed?".
> Also, uncompressing that may add 0.5 second boot time on a slow CPU :-)


I just tried to get some actual numbers for the size increase by looking 
at an actual initrd I had lying around.  If I just look at some some of 
the largest files needed for a initrd, they use 800kBytes:

ls -l bin/busybox lib/ld-uClibc-0.9.28.so lib/libuClibc-0.9.28.so
-rwxr-xr-x 1 root root 499804 2007-01-21 18:17 bin/busybox*
-rwxr-xr-x 1 root root  19492 2005-12-27 12:15 lib/ld-uClibc-0.9.28.so*
-rw-r--r-- 1 root root 312136 2005-12-27 08:46 lib/libuClibc-0.9.28.so

All files are stripped ARM9 binaries and as you can see, the C library 
is uClibc.  And compressed it is roughly about 400kBytes:

tar cvfz - bin/busybox lib/ld-uClibc-0.9.28.so lib/libuClibc-0.9.28.so | wc -c

422789

The in kernel BOOT/DCHP client and NFS root code increases the size of
the compressed kernel by slighty less than 8kBytes.  The 4k number was
just for turning off BOOTP/DHCP (IP_PNP).

 > I must admit that a solution which makes the effective kernel size

> 800k larger (your figure) doesn't look like a good standard to me.
> 
> If that was the "standard", I'd be tempted to add a MAC address driver
> hack to the kernel to save the space :-)

So the numbers aren't quite as bad, but it is a 50 time increase in 
overhead to do things "right".  For a kernel which is 1.5Mbytes it is 
"only" a 27% increase in total size though.

Of course, using busybox is a bit of an overkill, it should be possible 
to just port the in kernel BOOTP/DHCP client and NFS root code so that 
it is statically linked with klibc and put in an initrd.  If we assume 
that the useful parts of the code stay the same size, it should compress 
to about 8kBytes of initrd instead of 8kBytes of compressed kernel 
image.  But code running from an initrd will need a stdio library with 
printf and a bunch of other library functions.  After taking a quick 
look at klibc it seems that it would add something like 10-20kBytes 
compressed size to a normal application.  So that would only be a 2-3 
time increase in size which is much more acceptable to me.

Actually, just looking at the filenames in the klibc source, it seems 
that it does have a DHCP client and some NFS root code already.  An ARM9 
"kinit" binary is about 75kBytes, and I'm not sure if it includes the 
DHCP client or the NFS root code.  But it means that it's probably 
possible to replace the in kernel code with klibc as is for only an 
extra 50kBytes or so of increased compressed size.

Looks interesting, any year now...

   /Christer















  reply	other threads:[~2009-03-12 23:42 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11  2:29 [PATCH] dnet: Dave DNET ethernet controller driver Ilya Yanok
2009-03-11  4:00 ` Eric Dumazet
2009-03-11 23:33   ` [PATCH] dnet: Dave DNET ethernet controller driver (updated) Ilya Yanok
2009-03-12  6:29     ` David Miller
2009-03-11  4:18 ` [PATCH] dnet: Dave DNET ethernet controller driver Stephen Hemminger
2009-03-11  8:44   ` Sascha Hauer
2009-03-11  8:49     ` David Miller
2009-03-11  8:57       ` Sascha Hauer
2009-03-11  9:09         ` Wolfgang Denk
2009-03-11 10:35           ` Sascha Hauer
2009-03-11 13:23           ` David Miller
2009-03-11 14:00             ` Dan Williams
2009-03-11 18:23             ` Robert Schwebel
2009-03-11 19:15             ` Riku Voipio
2009-03-12  0:44               ` David Miller
2009-03-11 20:56       ` Christer Weinigel
2009-03-11 21:33         ` Russell King - ARM Linux
2009-03-12  0:13         ` Stephen Hemminger
2009-03-12 10:41           ` Christer Weinigel
2009-03-12 12:55             ` David Miller
2009-03-12 14:21               ` Christer Weinigel
2009-03-12 14:34                 ` Sascha Hauer
2009-03-12 15:01                 ` David Miller
2009-03-12 15:12                 ` Neil Horman
2009-03-12 16:25                   ` Christer Weinigel
2009-03-12 17:43                     ` David Miller
2009-03-12 17:52                       ` Christer Weinigel
2009-03-12 18:06                         ` Jamie Lokier
2009-03-12 18:39                           ` Dan Williams
2009-03-12 18:48                           ` Christer Weinigel
2009-03-12 19:04                             ` Sascha Hauer
2009-03-12 19:15                               ` Jamie Lokier
2009-03-12 19:16                               ` Neil Horman
2009-03-12 19:21                               ` Christer Weinigel
2009-03-12 20:14                               ` Wolfgang Denk
2009-03-12 20:27                                 ` Sascha Hauer
2009-03-12 20:35                                 ` Russell King - ARM Linux
2009-03-12 17:49                     ` Neil Horman
2009-03-12 18:25                       ` Christer Weinigel
2009-03-12 19:05                         ` Neil Horman
2009-03-12 19:14                           ` Sascha Hauer
2009-03-12 19:29                           ` Christer Weinigel
2009-03-12 21:59                           ` Jamie Lokier
2009-03-12 23:42                             ` Christer Weinigel [this message]
2009-03-13  0:21                               ` Neil Horman
2009-03-13  1:29                                 ` Christer Weinigel
2009-03-13 10:30                                   ` Neil Horman
2009-03-13  0:16                             ` Neil Horman
2009-03-12 19:25                         ` Jamie Lokier
2009-03-12 19:43                           ` Christer Weinigel
2009-03-12 20:24                   ` Mike (mwester)
2009-03-13  0:29                     ` Neil Horman
2009-03-12 13:41   ` Michael Cashwell
2009-03-12 14:05     ` David Miller
2009-03-12 14:26       ` Neil Horman
2009-03-12 18:02       ` Jamie Lokier
2009-03-13 19:49       ` Robert Schwebel
2009-03-13 20:12         ` David Miller

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=49B99DF1.9000509@weinigel.se \
    --to=christer@weinigel.se \
    --cc=davem@davemloft.net \
    --cc=dzu@denx.de \
    --cc=jamie@shareable.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shemminger@vyatta.com \
    --cc=wd@denx.de \
    --cc=yanok@emcraft.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).