Re: [HACKERS] Fix performance of generic atomics - Mailing list pgsql-hackers

From Jesper Pedersen
Subject Re: [HACKERS] Fix performance of generic atomics
Date
Msg-id 472aad3c-47a6-3ec2-f1ed-558db4261ac4@redhat.com
Whole thread Raw
In response to Re: [HACKERS] Fix performance of generic atomics  (Sokolov Yura <funny.falcon@postgrespro.ru>)
Responses Re: [HACKERS] Fix performance of generic atomics  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 05/25/2017 11:12 AM, Sokolov Yura wrote:
> I agree that lonely semicolon looks bad.
> Applied your suggestion for empty loop body (/* skip */).
> 
> Patch in first letter had while(true), but I removed it cause
> I think it is uglier:
> - `while(true)` was necessary for grouping read with `if`,
> - but now there is single statement in a loop body and it is
>    condition for loop exit, so it is clearly just a loop.
> 
> Optimization is valid cause compare_exchange always store old value
> in `old` variable in a same atomic manner as atomic read.
> 

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.

As such, I have marked the entry "Ready for Committer".

Remember to add a version postfix to your patches such that is easy to 
identify which is the latest version.

Best regards, Jesper




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] psql - add special variable to reflect the last query status
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing server version and psql version.