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.
>From 8171ed0a87d998bd07dad6700bee0938b9fa49d9 Mon Sep 17 00:00:00 2001
From: Julien Rouhaud <[email protected]>
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

Reply via email to