Re: [HACKERS] Fix performance degradation of contended LWLock on NUMA

From: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
To: Юрий Соколов <funny(dot)falcon(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Fix performance degradation of contended LWLock on NUMA
Date: 2018-01-02 16:09:19
Message-ID: abbdfc2f-3b52-9cbd-a4f6-88174ef128e0@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 11/27/2017 07:41 AM, Юрий Соколов wrote:
>>> I looked at assembly, and remembered, that last commit simplifies
>>> `init_local_spin_delay` to just two-three writes of zeroes (looks
>>> like compiler combines 2*4byte write into 1*8 write). Compared to
>>> code around (especially in LWLockAcquire itself), this overhead
>>> is negligible.
>>>
>>> Though, I found that there is benefit in calling LWLockAttemptLockOnce
>>> before entering loop with calls to LWLockAttemptLockOrQueue in the
>>> LWLockAcquire (in there is not much contention). And this way, `inline`
>>> decorator for LWLockAttemptLockOrQueue could be omitted. Given, clang
>>> doesn't want to inline this function, it could be the best way.
>>
>> In attach version with LWLockAcquireOnce called before entering loop
>> in LWLockAcquire.
>>
>
> Oh... there were stupid error in previos file.
> Attached fixed version.
>

As the patch still applies, make check-world passes and I believe that
Yura has provided feedback for Andres' comments I'll leave this entry in
"Ready for Committer".

Best regards,
Jesper

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Nenciarini 2018-01-02 16:16:04 Re: [PATCH] session_replication_role = replica with TRUNCATE
Previous Message Alvaro Herrera 2018-01-02 16:03:13 Re: [HACKERS] Proposal: Local indexes for partitioned table