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 38739D1D72D for ; Wed, 21 Apr 2004 23:35:39 -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 38444-05 for ; Wed, 21 Apr 2004 23:35:41 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id B7375D1D707 for ; Wed, 21 Apr 2004 23:35:36 -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 i3M2ZUBQ018323; Wed, 21 Apr 2004 22:35:30 -0400 (EDT) To: pg@fastcrypt.com Cc: Paul Tuckfield , Anjan Dave , Josh Berkus , 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: <1082580588.13371.260.camel@localhost.localdomain> References: <4BAFBB6B9CC46F41B2AD7D9F4BBAF78509814A@vt-pe2550-001.vantage.vantage.com> <200404200959.52813.josh@agliodbs.com> <1082515263.1558.214.camel@localhost.localdomain> <78427208-93C0-11D8-BA67-000393BD6C3E@tuckfield.com> <1082574808.1558.243.camel@localhost.localdomain> <1082580588.13371.260.camel@localhost.localdomain> Comments: In-reply-to Dave Cramer message dated "Wed, 21 Apr 2004 16:49:48 -0400" Date: Wed, 21 Apr 2004 22:35:30 -0400 Message-ID: <18322.1082601330@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/367 X-Sequence-Number: 6667 Dave Cramer writes: > diff -c -r1.16 s_lock.c > *** backend/storage/lmgr/s_lock.c 8 Aug 2003 21:42:00 -0000 1.16 > --- backend/storage/lmgr/s_lock.c 21 Apr 2004 20:27:34 -0000 > *************** > *** 76,82 **** > * The select() delays are measured in centiseconds (0.01 sec) because 10 > * msec is a common resolution limit at the OS level. > */ > ! #define SPINS_PER_DELAY 100 > #define NUM_DELAYS 1000 > #define MIN_DELAY_CSEC 1 > #define MAX_DELAY_CSEC 100 > --- 76,82 ---- > * The select() delays are measured in centiseconds (0.01 sec) because 10 > * msec is a common resolution limit at the OS level. > */ > ! #define SPINS_PER_DELAY 10 > #define NUM_DELAYS 1000 > #define MIN_DELAY_CSEC 1 > #define MAX_DELAY_CSEC 100 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. regards, tom lane