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 CDF4FD1EAC3 for ; Thu, 22 Apr 2004 03:01:58 -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 86178-07 for ; Thu, 22 Apr 2004 03:01:44 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id BEC5AD1E0F1 for ; Thu, 22 Apr 2004 03:01:32 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by www.postgresql.com (Postfix) with SMTP id 1CC98CF6671 for ; Thu, 22 Apr 2004 00:15:53 -0300 (ADT) Received: (qmail 11674 invoked from network); 22 Apr 2004 03:15:46 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 22 Apr 2004 03:15:46 -0000 Subject: Re: Wierd context-switching issue on Xeon patch for 7.4.1 From: Dave Cramer Reply-To: pg@fastcrypt.com To: Josh Berkus Cc: Tom Lane , Paul Tuckfield , Anjan Dave , Neil Conway , Dirk =?ISO-8859-1?Q?Lutzeb=E4ck?= , pgsql-performance@postgresql.org In-Reply-To: <200404211953.24898.josh@agliodbs.com> 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> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1082603927.1558.279.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Apr 2004 23:18:47 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) 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/376 X-Sequence-Number: 6676 More data.... On a dual xeon with HTT enabled: I tried increasing the NUM_SPINS to 1000 and it works better. NUM_SPINLOCKS CS ID pgbench 100 250K 59% 230 TPS 1000 125K 55% 228 TPS This is certainly heading in the right direction ? Although it looks like it is highly dependent on the system you are running on. --dc-- On Wed, 2004-04-21 at 22:53, Josh Berkus wrote: > Tom, > > > As far as I can tell, this does reduce the rate of semop's > > significantly, but it does so by bringing the overall processing rate > > to a crawl :-(. I see 97% CPU idle time when using this patch. > > I believe what is happening is that the select() delay in s_lock.c is > > being hit frequently because the spin loop isn't allowed to run long > > enough to let the other processor get out of the spinlock. > > Also, I tested it on production data, and it reduces the CSes by about 40%. > An improvement, but not a magic bullet. -- Dave Cramer 519 939 0336 ICQ # 14675561