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 1w71TB-004sib-3C for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 01:31:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w71TA-000KtH-1s for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 01:31:08 +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 1w71TA-000KsL-0x for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 01:31:08 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w71T7-00000001j9s-3RGE for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 01:31:07 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-7d8b2703f37so3736555a34.1 for ; Sun, 29 Mar 2026 18:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774834265; cv=none; d=google.com; s=arc-20240605; b=Plalwo3Gyh/V33AnZiL7qYviC3PBFKoitN0AUncPyh9BCJqDWi8c1evC6YUUUz1MPM sXzQ8r5qJGGyffwz7U2WMG5vbA6C67d1HB0RUKjrFXs03ry46kRSG1sw8b0VEHS9+3IH zIwZbtrRzKynkzDUbOJdsJKFf4MuWLkoJuOFw5K15T1WXydz+l/eDnzmSI9O+R3zd76s qQoFeydxs7tafCuH0j3/IijkVWj8yEN/8r6bzRXdXPeKCZE0eTLPkq+xr1jHCGJ38+Z8 P0hpzSs9jBHfF/Y6te0NhjKoEos9sji+CAkQ1i8QZ04+abA9QW46uY3mC+K2CzHTOHHF L87w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=96Y995sawBp3zqHi3l8xg1QnnlS+CXSnY5ic2qzUr+E=; fh=2BCvbiqnfUHUdzorlXM6x+zb2cDUDpbmgPCt/rktAfE=; b=e0fCfpIUTdvE1f2b2s8cExsdbVkQJRbdRudTlY2lsSar6l7dSKiN1oP0IN/AY6Y7/s 4EmRKD0jLJ3WbCqtJ40YMRZO87A2hGjZMsnSEyqT39AQi3Lumq4wrwiu5RhY/AaFz6Gq RT5721lNpOdnQitJHlgjKcFQA30OicenW96iAN3hhB/+2+6iQBV4BGNG8om6CWUZiaes B/DRP/KIJ6KqR6p+vst9fAVcOTOAM47NDOGcOK/wF29BgolRmbAnk6ytuIE1xyqblhEh UzVRes4nZXVNdBUbICjDRKIfluJlSwOkmI5WxC6M3MoyrSuBwhxqbsDJ1yrhCNpothm7 Uyhg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774834265; x=1775439065; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=96Y995sawBp3zqHi3l8xg1QnnlS+CXSnY5ic2qzUr+E=; b=VTWAcRz52lashas0l5OiztSXK3dprAhRuOi24uo/C8c0OMl6sGSbnZZyQP/4qubBWw 4hOMV+K684nbn0FlyJsbYSSJO6blVNPirYiMh1nwCbhUWk5ZDvwA5AAzSpv5lv5gtzrj SkXVFzTLd4R51NuYakpK08/MnmrKqRS6aBKEywW3UXJItPk8KVuBFx3yPGhm9pkU5Zgh CcK32W9LouftAAWJjw+dope34e4Fu03/NOXMsVETCLdbO7IJILWeZe3QvfYWD921uVRn 7XvaxBqplDO7agkkI+NLx4GsFsXaCaWr6Fw8zri7/ugDzw8SxvOfwLmUQ5YabcDBKlO8 xoxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774834265; x=1775439065; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=96Y995sawBp3zqHi3l8xg1QnnlS+CXSnY5ic2qzUr+E=; b=tXtqdjMtvmT/rfHOWEYFI2bqllOXpKJts9BcUY2KJdI1OD7aGI+j6wm3u64Fe9x2Ep qjGTJWwIOBbmWpsHroO0+zDG5cNkSBrNSZTy/oWQudf6/bnVsoyMKutKQS3nOiDZ52AA 0CJ2r//KlstZDVbVSpN4RTDhv1dRP1DWFk4p7KKERIYTvEsoFohsqh6yEqgslAe/H53n g5RPcweIh3hRN6CT0h5AsVOrq99RNnJJ4WmkJY9NFmeTSoDOSs6qOrqFtna0YGOzrxhu f9ePLr5a7CfvBP4f7RU20X9Gk1wpa6ZUoDINDmkC33sMbp56nJ8DehByNOP42fpE+R4p e96w== X-Forwarded-Encrypted: i=1; AJvYcCX+/NRYirzYhJSG25+NE1sK7r0ysOGRB5PEfe+cTJc+RguuSAZ8LltSowE0YzHcOOxcelqDN971zM/QydLp@lists.postgresql.org X-Gm-Message-State: AOJu0Ywz7TuG1eynf6KnrL32M2c3ShWjr0c/0ALyXSjdvBeCvtxM4eSm obX7qZOIeoY375V3uSB1SkVk0mJ3ghH/9MCdIMr8cbQkEoyUtOqVFizJD3ed3I0sSCq/17+jokD hEMgFtan2N9UFY982okoAFaQVVAuKKMY= X-Gm-Gg: ATEYQzw/wqKmLrmMDEaSXe/xuMEZ8qBK9A12Z43M2d1bmzArq9C4PwqaLe1CrciuP4G G91kR1CY7Ow2fKJfasFA+nNDStKXMVjEPIHFA+fkgWEx8zaYkEaBmlno5EjVcdiBSkka/94XcWb JAxFUrN7yJWStU3Czc0i8axdQLkY4pDasCS5mGWjzr3S4B1Jw+MzgjROlLzvkGzWqYdzUV7jKme J4TpCaOPh40h2YNgWWQkdk7QS2PhPqZRJtV4UAuuJeoCt5XOLrn+WwWQi94zkRA6lMIEl2a8HS9 YwS56kUokiHO9sQNZa8CCnQ9Q2bnPCsys08ZiQ/gdICCMag3YQ== X-Received: by 2002:a05:6820:1a0b:b0:67c:29e6:a5e with SMTP id 006d021491bc7-67e186ec82emr5566275eaf.47.1774834265188; Sun, 29 Mar 2026 18:31:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bharath Rupireddy Date: Sun, 29 Mar 2026 18:30:00 -0700 X-Gm-Features: AQROBzDbZuFclgB41vBXj5R466wznuwUoxklM_TXXkiShs3s75tweaenwegrR9k Message-ID: Subject: Re: Avoid multiple SetLatch() calls in procsignal_sigusr1_handler() To: Fujii Masao Cc: "Drouvot, Bertrand" , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Mar 29, 2026 at 5:30=E2=80=AFPM Fujii Masao = wrote: > > While reviewing the patch in [1], I noticed this issue and ended up here. > I agree with the approach and have attached a revised version of the patc= h. Thank you for reviving this patch. > I understand the concern. There's no guarantee that PostgreSQL functions > behave identically across major versions, so removing redundant SetLatch(= ) > calls is generally fine. However, as you are concerned, extensions might = call > these functions and implicitly rely on the extra SetLatch(). Since the pa= tch > doesn't change the API, such behavioral changes may be hard for extension > authors to notice. Also they will be not in release notes. In practice, > they would probably catch this during testing against a new major version= , > though. I'm still +1 for removing these redundant SetLatch calls from the multiplexed SIGUSR1 handlers. It not only keeps the signal handlers consistent but also avoids an additional function call and memory barrier from within the signal handler (a micro optimization). I reviewed the v2 patch and it looks good to me. --=20 Bharath Rupireddy Amazon Web Services: https://aws.amazon.com