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.96) (envelope-from ) id 1vfp4N-005FmA-00 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jan 2026 00:49:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vfp4M-0070vZ-0r for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jan 2026 00:49:06 +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.96) (envelope-from ) id 1vfp4L-0070uM-16 for pgsql-hackers@lists.postgresql.org; Wed, 14 Jan 2026 00:49:06 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vfp4I-000I24-2z for pgsql-hackers@postgresql.org; Wed, 14 Jan 2026 00:49:04 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 60EF014000E6; Tue, 13 Jan 2026 19:49:02 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 13 Jan 2026 19:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1768351742; x=1768438142; bh=y1nWQyzj3PLQybwTJcWhhqRGjKvxtfceqNoRUVqztlY=; b= kLYJ7GnevSlmRyQP2JsPsa3IKnDiuDABsh06HD62FCjZf+VwDh5I2vX+LJRjyU0O hfTc5h9RoUEV253a3KhIADNz96Usf718B38xGBPAKyiSlE7ws0mhbYzwgTbGD+mB jItfe9PhORrW//Zmibwq9kKRZuB8ZcyiBuJzBTBIRyQtFRW/WcH/SxdnKiIetHkp X4L5ZW+CIbuudsUeikGoMccdu0xc5/8K34lH5gMZqUvxIxkgstjhxV8Vyai5CqUL ZB0RVzWPOE9oXoezt75T0Md9cWuMg5PQ4U6XEQozRH+eLzu4+zt7KucG1lMXdRb8 +N0g+5StOuUhl6IB7hfzUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1768351742; x= 1768438142; bh=y1nWQyzj3PLQybwTJcWhhqRGjKvxtfceqNoRUVqztlY=; b=A IgoSdVLzGxdfnV11T/OAE2mBr04J/rxlNJUGfl++zNAmCo9fY6MxINbzF4GSIrSg dzjBWPnNBwUeD/Wobj7uO+zmNaZuvlUG7IM5bXhL1WC9gUOZwgC5FO3AhEnrS2aF /HxFBbzsPulnVyQ6FgPAWr7q4FcHiie68zT4dgKaBngxeiQFjB9PpCR+DrQPdCQe XgvJAc4jW+nvxhChpt9FkwSUPs1zBNpb8N0iz23zsd5HNRf6ldVUV5yaWXs5Q2Jx kEOl2a/sBCJfRpohO12XRam4vo360QAS/vIjS7Z4um1FzUkTBJ0eH878jVAeDTUw DOMlHpealNqjSbbPCuP7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduvddukedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggugfgjsehtkefstddttdejnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedtleelvdfgjedvffeiueekfeeuleffhfegfffhgfffkeevueehieehhfei gffhvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepledpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepsghovghkvgifuhhrmhdophhoshhtghhrvghsse hgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvlhgrnhhivghplhgrghgvmhgrnhesghhm rghilhdrtghomhdprhgtphhtthhopehmihgthhgrvghlrdhprghquhhivghrsehgmhgrih hlrdgtohhmpdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhm pdhrtghpthhtoheprhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtth hopehthhhomhgrshdrmhhunhhrohesghhmrghilhdrtghomhdprhgtphhtthhopehhlhhi nhhnrghkrgesihhkihdrfhhipdhrtghpthhtohepnhhorghhsehlvggruggsohgrthdrtg homhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdr ohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jan 2026 19:49:01 -0500 (EST) Date: Tue, 13 Jan 2026 19:49:00 -0500 From: Andres Freund To: Melanie Plageman Cc: Kirill Reshke , Heikki Linnakangas , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Noah Misch , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) Message-ID: References: <1108f18d-cf7c-4f17-b29c-a119fe42f7e5@iki.fi> <5dwlfu2jyzkyf3nrlzxxblxctb6xio5es73ptgsahjnmfu5miu@772rc764hfhi> <4csodkvvfbfloxxjlkgsnl2lgfv2mtzdl7phqzd4jxjadxm4o5@usw7feyb5bzf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-01-13 10:05:02 -0500, Melanie Plageman wrote: > On Mon, Jan 12, 2026 at 7:33 PM Andres Freund wrote: > > > > - added a commit that renames ResOwnerReleaseBufferPin to > > ResOwnerReleaseBuffer (et al), as it now also releases content locks if held > > > > I kept this separate as I'm not yet sure about the new name, partially due > > to there also being a "buffer io" resowner. I tried "buffer ownership" for > > the resowner that tracks pins and locks, but that was long and not clearly > > better. > > I didn't look at the patch but I strongly agree that > ResOwnerReleaseBufferPin() should not also release locks, so it should > have a new name. OK. > Ironic that ResOwnerReleaseBufferIO() releases pins and not locks. Not sure I follow? I don't think it releases pins? And why should it release locks? > What about ResOwnerReleaseBufferClaim() or > ResOwnerReleaseBufferAccess() or ResOwnerReleaseBufferHold()? I'm inclined to go with just ResOwnerReleaseBuffer() at the moment. Buffer IO kind of is a subsidiary thing, and it requires holding a pin as well, so it doesn't feel too wrong. I also wonder if we could merge BufferIO into the private refcount infrastructure, similar to how the patches store the lockmode in the private refcount. The separate resowner acquisition does show up in profiles when reading from the kernel page cache, so that'd be a nice (but small) improvement. Greetings, Andres Freund