pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Update outdated references to SLRU ControlLock
Date: Mon, 1 Sep 2025 11:32:41 +0800
Message-ID: <aLUT2UO8RjJOzZNq@jrouhaud> (raw)

Hi,

I just noticed that some references so the now removed SLRU ControlLock were
still present in slru.[ch].  I tried to improve the situation with the attached
patch by using the new "bank control lock" name that is used nearby.

Note that the main comment of slru.c still has one paragraph that mentions
"bank control lock" consistently before switching to just "control lock" in the
next paragraph.  I'm assuming that it's ok in that context as it seems clear to
me that those are the same thing, just spelled with a less verbose name.

Attachments:

0001-Update-outdated-references-to-SLRU-ControlLock.patch (text/plain, 2.1K) download From 8171ed0a87d998bd07dad6700bee0938b9fa49d9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud <julien.rouhaud@free.fr> Date: Mon, 1 Sep 2025 11:16:01 +0800 Subject: [PATCH] Update outdated references to SLRU ControlLock Oversight in 53c2a97a9266 which removed the single ControlLock and added the bank control locks. --- src/backend/access/transam/slru.c | 8 ++++---- src/include/access/slru.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 10ec259f382..f78e35d66d5 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -401,9 +401,9 @@ SimpleLruZeroPage(SlruCtl ctl, int64 pageno) * Assume this page is now the latest active page. * * Note that because both this routine and SlruSelectLRUPage run with - * ControlLock held, it is not possible for this to be zeroing a page that - * SlruSelectLRUPage is going to evict simultaneously. Therefore, there's - * no memory barrier here. + * bank control lock held, it is not possible for this to be zeroing a + * page that SlruSelectLRUPage is going to evict simultaneously. + * Therefore, there's no memory barrier here. */ pg_atomic_write_u64(&shared->latest_page_number, pageno); @@ -437,7 +437,7 @@ SimpleLruZeroLSNs(SlruCtl ctl, int slotno) * This is a convenience wrapper for the common case of zeroing a page and * immediately flushing it to disk. * - * Control lock is acquired and released here. + * Bank control lock is acquired and released here. */ void SimpleLruZeroAndWritePage(SlruCtl ctl, int64 pageno) diff --git a/src/include/access/slru.h b/src/include/access/slru.h index 20dbd1e0070..0b81bc62639 100644 --- a/src/include/access/slru.h +++ b/src/include/access/slru.h @@ -55,7 +55,7 @@ typedef enum /* * Shared-memory state * - * ControlLock is used to protect access to the other fields, except + * Bank control locks are used to protect access to the other fields, except * latest_page_number, which uses atomics; see comment in slru.c. */ typedef struct SlruSharedData -- 2.51.0

view thread (8+ messages)  latest in thread

Message-ID: <aLUT2UO8RjJOzZNq@jrouhaud>
Permalink:  ../aLUT2UO8RjJOzZNq@jrouhaud/
Also on:    postgresql.org/message-id/aLUT2UO8RjJOzZNq@jrouhaud

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: rjuju123@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Update outdated references to SLRU ControlLock
  In-Reply-To: <aLUT2UO8RjJOzZNq@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox