Why is the AIX real time kernel not real time?

16 07 2010

This is a minor quibble, but why is the AIX real time kernel called that? It’s not real time at all. To enable this feature, you must alter some bosboot settings, reboot the machine and set the RT_MPC environment variable. Its function consists of using on-demand scheduling with a global run queue. That is, a light weight process generates a schedule interrupt as soon as it becomes runnable and the OS executes it on any processor with lower priority tasks currently running, if they exist. This does have the effect of reducing processing latency standard deviations while increasing the average, which is superficially similar to real time processing characteristics, but real time isn’t a subjective thing. It is defined specifically in terms of meeting scheduling guarantees using mathematically provable algorithms. Scheduling guarantees cannot be met simply by trying to schedule tasks as quickly as possible based on priority. It requires a comprehensive analysis of all tasks, their priorities (both semantic priorities as inputs and algorithmic priorities as outputs of the analysis) and their periodicities. And if I’m not mistaken, scheduling guarantee analysis is an NP-complete task over N processors. That is, tasks must be fixed to processors if they are to be scheduled with any of the common real time algorithms. That means the AIX use of the global run queue is completely opposed to the definition of real time analysis.

Incidentally, the on-demand scheduling seems to be an obsolete feature as core density goes up. AIX offsets the periodic scheduling interrupts on each core, meaning that higher core density leads to smaller intervals between interrupts.




2 responses

30 12 2011
Daniel Martin

There are two types of real time, hard & soft.

Hard real time guarantees interrupts or exceptions will be serviced within a specified time, termed latency. Hard real time will generate an error and stop, waiting for operator intervention when a violation of latency time is detected (due to the stability of the job being done is compromised).

Soft real time does not guarantee the latency time between interrupt/exception and service. Soft real time will continue, trying to keep up (regardless if data or accurate time measurement is lost) as best as possible. It may or may not generate an operator error (depending how the o/s is designed) but regardless the system will continue running.

AIX is soft real time.

3 01 2012

My post was with regard to hard real time systems, although I think it is still misleading for AIX to refer to its real time kernel as such. Hard real time systems must meet a certain set of mathematically verifiable constraints for which there is industry consensus. While there is a common definition for soft real time systems, it is not so specific that one can definitively say that a system is or is not soft real time. In practice, most OS’s with features such fixed priorities and processor binding can be called soft real time. Since this includes most modern operating systems, I’m not sure how meaningful it is to market another OS that does the same thing as “real time”. When developers encounter a system that calls itself real time they do not expect a soft real time system, or at least they do not expect a system that stops at soft real time capabilities. They expect an RTOS, and that is not what AIX is. It is true that one could always say “what I meant was that it’s soft real time”, but that just isn’t how many people expect the term to be used.

I should also reiterate that I am not referring to the default AIX configuration. The OS comes with a kernel mode specifically referred to as the real time kernel. If most industrial OS’s can meet real time constraints, then one would expect standard AIX to be no different. Including a special mode called “real time” implies that such a mode provides RTOS capability. Instead, what it provides is another way of defining soft real time which is further away from hard real time than the standard kernel.

None of this detracts from the usefulness of either mode. I have used the standard kernel and real time kernel (which is not a different kernel but a collection of kernel settings) successfully for different applications. But it’s not an RTOS and so my critique is directly less at engineering than marketing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: