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 D5746D1B1CF for ; Wed, 19 May 2004 23:42:38 -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 23466-08 for ; Wed, 19 May 2004 23:42:21 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5433ED1B1B3 for ; Wed, 19 May 2004 23:42:17 -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 i4K2fQ47024374; Wed, 19 May 2004 22:41:26 -0400 (EDT) To: Bruce Momjian 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 Subject: Re: Wierd context-switching issue on Xeon In-reply-to: <200405200120.i4K1KKm06350@candle.pha.pa.us> References: <200405200120.i4K1KKm06350@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 19 May 2004 21:20:20 -0400" Date: Wed, 19 May 2004 22:41:26 -0400 Message-ID: <24373.1085020886@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: 200405/160 X-Sequence-Number: 6991 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. regards, tom lane