Re: [PATCH] Replace completions with semaphores

From: Ingo Molnar
Date: Sun Apr 13 2008 - 03:05:43 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Fri, 2008-04-11 at 15:00 -0600, Matthew Wilcox wrote:
>
> > So does it make sense to retain the completion as a primitive in
> > Linux?
>
> My take on it is the opposite: kill off semaphores and leave the
> completions around.

exactly. I first misread the subject line because i parsed it as
"replace semaphores with completions" and i thought "cool", then did i
realize that the patch does it the other way around. Converting
completions to semaphores just makes no sense.

Besides all your arguments later in this thread about how problematic
locking primitives semaphores are because they are so vague (which are
all correct), there's also another aspect: completions are faster a bit
in theory, because they know that they will schedule most of the time -
while semaphores assume that they will _not_ schedule. (And that's
exactly because the intent of the developer when using a completion is
crystal clear.)

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/