Log in



Archive for May, 2006

SCHED_RR quantum in Linux / POSIX

May 19th, 2006 by Peter

I am currently playing around with the POSIX Realtime Extensions API implementation in Linux. It offers the function sched_rr_get_interval(), which allows to get the quantum for a process in the SCHED_RR (real-time round robin) scheduling class. I asked myself why one need to provide a PID to this function – it could be expected that for the SCHED_RR scheduling class the quantum value is system-wide.

After searching the web, Martin pointed me to something very cool – the XRAT page. Citation:

“The rationale used to justify the simple time-quantum scheduler is that it is common practice to depend upon this type of scheduling to ensure ‘fair’ distribution of processor resources among portions of the application that must interoperate in a serial fashion. Note that IEEE Std 1003.1-2001 is silent with respect to the setting of this time quantum, or whether it is a system-wide value or a per-process value, although it appears that the prevailing realtime practice is for it to be a system-wide value.”

In Linux kernel 2.4.27, the function reads the quantum value from the nice (!) member in the task_struct for the given PID. Since sys_nice() does not check for the scheduling class, you can set the quantum of a SCHED_RR RT process in Linux with a simple nice() call (POSIX does not support the setting of the quantum). If you now want to achieve a specific quantum length, this becomes tricky. The nice value is another representation of a ticks, which is scaled in accordance to the system speed (more speed, less ticks for the same nice value). The resulting value is called jiffies in the scheduling case. The duration of one jiffie (or one tick) again depends on the clock frequency of the particular system. The method therefore returns different time specs for systems of different speed.

Is Windows NT a real-time operating system ?

May 19th, 2006 by Peter

The question of what defines a real-time operating system is constantly discussed in our group. The definition of real-time behavior (“holds a deadline”) is common and widely accepted in the scientific community. However, I made the mistake of applying this definition also the OS scope.

One could argue that NT is no a real-time system, since it cannot provide guaranteed timing behavior, especially with the DPC / APC and interrupt dispatch level concept. An interrupt service routine can schedule deferred procedure calls (DPC’s). NT has the concept of interrupt dispatch levels, where the OS scheduler runs on the lowest level, and ISR’s run on the higher levels. DPC’s are executed on the level above the scheduler level, so if the DPC is executed, nothing else runs in the system. Since NT executes all DPC’s until the queue is emtpy, and since there is only one queue, it can happen that a malicious driver implementation schedules DPC’s which take a non-deterministic amount of time.

(BTW: You might not now that when I talk about Windows NT, it means also Windows 2000 / XP / whatever comes in the future. The operating system kernel remained more or less the same in the last years. Read the book from Solomon and Russinovich if you need more details about changes between the versions.)

However, the DPC problem mainly relates to the design of drivers, applications and hardware behavior. In fact, you cannot the blame the operating system itself for being RT-capable or not. With well behaving hardware, good drivers (with deterministic DPC timing behavior) and an according application it would be possible to implement a RT-application with NT.

We see that with a timing-only definition, everything could be a RT operating system. For this reason, our RT expert (and Wikipedia) define a RT operating system as set of facilities which enables the development of RT applications. This includes fixed priority scheduling, according API’s, high resolution timers, memory pinning, and so on. This set of features is not centrally defined. The QNX authors define one neccessary feature set for RT operating systems, POSIX another one. Therefore, the operating system authors define if it provides facilities for the development of RT applications, and if it therefore can be named as RT operating system. The users decide if they agree that the feature set is complete enough for the development of their RT application.

Finally for me it comes out that Windows NT is not a real-time operating system, since it was not intended to be one. The good thing is that Microsoft somehow agrees to this kind of definition:

The funny question is if Linux could be named now as real-time operating system, since it supports the POSIX real-time API’s out of the box. The answer is simple: The operating system authors do not define a real-time system with the POSIX RT feature set only, and therefore it is not one.

Standardization of Remote Deployment

May 18th, 2006 by Peter

After some years of silence, the topic of remote deployment in web service- and grid architectures now becomes also of interest for standardization bodies. Hiro Kishimoto told the GGF community that the OASIS Solution Deployment Descriptor TC is developing
XML schema for deployment related metadata of multiple software packages (they call solution). Their scope is widely overlapped with CDDLM, ACS, JSDL, and OGSA-EMS.

Fix photos

May 16th, 2006 by Peter

I saw a live demonstration of this tool during a presentation from MSR Cambridge. This tool rocks:

http://research.microsoft.com/projects/groupshot/

Visual Diff Tool

May 3rd, 2006 by Peter

Yes, I learned VI. Yes, I learned to write automake scripts. Yes, I learned to intepret the hardest BASH scripts. And no, I never was able to get something useful out of a DIFF output.

On Windows, there is a bunch of tools for this. I like the WinMerge integrated in TortoiseSVN.

For MacOS X, I found TkDiff.