X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8A09232A178 for ; Wed, 20 Oct 2004 17:52:27 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34483-10 for ; Wed, 20 Oct 2004 16:52:12 +0000 (GMT) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3]) by svr1.postgresql.org (Postfix) with ESMTP id AA73032A134 for ; Wed, 20 Oct 2004 17:52:08 +0100 (BST) Received: from [127.0.0.2] (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i9KGpoSL003977; Wed, 20 Oct 2004 18:51:52 +0200 Message-ID: <417697A5.1050600@colorfullife.com> Date: Wed, 20 Oct 2004 18:51:49 +0200 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: neilc@samurai.com, markw@osdl.org, pgsql-performance@postgresql.org Subject: Re: futex results with dbt-3 References: <417221B5.1050704@colorfullife.com> <20151.1098222733@sss.pgh.pa.us> In-Reply-To: <20151.1098222733@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/411 X-Sequence-Number: 8887 Tom Lane wrote: >Manfred Spraul writes: > > >>Has anyone tried to replace the whole lwlock implementation with >>pthread_rwlock? At least for Linux with recent glibcs, pthread_rwlock is >>implemented with futexes, i.e. we would get a fast lock handling without >>os specific hacks. >> >> > >"At least for Linux" does not strike me as equivalent to "without >OS-specific hacks". > > > For me, "at least for Linux" means that I have tested the patch with Linux. I'd expect that the patch works on most recent unices (pthread_rwlock_t is probably mandatory for Unix98 compatibility). You and others on this mailing list have access to other systems - my patch should be seen as a call for testers, not as a proposal for merging. I expect that Linux is not the only OS with fast user space semaphores, and if an OS has such objects, then the pthread_ locking functions are hopefully implemented by using them. IMHO it's better to support the standard function instead of trying to use the native (and OS specific) fast semaphore functions. >The bigger problem here is that the SMP locking bottlenecks we are >currently seeing are *hardware* issues (AFAICT anyway). The only way >that futexes can offer a performance win is if they have a smarter way >of executing the basic atomic-test-and-set sequence than we do; > > lwlocks operations are not a basic atomic-test-and-set sequence. They are spinlock, several nonatomic operations, spin_unlock. -- Manfred