[Top] [All Lists]

Re: RT and XFS

To: Esben Nielsen <simlo@xxxxxxxxxx>
Subject: Re: RT and XFS
From: "Richard B. Johnson" <linux-os@xxxxxxxxxxxx>
Date: Mon, 18 Jul 2005 08:17:19 -0400 (EDT)
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, Daniel Walker <dwalker@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, Dave Chinner <dgc@xxxxxxx>, greg@xxxxxxxxx, Nathan Scott <nathans@xxxxxxx>, Steve Lord <lord@xxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <Pine.OSF.4.05.10507171848440.14250-100000@da410.phys.au.dk>
References: <Pine.OSF.4.05.10507171848440.14250-100000@da410.phys.au.dk>
Reply-to: linux-os@xxxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Mon, 18 Jul 2005, Esben Nielsen wrote:

On Thu, 14 Jul 2005, Christoph Hellwig wrote:

On Thu, Jul 14, 2005 at 08:56:58AM -0700, Daniel Walker wrote:
This reminds me of Documentation/stable_api_nonsense.txt . That no one
should really be dependent on a particular kernel API doing a particular
thing. The kernel is play dough for the kernel hacker (as it should be),
including kernel semaphores.

So we can change whatever we want, and make no excuses, as long as we
fix the rest of the kernel to work with our change. That seems pretty
sensible , because Linux should be an evolution.

Daniel, get a fucking clue. Read some CS 101 literature on what a semaphore is defined to be. If you want PI singing dancing blinking christmas tree locking primites call them a mutex, but not a semaphore.

As a matter of fact I just finished what corresponds to your "CS 101" (I study CS in spare time while having a full time job coding RT stuff): To the one lecture I attended they talked about sempahores. They tought students to use binary semphores for locking. Based on real-life experience (and the Pathfinder story), I complained and told them they ought to teach the students to use a mutex instead. They had no clue "It is the same thing they said". Yes, a mutex can be implemented just as a binary semaphore but the semantics of it is different. In RT the difference is very important and even without-RT it is a good idea to maintain the difference for readability and deadlock detection. If you later on want to optimize the semaphore for what it is used for it is also good to have maintained that information. It is a bit like discarding the type information from you programs. You want to keep the type information even though the compilere end up producing the same code.

The kernel developer clearly have followed the same lectures and used
plain binary semaphores, sometimes calling the mutex sometimes semaphore.
I believe that the semaphore ought to be removed. Either use a mutex or
a completion. Far the most code is using a sempahore as either signalling
- i.e. as a completion - or critical sections - i.e. as a mutex. If code
mixes the usage it is must likely very hard to read....

Unfortunately, one of the goals of the preempt-rt branch is to avoid
altering too much code. Therefore the type semaphore can't be removed
there. Therefore the name still lingers ... :-(


A MUTEX is a procedure. A semaphore is an object, often used in such a procedure.

Cheers, Dick Johnson Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips). Notice : All mail here is now cached for review by Dictator Bush. 98.36% of all statistics are fiction.

<Prev in Thread] Current Thread [Next in Thread>