Re: [rfc] [patch 1/2 ] Process private hash tables for privatefutexes

From: Ravikiran G Thirumalai
Date: Mon Mar 23 2009 - 23:19:55 EST


On Mon, Mar 23, 2009 at 10:57:55PM +0100, Eric Dumazet wrote:
>Ravikiran G Thirumalai a écrit :
>>
[...]
>> Hmm! How about
>> a) Reduce hash table size for private futex hash and increase hash table
>> size for the global hash?
>>
>> OR, better,
>>
>> b) Since it is multiple spinlocks on the same cacheline which is a PITA
>> here, how about keeping the global table, but just add a dereference
>> to each hash slot, and interleave the adjacent hash buckets between
>> nodes/cpus? So even without needing to lose out memory from padding,
>> we avoid false sharing on cachelines due to unrelated futexes hashing
>> onto adjacent hash buckets?
>>
>
>Because of jhash(), futex slots are almost random. No need to try to interleave
>them. Since you have a "cache line" of 4096 bytes, you need almost 4 pages
>per cpu to avoid in a statistical way false sharing.

How did you come up with that number? So there is no way adjacent
cachelines will never ever be used in the global hash??
--
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/