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 1vsltX-001Wsq-0m for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Feb 2026 18:03:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vsltW-00HEf7-0a for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Feb 2026 18:03:26 +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.96) (envelope-from ) id 1vsltV-00HEez-2W for pgsql-hackers@lists.postgresql.org; Wed, 18 Feb 2026 18:03:26 +0000 Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vsltT-00000001OuD-49eQ for pgsql-hackers@postgresql.org; Wed, 18 Feb 2026 18:03:25 +0000 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-40423dbe98bso21068fac.2 for ; Wed, 18 Feb 2026 10:03:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771437802; x=1772042602; 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=17UVOBjxfKKKzvULzuX5AkHt/+OPrQW2YidX1TAJVuY=; b=QqdN7zB6WlgCIthpDkUfx3QOmgW6O/ua4PB3qhAHctJ8bZAPqZwRsr07b2ZrP5/mTt c49615ds5SjPVUE78+8hG/vhEL0g1+j23U+2i+90j8jNWxyoHm/QyKmyAIu6wAnUJ4sO Wo+q75eOU9Op7x0e6/3144lUaDTHxH2ROVqI1xf4I4L2dve2f4eePoN0+35YK69Yb6mr /YU7spdJXrWZaB2OysBzBVW2xNPJbVGVtnFQV2U/OQLcxjB/yk2EcnN1m1oIgiqqCImX 9U+MAhuVsb1qzXWcbc8Xjj7ytezHilzHe2bWNz2RFesagKV5OWWtFsid5F4Fz0vyinwE AWaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771437802; x=1772042602; h=in-reply-to:content-transfer-encoding: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=17UVOBjxfKKKzvULzuX5AkHt/+OPrQW2YidX1TAJVuY=; b=jeXLVrBNbkiBUrSm+P3o0boPUcqM6H28GB/z60x5nTT1/LeIsAScLWMiwlRXcD8jWv PxRsGd8vG+LBYMpCHKGNaTiqOki3QqEkLGNRJanwslvKdRKyx1ZGhqDSTDPQILIX0mOt wM0fCZ9w0tWwXppzhbDZq0SoF8QSaGQKS/EUOLc27jUdX4MMDuYv16v6nMfOCmxiGxEi p0LKXK+Ely+JRBLKBb1lCASc0w7rTo8MJuindixCqzErdjFCDfGdKl76jyOjdabuy3s6 8rM8GskEuiZt5MTyfFHmLNotfcsl3QXFvQupli4aLLkypODdaGbMz6Z3+tdqC3kkHA1C qp9A== X-Forwarded-Encrypted: i=1; AJvYcCXjj8UtK2agkz7Ykox+HDVwePyuQqLycO3EV32og/RRA9La/CWLJA913AInaRr6aOMIOweMHxuWDCord8to@postgresql.org X-Gm-Message-State: AOJu0YwdkBWin6hIpVkYPr2Y4h5BRabGUI/g0ONpszgkDPaBY0nw8fEw GscIYLbRzLwMjegBzUK43aAWKS2PAMaaB51cuBt7eaaj2EkDNKYAn0nde4NuoQ== X-Gm-Gg: AZuq6aIz3KOrq4Ui+Ae9P/vCaQwYmB3CrmCQA70RJZXSyq4geBGZmP/B0J3DAdAoEgj Q7k4/f6kKBO6s/wvZ93paDsPmKnIWLd4gxLl821OaNaWeAkZ7NTiyHWosxmNU54WoN+PZy5ML1+ dBzZzd2VrTFC2nP2wXm3xJTZYkUrDGR214E6YIq2YCIQSY1dQJ7tiLgPr+8eikTBGraWKmhezzl fpAtN9KsFfCMKEE08srq1ohfV+ALqPWPraVlH27sGyxX3sMBYStKeSgf7yOlTjeOIPEqDVhviN1 d8QgYcN8sq0SZHtwUfQAUhJkh+s4kk0WnCvkv3bfRNUaMnUAYoF5sUJzS2wmSg8f3ZW1Hniebf4 39zw3EGYnOXmlceVvrXPb8/9M2AOFAu84G5yvHo38J7RXlD26QEt4VU5zaBQPuJ5kGU00sPO5VW hTleVnmxUPwoOIbgVcBvkbfa6VinYtOEqpB5NtyeRoGaPQD8GYrE5DjeIhhYL4q+4PhaYcVZ9Qu xfGRSDToHmal264H212FP8L6ek= X-Received: by 2002:a05:6820:4a11:b0:662:f8a9:9f7 with SMTP id 006d021491bc7-6785a153f21mr5935231eaf.37.1771437801487; Wed, 18 Feb 2026 10:03:21 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-678b13aec01sm8540972eaf.8.2026.02.18.10.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 10:03:21 -0800 (PST) Date: Wed, 18 Feb 2026 12:03:19 -0600 From: Nathan Bossart To: =?utf-8?B?RmFicsOtemlv?= de Royes Mello Cc: Heikki Linnakangas , Andres Freund , "pgsql-hackers@postgresql.org" Subject: Re: convert SpinLock* macros to static inline functions 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 Wed, Feb 18, 2026 at 02:52:46PM -0300, Fabrízio de Royes Mello wrote: > On Wed, Feb 18, 2026 at 2:28 PM Nathan Bossart > wrote: >> However, as soon as I did this, I got a bunch of build failures because >> various parts of the code still use volatile qualifiers quite liberally. >> It looks like most of these (e.g., see code from commits 2487d872e0, >> 966fb05b58, 4bc15a8bfb, and 4db3744f1f) predate making spinlocks compiler >> barriers (commit 0709b7ee72) or were cargo-culted from code that predated >> it. So, IIUC, it's probably safe to remove these volatile qualifiers now. >> We could alternatively add volatile qualifiers to the new static inline >> function parameters, but that seems like it might just encourage continued >> unnecessary use. > > Just wondering if there's some code-path that uses it inside > PG_TRY..PG_CATCH that can use longjump. I didn't notice any such code. For reference, we only need "volatile" in PG_TRY..PG_CATCH code if a local variable is modified in the PG_TRY section and used in the PG_CATCH section. -- nathan