Re: Reduce ProcArrayLock contention

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reduce ProcArrayLock contention
Date: 2015-07-29 16:54:59
Message-ID: CA+TgmoYhtxct50ZJ8gsJmZr5a7VLuG-DPhOY8+ntUE74JLC5Hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 29, 2015 at 10:54 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Mon, Jul 27, 2015 at 8:47 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Sat, Jul 25, 2015 at 12:42 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
>> wrote:
>> > I thought that internal API will automatically take care of it,
>> > example for msvc it uses _InterlockedCompareExchange64
>> > which if doesn't work on 32-bit systems or is not defined, then
>> > we have to use 32-bit version, but I am not certain about
>> > that fact.
>>
>> Instead of using pg_atomic_uint64, how about using pg_atomic_uint32
>> and storing the pgprocno rather than the pointer directly?
>>
>
> Good Suggestion!
>
> I think this can work the way you are suggesting and I am working on
> same. Here I have one question, do you prefer to see the code for
> this optimisation be done via some LWLock interface as Pavan is
> suggesting? I am not very sure if LWLock is a good interface for this
> work, but surely I can encapsulate it into different functions rather than
> doing everything in ProcArrayEndTransaction.

I would try to avoid changing lwlock.c. It's pretty easy when so
doing to create mechanisms that work now but make further upgrades to
the general lwlock mechanism difficult. I'd like to avoid that.

--
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 Heikki Linnakangas 2015-07-29 17:23:24 Re: LWLock deadlock and gdb advice
Previous Message Joe Conway 2015-07-29 16:52:13 Re: more RLS oversights