Kernel "bloat", efficiency of new versions.

Story: Linus calls Linux 'bloated and huge'Total Replies: 10
Author Content

Sep 22, 2009
11:33 AM EDT
First let's define bloat.

Is the Linux kernel source huge? Yes indeed, for all the reasons stated except sloth. The simple number of supported hardware architectures and kernel modules, and don't forget the good programming practice of copious comments, makes the source itself grow as it is changed and added to.

Is the Linux kernel slower than it used to be? Could be, because I see the bar-graphs on Phoronix kernel comparisons go up a little bit sometimes. I only retired my 2003 laptop a couple months ago, and in those 6 years of staying with the latest kernels I didn't notice any slowdown.

So let's narrow this down a little. Otherwise, I'm just writing Microsoft marketing copy.

The Debian "everything and the kitchen sink" kernel that I'm using right now:

-rw-r--r-- 1 root root 1506032 2009-08-19 05:48 vmlinuz-2.6.26-2-686

That's 1.5MB. Yes, compressed, but I have to wonder, "this is bloat?"

Silly question. This kernel is bigger than Linux used to be, even if it's tiny in comparison to other "popular" kernels.

Is the bloat in the modules? Certainly the NUMBER of modules has exploded, mostly due to hardware makers and their infinite variations on a theme. To my jaded opinion, I also think too many are being loaded, thus making for a larger loaded "kernel" when they're not used. Again my unoptimized system:

$ lsmod | wc -l 86

Certainly no high performance server is going to need the sound and video drivers. Would it be nice to unload unused drivers even if they are compiled in? Would it be nice if there were an app that could be run, unloading all modules not in use? Sure, but first one has to wonder just how much such unused modules actually slow the running kernel.

Here's what I think is going on: There is bloat, and the system is getting slowed down, but it's because of multiple areas of possible bloat added together.

The kernel itself, the scheduler, memory management, the basic things that constitute the fundamental kernel are constantly being tweaked. The entire "Fair Scheduler" controversy, to me, demonstrates that even the most fundamental elements of the kernel get a share of the attention.

Kernel modules. Well, the prime motivation is to get hardware working. After that, is all that much attention paid to optimizing? According to "Greg Kroah Hartman on the Linux Kernel", changes happen everywhere, across the board.

Not sure how to sum this up. With as many different hardware architectures, maybe the core kernel elements cannot be as "optimized" as it used to be when i386-specific tweaks could be inherently used in the code, not relying on compiler optimizations. Maybe bloat at the statistical level is inevitable, and over the course of years those statistics add up.

I've tried Menuet OS, and of course something optimized to a specific architecture and limited hardware seems very fast. So I wonder why such "hardware specific" OSs have such small penetration on the Top500 supercomputers?

Could it be that, stripped of all unused modules and compiled for specific hardware, Linux isn't actually all that bloated?

Sep 22, 2009
12:41 PM EDT
To give you an idea of how, to answer your last question, Linux isn't all that bloated... My netbook died and is going back for warranty repair. I've put my next best laptop back into service, a Toshiba purchased in 2002. It's was a low end machine then: a 1GHz Celeron processor with 512MB of RAM (maxed out). I'm running Vector Linux Light at the moment but it's in a dual boot configuration with Slackware 13.0. Neither OS Is slow on my machine.

We're talking low end hardware from seven years ago and performance is good...

Just in case I am rebuilding my ancient Toshiba Libretto SS1010, from 1998. It can still run Linux 11 years later. Yes, I'm restricted to lightweight apps and a lightweight window manager but it can still do work. It is not intolerably slow, either. Specs: Pentium MMX 233MHz processor with 64MB of RAM. A modern Linux kernel can run on 11 year old hardware.

That's bloated? Gee... I wish other things were "bloated" like that.

Sep 22, 2009
12:58 PM EDT
The whole "bloat" quote has been blown waaay out of proportion anyway. It's the headline du jour, and nearly every report gets it wrong. God forbid an intrepid "tech""journalist" should spend a few minutes watching the actual video of the actual kernel panel from yesterday, and hear first-hand what Linus said. It was a throwaway quip from an hour discussion on a number of aspects of kernel development.


