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 1w2AFd-0002ut-2n for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 15:53:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2AFb-00Axt9-39 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 15:53:04 +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.96) (envelope-from ) id 1w2AFb-00Axt1-2E for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 15:53:04 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2AFZ-000000002BA-10PN for pgsql-hackers@postgresql.org; Mon, 16 Mar 2026 15:53:03 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4852c9b4158so41651735e9.0 for ; Mon, 16 Mar 2026 08:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773676381; x=1774281181; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=s9JgSlGXs/NuipLR+BKQFj/V2B+2dRbeAX21BKYcDJE=; b=f89QKicTbwTjFpcttWOXKu2axVFtBGEw2aNhXU0vxMs72z3az9AxrJR2nCKn6BLWsq uhw0CjC2h/D00kx1wPQT2wqO40SMWHKG01b5fFzEwLDz94QInfza7DC7gHq5PCvDFv9x uUVCzjoaFWFlZOy80jVYSRymO68NDnXYmusRPLe1yDBmnMaNRZm7IpLX4jayoU55yNdj xkjaAVB4HVNDHcK3bDIyEMNkJQgvfqdCeeQ8yojQR7CQKIgB6gV9FgttTDma5bcn7RYt tE32lJx77MuDnOhpv4S3IFOv4ynIHugEccrWi8sSgymYJVIvlAWHD/MeD3Mjk8dAZx/2 2AiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773676381; x=1774281181; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s9JgSlGXs/NuipLR+BKQFj/V2B+2dRbeAX21BKYcDJE=; b=EZpvr4aeXSk570sEZ7SnXpwWoG8QKuphleQiaO7nyMv5Si+qOunyPo2aVKo0UAJ230 Ii1jGE3vu34F0F7pmjm0VBtlXEnp/9cyi35WtGoxsYTgafH4P1ypezWL7O5qdEdli1rA 9EYVTuSAPZafB2cR/mRkzp++5FfyvZQHTG58bd13U2o8FzgnzW/+NMDPW/lUhTN9IhuR UcChjaQmvx81GNaa/Xwk3o4j9gtDSK6eoAwXnm+lxEqRhKszA6h4j8ERYJhF+oUeLLXY rDGIhroxyK8RKeETCkNCHA6VWZutWf5pg92rQdtcGbCPkK0i4XFBX72hNei8XIUqVVGw izMg== X-Forwarded-Encrypted: i=1; AJvYcCU7BeGzBwudKCnwSkmfFcj41QmKqlK2RPDDXszM0Y7ZuMA4/0cA6BFcXzopRutXPr7I59LLma18gjfzn3QF@postgresql.org X-Gm-Message-State: AOJu0YxRLD+oslISavrXmZ3WsEVRFyH5R3RoSgbrampdnJPdRWXTJLue 1by5c2N61SbXN+qoEJ1J1+xbfLPgYCIh8zuPr37bjL1i1SQZHe22o8Ex X-Gm-Gg: ATEYQzzmgkyPXAfWbvmVx/wEchB/J4Dr+OmrC4XUtOUo1+G3O8wur/os7WZVKIfYb6H zopMKT2qJX2tgQI1NgopK8AKIh7ny8ZXBfINtcr9a1bkMO13XiDNt5dh9dgnlLrWsLLGo4pYwTS FUDtPnFsuw18i4czt+jXemJngBCVPrp/aDtSJvdGBYWoIJirgdEL3mZE+T4lh9ViT4jGQfIphUr 4TLjaajz+Yav/uhKe15pJW6M2BN2TTJPgDDv6z2hVJN4mgDRBmhCN3In+gYqCsAH7xX9PjGEzgS LYjaPQVO/AcA2+AStImSBPmVX3ULoNMc0jUXunYb2Kk4CX3XVms4oLm4fpct0Jlizp23bUg2mn7 CMAf7fLAAW5k8kbae+AgrnXMwhgOLut+y5iFj6g8hfDPmYDnfavLAIdcRIaqpKCjiFRgqnWizoR gPFimq5kLfgpVkyoh0VQhBrmlQc5Fe14+U6SvfKYTd0MqKrpGR4/Ni2y65w4iSy5l2el3xjeIfP bovqrWOj9z50qqpqtDAlhcvr1ShkrqEIKdfYgQ8KFgjOEAu823NNkrauw== X-Received: by 2002:a05:600d:4453:20b0:477:a54a:acba with SMTP id 5b1f17b1804b1-485567031a2mr168185725e9.17.1773676381197; Mon, 16 Mar 2026 08:53:01 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4856ea9d7e1sm1295245e9.7.2026.03.16.08.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 08:53:00 -0700 (PDT) Date: Mon, 16 Mar 2026 15:52:59 +0000 From: Bertrand Drouvot To: Peter Eisentraut Cc: Heikki Linnakangas , Andres Freund , "pgsql-hackers@postgresql.org" Subject: Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals) Message-ID: References: <3dd6f70c-b94d-4428-8e75-74a7136396be@iki.fi> <787be980-0878-4f4a-be01-d042ab5d370e@iki.fi> <3ff35999-7a1e-40fa-938c-f2bff85e2e2f@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Mar 16, 2026 at 11:16:51AM +0000, Bertrand Drouvot wrote: > Hi, > > On Mon, Mar 16, 2026 at 11:42:35AM +0100, Peter Eisentraut wrote: > > 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. > > Thanks! I don't know why but I don't see it in https://git.postgresql.org/gitweb/?p=postgresql.git;a=summary, > or in the github repo though. FWIW, I reached out to sysadmins@ and it has now been fixed. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com