Re: [PATCH] Replace completions with semaphores

From: Peter Zijlstra
Date: Sat Apr 12 2008 - 14:06:21 EST


On Sat, 2008-04-12 at 11:26 -0600, Matthew Wilcox wrote:

> We can continue the
> discussion about eliminating one or the other API, but my opinion is that
> eliminating either is a mistake. The choice of API indicates how the
> author thinks about the code, which is crucial for those reading the code.

Which is exactly the point, semaphores are rarely the right tool for the
job (I'm currently only aware of XFS that actually uses them as actual
semaphores, and the driver model that uses it to get around lockdep -
still need to come up with a good solution for that).

Even worse, semaphores actively harm the development of linux-rt and
arguably linux kernel development as a whole by not being part of
lockdep - so making a mistake will not be noticed until its too late.

Completions OTOH are not the typical exclusion primitive, they are more
a synchronisation primitive - not unlike wait4(). Typically not things
concerned about priority inversion.


--
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/