Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to compile a 2.6.x kernel for my slack box. There is an option for building into the kernel or to modularise for almost every component. The general question is - what is the rule-of-thumb for deciding on which approach to take for each component? What are the pros and cons of each approach?
More specifically, I have a slow computer (Transmeta Crusoe on some VIA chipset [I think...] running on old-school SDRAMs with the on-board graphics accelerator leeching memory off it) and I want to optimise my slack, which mainly runs xfce on it.
* Bonus question: I can't figure out where the bottleneck for the sluggish performance is. Any benchmarking tool or some method that I can use to pinpoint the bottleneck?
Back to modules, any specific functions that I should modularise and any specific ones to build in to get the maximum performance from my box?
Unless you want to make an initrd image for boot, you're required to compile in your PCI controller and filesystem type. Mine for example are piix and ext3.
Beyond that, on my old machine I just compile everything I want in and then say "N" to everything I know I don't need (like the 57 sound cards that I know I don't have). Anything that is vague or I'm not exactly sure I need, I leave as a module. My machine works pretty quickly now (Debian Sarge with a minimal KDE on a Celeron 400MHz, 256MB Ram).
One advantage of using modules instead of compiling in is that if a module craps out it likely won't take the entire kernel with it. Of course with the stability of linux that doesn't seem to happen much anyway.
Another advantage of the modular approach is that you can upgrade modules (for example alsa) without a kernel recompile.
In terms of device drivers, personally, if it's on the motherboard, I build it in, if it's a PCI card etc, I make it a module (so if I remove the card, the driver is not wasting space). Exceptions are sound and network drivers, since I might want to juggle them (i.e. use an audigy instead of onboard sound, use a pci network card if the onboard exhibits any flakiness and so on).
Obviously, you need to compile in whatever you need to boot (framebuffer, root filesystem driver and so on). Other than the essentials for booting, I leave most stuff as modules, especially drivers that take parameters, as the only way to change the parameters for a builtin driver is to reboot. A module can just be reloaded.
There may be (I haven't benchmarked) a tiny performance overhead using modules, but this will be negligible. If your system is sluggish, it's extremely unlikely that the cause is too many modules!
First thing to check is if you have dma enabled (hdparm /dev/hda). You can use hdparm -tT /dev/hda for a quick memory/drive throughput test. Bonnie is also useful for testing hard drives.
That seems pretty reasonable for your hardware. On my Athlon 64 3200 box at home, I get ~2200 MB/s cached and 55-60 MB/s buffered. My old 2GHz Athlon 2800 got ~800/50 (dual channel). I'm currently using my mother's 1.4GHz Athlon XP, and I'm getting ~490/30 (single channel, motherboard isn't great). On my old PIII's I get 400/20 (1GHz, rambus) and 250/16 (600MHz, sdram).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.