Re: [PATCH 2/2] Futex non-page-pinning fix
From: Muli Ben-Yehuda
Date: Tue Aug 26 2003 - 03:09:44 EST
On Tue, Aug 26, 2003 at 09:56:51AM +0200, Arjan van de Ven wrote:
> On Tue, 2003-08-26 at 09:02, Andrew Morton wrote:
>
> > umm, how about hashing only on offset into page? That reduces the number of
> > threads which need to be visited in futex_wake() by a factor of up to 1024.
>
> How likely do you consider it that we then get a major collision?
> I wouldn't be surprised if, say, glibc lays some hot futexes out in a
> way that's the same for all processes in the system, like start of the
> page.... Might as well not hash :)
How about combining something that's shared to all of the threads that
share a futex but not system wide (the mm?) with something simple that
won't change, like the page offset? Adding the mm into the mix wil
make collisions harder, and limiting the buckets to the number of
different futex offsets will make it simple and differentiate between
different futexes in the same mm.
--
Muli Ben-Yehuda
http://www.mulix.org
Attachment:
pgp00001.pgp
Description: PGP signature