Pages

Sunday, October 24, 2010

Lowering Latency in Linux: Introducing a Preemptible Kernel

Lowering Latency in Linux: Introducing a Preemptible Kernel

INTRODUCTION:


Performance measurements come in two flavors, throughput and latency. The former is like the width of an expressway: the wider the expressway, the more cars can travel on it. The later is like the speed limit, the faster it is, the sooner the cars can get from Point A to Point B. Obviously, both quantities are important to any task. Many jobs however require more of one quantity than the other.
Audio/Video processing and playback are two common beneficiaries of lowered latency. Increasingly important to Linux, however, is its benefit to interactive performance. With high latency, user actions such as mouse clicks go unnoticed for too long – not the snappy responsive desktop users expect. The system cannot get to the important process fast enough.
The problem, at least as far as the kernel is concerned, is the nonpreemptibility of the kernel itself. Normally, if something sufficiently important happens such as an interactive event, the receiving application will get a priority boost and subsequently find itself running. This is how a preemptively multitasked operating system works. Applications run until they use some default amount of time (called a time slice) or until an important event occurs. The alternative is co-operative multitasking, where applications must explicitly say “I’m done!”, before a new process can run. The problem, when running in the kernel is that scheduling is effectively cooperative.
Applications operate in one of the two modes: either in user space, executing their own code, or within the kernel, executing a system call or otherwise having the kernel work on their behalf. When operating in the kernel, the process continues running until it decides to stop, ignoring timesclices and important events. If a more important process becomes runnable, it cannot be run until the current process, if it in the kernel, gets out. This process can take hundreds of milliseconds.
MontaVista has developed a hard real-time fully preemptible Linux kernel, based on Linux kernel 2.4. The preemptible kernel has the potential to dramatically improve application responsiveness of the Linux kernel, while fully preserving the standard Linux programming model. The current prototype of the preemptible Linux kernel (for IA32/X86 platforms) is available for ftp download, at ftp://ftp.mvista.com.

for more info visit.
http://www.enjineer.com/forum

No comments:

Post a Comment