Re: sinval synchronization considered harmful

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Noah Misch <noah(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: sinval synchronization considered harmful
Date: 2011-07-22 00:25:08
Message-ID: CA+TgmoakLZXzZsUza0qhZZHxyv27zW--E69fUYs8Jg9QLVTyzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 21, 2011 at 6:43 PM, Noah Misch <noah(at)2ndquadrant(dot)com> wrote:
> 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.

Now that is a potentially big problem.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Kupershmidt 2011-07-22 01:17:28 Re: psql: bogus descriptions displayed by \d+
Previous Message Robert Haas 2011-07-22 00:24:51 Re: sinval synchronization considered harmful