Re: [PATCH] Introduce down_try() so we can move away fromdown_trylock()

From: Linus Torvalds
Date: Mon Aug 04 2008 - 01:54:25 EST




On Mon, 4 Aug 2008, Rusty Russell wrote:
>
> Someone sent me a patch documenting the illogic of down_trylock(). I decided
> to try to fix it rather than just bitch and moan.

I do agree that it is illogical. I just think your solution is worse than
the problem - turning one illogical function into a redundant one seems
the worse problem.

We could just fix the return value, since it's not used very much, but
we'd obviously never know what out-of-tree users there might be, so that's
not really a good solution either. But that's obviously why we'd then have
to rename it to something else, so whichever way we turn, we'd just be
screwed.

I'm much happier telling people to "just don't use semaphores any more".
The _legacy_ users get down_trylock() right.

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