Re: Fix performance of generic atomics

Jesper Pedersen <jesper.pedersen@redhat.com>

From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Sokolov Yura <funny.falcon@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org
Date: 2017-09-05T18:39:05Z
Lists: pgsql-hackers
On 09/05/2017 02:24 PM, Tom Lane wrote:
> Jesper Pedersen <jesper.pedersen@redhat.com> writes:
>> I have tested this patch on a 2-socket machine, but don't see any
>> performance change in the various runs. However, there is no regression
>> either in all cases.
> 
> Hm, so if we can't demonstrate a performance win, it's hard to justify
> risking touching this code.  What test case(s) did you use?
> 

I ran pgbench (-M prepared) with synchronous_commit 'on' and 'off' using 
both logged and unlogged tables. Also ran an internal benchmark which 
didn't show anything either.

Setting the entry back to "Needs Review" for additional feedback from 
others.

Best regards,
  Jesper


Commits

  1. Further marginal hacking on generic atomic ops.

  2. Use more of gcc's __sync_fetch_and_xxx builtin functions for atomic ops.

  3. Remove duplicate reads from the inner loops in generic atomic ops.