pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pg@fastcrypt.com
Cc: Paul Tuckfield <paul@tuckfield.com>
Cc: Anjan Dave <adave@vantage.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Neil Conway <neilc@samurai.com>
Cc: Dirk Lutzebäck <lutzeb@aeccom.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Wierd context-switching issue on Xeon patch for 7.4.1
Date: Thu, 22 Apr 2004 08:36:28 -0400
Message-ID: <25058.1082637388@sss.pgh.pa.us> (raw)
In-Reply-To: <1082603201.1556.272.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>
	<18322.1082601330@sss.pgh.pa.us>
	<1082603201.1556.272.camel@localhost.localdomain>

Dave Cramer <pg@fastcrypt.com> writes:
> My hypothesis is that if you spin approximately the same or more time
> than the average time it takes to get finished with the shared resource
> then this should reduce cs.

The only thing we use spinlocks for nowadays is to protect LWLocks, so
the "average time" involved is fairly small and stable --- or at least
that was the design intention.  What we seem to be seeing is that on SMP
machines, cache coherency issues cause the TAS step itself to be
expensive and variable.  However, in the experiments I did, strace'ing
showed that actual spin timeouts (manifested by the execution of a
delaying select()) weren't actually that common; the big source of
context switches is semop(), which indicates contention at the LWLock
level rather than the spinlock level.  So while tuning the spinlock
limit count might be a useful thing to do in general, I think it will
have only negligible impact on the particular problems we're discussing
in this thread.

			regards, tom lane



view thread (22+ messages)  latest in thread

Message-ID: <25058.1082637388@sss.pgh.pa.us>
Permalink:  ../25058.1082637388@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25058.1082637388@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pg@fastcrypt.com, paul@tuckfield.com, adave@vantage.com, josh@agliodbs.com, neilc@samurai.com, lutzeb@aeccom.com
  Subject: Re: Wierd context-switching issue on Xeon patch for 7.4.1
  In-Reply-To: <25058.1082637388@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox