Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgjus-0002TL-N5 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2020 07:03:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgjup-00013W-UG for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2020 07:03:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgjuo-00012T-66 for pgsql-hackers@lists.postgresql.org; Thu, 04 Jun 2020 07:03:51 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgjuk-0001Ue-39 for pgsql-hackers@lists.postgresql.org; Thu, 04 Jun 2020 07:03:49 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B437F5C005B; Thu, 4 Jun 2020 03:03:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 04 Jun 2020 03:03:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=sFZR38wVBPCG09RQg7ypQ/zzlpl uX5TGvuSDcO39jac=; b=BkP0y/3wZVPcmpsP1jd4dfPhPR66a0JymCoYpBzKxhb osYdW2kwQCPmbSkEgzj0DSxpM7bEGmqLBtAUJtzTkmn0IGLurItxyUGe/h6/SPEt bRiLD69g9y7ZyETwh8Dsj3etva25NSDu6s0EfXz6ti5VzxV2zVxA9PiOZXx0vYSq jQ6KRXmQlG1Y6AXRF4O4NrL8KPCK4gbYhCiYT99Lgjwf9Blc+W7aepcDyTva+PAu 7hWlHXpVOw+g5kIwX5BK9wT6YB+dNORr8RRnOORC6KgcnEH5FmiHFln4zZno6iNg iGoxtZWNBYJa2pOEZDGUNwvA5+rAagqfmG/AOKTKaAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=sFZR38 wVBPCG09RQg7ypQ/zzlpluX5TGvuSDcO39jac=; b=CWxVenXgyqAu9RVjGsYjWv ScU2vJouiFm4sJyYfSMRgQJ5GhFPat2S28eNiM6zN5fucTimm+CenJgnxGEUfZcH iggEJat22LHkN/3Zx5Gm2qahSYeC/K2vcE5gxO88Q8qiVl0wUNWVpIv9dLPMia/V W68U6y17CpOA8tLMtgAMSW9DNqIBRbNJ4XjfImrpyigQZQ3qY9HPcuR/uiKQHAq2 UMVg9OqGbGglxhE8Vns2PG2AqkyJ+V7eABp/75MkA8ntZU/kfpP3BELFcMmTOTyZ bK4pIvC2Imbhr8x2m1C8s5H/ea2kfY+5gAAbr2YGvw2K7zWW+6IrNyxuxBDlWC0Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudegtddguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveej heehieevueeigeelteegleejleeiueeiheegvefhnecukfhppeduuddurddutddvrdduke dtrddukeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id ED2E5328005E; Thu, 4 Jun 2020 03:03:34 -0400 (EDT) Date: Thu, 4 Jun 2020 16:03:28 +0900 From: Michael Paquier To: Thomas Munro Cc: Andres Freund , Tom Lane , PostgreSQL Hackers Subject: Re: Atomic operations within spinlocks Message-ID: <20200604070328.GS89559@paquier.xyz> References: <1141819.1591208385@sss.pgh.pa.us> <20200603204542.reuladbmgmjqzoi6@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aKl9HDSa9q6Cj3fk" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --aKl9HDSa9q6Cj3fk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 04, 2020 at 09:40:31AM +1200, Thomas Munro wrote: > Yeah. It'd be fine to move that after the spinlock release. Although > it's really just for informational purposes only, not for any data > integrity purpose, reading it before the spinlock acquisition would > theoretically allow it to appear to be (reportedly) behind > flushedUpto, which would be silly. Indeed. This could just be done after the spinlock section. Sorry about that. -- Michael --aKl9HDSa9q6Cj3fk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl7YnMAACgkQnvQgOdby QH2UmRAAmrPXtQJnaG55ge3pmccfp/hyMRf8fGs1nTKlMlrHZTGwVwVH8eVFImqS zyjy+dS/oIMLbipy4sdCp4av25h9OCtJ/MAuUH3xCJoX3I/4uJh/uEU/f3LnsJUV pE5HQ+tQhA2IuP/X0TTXzxADCtfO2yKvLT8+hubB6qPAPd4Yi1Ym8rHtCPoZCgdc HlGgFfcgquh+prBhH9PE9Rd2jsR0GXre8JAqoOusQeAOKYSU7s90c0McR31S83iu EabAVnyxOfgR+iHuLC3w7zdq68cz2tynsXn/NHOxe1+N9MYlo7SpjedacXxEHkj1 gdpm/rd2fVV45JMJ7/1bbh30rA7upmPlgB8CddOjpTN35yDNaFod6pbKlRHaPyZO KFFL0qDy1ofbhlcOYR9+qQLShnvfRy842zi1d436dYELFD4l6bgJWowDXqolUiIv ybR8ugk8crdKKywLTYqQUDt1ukLGEeLR4K7t1uQ6xjl34q4qgS0mHjKROYSrvho3 2NDnioulttn8UySnneCniD0LATndteIQS5P25Lrrb+K7iz2yQv8devG+TWoYysqK eS4tX3J836QwEptAA+qiMOcI00Ko/eFvvx//UfryMaIyPmqbbn2CGlNQ+HZbjlVm zs58geElZjRu6P7zegEGR/R6g/d5Bu24Mz3C2KWUiZdHC9KU1Nc= =ZZ7O -----END PGP SIGNATURE----- --aKl9HDSa9q6Cj3fk--