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 1rrzHy-0043ew-7H for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 12:00:22 +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 1rrzHx-0019ek-7i for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 12:00:21 +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 1rrzHw-0019eA-T7 for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 12:00:20 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrzHs-000Pst-9W for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 12:00:20 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 11C8F3200A20; Wed, 3 Apr 2024 08:00:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 03 Apr 2024 08:00:12 -0400 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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712145611; x= 1712232011; bh=V+ntSlCMI+xiETswDPwUL8PtobjGtGjhWpSzZHczw1c=; b=V McYi2bxgfj8Tw0I/ZFxsSaliph1SQG91AixGrX0taqlmFTfbiQZJEUovBb6Ox1Qd RtvPAOOqg2tePtG53MwAJz0llCUuVy1zKHszOK7tje3JXFQC0TMW2+bGBVPIhuv7 HAiO/iF9ceOiiAkhlVfnjldDciHSRGL4nEiHMLVXwtepGIuvJmlP7MdKl2Ueu5+X geI4fyqfHh/mwYNmcIUOElVgPexOGCC99k09h7nLDfzAmNSmb1rCxw0x3c08T061 IDYKeSO8gLtKChU4ZRCpih1GXauqLv5VTdtfeTq9wzzSpwAJu8Qyat4xf9tHqF6X 6UM9CpzwZriwMwJ+AB/EQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhephfeuheeuuefgffelhefhhfeltdeuvefhvdejvdekleet ledttdegtdevtdevkeeknecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh dplhifnhdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 08:00:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1712145609; bh=EFvQqL2Dj/VcY3pPG9aC2vxJ+qNVPSnMMkIhlwLvmdk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=dxUCpuPDD0ptfZDIVCVAIkKONGdzcliU2cy6mZnV+n28HkQeS96LRxSv5qO5ICEqk OVSRqxzHgPDe/5a47YgwM0Tj+7rr6uEVjHH2sbqqxMD/ZsXAo1bl0LmZeNgs+429Ev gvzX3iASUY1Nrz2BidVfZi0Uu+4Uei96mk3fTRG/67N+pWDFgjZek5BGfAq08BU+b5 syjblWBZ8Z7/tQJILKfIBgHpw4Oh72gnS/oN4ulDAxAI/a4Ej5XCaCArDg2X9HivSP uZRyZvOytrVzld4kVq1ez9xzL3/RosHo7p9LVpbBa8GHbDJfqO06pzy2JRPXPCx7Lt HWZznqzFPdcsA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 57E3841E; Wed, 3 Apr 2024 14:00:09 +0200 (CEST) Date: Wed, 3 Apr 2024 14:00:09 +0200 From: Alvaro Herrera To: Bharath Rupireddy Cc: Jeff Davis , Tom Lane , Andres Freund , pgsql-hackers@lists.postgresql.org, Jaime Casanova Subject: Re: LogwrtResult contended spinlock Message-ID: <202404031200.335odntqgtq4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202404031119.cd2kugjk2vho@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Apr-03, Alvaro Herrera wrote: > So what I do in the attached 0001 is stop using the XLogwrtResult struct > in XLogCtl and replace it with separate Write and Flush values, and add > the macro XLogUpdateLocalLogwrtResult() that copies the values of Write > and Flush from the shared XLogCtl to the local variable given as macro > argument. (I also added our idiomatic do {} while(0) to the macro > definition, for safety). The new members are XLogCtl->logWriteResult > and XLogCtl->logFlushResult and as of 0001 are just XLogRecPtr, so > essentially identical semantics as the previous code. No atomic access > yet! BTW I forgot. I didn't like the name XLogUpdateLocalLogwrtResult() name much. What do you think about RefreshXLogWriteResult() instead? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "How strange it is to find the words "Perl" and "saner" in such close proximity, with no apparent sense of irony. I doubt that Larry himself could have managed it." (ncm, http://lwn.net/Articles/174769/)