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.96) (envelope-from ) id 1w25PM-000rnb-05 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 10:42:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w25PK-009N8s-1Z for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 10:42:47 +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.96) (envelope-from ) id 1w25PK-009N8h-0e for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 10:42:46 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w25PD-00000000PQZ-1RcU for pgsql-hackers@postgresql.org; Mon, 16 Mar 2026 10:42:41 +0000 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 56DE81D0017E; Mon, 16 Mar 2026 06:42:37 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 16 Mar 2026 06:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm3; t=1773657757; x=1773744157; bh=ITSZLtSUR73jUm4p1t68tg3+AT/x9VMl px9WzfFC+gE=; b=cotbB3UN8qGHEtQ1Bs2Wp3Aftn7L8RS0lMCl4wLaIJvp6GPT MDkMF9wwUliqwiXZ1DeSFayRdlodzqkT3kW72oTYy6GZ9PP7kCtmXRHWnRxyDR1N IaXMLep3h+lKv8ZxY8kOofT3aIgqxtOSARWBpwPvggKDhMAIuaYwbygxarmZSVil xtQNUB9LXnOMrHTeJ6oxjy+wlmbdoYSHw8tvTG7DF/sX5P0wCHvvIGyZzRZFmeLy deO8tMwgpGb0ezTJ8P9Pwe3WZrW3ZWlvcyNofU3cNrflJexW6Wf62cmzZkmP7Mmi b1mpqrgNcavV8j/zjiwIm+EI/M2FtATTzPCwww== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1773657757; x= 1773744157; bh=ITSZLtSUR73jUm4p1t68tg3+AT/x9VMlpx9WzfFC+gE=; b=Y hOCGxTyUVAK7QANtmEvYC1t1QmT5m+BlvPifSfv+w1dcjKjk5lDeLR3faPWkSvbt HSHEQU1S/Z6hBrslIC5eFk29j/g07uIzH1GwnRIktJnvmrXmcJ5zhKMTlg+jHVHf Gfclh2lmhxhz+nUsGiCYE9BJsmLuhWcEo38nuH9/D5i3SJZJX3ezovBNSuFR1fle i+8TWBJHEOzYov62Puh+3N+P9uf+VPv2Kblpus3QPB34oRMzO+h6Aav30aXZoiQc 4808TEIo+ov7i9XgdCfeykQr+PCLjjiwR1C6rxO+m2vtgQIvv8GTl9FBRy/rakkU TpiyjJgXeqDx6u0PGWGaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvleekudejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgheqne cuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfeileehteeljeeghfeuledthfeutedv ffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsvghrthhrrghnuggurhhouh hvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopehhlhhinhhnrghkrgesihhk ihdrfhhipdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpth htohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Mar 2026 06:42:36 -0400 (EDT) Message-ID: <3ff35999-7a1e-40fa-938c-f2bff85e2e2f@eisentraut.org> Date: Mon, 16 Mar 2026 11:42:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals) To: Bertrand Drouvot Cc: Heikki Linnakangas , Andres Freund , "pgsql-hackers@postgresql.org" References: <1cb0d7e9-d6dd-4517-a7cd-0ad98e1207f3@iki.fi> <3dd6f70c-b94d-4428-8e75-74a7136396be@iki.fi> <787be980-0878-4f4a-be01-d042ab5d370e@iki.fi> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24.02.26 12:28, Bertrand Drouvot wrote: >> You can/should use C11 standard alignas(), so you don't need to worry about >> whether it's supported or not. > > Oh right, I did not notice 300c8f53247 and following like e7075a3405c, d4c0f91f7d5 > and 97e04c74bed. > > PFA, 0001 doing so for PGPROC and PgAioUringContext. As those are typedef, > the patch puts alignas within the struct. > > For PGPROC at the start of the struct, I think that placing it on the first member > is the right location because it ensures the whole struct is aligned to PG_CACHE_LINE_SIZE > without adding padding before this member. For example if I set it on backendType, > then it adds 100 bytes of padding and the struct is obviously still a multiple of > PG_CACHE_LINE_SIZE but is now 1024 bytes (instead of 896). > > For PgAioUringContext at completion_lock (like suggested by Andres in [1]), which > is also the start of the struct. > > I checked and the padding for those are exactly the same after the changes. I have committed the 0001 patch. > 0002, is also making use of alignas in ItemPointerData, but this one is more > tricky so I'm not sure that's worth it (given the fact that we still need to > keep pg_attribute_aligned() as explained by Peter in [2]). This doesn't seem worth it to me. Let's skip it.