Linux and Real-Time

This chapter describes several reasons why standard Linux is not considered suitable for real-time use, which include: coarse grained synchronization, paging, fairness in scheduling, request reordering, and batching. Linux was conceived and built as a general-purpose multiuser operating system in the model of UNIX. General purpose operating systems are tuned to maximize average throughput even at the expense of latency, while real-time operating systems attempt to minimize, and place an upper bound on, latency, sometimes at the expense of average throughput. The chapter presents an experiment to explain how much latency varies in standard Linux. It also explains how to improve the latency of standard Linux. The kernel's scheduling policy and process priority for the jitter process can be changed and process's memory image can be locked into RAM so that it does not get paged out. The chapter describes two approaches to giving Linux deterministic behavior: preemption improvement and interrupt abstraction.