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 1rs4rl-004fWd-0U for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 17:57:41 +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 1rs4rk-005zJz-4B for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 17:57:40 +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 1rs4rj-005zGx-PH for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 17:57:39 +0000 Received: from wfhigh4-smtp.messagingengine.com ([64.147.123.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rs4rh-000OdN-2r for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 17:57:38 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 3D1C118000AD; Wed, 3 Apr 2024 13:57:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 03 Apr 2024 13:57:35 -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=1712167054; x= 1712253454; bh=nxrQo9kYGra9+HyQcZmxbFcqZ+yPoF2phAydFrYN4MQ=; b=V 1+imi5i+nYiWIbTRLxZzKccK9zp2olzNfhIBdU3bPF6yDtPOd+aEyRU2hzkdKrpT it1YAXJ2L7quXMLk9uX9a3e16wYU5j5Nnf2o3XGS695Ugr9onJQ90XT7w53NQ9ti C77dxYYJvOTjsy7DVcDtmwX9SWdEhjW34wtCnTNXptpMWfZ18n8SQJzENprBl0to fx4R/S/OtKIs+k761HSQjzorvkKFlcusz0Am/HEWNYFie3G24wa2Dm5OorV0J7Iz GXrWw4ulr2CX5EOsiVvdLTKWCljVy2rqq9H6X2qOkjfqBCWEQcMxk0RdEB9bEmF4 O+YEoW66GFsI6MiCbJ2dQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 13:57:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1712167052; bh=ogsqeRTDfRJ9vkMwetIKFehWC5xeBJbUZge80C8Lrs8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=hgvAPZ65lvcnLMFqfopcDaDP9yzzSZjDWGjve1/bRJZ1ltY4cwm+RIeKQ6InLs2ue 2H3unge3+sDFgkg4C5aN7ZUsQcz2G4PhWHAf6kSpr60jKeGLzyqoJ12i8EMW5fy2r4 94gYLKKyzqkc4HTv9DKZqYj4a3XutlsvpbsB44yYDmsf0bnz3nulS31iU/FkjC7Ju5 eUOD1r5ZQ+Y/IKqI4wb09aSNd4pKosBYMF+cblseGG203BL5yWmcxI60D0DseCF21l ki/3Jyi/K2wI1BwAO0IY+BQ8hXEcdTyBvRc53d50rJ50farKZcx+MaMNHkvMA3XIQQ hYtC+ZVLJuwGA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id A8EA541E; Wed, 3 Apr 2024 19:57:32 +0200 (CEST) Date: Wed, 3 Apr 2024 19:57:32 +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: <202404031757.72amsbwj4npm@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 2024-Apr-03, Bharath Rupireddy wrote: > On Wed, Apr 3, 2024 at 4:49 PM 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! > > +1. > Also, I'm fine with renaming XLogUpdateLocalLogwrtResult() to > RefreshXLogWriteResult(). Okay, I have pushed 0001 with the name change, will see about getting the others in tomorrow. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/