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 62510D1B91C for ; Tue, 20 Apr 2004 23:38:22 -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 37921-01 for ; Tue, 20 Apr 2004 23:38:22 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 2253DD1B974 for ; Tue, 20 Apr 2004 23:38:19 -0300 (ADT) Received: (qmail 31760 invoked from network); 21 Apr 2004 02:38:17 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 21 Apr 2004 02:38:17 -0000 Subject: Re: Wierd context-switching issue on Xeon From: Dave Cramer Reply-To: pg@fastcrypt.com To: Josh Berkus Cc: Anjan Dave , Dirk =?ISO-8859-1?Q?Lutzeb=E4ck?= , Tom Lane , pgsql-performance@postgreSQL.org, Neil Conway In-Reply-To: <200404200959.52813.josh@agliodbs.com> References: <4BAFBB6B9CC46F41B2AD7D9F4BBAF78509814A@vt-pe2550-001.vantage.vantage.com> <200404200959.52813.josh@agliodbs.com> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1082515263.1558.214.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 20 Apr 2004 22:41:03 -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/327 X-Sequence-Number: 6627 I modified the code in s_lock.c to remove the spins #define SPINS_PER_DELAY 1 and it doesn't exhibit the behaviour This effectively changes the code to while(TAS(lock)) select(10000); // 10ms Can anyone explain why executing TAS 100 times would increase context switches ? Dave On Tue, 2004-04-20 at 12:59, Josh Berkus wrote: > Anjan, > > > Quad 2.0GHz XEON with highest load we have seen on the applications, DB > > performing great - > > Can you run Tom's test? It takes a particular pattern of data access to > reproduce the issue. -- Dave Cramer 519 939 0336 ICQ # 14675561