You are here: Home / RTLWS 1999-2017 / RTLWS Submitted Papers / 
2024-12-11 - 19:28

Real Time Linux Workshops

1999 - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 - 2013 - 2014 - 2015

Twelfth Real-Time Linux Workshop on October 25 to 27, in Nairobi, Kenya

Effective Real-Time computing on Linux

Dhaval Giani, Tommaso Cucinotta, Fabio Checconi and Dario Faggioli, ReTiS Lab. Scuola Superiore S. Anna, Pisa, Italy

General-Purpose Operating Systems are being increasingly considered for realizing complex embedded, time-sensitive and distributed systems. Example application domains are constituted by multimedia applications, digital A/V processing systems, interactive distributed collaboration systems, real-time control applications with timing constraints that are not excessively strict, etc. Due to the availability of a wide variety of libraries, tools, middleware and applications, as well as a rich set of supported multimedia peripherals, such as acquisition and playback devices and memory cards and the wide variety of networking devices and protocols, a GPOS like Linux is an ideal development environmentfor these type of systems. However, these soft real-time applications pose challenging requirements for the Operating System in terms of the ability to provide proper guarantees on the timely execution of the hosted processes.

Focusing on Linux, there have been significant advances in the last few years in terms of the capabilities required for precise timing of applications. From the years of the 2.4 kernel series, when kernel code was not preemptable, the current kernel supports fully preemptable kernel sections. The High Resolution Timers subsystem, now integrated in the mainline kernel, allows for a nanosecond-precision time accounting and posting of timers. The increased usage of advanced synchronization primitives such as Read-Copy-Update optimizes the access to shared data structures across multiple cores and processors on SMP systems. The kernel supports almost all the POSIX real-time extensions related to management of clocks, timers, signals and process scheduling policies. The PREEMPT_RT project re-engineers the interrupt management subsystem to run handlers in dedicated real-time kernel threads with the actual kernel logic which runs in interrupt context limited to just waking up the appropriate handler thread. This dramatically improves the responsiveness of the Operating System to external events, at the cost of a slight decrease in overall system throughput. Finally, the current real-time throttling  mechanism and its integration with the cgroup framework allows for a minimum degree of temporal isolation across concurrently running real-time tasks or groups of tasks.

However, this last aspect is still somewhat incomplete, at least in the official mainline kernel version. Despite the growing need for a proper mechanism to enable temporal isolation to provide scheduling guarantees to concurrently running real-time tasks in the systems, the kernel still lacks it. The set of applications mentioned earlier as well as the multimedia application domain would greatly benefit by task scheduling mechanisms at the kernel level with precise real-time guarantees. For example, with priority-based scheduling as mandated by POSIX and implemented in the kernel a high-priority task may indefinitely delay lower-priority ones, hindering the possibility to provide proper guarantees to individual real-time tasks. While this may not constitute a problem for simple embedded real-time system where nearly everything is under control of the designer, for more complex systems the lack of a proper temporal encapsulation support by the kernel is an important issue. The POSIX Sporadic Server scheduling policy would address such issues, but unfortunately it is not yet implemented in the mainline Linux kernel (even though there exists a patch supporting it). The real-time throttling mechanism mentioned earlier partially mitigates this lack of feature by providing the possibility to associate groups of tasks with certain scheduling guarantees. However, the granularity over the time period these guarantees are provided is solely system-wide (and it defaults to 1 second). Also, the current implementation, being based on the cgroup interface, is oriented towards static configuration of the scheduling parameters, rather than a much more dynamic exploitation of it as it would be required, for example, by multimedia and adaptive real-time applications.

In this paper, a software architecture, designed with the purpose of supporting real-time computing on the Linux Operating System, has been described. A multitude of projects focussing on enriching Linux with proper real-time task scheduling policies already exist. In this paper the discussion builds over the experience gained from some of these projects, yet what is proposed is something quite different. The focus is on the requirements posed by complex real-time and multimedia applications, the proper level of abstraction which needs to be exposed at the Application/OS interface as well as the minimum set of core functionality needed for the purpose of building higher level complex and possibly distributed infrastructures for real-time systems. We also present a prototype implementation of this architecture.

The main aim of this paper is to gather feedback from the community about the design and directions for future development and further refinement of the proposed architecture.