Fedora Core 5

March 22, 2006

I installed Fedora Core 5 yesterday.  The new installer is a bit of a step up, it’s nice to see it using Yum instead of RPM.  It seemed a bit slower though,  I didn’t time it when compared to Fedora Core 4.  The hardware support seems a bit better than previous versions.  The install worked the first time on my NForce chipset which usually crashed using previous versions of any installer.

Gnome 2.14 is a big step up in speed than previous versions and the new Fedora theme is a lighter and easier on my eyes than previous versions.  It’s a pretty good upgrade.


Kernel Development

March 9, 2006

For the kernel hacking class that I’m in it looks like I’m going to be adding support for turnstiles to the Linux kernel.  Turnstiles can be found in Open Solaris and they are used in Semaphores instead of wait queues in Linux.  Turnstiles are different from wait queues because they also take priority into account when they are selecting the process that will receive the lock.  This helps solve the priority inversion problem.  I’ll also need to come up with a way to prevent process starvation.


Solaris Locking Primitives

March 6, 2006

Mutexes - There are two types of mutexes that are currently implemented in the kernel. They are spin and adaptive mutexes. Adaptive mutexes are designed to either spin or block when a lock is held; depending on what state the holder of the lock is in. Spin locks have to be used in high-level interrupt handlers, because blocking means you are forced to have a context switch.

Conditional Variables - Conditional variables are kernel thread level synchronization primitives. These are implemented as a structure, and they also use a mutex to provide the locking ability. The mutex is passed into the functions as necessary, it is not part of the conditional variable structure.

Semaphores - The semaphores that are included in Solaris are standard counting semaphores that we’re used to using. They should be used in situations that the speed of mutexes and rwlocks aren’t necessary. The fact that they are a counting semaphore makes it very natural for them to be used for resource allocation and deallocation. They also use standard sleep queues, unlike mutexes which use turnstiles when the processes block on a given resources.
Contracts - These are a much more complicated synchronization primitive. There main purpose to help enrich the relationship between a process and the system resources. These system resources can include pages, threads, and they can also be used for asynchronously reporting errors to a process. This primitive depends on the contracts file system to provide an interface to user level processes. Contract types are used to implement the different relationships between processes and system resources.

Turnstiles – Turnstiles are another synchronization primitive that provide blocking and wakeup support, and priority inheritance for synchronization primitives, which include mutexes and rwlocks. This is very similar to the linux kernel wait queue, but the difference is that this helps prevent priority inversion. It does this be supporting priority inheritance and not being a standard FIFO data structure like the linux kernel wait queue.

Dispatcher Locks – This is a type of kernel locking primitive that is specific to the Solaris scheduler. There are two types of these locks they are spin locks and locks that also have the ability to raise the priority level of a process. They are used almost exclusively in the scheduler, they see extremely limited use in other parts of the kernel. This is needed because you cannot handle interrupts when you are modifying the dispatch queues. This is very similar to Linux spin locks that also disable interrupts on the system. This is a one byte data structure that also has the ability to disable the irqs and is implemented in assembly language all platforms.