Re: sinval synchronization considered harmful - Mailing list pgsql-hackers

From Noah Misch
Subject Re: sinval synchronization considered harmful
Date
Msg-id 20110721224326.GA27478@tornado.leadboat.com
Whole thread Raw
In response to sinval synchronization considered harmful  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: sinval synchronization considered harmful
List pgsql-hackers
On Wed, Jul 20, 2011 at 09:46:33PM -0400, Robert Haas wrote:
> Profiling this combination of patches reveals that there is still some
> pretty ugly spinlock contention on sinval's msgNumLock.  And it occurs
> to me that on x86, we really don't need this lock ... or
> SInvalReadLock ... or a per-backend mutex.  The whole of
> SIGetDataEntries() can pretty easily be made lock-free.  The only real
> changes that seem to be are needed are (1) to use a 64-bit counter, so
> you never need to decrement

On second thought, won't this be inadequate on 32-bit systems, where updating
the 64-bit counter produces two stores?  You must avoid reading it between those
stores.

-- 
Noah Misch                    http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Dan Ports
Date:
Subject: Re: sinval synchronization considered harmful
Next
From: Florian Pflug
Date:
Subject: Re: sinval synchronization considered harmful