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 2C36CD1B1BD for ; Thu, 20 May 2004 00:03:33 -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 29842-10 for ; Thu, 20 May 2004 00:03:13 -0300 (ADT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id F0713D1B1C7 for ; Thu, 20 May 2004 00:03:08 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i4K32G721749; Wed, 19 May 2004 23:02:16 -0400 (EDT) From: Bruce Momjian Message-Id: <200405200302.i4K32G721749@candle.pha.pa.us> Subject: Re: Wierd context-switching issue on Xeon In-Reply-To: <24373.1085020886@sss.pgh.pa.us> To: Tom Lane Date: Wed, 19 May 2004 23:02:16 -0400 (EDT) Cc: pg@fastcrypt.com, Robert Creager , Josh Berkus , =?ISO-8859-1?Q?Dirk=5FLutzeb=E4ck?= , ohp@pyrenet.fr, Joe Conway , "scott.marlowe" , pgsql-performance@postgresql.org, Neil Conway X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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: 200405/162 X-Sequence-Number: 6993 Tom Lane wrote: > Bruce Momjian writes: > > Did we ever come to a conclusion about excessive SMP context switching > > under load? > > Yeah: it's bad. > > Oh, you wanted a fix? That seems harder :-(. AFAICS we need a redesign > that causes less load on the BufMgrLock. However, the traditional > solution to too-much-contention-for-a-lock is to break up the locked > data structure into finer-grained units, which means *more* lock > operations in total. Normally you expect that the finer-grained lock > units will mean less contention. But given that the issue here seems to > be trading physical ownership of the lock's cache line back and forth, > I'm afraid that the traditional approach would actually make things > worse. The SMP issue seems to be not with whether there is > instantaneous contention for the locked datastructure, but with the cost > of making it possible for processor B to acquire a lock recently held by > processor A. I see. I don't even see a TODO in there. :-( -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073