LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How much space does the Linux kernel take up? (https://www.linuxquestions.org/questions/linux-general-1/how-much-space-does-the-linux-kernel-take-up-227115/)

Thaidog 09-05-2004 09:18 PM

How much space does the Linux kernel take up?
 
I've heard things like a microkernel like MACH can be contained completely in the CPU's cache.

I was thinking about buying a P4 EE with 2MB of cache do you think this is big enough to contain a monolithic kernel?

aeruzcar 09-06-2004 12:31 AM

Hello there, as far as I know, the linux kernel takes only about 1.5mb not more

btmiller 09-06-2004 12:55 AM

Depends on what all's running in it, but it shouldn't be more than a few MB (maybe 12 at most for a really loaded kernel). The kernel image on one of my servers is 1.2 MB compressed, so probably about 4 MB uncompressed, add in runtime data and the like and you might get 8 MB of space used or so.

Thaidog, yes, microkernel's can be very small, but size isn't the end all and be all of efficiency. For instance, with microkernels, so much is handled in userspace that there's a whole load of extra context switching[1] between all the different user processes, which is time "wasted" from the user POV. And if the entire microkernel was on cache, how much room would be left for user stuff? Not much, I wager (until caches get much bigger), so you're probably going to need to take out kernel stuff to make user processes run as optimally as possible.

The microkernel vs. monolithic kernel debate is ongoing to this day. A google on the subject should put up some good links, some of which I need to read myself some day.

[1] context switching is taking one process off the CPU and putting another on it to run.

DavidPhillips 09-06-2004 01:48 AM

Most default kernels come with way more built in support than you may actually need. The latest kernels I've been getting will not even boot from a floppy anymore. It would be a good idea to build a custon kernel if you have the time.


All times are GMT -5. The time now is 01:37 AM.