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 1r4QYC-008fqr-KN for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Nov 2023 19:00:16 +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 1r4QYA-001fBQ-4t for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Nov 2023 19:00:14 +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.94.2) (envelope-from ) id 1r4QY9-001fBI-Q0 for pgsql-hackers@lists.postgresql.org; Sat, 18 Nov 2023 19:00:13 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r4QY5-0076Z4-VQ for pgsql-hackers@lists.postgresql.org; Sat, 18 Nov 2023 19:00:12 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F2C835C01B0; Sat, 18 Nov 2023 14:00:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 18 Nov 2023 14:00:07 -0500 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 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1700334007; x= 1700420407; bh=XQNKl2W9PIy5w7VWLlKR0DdIE3TC2LhJ8TtgJ1IpJHM=; b=E BphLiVW6G9j+35Q7X53H5gopz/Wmcz5YCjBbvEktRpoRrd4niY/Wo+RZ/hmU5L7s FhLQbH4VHK1yzgY9zH80GqaXG5DPPYcHE65hb3dfOLXUdwaHfIf0/FMU8WuvbIZQ qra1dmaqPM+LyBo+H4a9ih4r1uVXNfIAr/AkjQTQk4LZps/ZdLloqOpjuU5m2SLm gS9hU85/Fz1JpHjFGEeZmlOnZxzAnk9slahLOatxzq24xu9+o4JKwHXEnJlxchhR lTJdg1uw+U1wmnHUll+Xpdaa7Bng+gXQrDaOpiTdB4x/7jhZAJXeNND6TbnVBAw7 fokHpvcJpp0tVdKwPzQAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegvddguddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeeljeelvdeluddtuefhvdegfeevhfegffffjeevhfdv tdfgfedtteeigedttdevteenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpd hpohhsthhgrhdrvghspdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 Nov 2023 14:00:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1700334004; bh=SVu8ejI0CPNJnLjAfwEs04hJAru6QW+lpFUJiUtEzT8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=nB8XqBex1VHJQOYNrLiRxMvjneEDtneWJOcSxELn7n3rBZNjnugwh9WQSf/GBtN7D fnl6f10S1XWP8YWi/orknxyCBmPdgbo8A/Q0f3oFuTHg7ftW35WB612VGsbX8F/qj2 VyKK8mmmgQ8EIsFbTUD4evj6bK6mp0Y2lCiOSzqKpOgr1+Uqhi66atCrTarX5372bY 11gCTd6Lhae98gyFjSpMDzYa2xxgDJc5apl20dRDi/ygHwQso3ttpGQguj95SVBWeA /uHXjFW8aD+0g8cBMOhEwicBUWQs/YO3TT/EHa6cxohiGS0/Q1ofzoeeSAO5gL0/gK 4EFPpSSPOLkxw== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id B2432127; Sat, 18 Nov 2023 20:00:04 +0100 (CET) Date: Sat, 18 Nov 2023 20:00:04 +0100 From: Alvaro Herrera To: Dilip Kumar Cc: "Andrey M. Borodin" , PostgreSQL Hackers Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock Message-ID: <202311181900.qayx7nlodfsd@alvherre.pgsql> 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 On 2023-Nov-18, Dilip Kumar wrote: > On Fri, Nov 17, 2023 at 6:16 PM Alvaro Herrera wrote: > > I wonder what's the deal with false sharing in the new > > bank_cur_lru_count array. Maybe instead of using LWLockPadded for > > bank_locks, we should have a new struct, with both the LWLock and the > > LRU counter; then pad *that* to the cacheline size. This way, both the > > lwlock and the counter come to the CPU running this code together. > > Actually, the array lengths of both LWLock and the LRU counter are > different so I don't think we can move them to a common structure. > The length of the *buffer_locks array is equal to the number of slots, > the length of the *bank_locks array is Min (number_of_banks, 128), and > the length of the *bank_cur_lru_count array is number_of_banks. Oh. > > Looking at the coverage for this code, > > https://coverage.postgresql.org/src/backend/access/transam/clog.c.gcov.html#413 > > it seems in our test suites we never hit the case where there is > > anything in the "nextidx" field for commit groups. To be honest, I > > don't understand this group stuff, and so I'm doubly hesitant to go > > without any testing here. Maybe it'd be possible to use Michael > > Paquier's injection points somehow? > > Sorry, but I am not aware of "Michael Paquier's injection" Is it > something already in the repo? Can you redirect me to some of the > example test cases if we already have them? Then I will try it out. https://postgr.es/ZVWufO_YKzTJHEHW@paquier.xyz -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Sallah, I said NO camels! That's FIVE camels; can't you count?" (Indiana Jones)