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 1qM9r5-001XcO-7Q for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 16:16:47 +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 1qM9r2-007Wa8-L8 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 16:16:44 +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.94.2) (envelope-from ) id 1qM9r2-007Wa0-Bx for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 16:16:44 +0000 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qM9qv-000LAx-1y for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 16:16:42 +0000 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-55e1a9ff9d4so594049eaf.1 for ; Wed, 19 Jul 2023 09:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1689783396; x=1692375396; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IYw70924sFdrfcV7uUhzF5SOTWg9gHt+Qi4wSzFfKAI=; b=PKFe1lqgU5OXtsWdsmjxtuRLt4agi/6KaOXQxOJgOLEjUiEsMcsPr7g2KprNKSIGoZ IPdk6YyuPuy0peTsT/NTlYnG38P2U64URcpKYthNq087HedxppjEb0DBUB8xeyuIR54x qyy4pJs0/Xh++ugT3c+U1VV9XNmLJFf5u8cvJ/jwPdd2/2NG2JYhw04vePfgHPqZ65J2 3p1OhfvfIWUtpSjFjYN/dN0jnezEK3+egjvhuXYH5NXaJ/ecWU932ih2mijFwXXG3/KE EHHxQT7FSKZnYzRyeJH6ZmkkcU/ECZjN6v5sRAlMxRWIFMD/Yb46r/KNkFSLqpt+vMX/ MoCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689783396; x=1692375396; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IYw70924sFdrfcV7uUhzF5SOTWg9gHt+Qi4wSzFfKAI=; b=Ihl/qgUmbJ99Av2UWqErJmup3VrO9iPgg6jsuc1NlbNxbVvOAgjHRo4U7sn+QHicch 2UvCRHR1rlBq76WuWl9ywmGjYGs0osKFl89S9GTBJyRQYcNzTuMnJvUHb3d2w13Tv7gv fDloZpgpaViiyfoFeV0BGkPBMgYqE65ZRCNFxGewpAeDhMmWxb06uSbkWqfwHftNiRBX vs64vt3GIonDMQIsQqt/uYzwj866Yr62xdJ+ita8y5j6AwdzawsJLbS7U+WAnUvJtPtG 6Lzo1rC2g7EIJ7bwUsokJBEHVeJjFlKfJ6jxQIRmAfmtwjRcfytYC91K0r6LDhl267Jo CUSg== X-Gm-Message-State: ABy/qLbhrd4D1vIWac1pGTDClYbLf5lWBLZ6IvJ5zkPQxCXZqeUnq0IS BQd9Y5wHXUax1pWU+Z8OSz8dcg== X-Google-Smtp-Source: APBJJlH6aO2moJS5DN6UKgccGxn1tgsblVXWVvCGHOzu+Dlvi8xbPaLD+9SrSBQciCsLhR7kGVg73w== X-Received: by 2002:a05:6808:dde:b0:39f:f42c:863 with SMTP id g30-20020a0568080dde00b0039ff42c0863mr1573982oic.6.1689783396363; Wed, 19 Jul 2023 09:16:36 -0700 (PDT) Received: from localhost ([2607:fb90:f280:130d:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id bj8-20020a056808198800b003a0619d78ebsm1894526oib.55.2023.07.19.09.16.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jul 2023 09:16:35 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Wed, 19 Jul 2023 11:16:34 -0500 Message-Id: Cc: "Masahiro Ikeda" , , Subject: Re: Support to define custom wait events for extensions To: "Michael Paquier" From: "Tristan Partin" X-Mailer: aerc 0.15.2-105-g00bf476582f7 References: <135feae32cd28f9fb555fe46acb939a0@oss.nttdata.com> In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue Jul 11, 2023 at 6:29 PM CDT, Michael Paquier wrote: > On Tue, Jul 11, 2023 at 12:39:52PM -0500, Tristan Partin wrote: > > Given the context of our last conversation, I assume this code was > > copied from somewhere else. Since this is new code, I think it would > > make more sense if newalloc was a uint16 or size_t. > > This style comes from LWLockRegisterTranche() in lwlock.c. Do you > think that it would be more adapted to change that to > pg_nextpower2_size_t() with a Size? We could do that for the existing > code on HEAD as an improvement. Yes, I think that would be the most correct code. At the very least, using a uint32 instead of an int, would be preferrable. > > From what I understand, Neon differs from upstream in some way related > > to this patch. I am trying to ascertain how that is. I hope to provide > > more feedback when I learn more about it. > > Hmm, okay, that would nice to hear about to make sure that the > approach taken on this thread is able to cover what you are looking > for. So you mean that Neon has been using something similar to > register wait events in the backend? Last time I looked at the Neon > repo, I did not get the impression that there was a custom patch for > Postgres in this area. All the in-core code paths using > WAIT_EVENT_EXTENSION would gain from the APIs added here, FWIW. I did some investigation into the Neon fork[0], and couldn't find any commits that seemed related. Perhaps this is on our wishlist instead of something we already have implemented. I have CCed Heikki to talk some more about how this would fit in at Neon. [0]: https://github.com/neondatabase/postgres --=20 Tristan Partin Neon (https://neon.tech)