May 26, 2018

Building Your Own Linux Kernel: Tricky kernel options (part 3)

IO Schedulers, Processors, Power Management

  • October 22, 2009
  • By Akkana Peck

After the last article, you've built a custom kernel, turning off some options you don't need and maybe reducing the number of modules. But some of the options in the kernel configuration are confusing! Today I'll try to clarify some of the places where it's easy to go wrong.

Block Layer: IO Schedulers

Under "Enable the block layer" lies an option you probably wouldn't think to look at: "IO Schedulers". That's obviously some kind of �bergeeky option that only a kernel developer would care about, right?

Well, mostly true. But if you're on a netbook, there's a hidden option you should know about: the No-op scheduler.

IO schedulers manage disk reads and writes to try to reduce the number of times the disk head has to move. But with a solid-state drive, there's no disk head, and all this smart scheduling can actually hurt performance.

Under IO Schedulers --> Default I/O scheduler, you'll see an option for the "No-op" scheduler (Figure 1). If your main disk is solid-state, try it. You may see an improvement.

figure 1
figure 1

You can even enable it at runtime for a single disk:

# cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]
# echo noop > /sys/block/sda/queue/scheduler
[noop] anticipatory deadline cfq

Processor type and features

This option group is fairly straightforward, but there are a few options worth noting.

"Tickless System" lets the system set timer interrupts only as needed, rather than at every clock cycle. This can really help with laptop battery life. You also need it if you run performance measurement apps like powertop.

"Symmetric multi-processing support" is needed for machines with multiple CPUs. You'll also want it if you have a "hyperthreaded" CPU, like an Atom.

"Processor family" lets you build a kernel that may run a bit faster on your specific processor. Most people don't see much difference in practice. If you enable this but upgrade hardware often, you might want to turn on "Generic x86 support" as well, so you'll be able to run your kernel on any x86 machine.

I mentioned "High Memory Support" in the last article -- remember, if you have 4GB you may need to set it to 64GB.

Power management and ACPI options

ACPI is how modern x86-based machines do power management. APM is an older standard. Unless you have a very old machine (older than 7 years), you can probably turn off APM and use only ACPI. If your machine has trouble suspending, either to disk or to RAM, or it doesn't respond appropriately to the power button or can't read the battery level, ACPI is the category to check.

Most Popular LinuxPlanet Stories

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.