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 1x52Y9-007a1C-1O for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 14:48:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x52Y8-00FQUp-19 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 14:48:20 +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 1x52Y7-00FQUf-2C for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 14:48:20 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x52Y5-000000059N3-2FhD for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 14:48:18 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id A37FDEC0143; Fri, 11 Sep 2026 10:48:16 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-02.internal (MEProxy); Fri, 11 Sep 2026 10:48:16 -0400 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=fm1; t=1789138096; x=1789224496; bh=Qey8NgPdyhg0gGkNswoSYhw3hT5SxohO5EQxIvuoafU=; b= KZQ9OfJuH161fUUfp67BIvCfI2snoYyAEy4MkN0qNH42Rx1w4qiB100r3PP7Wr3q YrfvIUTkWofo5u4uyZJfKfFOe3+2xvLGoZEdrz1xpRPsMA0frweF710h6ngVBpgt yEKYUjsptAPNiUhZHD5jWseK272nwgNJCL8UeiAleCtU96o0TF50XYnt3f68iubg f8fFZANI0Tq8EBKtjIOc5LPLDZ2xxkfKOUQoaP0aLQaZDmlUaJTTp7tsD4b6j1FV /B1XXSWXlAknUTByTvAq3CzxfEUMspQuRU2hzy09Ff0Slsm+fUF8043yT4plfI07 79q0i/m9pH4FMhlIj3vaOg== 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=1789138096; x= 1789224496; bh=Qey8NgPdyhg0gGkNswoSYhw3hT5SxohO5EQxIvuoafU=; b=r Q0zTyAM9k4dDeWC09Ns4U6usZfbFmwF5WmYSq0orS2S5IlqEMNCD5eS4T1+P9YIU bux1feOTLUx+jbGES7p0tZexB7sjKziFu1REY8IMZ3nupln/JNbzjDtOLctnWNp8 XA9kV4qQuc1Qm5x19jQQs/iFWaCDXJIpzXPXc2y+Vn9tI+tEkduUafzmiI3P8lQt BS6MzQ38vfpWjxE3WazKPZ1O3bce+hm6un6+xM19F8oy/ZE2Pe3W6fwz0QEcbCEN AObQ35LmVncbh6jhA0ltzIg3hCbATjFQrW09r5mSixn59UVRxWAjw/1R/qc4QSLV CaT3RkN3AkIkSX+F6mLEw== X-ME-Sender: X-ME-Proxy-Cause: dmFkZTEIQoaCMPWWTZrZLSuPfIMcpoaFOQgssu0q064kZTXnvPG+lpiWmZoBHDk21bckse fvuVPSg/rTZHZ0CC46xxSz8VFAkn4wCrcPtPiWmNVC0OV5nVsejxMwVeg2+Huuql3jozpL RjuC09R0PqemHI2hTU9oZkBFjReFo07HkHkLL28iLuIlnBVOkrQFpCMjbtrqIxQlGMa7YM zS1nu5fPfM7GXBJQmotNZX84BIj6/YBwe0jixaLlMiIbfmuZ+m1H6I+lY6FMq78/VHabMY Hg8mwI4X4EObu/M+1z/yMjclObdwt0/drMln4hhSFQYlI9GaU4quQJtCHY8cc0J+nIqXGd JFEgxuDpg+nSi8KGLZA3dBJyWUnLpiGuUlPYi6oMhlROTr4X5NXlvf9b6oCuZc7JzUMN+/ MZ6/mXpnpkfJqIxbb4Blxdd2QMbEOjCTuSJntDLE1hLQS6sYNMRJjf0+bOcvDkg5OdqCAW rJIF5NMb4NIXViwaq275kw1uBB9FtDFVoMpTiHvIT+KGFQkDl7P74DIKbNam4bYc8g7y/k f+bm4r2dVpcVgwJXuSnblYQsTQ6V6wev4XORvrObCBlhXbeWBKwXSti9D2rqxZ3r3acbs9 MDShvZpVcnOK/OMIuCBMoEXfU3SkXJfzpxD5vR5xnZXPkQCHmxNlC+NMspuQ X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 5E1D9700065; Fri, 11 Sep 2026 10:48:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: A5esK-b6BnZB Date: Fri, 11 Sep 2026 10:47:56 -0400 From: "Greg Burd" To: "PostgreSQL Hackers" Cc: "Jim Mlodgenski" Message-Id: In-Reply-To: <4dc7c3c0-6b5e-4f5d-921f-0b1a62698b1a@app.fastmail.com> References: <79629577-3ad8-4b1c-a469-ebc2cb4c5104@app.fastmail.com> <618241c3-a1e5-4a16-be12-17a361822ee0@app.fastmail.com> <5bcaa70b-89c7-44b6-b197-638d10997cae@app.fastmail.com> <76c33898-3baa-4f7b-8b72-57dd390fcffe@app.fastmail.com> <9cfdf3f2-b799-485a-8b5a-5159c00ff2df@app.fastmail.com> <96dc1db7-58a2-41ba-ae2e-bea86fa2fb3a@app.fastmail.com> <4552df91-98bc-40e8-9189-a167daab6f0d@app.fastmail.com> <8bd912c8-22bb-4667-a656-3be843709be2@app.fastmail.com> <4dc7c3c0-6b5e-4f5d-921f-0b1a62698b1a@app.fastmail.com> Subject: Re: [PATCH] Batched clock sweep to reduce cross-socket atomic contention Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I'm withdrawing this series, and I want to leave the reasons on the record rather than just let the thread go quiet. Over the last week I built Vondra's NUMA partitioning patchset (v20260605 0001-0006 plus Wartak's 0008) and benchmarked it against both of my patches, using Jakub Wartak's harness from the "Adding basic NUMA awareness" thread -- his seqconcurrscans.sql and pgbenchS.sql unchanged, scale 1000 against shared_buffers=8GB, huge_pages on, 20s runs, 5 runs per point with the arm order rotated, datadir on a real filesystem. Two boxes: i4i.metal (2 NUMA nodes, 128 threads) and r8i.metal-96xl (6 nodes, 384 threads). Four arms, with each arm's feature combination verified at runtime before measuring -- partition count from pg_buffercache_partitions, and usagecount values to confirm which evictor was live ({1,2,3,4,5} for stock, {0,1} for HOT/COOL.) The partitioning works, better than expected and better than my batched approach. Partitioning alone, versus master, on seqconcurrscans: 2 nodes: -12% at c=1, then +12/+6/+8% at c=8/32/64 6 nodes: -49% at c=1, then +23/+46/+47% at c=8/32/64 Then, with partitioning on in both arms, changing only the evictor from the 0..5 clocksweep to 1-bit HOT/COOL. Ratios are per-run and paired, which matters because the run-to-run spread here is 8-23%: 2 nodes, seqconcurrscans median ratio HOT/COOL faster in c=1 1.058 3/5 runs c=8 1.012 4/5 runs c=32 1.008 3/5 runs c=64 1.030 5/5 runs 6 nodes, seqconcurrscans c=1 0.987 2/5 runs c=8 1.140 4/5 runs c=32 0.976 1/5 runs c=64 1.036 3/5 runs pgbenchS is flat for every arm on both boxes. Read honestly, that is a wash. The only point I'd call real is 2 nodes at c=64, where HOT/COOL is faster in 5 of 5 runs for about +3%; everything else straddles 1.0 and flips sign between adjacent client counts on the same box, which is what noise looks like. The apparent +14% at 6 nodes / c=8 has individual ratios from 0.94 to 1.15, so I don't believe it. I'm dropping the batched clock sweep entirely. It solves a problem that partitioning solves better and more generally, and I see no argument for carrying a second mechanism for the same cache line. Continuing to advocate for HOT/COOL, but on the NUMA thread rather than here, and as a simplification rather than a performance patch. The case isn't throughput, the numbers above show there isn't any once partitioned. The case is that it replaces a 0..5 counter and its magic constant with a single bit, it makes scan resistance a property of the replacement algorithm instead of something the ring buffers have to bolt on, and it removes a failure mode I measured earlier in this thread where the 0..5 counter can spend up to five dTLB-missing visits per victim on a large pool with huge pages off. Andres is right that I have not shown a real-world cost for that cliff, and that remains open. But if the buffer manager is being restructured for NUMA anyway, doing it with one bit of replacement state rather than three seems worth arguing for while the code is already being touched. Thanks to Andres and Ants for the reviews on this thread. They were blunt and they were correct, and between them they killed two of my three ideas (the strategy removal and the ghost directory) before they cost anyone else any time. That's the thread working. They also pushed for more collaboration on the Vondra thread, so here I come. :) Marking the commitfest entry withdrawn too. best. -greg