Skip to contentSkip to conversation

Kernel bloat 2.4 vs. 2.5

DISCUSSION Daniel Egger 6 participants 11 messages Mar 4, 2003 – Mar 6, 2003

lore
Share & tools
lore
#0 lore raw

Hija,

I've seen surprisingly few messages about the dramatic size increase between a simple 2.4 and a 2.5 kernel image.

I just decided to check back with the 2.5 series again after my last try with 2.5.53 (which wouldn't even boot) but had to dramatically cut down the kernel featurewise to keep it below 1MB because I can't boot it over tftp otherwise.

909824 Feb 14 20:02 vmlinuz-192.168.11.3-2.4.20
954880 Mar 4 17:01 vmlinuz-192.168.11.3-2.5.63

What you see here is a 2.4 kernel with almost everything needed to run the machine built in and a (rsync'ed) 2.5.63 kernel with everything but the basic stuff + ipv4 + NIC + NFS (+ other necessary features not builtable as modules) built as modules.

Are there any patches I've missed to get that down? A slight tad bigger and I couldn't even work with recent kernels if modules actually worked... :/

Signature · 2 lines
Servus,
       Daniel
#1 lore raw
Quoted 6 lines · Daniel Egger

Hija,

I've seen surprisingly few messages about the dramatic size increase between a simple 2.4 and a 2.5 kernel image.

Quoted 7 lines

I just decided to check back with the 2.5 series again after my last try with 2.5.53 (which wouldn't even boot) but had to dramatically cut down the kernel featurewise to keep it below 1MB because I can't boot it over tftp otherwise.

909824 Feb 14 20:02 vmlinuz-192.168.11.3-2.4.20
954880 Mar 4 17:01 vmlinuz-192.168.11.3-2.5.63

2.4 has magical size reduction tricks in it which were not brought into 2.5 because we expect that gcc will do it for us.

Please specify the compiler which was used, and use /usr/bin/size to report image sizes.

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 2 lines · Daniel Egger

I've seen surprisingly few messages about the dramatic size increase between a simple 2.4 and a 2.5 kernel image.

2.4 has magical size reduction tricks in it which were not brought into 2.5 because we expect that gcc will do it for us.

I can't see it helping *that* much, for me I have:

    charon:~/wk/linux% size 2.4.x-cw/vmlinux bk-2.5.x/vmlinux
       text    data     bss     dec     hex filename
    2003887  120260  191657 2315804  23561c 2.4.x-cw/vmlinux
    2411323  267551  181004 2859878  2ba366 bk-2.5.x/vmlinux

    gcc version 2.95.4 20011002 (Debian prerelease)

this is for functionally (in terms of .config) equivalent kernels.

--cw

#3 lore raw
Quoted 13 lines · Chris Wedgwood
Quoted 7 lines · Andrew Morton
Quoted 2 lines · Daniel Egger

I've seen surprisingly few messages about the dramatic size increase between a simple 2.4 and a 2.5 kernel image.

2.4 has magical size reduction tricks in it which were not brought into 2.5 because we expect that gcc will do it for us.

I can't see it helping *that* much, for me I have:

Quoted 9 lines
    charon:~/wk/linux% size 2.4.x-cw/vmlinux bk-2.5.x/vmlinux
       text    data     bss     dec     hex filename
    2003887  120260  191657 2315804  23561c 2.4.x-cw/vmlinux
    2411323  267551  181004 2859878  2ba366 bk-2.5.x/vmlinux

    gcc version 2.95.4 20011002 (Debian prerelease)

this is for functionally (in terms of .config) equivalent kernels.

Don't know what your point is here, really.

2.4 has hacks to make it smaller. iirc they were worth ~200 kbytes, or around 10%.

gcc-3.x string sharing was supposed to make those hacks unnecesary. However a quick test here shows gcc-3.2.1 generating a 10% larger 2.5 image than gcc-2.95.3, so a club may need to be taken to 2.5 as well.

#4 lore raw
In reply to Chris Wedgwood
Quoted 8 lines · Chris Wedgwood

I can't see it helping *that* much, for me I have:

    charon:~/wk/linux% size 2.4.x-cw/vmlinux bk-2.5.x/vmlinux
       text    data     bss     dec     hex filename
    2003887  120260  191657 2315804  23561c 2.4.x-cw/vmlinux
    2411323  267551  181004 2859878  2ba366 bk-2.5.x/vmlinux

    gcc version 2.95.4 20011002 (Debian prerelease)

Ugh look at that increase in data. Is this SMP?

Robert Love

#5 lore raw
Quoted 5 lines · Robert Love
Quoted 2 lines · Chris Wedgwood

I can't see it helping *that* much, for me I have:

Quoted 9 lines
Quoted 6 lines
    charon:~/wk/linux% size 2.4.x-cw/vmlinux bk-2.5.x/vmlinux
       text    data     bss     dec     hex filename
    2003887  120260  191657 2315804  23561c 2.4.x-cw/vmlinux
    2411323  267551  181004 2859878  2ba366 bk-2.5.x/vmlinux

    gcc version 2.95.4 20011002 (Debian prerelease)

Ugh look at that increase in data. Is this SMP?

well kallsyms is worth 150k.

Do `strings vmlinux' and take a look at it all.

#9 lore raw
In reply to Chris Wedgwood
Quoted 6 lines · Chris Wedgwood
    charon:~/wk/linux% size 2.4.x-cw/vmlinux bk-2.5.x/vmlinux
       text    data     bss     dec     hex filename
    2003887  120260  191657 2315804  23561c 2.4.x-cw/vmlinux
    2411323  267551  181004 2859878  2ba366 bk-2.5.x/vmlinux

    gcc version 2.95.4 20011002 (Debian prerelease)

objdump -h vmlinux gives even more detailed information, which could be quite useful. E.g. the increase in data could be __kallsyms, which is a config option in 2.5.

--Kai

#6 lore raw
In reply to Andrew Morton
Quoted 3 lines · Andrew Morton

well kallsyms is worth 150k.

Do `strings vmlinux' and take a look at it all.

Oh, yah. If he has kallsyms enabled that explains most of it.

Robert Love

#8 lore raw
In reply to Robert Love
Quoted 1 line · Robert Love

Ugh look at that increase in data. Is this SMP?

UP ... no preempt.

As somene pointed out, kallsyms doesn't help, so let me rebuild and compare again.

--cw

#7 lore raw
In reply to Robert Love
Quoted 9 lines · Robert Love
Quoted 3 lines · Andrew Morton

well kallsyms is worth 150k.

Do `strings vmlinux' and take a look at it all.

Oh, yah. If he has kallsyms enabled that explains most of it.

Robert Love

This shows what taking out kallsyms can do:

text data bss dec hex filename

1860575  293780  337404 2491759  26056f kernels/linux-2.4.18/vmlinux
1936720  311656  157792 2406168  24b718 BK/testing-2.5/vmlinux
1936592  437556  158720 2532868  26a604 BK/testing-2.5/vmlinux-with-kallsyms

The 2.5 tree was current yesterday.
The .config files were as "functionally equivalent" as I could make them, and except for CONFIG_KALLSYMS, were identical for the two 2.5 images. gcc is 2.96.

Steven

#10 lore raw
In reply to Andrew Morton

Am Mit, 2003-03-05 um 00.41 schrieb Andrew Morton:

Quoted 2 lines

Please specify the compiler which was used, and use /usr/bin/size to report image sizes.

The compiler was in both cases:
gcc version 3.2.3 20030228 (Debian prerelease)

2.4.20:

2271565 Feb 25 17:08 vmlinux

text data bss dec hex filename
1730302 112564 176676 2019542 1ed0d6 vmlinux

2.5.63:

2561828 Mar 4 16:50 vmlinux

text data bss dec hex filename
1867787 167450 140292 2175529 213229 vmlinux

As I said, the 2.4 kernel has almost everything built in while 2.5 was stripped down to minimum size possible. The latter is still unusable since modules do not work. :/

Signature · 2 lines
Servus,
       Daniel