Re: [patch] bufmgr Half state CAS - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [patch] bufmgr Half state CAS
Date
Msg-id 5ba2846d-cb1c-4411-868a-357f0d9391ea@iki.fi
Whole thread
In response to [patch] bufmgr Half state CAS  (Alexandre Felipe <o.alexandre.felipe@gmail.com>)
List pgsql-hackers
On 08/10/2026 23:03, Alexandre Felipe wrote:
> Currently Buffer header state is a 64-bit, but it is conceptually a bit 
> field structure.
> The CAS loops care about only some of those bits, however by operating
> on a 64-bit structure unrelated field changes will cause a retry.
> 
> The atomic operations don't support a comparison mask, but in this case
> we can at least CAS 32-bit, low and high half separately, reducing the 
> likelihood
> of retrial.

Got benchmarks? I seriously doubt that you'd see any performance benefit 
from this. I wouldn't be surprised if this was even slower.

- Heikki




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Fix a wal_debug crash with the new shmem allocation API
Next
From: ahmed
Date:
Subject: Re: Use instr_time for pg_stat_database block read/write time counters