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 1sOI7a-00DUrw-Qx for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 14:35:10 +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 1sOI7Z-002VQs-7R for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 14:35:09 +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 1sOI7Y-002VQb-Ea for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2024 14:35:09 +0000 Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOI7W-004V4h-1Y for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2024 14:35:08 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 7607D11400E4; Mon, 1 Jul 2024 10:35:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 01 Jul 2024 10:35:04 -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=1719844504; x= 1719930904; bh=Vel8xOrsx6GWdvqrdN3qqNho4sfyB7GzAlMVBOewYf4=; b=K 9EeKWxlCy/Rqc2mup7soz3D0OySeg03qmgevUzPHvZLg5Gnz/QW3FsbxvkJ6cgwi 1NNKIhhNolgqspAEz00CaIwp/8A57HwTYcVa+oF3nrvKx9vruo7xlhjCe1vezo9L Rl9DTsHPW5bXeYbbOMtx9Iau56GwHmXCIob1Bibab2KA6km4peYyIjy7k6EsJ4gP PsoPO36dOdE9bgn4/UAecWnp5FKM0/geGoGYlMtH+/r3iQ23ZOpJZno9HlV745+X omZ5ZlcVqufd6p9uoH4oAR18VG+MK4vwZk1KrQeLr9BBCwBKJHuzq4EUQa87REBM tI83tW71Ax4s1seDjupHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudefgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeehleeuhffgveeivdfgjeetveduleelhfevkeeitdfhfefh keelfffgkeegteeiteenucffohhmrghinhepmhhitghrohhsohhfthdrtghomhdpvghnth gvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Jul 2024 10:35:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1719844502; bh=TcRbO+c8ha6oqcv/ZTT6MfCTTjDZpqCanYM88T2pw/M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=C9PFgFGy/gwLBbprRw+H4mS/MR6rJQE02Dja/fQCvBafBnMn7+H4wy0A6XQF9KPy/ N/xyBR7CekUcCYrstwMsNupsqo/8oU31IN2BICUX1BsnpuijYOVpkHVBRMDkq2hkYo AXpJCkyCTmgBWxUtDBh92/JGrf+XvsAQM5RT6OlkRDojiug4X/IiQzqA49vmjh3N8e /eDZMg1sryYr3N9Z6st9DABjGstRK3c1zuuKA//g8W08fn0PM0dIuFpaKUqRk/kTte 1Z7Gk02+ksIH1FZCTdwUu7BAlAbC8i6c7t+Xj+sm7sHBWiUKJGeX9l/eokmcvzoi+4 pdg0xRHtubrvQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 3D431529; Mon, 1 Jul 2024 16:35:02 +0200 (CEST) Date: Mon, 1 Jul 2024 16:35:02 +0200 From: Alvaro Herrera To: Tom Lane Cc: Alexander Lakhin , Bharath Rupireddy , Andres Freund , Jeff Davis , pgsql-hackers@lists.postgresql.org, Jaime Casanova Subject: Re: LogwrtResult contended spinlock Message-ID: <202407011435.oiv2idunr7ps@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2735446.1719842903@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Jul-01, Tom Lane wrote: > Alvaro Herrera writes: > >> because the failed assertion is: > >> #ifndef PG_HAVE_ATOMIC_U64_SIMULATION > >>     AssertPointerAlignment(&currval, 8); > >> #endif > > Perhaps this assertion is what is wrong? If the platform has no > native 8-byte alignment requirement, why do we think that atomics > need it? Oh, that's a good question. TBH I just copied the assertion from the other routines for 64-bit variables in the same file. But I think that's correct. We're gating the assertion on _not_ having emulation, which must mean we have native atomics; on MSVC, if I read the #ifdef maze correctly, that's implemented using _InterlockedCompareExchange, whose docs state: : The variables for this function must be aligned on a 64-bit boundary; : otherwise, this function will behave unpredictably on multiprocessor x86 : systems and any non-x86 systems. See _aligned_malloc. https://learn.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-interlockedcompareexchange64 So I think the assertion is correct. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "[PostgreSQL] is a great group; in my opinion it is THE best open source development communities in existence anywhere." (Lamar Owen)