Echtzeit unter Linux in Embedded-Systemen
Publication
Update
Real TimeEmbedded Linux

When is Linux suitable for real-time requirements in embedded systems? A technical overview of determinism, PREEMPT_RT, scheduling, drivers, architecture and limitations.

Linux is the platform of choice in many embedded systems. However, as soon as stringent timing requirements come into play, a standard setup is no longer sufficient. This article explains what ‘real-time’ means in technical terms under Linux, the role played by PREEMPT_RT, scheduling and driver quality, and the limitations of Linux-based architectures.

Everything you need to know at a glance

  • Real-time does not mean ‘fast’, but rather predictable. The crucial factor is that defined response times are consistently met, even under load.
  • Standard Linux is not automatically real-time capable. Jitter arises, amongst other things, from interrupt behaviour, kernel sections, drivers and competing loads.
  • PREEMPT_RT significantly improves timing, but is no substitute for a clean architecture. Real-time behaviour arises only from the kernel, thread prioritisation, CPU allocation and controlled runtime paths.
  • In practice, drivers, scheduling and interrupts are decisive for success. Many timing problems arise not in the application, but in the deeper system layers.
  • Linux is often a sensible choice when determinism needs to be combined with connectivity, updatability and maintainability. For very stringent timing requirements, a separate real-time domain may be the more robust solution.

What does ‘real-time’ actually mean in embedded systems?

Real-time does not mean ‘as quickly as possible’. What is crucial, rather, is that a system responds to an event within a defined time frame and that this behaviour remains reproducible even under load. It is therefore not the average response time that is decisive, but the predictability of the latency.

In embedded systems, real-time requirements can typically be classified into three categories:

  • Soft real-time: Occasional time-out violations are tolerable.
  • Hard real-time: Deadline violations significantly impair quality or stability.
  • Hard real-time: Failing to meet a time specification is functionally unacceptable.

This distinction is central to the choice of software architecture. Many applications do not require hard real-time in the strictest sense, but they do require deterministic behaviour in communication paths, sensor processing, control tasks or actuator control. It is precisely in this area that Linux can be a technically and economically viable platform.

Why isn’t standard Linux automatically real-time capable?

A standard Linux kernel is primarily designed for high throughput, fairness and overall system performance. Whilst these characteristics are desirable in many embedded systems, they do not automatically result in minimal and reproducible latencies.

Typical causes of timing jitter in standard Linux are:

  • non-deterministic interrupt handling times
  • longer, non-interruptible kernel sections
  • competing background processes
  • load spikes during memory and I/O accesses
  • drivers with unfavourable runtime behaviour

Even high-performance hardware alone does not solve this problem. A fast processor can improve average performance, but does not guarantee deterministic timing. For real-time embedded systems, therefore, it is not only absolute performance that is crucial, but above all the worst-case behaviour.

How does PREEMPT_RT improve real-time performance under Linux?

When Linux is used in embedded systems with stringent timing requirements, a standard kernel is often insufficient. A key approach to improving real-time behaviour is the use of a PREEMPT_RT-enabled kernel.

PREEMPT_RT reduces non-preemptible kernel sections, improves the prioritisation of tasks and ensures that interrupt and scheduling behaviour can be better controlled. As a result, latencies and jitter can typically be significantly reduced compared to standard Linux.

However, kernel configuration alone is not sufficient to achieve a reliable result. In practice, further measures are crucial:

  • proper prioritisation of time-critical threads
  • CPU affinity for relevant tasks
  • reduction of competing background load
  • targeted allocation of interrupts
  • avoidance of unnecessary context switches
  • controlled memory strategies at runtime
  • optimised driver paths

Why do interrupts, scheduling and drivers determine the outcome?

In many embedded projects, the biggest problems lie not in the application logic, but in the lower system layers. Three areas are particularly relevant: interrupt handling, scheduling and driver design.

 

How do interrupts affect timing behaviour?

