Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030192AbWHHQ7I (ORCPT ); Tue, 8 Aug 2006 12:59:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964999AbWHHQ7I (ORCPT ); Tue, 8 Aug 2006 12:59:08 -0400 Received: from pfx2.jmh.fr ([194.153.89.55]:19371 "EHLO pfx2.jmh.fr") by vger.kernel.org with ESMTP id S964994AbWHHQ7G (ORCPT ); Tue, 8 Aug 2006 12:59:06 -0400 From: Eric Dumazet To: Nick Piggin Subject: Re: [RFC] NUMA futex hashing Date: Tue, 8 Aug 2006 18:59:04 +0200 User-Agent: KMail/1.9.1 Cc: Ulrich Drepper , Andi Kleen , Ravikiran G Thirumalai , "Shai Fultheim (Shai@scalex86.org)" , pravin b shelar , linux-kernel@vger.kernel.org References: <20060808070708.GA3931@localhost.localdomain> <44D8BD29.4010102@yahoo.com.au> <200608081849.28458.dada1@cosmosbay.com> In-Reply-To: <200608081849.28458.dada1@cosmosbay.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608081859.04727.dada1@cosmosbay.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1489 Lines: 33 On Tuesday 08 August 2006 18:49, Eric Dumazet wrote: > On Tuesday 08 August 2006 18:34, Nick Piggin wrote: > > Eric Dumazet wrote: > > > We certainly can. But if you insist of using mmap sem at all, then we > > > have a problem. > > > > > > rbtree would not reduce cacheline bouncing, so : > > > > > > We could use a hashtable (allocated on demand) of size N, N depending > > > on NR_CPUS for example. each chain protected by a private spinlock. If > > > N is well chosen, we might reduce lock cacheline bouncing. (different > > > threads fighting on different private futexes would have a good chance > > > to get different cachelines in this hashtable) > > > > See other mail. We already have a hash table ;) > > Yes but still you want at FUTEX_WAIT time to tell the kernel the futex is > private to this process. > > Giving the same info at FUTEX_WAKE time could avoid the kernel to make the > second pass (using only a private futex lookup), avoiding again the > mmap_sem touch in case no threads are waiting anymore on this futex. After looking at kernel/futex.c, I realize we also can avoid the atomic ops (and another cacheline bouncing) done in get_key_refs()/drop_key_refs(), touching the inode i_count or mm_count refcounter) Eric - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/