Re: Wierd context-switching issue on Xeon patch for 7.4.1 - Mailing list pgsql-performance

From Tom Lane
Subject Re: Wierd context-switching issue on Xeon patch for 7.4.1
Date
Msg-id 19596.1082607804@sss.pgh.pa.us
Whole thread Raw
In response to Re: Wierd context-switching issue on Xeon  ("Anjan Dave" <adave@vantage.com>)
Responses Re: Wierd context-switching issue on Xeon patch for 7.4.1
Re: Wierd context-switching issue on Xeon patch for 7.4.1
List pgsql-performance
Dave Cramer <pg@fastcrypt.com> writes:
> I tried increasing the NUM_SPINS to 1000 and it works better.

Doesn't surprise me.  The value of 100 is about right on the assumption
that the spinlock instruction per se is not too much more expensive than
any other instruction.  What I was seeing from oprofile suggested that
the spinlock instruction cost about 100x more than an ordinary
instruction :-( ... so maybe 200 or so would be good on a Xeon.

> This is certainly heading in the right direction ? Although it looks
> like it is highly dependent on the system you are running on.

Yeah.  I don't know a reasonable way to tune this number automatically
for particular systems ... but at the very least we'd need to find a way
to distinguish uniprocessor from multiprocessor, because on a
uniprocessor the optimal value is surely 1.

            regards, tom lane

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Wierd context-switching issue on Xeon patch for 7.4.1
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Wierd context-switching issue on Xeon patch for 7.4.1