Sep 22, 2009
12:59 PM EDT
Yep, me too. 128MB, 300MHz, 1998 laptop ran 2.6.18 kernel and current applications from Debian Sid last summer when I finally retired it. And, as you mention, all I had to do was use one of the smaller window managers and only one of the "big" applications at a time, like OpenOffice.

But it worked, and as you say it worked just fine.

If this be "bloat", let's make the most of it.

Sep 22, 2009
1:20 PM EDT
@Caitlyn and Bob:

I have an old laptop (1 GHz purchased in 2002). It has only 256 MB RAM. Debian Etch ran great, Lenny not so much. Slackware 12.1 didn't run worth a darn. Vector Light OTOH is very responsive. I assumed that Vector Light has a stripped-down kernel, but I may be wrong.

Sep 22, 2009
1:49 PM EDT
Bigg, I've noticed on a 1GHz Athalon server, that several months ago it could play full motion video just fine, using Lenny. XINE had to be told to "just drop frames", but it was smooth and ran just fine even with H264 files.

I had a Grub2 problem and reinstalled, again with Lenny, but now XINE won't play the same video files smoothly at all, and builds up enough problems to stop itself even playing miniscule .avi files.

What changed? I have NO freaking idea. But what I can say is that I don't think it's the fault of the Linux kernel itself. Certainly applications do keep getting bigger, and bigger, and bigger...

I've been thinking of getting an "obsolete" nVidia PCI card to replace the onboard video, see if that frees up enough resources to make the difference.

Sep 22, 2009
2:30 PM EDT
@Bob_Robertson You are probably on the right track with trying a separate nVidia card. Not only are even the "obsolete" low-end PCI or AGP cards that you can often find as cast-offs or the $19 loss leader at Fry's usually significantly faster than most built-in video you will probably also be able to re-claim some system memory because most on-board video uses shared memory. Both of those things should help not only video performance but may even give a slight boost to overall system performance.

Sep 22, 2009
2:36 PM EDT
It could be Xine. At least VLC is having a similar problem, where the newer versions are so heavy they choke on some files. 0.86b, on the other hand, works fine.

Sep 22, 2009
3:01 PM EDT
'Kernel Bloat' is not a problem when it comes to desktops (except for having to configure your 2.6 kernel starting with an empty .config - may take a few hours). It may a problem be when it comes to embedded systems.

That's why embedded systems run 'trimmed down' Linux kernels, uclibc, busybox and dasBoot, and why ARM joined the Linux foundation - I guess.

Sep 22, 2009
5:55 PM EDT
I've put Slackware 3.2 (yes, three point two) and Slackware 12.2 on the same machine (different disks, however), a 400 MHz K-6 Gateway. I did this during the current calendar year.

I had to upgrade the 3.2 distro's kernel to 2.0.40 to get it to support a 3c905 ethernet card, and I had to recompile Xfree86 4.99 to get the ATI "Rage" video card to work. 3.2 also didn't include SSH.

Kernel 2.0.40 did seem slightly snappier than the 2.6.xx kernel in Slackware 12.2, but overall, there's not that much performance difference.

Sep 22, 2009
7:55 PM EDT
I personally haven't seen any performance "regressions" between Debians Etch and Lenny. What I have seen is a lot more functionality in Lenny just by virtue of the kernel and all the ancillary tools being able to do more.

I just rolled out a Debian Lenny laptop with Xfce that has VERY low specs: 144 MB RAM, 233 MHz Pentium II CPU. I had Etch on it quite a while ago, and it seems to run as well or better with Lenny. Of course it ran pretty well with OpenBSD 4.2 as well; I did try to reinstall (having failed at upgrading another box with OpenBSD) ... this time I screwed it up in a 10th the time, hence the return of Debian.

Probably the best distro I tried on this old laptop was Puppy Linux, with 2.13 being quite a bit faster than 4.1.x (can't remember the exact version number). But both were great running from live CD.

But Lenny is more than adequate on it, and the ability to update/upgrade easily and keep it patched means I'll probably be sticking with Lenny on it.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!