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 1vQbW1-00CTgs-0J for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2025 01:18:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQbW0-00ApVw-08 for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2025 01:18:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQbVz-00ApVn-1c for pgsql-hackers@lists.postgresql.org; Wed, 03 Dec 2025 01:18:44 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQbVx-002pmJ-1Z for pgsql-hackers@postgresql.org; Wed, 03 Dec 2025 01:18:43 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id A6521EC0584; Tue, 2 Dec 2025 20:18:39 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Tue, 02 Dec 2025 20:18:39 -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=fm1; t=1764724719; x=1764811119; bh=UiSUgobvVmxNJKES4/z8wdM8WbMNigDhrW4Cj4KPnbQ=; b= X6FUNyuZkwx4zlSek9xu7cGx+a0kPi9OgjTqjjG+yXAdB+IRxKvbG5zdkVSmYVkn 2+wDpZtxu75OlxE4GxxKJtaEi9/D+WW20Gl2zh1XEtcC1L5prmPPJ3KS09dr9ror wufzNy1rUTxT/G69XnUN964buUTiOVPcvnDHNQ+VfrNLA2sRmcRf/2q6Oh+ikffo sAUdJ8AJAOYqFgHEhswPP5VEcwvWsUkbhYiEUpz7kKVdGNCrFh1w9goEoaQlybpC wDt0a7wf8ChcDY+lZVSDTCgSz9CdgfnGNeKQVhZvQBKBH8BFGEQ69k6FDmfcbMzN KOhnCUWdKGeoJFS30A2pjw== 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=fm1; t=1764724719; x= 1764811119; bh=UiSUgobvVmxNJKES4/z8wdM8WbMNigDhrW4Cj4KPnbQ=; b=A NrD3O+SIKo2qLKrvJhLazK29cXBqc0y/iFcr8ZoLnN7ZMzW8Gqw6sI0UQqsyxEQv 8u3BPOWbwUgG9AhPG4l+bqcuNPGuIQODxYO8yu39vrzT9uZK9KsA2VNHrSQAdm2L LbSrCuz8inuIUK91GD4e5ou4kITD3Qpn6dnMhX33vdO2gLboeuqdelFYYdCoqcVZ +GWnpy4KWUVNGiJAnieGuLhN2RA3u2xDr+eOUNIOzPhX+hn4Os+PjLmEjJjJTpMl A7ao8wQHdkU8yefJVOOHcTaYIQA0CxloXrp933jBFS29IypvNUZR9NKns3GQvO9R kt+67EWS8HZC1nzDG4LDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkfhggtggugfgjsehtkefstddttdejnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpedtleelvdfgjedvffeiueekfeeuleffhfegfffhgfffkeevueehieehhfeigffh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepledpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepphhgsegsohifthdrihgvpdhrtghpthhtohepsghovg hkvgifuhhrmhdophhoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgv lhgrnhhivghplhgrghgvmhgrnhesghhmrghilhdrtghomhdprhgtphhtthhopehmihgthh grvghlrdhprghquhhivghrsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhosggvrhht mhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopehthhhomhgrshdrmhhunhhroh esghhmrghilhdrtghomhdprhgtphhtthhopehhlhhinhhnrghkrgesihhkihdrfhhipdhr tghpthhtohepnhhorghhsehlvggruggsohgrthdrtghomhdprhgtphhtthhopehpghhsqh hlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Dec 2025 20:18:38 -0500 (EST) Date: Tue, 2 Dec 2025 20:18:38 -0500 From: Andres Freund To: Peter Geoghegan Cc: Melanie Plageman , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Heikki Linnakangas , Noah Misch , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) Message-ID: References: <3je3ahgf7rrmmurxo6hnlhg5d3ffwfrtjwjxd6jm5srlv5iebp@vxqk5qtgmowr> <3w7v3w6a57jnssokap4k7thoekig72flnyhd4wp3yftzdd7lm7@f6lpcfen6hr7> <6rgb2nvhyvnszz4ul3wfzlf5rheb2kkwrglthnna7qhe24onwr@vw27225tkyar> <3nce7i72ayzkunai6mkz24ckbxk74jodz4ua2chcdrwppxlxcd@w6x5kfkjrkru> 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 2025-12-02 20:12:14 -0500, Peter Geoghegan wrote: > On Tue, Dec 2, 2025 at 7:47 PM Andres Freund wrote: > > On 2025-11-25 11:54:00 -0500, Andres Freund wrote: > > > Thanks a lot for that detailed review! A few questions and comments, before I > > > try to address the comments in the next version. > > > > Here's that new new version, with the following changes > > _bt_check_unique will hold an exclusive buffer lock on the page being > LP_DEAD-set in the vast majority of cases. Should we expect your > changes to have no effect at all in that common case? If we already have an exclusive lock, BufferBeginSetHintBits() will quickly return true and won't ever return false. > The BTP_HAS_GARBAGE flag is deprecated these days; we basically don't > use it anymore. How much value might there be in avoiding setting > BTP_HAS_GARBAGE as a way of being able to use BufferSetHintBits16 more > often in nbtree? None of the MarkBufferDirtyHint() cases in nbtree that had to be modified looked like they would benefit from BufferSetHintBits16(), since they will typically modify the page multiple times. But maybe I'm just misunderstanding what you mean? Greetings, Andres Freund