IT NEWS     Sustainability    Get JOB ALERTS that match your skills
Technology news and Jobs arrow Information Technology News arrow An Ubuntu guide to taming the Linux kernel
An Ubuntu guide to taming the Linux kernel PDF E-mail
User Rating: / 11
PoorBest 
by David M Williams   
Monday, 15 October 2007
Tuning the kernel
Most pieces of software use configuration files to adjust how they function; the kernel is no different in this regard. One of its most important configuration files is /etc/sysctl.conf which sets the value of a wide range of kernel parameters.

Most every article on tweaking performance out of Ubuntu will invariably direct you to edit /etc/sysctl.conf. For example, broadband users might tweak TCP/IP settings. Or you might adjust how much of the system’s RAM is used for shared memory (which is utilised for inter-process communication between separate running apps.) These articles, and many others, are well worth reading, along with the sysctl.conf man page itself.

You don’t need to reboot to see your modifications take effect; Ubuntu handily provides a command called sysctl to adjust parameters directly on the running kernel. Note that although sysctl will act right away, it won’t persist the modification; if you are happy with it, you need to still modify /etc/sysctl.conf. An example of using sysctl to alter a running kernel is given in the Ubuntu Community Docs to adjust timer resolutions for MIDI purposes.

Compiling the kernel
All this said, there are times when you might want to install a new kernel. For most people this will not be necessary, as Ubuntu provides a range of kernels for different processor types as well as letting modules be manipulated and parameters be tweaked as we have discussed, but rebuilding does allow you to make use of the very latest compilers and libraries, and allows you to exercise full control.

If you wish to go down this route, be sure to make a working boot disk so you can boot back up to a known state should something go wrong. From here, the steps are basically a sequence of ‘make’ commands.

Begin with make mrproper to tidy up the source tree. This command will clear all previously compiled binaries as well as other intermediate files. Note carefully this will remove the essential .config file so either save a copy, or wait until after running mrproper to create it. You can use commands make menuconfig or make xconfig (for a GUI) to adjust this configuration file.
Use make dep to create code dependencies, make clean to prepare sources, and then make bzImage to actually generate a compressed binary image.

Execute make modules to compile modules; make modules_install to install the resulting binaries into /lib/modules. Run make install to copy your new kernel to /boot and to perform other important tasks.

You’ve finished with the source code at this point, but before rebooting to test your new kernel, be sure to verify that the /boot/grub/grub.conf or /etc/lilo.conf boot loader files have been updated to use your new kernel.

While rebooting, monitor the screen for any errors and be sure to inspect /var/log/messages after successfully logging in.

With this information all understood, you now have a good grounding to launch into the kernel and to take full control over how it operates on your own computer.

Please enable JavaScript in your browser to post your comment!


Get stories like this delivered daily - FREE - subscribe now


 
< Next story in category   Previous story in the category >
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff
Subscribe to our free e-newsletter
First name:
Last name:
Your email address:
Your role:
Your industry:
Australian state:
Country:
Enter the security code shown:
mandatory
Contact , Register , Advertise with iTWire , Links , About iTWire , Feedback , Post your jobs , Events , iTWire site map , Start Blogging , MyBlogLog page
Industry Releases , Submit your release now