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 1vMA1w-002Ykp-1y for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Nov 2025 19:09:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vMA1v-003bQQ-0M for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Nov 2025 19:09:19 +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 1vMA1u-003bQH-0r for pgsql-hackers@lists.postgresql.org; Thu, 20 Nov 2025 19:09:19 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vMA1r-000ZVt-1p for pgsql-hackers@postgresql.org; Thu, 20 Nov 2025 19:09:17 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 884AF7A00A7; Thu, 20 Nov 2025 14:09:14 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 20 Nov 2025 14:09:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; 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=fm3; t=1763665754; x=1763752154; bh=HwwMI+PbNKfET+N74yvKpg697Cgo/JUR5IpFr3iUFHQ=; b= cgrHjCGAODzuVNNbqPk5yNttnQpSqplFEuR5c64M35VYyS7MTV6BYfQ6iEFeD8Ji +y5r4ivZjMrCQDZBM+XDjeIelOHARh4QFeQPaY1861Kwwt9lg2mYdayUGjLfPnQF R2G57+FMYk8LI/kBAjPPCQZKal8C5KsHK4ujfh8nOY9rk+Sq11CITebolCl8+Im0 XQEByddsjDqJo3hZ5m0O5w+gO6iHbartAkq7afNGtGTS9BR6ELl2ag/dJ/2fDpEJ MTDX5nGwUimwhi94DWjSC4ISIUQn0cWsrFdir87Jexex8GBiSCmRoHnq+Fo+pmtg 9MNQv6ZhCRr0DjI2k2R3fA== 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=fm3; t=1763665754; x= 1763752154; bh=HwwMI+PbNKfET+N74yvKpg697Cgo/JUR5IpFr3iUFHQ=; b=k 7KbfW1yOSp9j3B252eMyBGL9ri/mi7jIuBaxs1WOMiWRHcN0EYh1tPABJyOg2InO 0dpy8whqBTvLmMbxKgjRX0Gs6p87FB2tm81USqgS6YjMPq7yyuFN7yJ84P2kqkgS 91ducHghBRxo5ByAWcLqjSLWMc9Ed3MJ7NEgzzI17P+bo/EWptE8pjtt+YH1cLAN RvTSthmCYy6nuNMpvmOGW7/dzLa3UBlvvDq2SXUOLUWpCxIW28mer1LtJUf/1Wh2 ov4RSi3LXktPJH59VKAU0R8nDsHuKPW4PO6nkLTYRrEJQdv9mQvrjTEbdyoH2pSc 8qDE44jYQz43utalluvvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdejkeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevkfgjfhfuofggtgfgugesthejmhdtredtjeenucfhrhhomhepifhrvghg uceuuhhrugcuoehgrhgvghessghurhgurdhmvgeqnecuggftrfgrthhtvghrnhepgedvff dtledvkeetleejvdeludeuvedugfegtedugfdujedtieektdevgfelgfeinecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsegsuhhrug drmhgvpdhnsggprhgtphhtthhopeelpdhmohguvgepshhmthhpohhuthdprhgtphhtthho pegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprhgtphhtthhopegsohgvkhgvfihurh hmodhpohhsthhgrhgvshesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhh rggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehmvghlrghnih gvphhlrghgvghmrghnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhhohhmrghsrdhm uhhnrhhosehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhlihhnnhgrkhgrsehikhhird hfihdprhgtphhtthhopehnohgrhheslhgvrggusghorghtrdgtohhmpdhrtghpthhtohep rhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopehmihgthhgrvg hlrdhprghquhhivghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Nov 2025 14:09:13 -0500 (EST) Date: Thu, 20 Nov 2025 14:08:57 -0500 From: Greg Burd To: Andres Freund Cc: Matthias van de Meent , "=?utf-8?Q?pgsql-hackers=40postgresql.org?=" , Melanie Plageman , Thomas Munro , Heikki Linnakangas , Noah Misch , Robert Haas , Michael Paquier Message-ID: <1FAF2680-51A6-4ACF-8446-C6FA3234D72A@greg.burd.me> In-Reply-To: <6rgb2nvhyvnszz4ul3wfzlf5rheb2kkwrglthnna7qhe24onwr@vw27225tkyar> References: <6rgb2nvhyvnszz4ul3wfzlf5rheb2kkwrglthnna7qhe24onwr@vw27225tkyar> Subject: Re: Buffer locking is special (hints, checksums, AIO writes) X-Mailer: Mailspring MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Nov 19 2025, at 9:47 pm, Andres Freund wrote: > Hi, > > On 2025-10-09 17:16:49 -0400, Andres Freund wrote: >> On 2025-10-09 16:35:44 -0400, Andres Freund wrote: >> > I pushed a few commits from this patchset after Matthias' review >> > (thanks!). Unfortunately in 5e899859287 I missed that the valgrind annotations >> > would not be done anymore for the buffers returned by >> > StrategyGetBuffer(). Which turned skink red. >> > >> > The attached 0001 patch centralizes the valgrind initialization in >> > TrackNewBufferPin(), which 5e899859287 had added. The nice side >> effect of that >> > is that there are fewer VALGRIND_MAKE_MEM_DEFINED() calls than >> before. The >> > naming isn't the perfect match, but it seems fine to me. >> >> Forgot to say: I'll push this patch soon, to get skink back to green. Unless >> somebody says something. We can adjust this later, if the comment and/or >> placement of VALGRIND_MAKE_MEM_DEFINED() isn't to everyones liking. > > I have pushed that fix as well as the subsequent buffer header locking changes > a while ago. Hello Andres, After talking to you about these ideas at PGConf in NYC I've been anxiously awaiting this patch set. Thanks for dedicating the energy and time to get it to this stage. High level feedback after reading the patches/email/commit messages is that it looks to get you to where you wanted to be, unblocking AIO writes. I think they'll end up being faster than what's in place now, even before you get to the AIO piece. Certainly removing the copy of each page to do a checksum will help. Opening the door to a future where we can have super-pinned/locked pages is also a net win. Everything before/after 0008 was rather easy to digest and understand and I found nothing really to call out at this stage 0008 is understandable too, it's just sizable. While it is large, I find it well laid out and more readable than before. I gave the locking code a good look, it seems correct AFAICT. Keep going, I'll be happy to dedicate time to testing and digging into the commits as you get this into a final state. I look forward to extending/enhancing this code once integrated. > I want to again emphasize that the important commits (i.e. 0008, 0012, 0014) > aren't close to being mergeable. But I think they're in a stage that they > could benefit from "lenient" high-level review. > > Greetings, > > Andres Freund cheers. -greg