Technology news and Jobs
The Linux distillery
Just what makes Linux tick
The Linux distillery
Just what makes Linux tick | Just what makes Linux tick |
|
| by David M Williams | |
| Thursday, 21 February 2008 | |
|
Page 3 of 3 Each time the clock ticks the scheduler has an opportunity to switch out the running process and bring in another. So, increasing the frequency of interrupts will decrease the length of a jiffy and mean the running process is changed more often. In a real-time system, such as a hospital or military system, every millisecond can be crucial.Featured Whitepaper
5 Best Practices for Smartphone Support
In fact, a higher tick frequency can also result in higher CPU usage in general. If your computer is a server-based system with dual processors and backup power supplies then this is not an issue. If, however, your Linux system is running on a laptop that’s often disconnected from power, then you will be adversely affected. This is also true of embedded systems with slow CPUs. As of kernel 2.6.14 the clock tick frequency has become configurable on most architectures. The default value for 32-bit ‘386-based systems is now 250Hz – ie 250 ticks per second – but options are given for 100, 250 and 1,000 Hz when the kernel is being built. A slow processor or low power system would opt for a smaller value, whereas a powerful machine or one with multimedia or critical real-time application requirements would benefit from a higher value. This value can only be set when the kernel is being built; it cannot be changed on any Linux system without rebuilding the kernel. To check what the value of HZ is on your system execute the command cat /boot/config-`uname -r` | grep '^CONFIG_HZ=' Does this meet your needs? For most people the defaults should be fine. However, if you are on the extremes you can tweak your system to either consume less power or to react more quickly by adjusting this value. This isn’t for everyone; you need to take care when rebuilding the Linux kernel. However, on the other hand, the Linux kernel which comes with every distro is largely generic so it can suit the broadest range of computers. By rebuilding your kernel you can also take advantage of optimisations or the removal of unnecessary drivers to eke out greater performance. Be sure to check out the man pages for the time and strace commands. Being able to monitor the time your applications take is tremendously useful for understanding your system and for debugging slow executing code. See you in a jiffy next Monday where we’ll talk about what Linux has in common with a B-grade horror flick. |
| < Next story in category | Previous story in the category > |
|---|




Tags





