During the last decade, there has been a considerable interest in using Linux in real-time systems, especially for industrial control. The simple and elegant design of Linux guarantees reliability and very good performance, while its open-source license allows to modify and change the source code according to the user needs. However, Linux has been designed to be a general-purpose operating system. Therefore, it presents some issues like unpredictable latencies and limited support for real-time scheduling. In this paper, we present our experience in the design and implementation of the real-time scheduler that has been recently included in the Linux kernel. The scheduler is based on the Resource Reservation paradigm, which allows to enforce temporal isolation between the running tasks. We describe the genesis of the project, the challenges we have encountered, the implementation details and the API offered to the programmers. Then, we show the experimental results measured on a real hardware.has concerned the optimization of the average throughput (i.e. the amount of 'useful work' performed by the system in the unit of time) instead of meeting the timing constraints of each running application. As a result, the standard Linux kernel does not provide good real-time performance (i.e. low kernel latencies) or other features needed for supporting real-time applications (for example, advanced scheduling / resource management algorithms).In this paper, we describe a real-time scheduler for the CPU that we have recently included in Linux. The paper is organized as follows. In Section 2, we present the previous work about real-time on Linux. In Section 3, we describe the scheduling algorithm, the implementation details as well as the API offered to the programmer. Then, in Section 4, we provide some experimental results on a real hardware. Finally, in Section 5, we state our conclusions and we provide information about the future work.
RELATED WORKIn the last decade, several (sometimes orthogonal) mechanisms have been proposed to add real-time capabilities to the Linux kernel. These mechanisms can be grouped in the following classes [1].Hardware Abstraction Layers (HALs). The first technique consists on reducing the kernel latency through a small abstraction layer (also called hypervisor), which virtualizes the hardware exposed to the Linux kernel [2]. This layer takes full control of the hardware resources (mainly, interrupts and system timers) and directly handles the real-time tasks at a higher priority than Linux. The Linux kernel is thus scheduled by the HAL as a low-priority task. The real-time applications cannot use functionalities provided by the Linux kernel, unless by temporarily loosing their real-time guarantees.This approach, originally introduced by Finite State Machine Labs with real-time Linux (RTLinux) [3], then acquired by Wind River [4], is now provided by two community-driven projects. The Real-Time Application Interface (RTAI) project [5], started in 1997, has developed the Adeos kernel [6] as a rep...