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 7DD0C32A165 for ; Wed, 20 Oct 2004 23:06:12 +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 56436-03 for ; Wed, 20 Oct 2004 22:05:59 +0000 (GMT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by svr1.postgresql.org (Postfix) with ESMTP id D88F432A155 for ; Wed, 20 Oct 2004 23:05:57 +0100 (BST) Received: (from markw@localhost) by mail.osdl.org (8.11.6/8.11.6) id i9KM5Sc10745; Wed, 20 Oct 2004 15:05:28 -0700 Date: Wed, 20 Oct 2004 15:05:28 -0700 From: Mark Wong To: Manfred Spraul Cc: Tom Lane , neilc@samurai.com, pgsql-performance@postgresql.org Subject: Re: futex results with dbt-3 Message-ID: <20041020150528.B7838@osdl.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <4176A2C1.3070205@colorfullife.com>; from manfred@colorfullife.com on Wed, Oct 20, 2004 at 07:39:13PM +0200 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/330 X-Sequence-Number: 8806 On Wed, Oct 20, 2004 at 07:39:13PM +0200, Manfred Spraul wrote: > > But: According to the descriptions the problem is a context switch > storm. I don't see that cache line bouncing can cause a context switch > storm. What causes the context switch storm? If it's the pg_usleep in > s_lock, then my patch should help a lot: with pthread_rwlock locks, this > line doesn't exist anymore. > I gave Manfred's patch a try on my 4-way Xeon system with Tom's test_script.sql files. I ran 4 processes of test_script.sql against 8.0beta3 (without any patches) and from my observations with top, the cpu utilization between processors was pretty erratic. They'd jump anywhere from 30% - 70%. With the futex patches that Neil and Gavin have been working on, I'd see the processors evenly utilized at about 50% each. With just Manfred's patch I think there might be a problem somewhere with the patch, or something else, as only one processor is doing anything at a time and 100% utilized. Here are some other details, per Manfred's request: Linux 2.6.8.1 (on a gentoo distro) gcc 3.3.4 glibc 2.3.3.20040420 Mark