Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1usvHl-00D6nR-Mk for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Sep 2025 03:32:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1usvHl-0041A8-6O for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Sep 2025 03:32:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1usvHk-00419w-TD for pgsql-hackers@lists.postgresql.org; Mon, 01 Sep 2025 03:32:49 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1usvHj-002m1d-0I for pgsql-hackers@lists.postgresql.org; Mon, 01 Sep 2025 03:32:48 +0000 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-b49cf1d4f6fso2640271a12.3 for ; Sun, 31 Aug 2025 20:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756697567; x=1757302367; darn=lists.postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=s71P5xFznTOcF7AhuWGHVVHqH2DH5RDP0N1mVn80xfQ=; b=E679z6JT57+E/nSXcHyaeXC/8AZOp1jrzzA2KeI8WB5ywsbdm4KKhR5RtfHCsFM8Go TJmgT0cpmYFT4UqNLfYarondD7JPdFZI7tQbJ/lCSt7E4fy4niTZXSYH2YEkE6VlNitU UJeBIcPq8nQYgBDWV/VnGYch1UbAG32JzJetdJV4tFL1GfJA6gAm+1pUW3X9FaSbgJrA 1McsffM4Aq1mYnK6gueVt9P2EnbRLgxqZnmL7hxjKy751YgTnlTDLpANC9in7NepAQrS mnX3is9rMYBy5pBO6ry2s83G3wdelpIHhyp4b8iTx/02CqHyoTJIQA3wzcI+3V7Hh2A1 ZD9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756697567; x=1757302367; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s71P5xFznTOcF7AhuWGHVVHqH2DH5RDP0N1mVn80xfQ=; b=ENWIJcoyfgofHc35bLK+2plE3XrjRIjDzhyc06AH9IMUrQg9ttKHCxpkeiUYrSxObg RqSuLlHuWduBEAFIRpzrWLIc9Uyd7Fm9inP9mcI/OnHC3smdmCUrXwKIkHHLRtKv2ipD rW8EMUC1YIp4gJZW3hP3elWs3lhAMGUWRcL36FDHHjiw10iYpTp+ht9AGC6mFuvXprSX 073+mrywWO2LE8G1vyFkneHaD36r9qAbGntG7qL3diJo/WpbhodJ2z09ydKOYdiAFFqM LzkhrZ41upst6U8eEzHcZ41uklEEG+LdURtTSB7iNxR/UboBkBbQ4r7qVsXh506nrm5T mtuQ== X-Gm-Message-State: AOJu0YwAAQctC6vfHov6GaKIFOUtrqpmtoJC9MpH3bQWLdsmBSmLQgvz tXXtjG/k1b/lePaXTaDKUg++PkA/QH9w4I1pONFypIGfdXRYX7w+qJsJHIFtYQ== X-Gm-Gg: ASbGncvDSJpZnldbJSUepCHU+fRU8G7GEaxFjE4T/icswOc7I2yI453X08+n6zcF632 ZidVNBNGAtPlK8VBnyvhkKOaOxBMfH4J/tI2jzZ/sTorHevy96t+5S5DGCEWTE8xq4qRFmQHGNb /EbnbILaTJjqpcvZRu3XceQLoej5vIxTcI7tEx8go37SIOl9FvjKXdK3i4PJ9+s6mWbMqXsrn9Q dvDyFa/pjN0lYGPCd3Dle5P22kiuSQfrrGh2j/IE7FbzaU/4Bhbq+QfHxal6mNRH0AUYhGOgFxr vVGg8YIAg2ZMANJV8uP0L+4y978ghoG/RFKXyA/4Q6fgqjzvgxlYczvWAIB23KPnRlrJbWDpDWO LZVdnko320fWppwHlqyUmLdr16zMx7n+69+wQ X-Google-Smtp-Source: AGHT+IHPulylK9OgJ/JBmPcG6RN1/0H53C63tr1nrhbtaS+E00iNcpXaa9QN1YrfCyVRgw91T8AmYQ== X-Received: by 2002:a17:903:32d2:b0:249:353:ebd2 with SMTP id d9443c01a7336-249446d26acmr83465815ad.0.1756697566742; Sun, 31 Aug 2025 20:32:46 -0700 (PDT) Received: from jrouhaud ([115.43.41.38]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b4cd347e359sm7951199a12.48.2025.08.31.20.32.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Aug 2025 20:32:45 -0700 (PDT) Date: Mon, 1 Sep 2025 11:32:41 +0800 From: Julien Rouhaud To: pgsql-hackers@lists.postgresql.org Subject: Update outdated references to SLRU ControlLock Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="abnzYpv2yjkqzQeb" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --abnzYpv2yjkqzQeb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --abnzYpv2yjkqzQeb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=0001-Update-outdated-references-to-SLRU-ControlLock.patch From 8171ed0a87d998bd07dad6700bee0938b9fa49d9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud 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 --abnzYpv2yjkqzQeb--