In many systems, external events must be processed with the shortest possible and reproducible delay. If interrupts are blocked for too long or processed in heavily loaded contexts, jitter increases. Real-time behaviour therefore depends crucially on how interrupt sources are distributed within the system and the resulting load.

 

Why is real-time scheduling so critical under Linux?

Even with a real-time-optimised kernel, time-critical threads must be prioritised correctly. If high-priority tasks compete with logging, networking, the GUI or file system access, unnecessary delays occur. Clear load separation is therefore essential, particularly in more complex embedded Linux systems.

 

What role do drivers play in deterministic behaviour?

Drivers have a direct impact on the temporal behaviour of the overall system. Blocking calls, long critical sections or unsuitable synchronisation mechanisms can significantly impair responsiveness. In customised embedded systems, the quality of driver optimisation is therefore often a decisive factor in determining the achievable real-time performance.

 

Why is real-time computing on Linux primarily a question of architecture?

There is no one-size-fits-all answer to the question of whether Linux is suitable for a particular application. The specific system architecture is the decisive factor. The following questions should therefore be clarified as early as the initial stages of a project:

 

QuestionLinux in embedded systemsRTOS / Separate real-time domain
Where does its strength lie? In the case of complex systems involving networks, updates, diagnostics, user interfaces and a high degree of integration For highly time-critical functions with clearly defined response limits
To what extent is deterministic behaviour achievable? This is easily achievable if the kernel, scheduling, interrupts and drivers are consistently optimised for timing Generally more suitable when very tight and reliably reproducible time constraints must be met
What are the typical risks? Competing system loads, unsuitable drivers, I/O spikes and inadequate load isolation Limited scope for integration, greater additional effort required for overall system functions, and potential architectural complexity in hybrid approaches
When does this approach usually make sense? When, in addition to time-critical tasks, maintainability, connectivity and long-term platform support are also important If certain functional areas are so time-critical that Linux, even with optimisation, would not be the most robust solution
What kind of architecture is often practical? Linux handles communication, diagnostics, update mechanisms and higher-level application logic A separate real-time domain handles strictly time-critical control or regulation tasks

It is crucial not to approach the issue of real-time performance from an ideological perspective. A sound decision can only be reached once latency requirements, load profiles, interrupt patterns and integration needs have been assessed together.

 

What are some common misconceptions about real-time systems on Linux?

To conclude, it is worth taking a look at three common misconceptions that regularly lead to problems in projects:

Is a fast processor automatically sufficient?

No. Higher computing power improves average performance, but does not automatically improve worst-case behaviour.


Is PREEMPT_RT sufficient on its own?

No. Without appropriate prioritisation, thread allocation, driver quality and load isolation, the result is often inadequate.


Does real-time capability only emerge during implementation?

No. The crucial decisions are already made at the architectural stage.

Real-time Linux is possible, but not a given

Whether Linux is suitable for an application depends on the technical depth of its architecture: kernel configuration, scheduling, interrupt handling, driver quality and load balancing are more important for this than raw computing power.

For many embedded products, Linux provides a particularly strong foundation when, in addition to time-critical functions, connectivity, maintainability, the ability to update and long-term platform support are also required. Where the demands for determinism increase, the system must be consistently designed with this in mind. And where hard limits are reached, a clear separation between the Linux environment and the real-time domain is often the right approach.

By precisely defining real-time requirements at an early stage, one can avoid costly architectural errors and lay the foundations for an embedded system that operates reliably not only in terms of functionality but also in terms of timing behaviour.

 

Thomas Heinke

Thomas Heinke

Head of sales department

Thomas Heinke has more than 25 years of experience in technical project management at SIGMA Chemnitz. His expertise includes advising and supporting industrial clients, system integration, and projects in the areas of ERP, PLM, business intelligence, and AutoID/RFID. In his work, he bridges the gap between technological developments and the practical requirements of industrial applications.

More about the author

Talk to us!

We will be happy to present solutions for your industry and your processes.
Talk to the specialists for SMEs.

request now