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 1vprSD-000FFT-1K for pgsql-committers@arkaria.postgresql.org; Tue, 10 Feb 2026 17:23:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vprSC-000DL2-2Q for pgsql-committers@arkaria.postgresql.org; Tue, 10 Feb 2026 17:23:13 +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 1vprRA-0009GA-1k for pgsql-committers@lists.postgresql.org; Tue, 10 Feb 2026 17:22:09 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vpqo7-00000001TNu-3r7k for pgsql-committers@lists.postgresql.org; Tue, 10 Feb 2026 16:41:49 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4D07D7A0060; Tue, 10 Feb 2026 11:41:46 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 10 Feb 2026 11:41:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc: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=1770741705; x=1770828105; bh=sV9ZBtr/NP kIQA7/5EzZEaZRufvWqtx2zE6yAqqWOJs=; b=RVG9gPWmOrXi2gH6zSHlWsUByG ZGIfnnOttDExAmDyOuYe3i3lvyh2okRqi/FfFzfg0CIsOqRtxyhOboy/Lp/Bbc+m oD7VW5acXn0UdfrU9rGflukVYbHhGvHoCNhHCFhl88A8rwcCVGfRKdqrEFr6ttbK TEhIVeR5KKRqIoXN0k7iGXQYloXmwQfOfDZJeSa+GVbwMfhHae0pzuenSraVBrAJ gu9DSO8r+ngXZPdYRrDcaty5w1BWM/E44RHj7Qw5TF+GbadzIpEKBf/YofLNJUAU Mrs8NBv+Dt51YIZatBJiaNwubs+8ad7JGilzWvyt6lpY9Vg4/2gmOwvKY51g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm3; t= 1770741705; x=1770828105; bh=sV9ZBtr/NPkIQA7/5EzZEaZRufvWqtx2zE6 yAqqWOJs=; b=pv1GDcuNaLcNL4S/Q7NOXbvycKWdhD/nDaYji9ryShQ94IbltwB cw62ok5gxuE1Hh1u7xp3Bi75+cks5degwdp1zOLdqKYDAENWCz3MQl+UDyQOWqVd OI1eX8cWbhyh9R5RK//dBsFhKKB2UdpwR8BcjdZMCdE8zZUSz5pDv9I2H/Lw6aVW cO99+9VBOUwLHxcHCFIyKbEwC2Jq8ONqYfVx3w8hFJuY38QSZoaHsgn3bnfmZwpw MH+nEaKfpgAf67WdtAUTMuzsw4vaB42esQ10KnfT2HETbY25AvFTKGRVsSEB4HPK OOpD8J3Qyw+w6F2If4svTXbDSz8hvx1ENqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvtddtudekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepgeetveejudeuudeuhfeftdffheetgfevudeftdefvefgieefgfejuddvffeg feeknecuffhomhgrihhnpehpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv pdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsvg hrthhrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopehh lhhinhhnrghkrgesihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdqtghomhhmihhtth gvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 10 Feb 2026 11:41:45 -0500 (EST) Date: Tue, 10 Feb 2026 11:41:40 -0500 From: Andres Freund To: Heikki Linnakangas Cc: Bertrand Drouvot , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Separate RecoveryConflictReasons from procsignals Message-ID: References: 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 2026-02-10 17:52:16 +0200, Heikki Linnakangas wrote: > On 10/02/2026 17:19, Bertrand Drouvot wrote: > > Hi, > > > > On Tue, Feb 10, 2026 at 02:32:37PM +0000, Heikki Linnakangas wrote: > > > Separate RecoveryConflictReasons from procsignals > > > > > > Share the same PROCSIG_RECOVERY_CONFLICT flag for all recovery > > > conflict reasons. To distinguish, have a bitmask in PGPROC to indicate > > > the reason(s). > > > > I did not look at the thread, so sorry to be late, but that makes the size of PGPROC > > going from 832 to 840 bytes, so not a multiple of 64 anymore. Is that something > > to worry about? (same kind of discussion in [1]). > > > > [1]: https://postgr.es/m/tw53roer2j4quxh7vlyv62drc5fo6c6zdltvl6d2dttqa62uhi%40stwlpdwlftpj > > Right, that's a fair question. I hope the cache line alignment is not > critical for performance, because the alignment is completely accidental > today. I checked the size on different versions: > > master: 840 (after this commit) > v18: 832 > v17: 888 > v14-v16: 880 > > So v18 was the outlier in that it happened to be 64-byte aligned. > > If there's a performance reason to keep have it be aligned - and maybe there > is - we should pad it explicitly. We should make it a power of two or such. There are some workloads where the indexing from GetPGProcByNumber() shows up, because it ends up having to be implemented as a 64 bit multiplication, which has a reasonably high latency (3-5 cycles). Whereas a shift has a latency of 1 and typically higher throughput too. Re false sharing: We should really separate stuff that changes (like e.g. pendingRecoveryConflicts) and never changing stuff (backendType). You don't need overlapping structs to have false sharing issues if you mix different access patterns inside a struct that's accessed across processes... Greetings, Andres Freund