X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1C66AD1BB36 for ; Thu, 22 Apr 2004 01:23:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 46049-08 for ; Thu, 22 Apr 2004 01:23:30 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5F84BD1BACC for ; Thu, 22 Apr 2004 01:23:29 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i3M4NPoK019597; Thu, 22 Apr 2004 00:23:25 -0400 (EDT) To: pg@fastcrypt.com Cc: Josh Berkus , Paul Tuckfield , Anjan Dave , Neil Conway , Dirk =?ISO-8859-1?Q?Lutzeb=E4ck?= , pgsql-performance@postgresql.org Subject: Re: Wierd context-switching issue on Xeon patch for 7.4.1 In-reply-to: <1082603927.1558.279.camel@localhost.localdomain> References: <4BAFBB6B9CC46F41B2AD7D9F4BBAF78509814A@vt-pe2550-001.vantage.vantage.com> <1082580588.13371.260.camel@localhost.localdomain> <18322.1082601330@sss.pgh.pa.us> <200404211953.24898.josh@agliodbs.com> <1082603927.1558.279.camel@localhost.localdomain> Comments: In-reply-to Dave Cramer message dated "Wed, 21 Apr 2004 23:18:47 -0400" Date: Thu, 22 Apr 2004 00:23:24 -0400 Message-ID: <19596.1082607804@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/369 X-Sequence-Number: 6669 Dave Cramer writes: > I tried increasing the NUM_SPINS to 1000 and it works better. Doesn't surprise me. The value of 100 is about right on the assumption that the spinlock instruction per se is not too much more expensive than any other instruction. What I was seeing from oprofile suggested that the spinlock instruction cost about 100x more than an ordinary instruction :-( ... so maybe 200 or so would be good on a Xeon. > This is certainly heading in the right direction ? Although it looks > like it is highly dependent on the system you are running on. Yeah. I don't know a reasonable way to tune this number automatically for particular systems ... but at the very least we'd need to find a way to distinguish uniprocessor from multiprocessor, because on a uniprocessor the optimal value is surely 1. regards, tom lane