Re: [patch] Real-Time Preemption, -RT-2.6.9-rc4-mm1-U8

From: Ingo Molnar
Date: Thu Oct 21 2004 - 06:16:46 EST



* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> > > This is used to wait for command completion and therefor we have the
> > > completion API. It was used this way because the ancestor of completion
> > > (sleep_on) was racy !
> >
> > I didn't look at the USB code, I'm just saying that it's perfectly valid
> > use of a semaphore the pattern you describe (process A holding it,
> > process B releasing it).
>
> Yeah, for a semaphore it is, but not for a mutex.

but mutexes dont exist in upstream Linux as a separate entity. (they
exist in my tree but that's another ballgame.)

> IMHO, this is not clearly seperated and therefor produces a lot of
> confusion.

if used to complete some work then semaphores are indeed a tad unclean
and slightly slower than completions - but they are fully correct kernel
code. And there are much worse offenders of cleanliness around.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/