Re: [PATCH 0/3] 64-bit futexes: Intro

From: Linus Torvalds
Date: Fri Jun 06 2008 - 11:02:47 EST




On Fri, 6 Jun 2008, Nick Piggin wrote:
>
> Well... a single lock is only going to be so scalable. I don't see how
> it could be done really significantly better?

My worry is that I did something wrong in the slowpath, and that there is
some thundering-herd-wakeup kind of thing that makes that much slower than
it should be.

The slow path doesn't much matter from the angle of counting individual
cycles, but it still matters very much from a bigger picture. Does it have
bad behavior where we wake up a thousand readers, but then a writer gets
to come in first and all the readers have to go to sleep again?

That's one thing I tried to avoid in the second version (the "Another
approch" commit) where a read-wakeup actually moves the readers from the
pending count to the final count - both to get more fairness (which can be
_bad_ for performance), but also because I think it can avoid pathological
cases (reader starvation and unnecessary futex wakeup).

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/