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 77955EAE4AB for ; Fri, 22 Oct 2004 21:55:40 +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 63013-04 for ; Fri, 22 Oct 2004 20:55:39 +0000 (GMT) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3]) by svr1.postgresql.org (Postfix) with ESMTP id 9813EEAC955 for ; Fri, 22 Oct 2004 21:55:28 +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 i9MKtdSL004760; Fri, 22 Oct 2004 22:55:40 +0200 Message-ID: <417973CA.1090807@colorfullife.com> Date: Fri, 22 Oct 2004 22:55:38 +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: Mark Wong Cc: Tom Lane , neilc@samurai.com, pgsql-performance@postgresql.org Subject: Re: futex results with dbt-3 References: <417221B5.1050704@colorfullife.com> <20151.1098222733@sss.pgh.pa.us> <417697A5.1050600@colorfullife.com> <7178.1098292535@sss.pgh.pa.us> <4176A2C1.3070205@colorfullife.com> <20041020150528.B7838@osdl.org> <41774D11.1030906@colorfullife.com> <20041021065458.A5580@osdl.org> In-Reply-To: <20041021065458.A5580@osdl.org> 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/414 X-Sequence-Number: 8890 Mark Wong wrote: >Pretty, simple. One to load the database, and 1 to query it. I'll >attach them. > > > I've tested it on my dual-cpu computer: - it works, both cpus run within the postmaster. It seems something your gentoo setup is broken. - the number of context switch is down slightly, but not significantly: The glibc implementation is more or less identical to the implementation right now in lwlock.c: a spinlock that protects a few variables that are used to implement the actual mutex, several wait queues: one for spinlock busy, one or two for the actual mutex code. Around 25% of the context switches are from spinlock collisions, the rest are from actual mutex collisions. It might be possible to get rid of the spinlock collisions by writing a special, futex based semaphore function that only supports exclusive access [like sem_wait/sem_post], but I don't think that it's worth the effort: 75% of the context switches would remain. What's needed is a buffer manager that can do lookups without a global lock. -- Manfred