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 1uZY5P-0053Px-Vq for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jul 2025 16:56:00 +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 1uZY5M-001ZD0-Jk for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jul 2025 16:55:57 +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 1uZY5L-001Z94-UX for pgsql-hackers@lists.postgresql.org; Wed, 09 Jul 2025 16:55:56 +0000 Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uZY5K-006QoO-1w for pgsql-hackers@lists.postgresql.org; Wed, 09 Jul 2025 16:55:55 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4C1AD1400385; Wed, 9 Jul 2025 12:55:53 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 09 Jul 2025 12:55:53 -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=fm2; t=1752080153; x=1752166553; bh=0s03VTZz6ZKZJAfOXWlcdYhBoUGr0GN9X1ncRXn0Oc4=; b= gCJoSoC4MUbnzDCZVfCJHX1Ah6HChhO0KVwUSwXZ5Sah+27/3uNxugrY36nLCReg Favps9GFYpoxUqdi9WZB/aGZGRJS4yf+47XyV5H5v3wA/6xZCrrJ5M6xUu+WVHPJ jlByp53UEdVfPawwhbKUK9lopqjx5IAhpis8FHTitFd0dzPVtcts2DNQ24YdssUn 44tDMnaa5sb1NpMlIRY7GXmeA6wPfD4r28hYWUDXAxUD2uA3Zh3HWL2hYBc25LWe t8bGP4rQQYdA/M1vb9A12G8ryXDPfOp7pn3sONmcB19zy5wYS1hVfwj63H2lSaQG 1UpdiAmYJJAffK0mNWJn9g== 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=1752080153; x= 1752166553; bh=0s03VTZz6ZKZJAfOXWlcdYhBoUGr0GN9X1ncRXn0Oc4=; b=G ZNxIV0mVu5D1ZC6GlZCgbYVG+XbfoBMPf5CzS4r8JDjCl+BiRZzEtx5SRicIh+Xt Bx+mV6jtLvGCICyXox2aTyMjfu8HCFoEowM5ESqmmkaXJSfstY+9tNagfWRxeuvA wsi28d0j2TNaVu5dnYp/kQlU42PPqHBAlt3hUA5Z2msEXZlmiuZqeu7eF9feEb74 l1QORrxvxPTkQRmGT2Xd94iyOuotBdpxIjtB42IXXbBf30ZBcqwz9sq7r6oY67Ba YR+2yUnSEEnUQ3YIuOveatLSix7O87hXLcv3psocRaWIMrHh9LSBndTtuJCP9nZV TNJCccvZ+rtUlel6G7MnA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdefkedutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefkjghfuffogggtgfgusehtjehmtdertdejnecuhfhrohhmpefirhgvghcu uehurhguuceoghhrvghgsegsuhhrugdrmhgvqeenucggtffrrghtthgvrhhnpeegvdfftd elvdekteeljedvleduueevudfggeetudfgudejtdeikedtvefglefgieenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvghessghurhgurd hmvgdpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep rghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohepthhomhgrshesvhhonh gurhgrrdhmvgdprhgtphhtthhopegrshhhuhhtohhshhdrsggrphgrthdrohhsshesghhm rghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrd hpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopeelvghrthhhrghlihhonheisehg mhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Jul 2025 12:55:52 -0400 (EDT) Date: Wed, 9 Jul 2025 12:55:51 -0400 From: Greg Burd To: Andres Freund Cc: Tomas Vondra , Ashutosh Bapat , PostgreSQL Hackers , Dmitry Dolgov <9erthalion6@gmail.com> Message-ID: In-Reply-To: References: Subject: Re: Adding basic NUMA awareness 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 Jul 9 2025, at 12:35 pm, Andres Freund wrote: > FWIW, I've started to wonder if we shouldn't just get rid of the freelist > entirely. While clocksweep is perhaps minutely slower in a single > thread than > the freelist, clock sweep scales *considerably* better [1]. As it's rather > rare to be bottlenecked on clock sweep speed for a single thread > (rather then > IO or memory copy overhead), I think it's worth favoring clock sweep. Hey Andres, thanks for spending time on this. I've worked before on freelist implementations (last one in LMDB) and I think you're onto something. I think it's an innovative idea and that the speed difference will either be lost in the noise or potentially entirely mitigated by avoiding duplicate work. > Also needing to switch between getting buffers from the freelist and > the sweep > makes the code more expensive. I think just having the buffer in the sweep, > with a refcount / usagecount of zero would suffice. If you're not already coding this, I'll jump in. :) > That seems particularly advantageous if we invest energy in making the clock > sweep deal well with NUMA systems, because we don't need have both a NUMA > aware freelist and a NUMA aware clock sweep. 100% agree here, very clever approach adapting clock sweep to a NUMA world. best. -greg > > Greetings, > > Andres Freund