pgsql: Split PGPROC 'links' field into two, for clarity

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Split PGPROC 'links' field into two, for clarity
Date: 2026-02-20 21:01:18
Message-ID: E1vtXck-000MzU-2k@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Split PGPROC 'links' field into two, for clarity

The field was mainly used for the position in a LOCK's wait queue, but
also as the position in a the freelist when the PGPROC entry was not
in use. The reuse saves some memory at the expense of readability,
which seems like a bad tradeoff. If we wanted to make the struct
smaller there's other things we could do, but we're actually just
discussing adding padding to the struct for performance reasons.

Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/3dd6f70c-b94d-4428-8e75-74a7136396be@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/36bbcd5be3ffee1aa03f69228022decef6ebd37a

Modified Files
--------------
src/backend/access/transam/twophase.c | 2 +-
src/backend/storage/lmgr/deadlock.c | 14 ++++++-------
src/backend/storage/lmgr/lock.c | 6 +++---
src/backend/storage/lmgr/proc.c | 39 ++++++++++++++++++-----------------
src/include/storage/proc.h | 8 +++----
5 files changed, 34 insertions(+), 35 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-02-20 21:01:33 Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Previous Message Tom Lane 2026-02-20 20:31:27 pgsql: First-draft release notes for 18.3.