pgsql: bufmgr: Make UnlockReleaseBuffer() more efficient - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: bufmgr: Make UnlockReleaseBuffer() more efficient
Date
Msg-id E1w6DKV-001k14-0A@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
bufmgr: Make UnlockReleaseBuffer() more efficient

Now that the buffer content lock is implemented as part of BufferDesc.state,
releasing the lock and unpinning the buffer can be implemented as a single
atomic operation.

This improves workloads that have heavy contention on a small number of
buffers substantially, I e.g., see a ~20% improvement for pipelined readonly
pgbench on an older two socket machine.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f39cb8c011062d65e146c1e9d1aae221e96d8320

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 58 +++++++++++++++++++++++++++++++++++--
1 file changed, 55 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: pgindent: ensure all C files end with a newline.
Next
From: Tom Lane
Date:
Subject: pgsql: Doc: split functions-posix-regexp section into multiple subsecti