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 1ubjCQ-004U6y-Ly for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jul 2025 17:12:14 +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 1ubjCO-003nqW-PP for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jul 2025 17:12:13 +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 1ubjCO-003nqI-FI for pgsql-hackers@lists.postgresql.org; Tue, 15 Jul 2025 17:12:13 +0000 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ubjCM-007uZl-2z for pgsql-hackers@postgresql.org; Tue, 15 Jul 2025 17:12:12 +0000 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3df2ddd39c6so21662435ab.0 for ; Tue, 15 Jul 2025 10:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752599528; x=1753204328; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=zX2E9CJLjE4PohuBpUN+R9rL0cWenzXEOr6BtB3+Zw8=; b=eiopTj4UG6ZBNrDD+dUqzOvGZcfwZKjy7pcoW7/CV4CQrsP1a4WDdZpPl4qm67aFHy RIQ6OdEel87D8JI1ghNo92VrxEu/rzbGw73yUFVSYkxsH0AGmnaf/sCSgl57+Ix1ZB+L LZ+i6zyaR/9oMjhJKkmgsPR9VcQueQKVHsl/f7C3wFWyR3cYPsgTzXr7qIF6KaT5nRG/ AeyFRi15abHB2lsrdxJWbb/8PmPtk65taWR4WLC88RI0u53tCnTTydLiuFfOZcxJ505G Vxv+qBZZbkeUI2Tdq9DgdUyH4/iPTl2boHa9eYHlCcr3zXb5Uo/TOUufiEgqRhdDqrgm jszA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752599528; x=1753204328; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zX2E9CJLjE4PohuBpUN+R9rL0cWenzXEOr6BtB3+Zw8=; b=HBJFtQYrui2dNR8snPOaCzZZUFF/Fr/I/3s3lPU/ScdII/k4PjMCdyj2+CqAaIG91z ZuCSPci8xUJe0jVuOgzPiFD9rZr8jT4X3NJHGK5Iqn+vEPwUSQwf6Ar4cNJ0npcuqR73 aKRwUewLqB754dtR+VKRxPS3Oo6MXQSAUVjD0AWK9FfF2wukYpw2Dcf9Be9NmZKxKPoh pnzbiBGyEAc+PmxcRblWZgIWryyAWyaLmiWj8ogSlArfQGyTiTDq80KBcf6SJrBxDkir UCvU7Z3rX3YIKT1lMVxWeAM+HjaelreYeyGIc1RI4q2V9v12V79e90nfOq2gBPSpzKUc Kwpg== X-Forwarded-Encrypted: i=1; AJvYcCW8Iz79QGkFKeyMwmv98VANeT3dFg2tC7g/CkhfsjnaCIOcfcVFM76NlpKBWPsWp/Jis9+q/XCoT3Jk9R0+@postgresql.org X-Gm-Message-State: AOJu0YyuR0q+iGOfrfoZaRh4GPQY2e2/qGFT1EEJ/aDiPzPPsPWfMkPP LnIs9Ev+MIT6ByhTF5iCdrk7pl1Fvj1LXWnUoEFDXft+thUqijVZ6hXo X-Gm-Gg: ASbGnctCAR+4Ak/hZww478qlOm5KyFMB4E1AOohaTKLxFzbyqK/+QLD252AjBHI+51f i+ZPEqE5VmRz8QAdeXWmOv5iPhnmHwPO575kAek8jzf3defaezyPy3ZgGnwKj4XXZgJCziYOVXR KMLCLxtFMCVP02IgJ4T180UO26E0OAJkfYA2MAz5pQUt4vvnMMbpXtNPKmtlRcwMPIdHGiPXcCG VRR6HPbARP6eJy+8y8vq+sPevHj7MOsDovIA1nJ7PV7JfZhF+66aqitGFzRY/FSDgzr7Bl8DWZj kvlnVRkfZVwPd8vwJgmP0QaMDhf9u7mLHW7/+eaa6gHPcqEPMp+anPppb+7M5pSlx8q6XlIiWak bo7fqwb8lQ4NijQLYqi6UisistAKd9C3viv6UpyyIkmXDq+wyyXrT1XZMT4peRGH1FnRIwplRj1 WglEwqEV+KChF/ X-Google-Smtp-Source: AGHT+IF4S87wifFU4P967cmI6wRO5c3EXJ0W0HpFSupXDfh1xvnE6aLxKlnITfk736fo8nM/7VemTQ== X-Received: by 2002:a92:ca09:0:b0:3dc:7f3b:acb1 with SMTP id e9e14a558f8ab-3e25426be83mr140240235ab.13.1752599528138; Tue, 15 Jul 2025 10:12:08 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3e24626152asm39222275ab.68.2025.07.15.10.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jul 2025 10:12:07 -0700 (PDT) Date: Tue, 15 Jul 2025 12:12:06 -0500 From: Nathan Bossart To: Sami Imseih Cc: Bertrand Drouvot , pgsql-hackers Subject: Re: Improve LWLock tranche name visibility across backends Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 15, 2025 at 12:06:00PM -0500, Sami Imseih wrote: > On Tue, Jul 15, 2025 at 11:57 AM Nathan Bossart > wrote: >> I was imagining putting the array in one big DSA allocation instead of >> carting around a pointer for each tranche name. (Sorry, I realize I am >> hand-waving over some of the details.) > > I understood it like this. Here is a sketch: > > ``` > dsa_pointer p; > > dsa = dsa_create(....) > > p = dsa_allocate(dsa, LWLockTranchesInitialSize()); > tranche_names = (char **) dsa_get_address(dsa, p); > tranche_names[0] = "my tranche"; > tranche_names[1] = "my tranche"; > ``` > > We will need to track the size and resize if needed. > > Is this what you mean, from a high level? Yes, that's roughly what I had in mind. We might need to employ some tricks to avoid a limit on tranche name length, but maybe that's not worth the energy. -- nathan