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 1vRBnk-008vJQ-26 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 16:03:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRBnj-003N1l-21 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 16:03:27 +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 1vRBnj-003N1c-12 for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 16:03:27 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vRBnh-0037vx-0C for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 16:03:26 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7c75387bb27so499642a34.1 for ; Thu, 04 Dec 2025 08:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764864205; x=1765469005; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=k5kucgfnoIOOkploQfh8gRqQRBoSmWOg15urA8ZDedE=; b=hGsZIuy8twUnYe0pWKGuTLRedr5WSroJlqgNg2+Yk3N/0ssUiz/+R3668mRGI89xFJ lLYRxi4fJEMSLQ1Ia9ubC4rnFdYaHo25+n1Rqck5oPn7Tvay5AOifXPdCHCVcCuQ6tPx q4iRcC/EwsfQBA+yb701BgJHfdEFj4fRqRDkEXiO3PDlmzM3k9ztaQeEU60eANSkWidi S+ZJRM1agMtNeGJ1ZlWvnhAKztl2TeHi8f9X7SSQsumJU1DAJXN7Ri8z7C9gv1GUCmB6 SJqFYffwLYzbjrddwFSoHKaQENAPOtW2NGp5fBySRAmwCV53ADBR4CdWUHE4bGs8n72W xIhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764864205; x=1765469005; h=in-reply-to: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=k5kucgfnoIOOkploQfh8gRqQRBoSmWOg15urA8ZDedE=; b=S2cb6tuW4BomcCE45P3X1arHwVDvuX3fYu7byKggfP1tg6wACA03mBfeVebKWM8m+k JJXKc4jKdKX2VII71cVmlA2/zuiWvyg9uiKVE2h9aLTGPDv2/XkYw/45OCCl6tgEtSej tgs4RtGbsT6dA3tCvVNeAb3CqLZh5jeWIKD/FvhtILHMBIIhCfBY4vOfySNWcl8mNFVz blmBF2MlW3Y93+VaL4TcHiRmNkEZ3eiVDb5BP2rny3dHvokSHkaLPflBIFhlwxSTvFOG Ft/qabUkoJpY/yML3W3WDbR52tgolioBNkTQTJKm9soJ2XLmPSy9K9BPjavz3WuX98xO 8BsA== X-Gm-Message-State: AOJu0YwMN2uM71An7WH0m23Dq7Z+xakSZl4Z+iZ3icM4TIxqORHohlmq Nrc1z148b5DBlli4Tjnz+MTz15CXztKIE01Av2Pykx+hh8MAWO9cJkOw X-Gm-Gg: ASbGncu1c5jCj5Dtjab8LB2cc8oTwe2PsFHHBxE+hpG8oOsMBKJ4LiNolI8WSkefXCl xlr+C9PdgoiLj3ECCw9eaMe4D9XA/oEzc/n5eqCLlSZHMM2T5SvC7sMXo/NjFbQ8KqigTckSzO4 UzaiwOIIxWjeSpxxZs1D2r7sc4gx0igv8yhZTizz23WDspmv1dEv7leUeb3yG10dXaEMzDUTv2N GTN3xYyS794i0PR5b1B82gpk96i8Rk9xrtbYTO+R4haRkQbWSPTMv3BOCaKFk48ZIKrD8XswSNC acOvMpRd0SiFDJyYS5S2zSjwM77rEjJdcguVT//UUs8sXdfAzjm0g2FqG1tj0iW8EMhp4wVVh7I 1FrGxQHqGtUYjUiKAiaIRmz20xVg2uLpI6vgymOPypqS7jLbr4IBHBL86m3RO3FH8cJUk4G4MuD 86J2faLOcJkgdXyZdj3yUHXanIpNTGtzWFUw3XcsNOMkSz9Hbh5lQKJnDaQQkicHep/gFkFDOmn Xtt X-Google-Smtp-Source: AGHT+IGmgRX3MRQ+XzDIY60KbJ+p1qCy9ZKjzzrkHSKgqEj9RcrceG9V7SgU5fj38C2aR+QS8Di8Bw== X-Received: by 2002:a05:6830:2b0a:b0:756:a322:311 with SMTP id 46e09a7af769-7c94da53338mr4220346a34.10.1764864205144; Thu, 04 Dec 2025 08:03:25 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7c95acd733bsm1598133a34.26.2025.12.04.08.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 08:03:24 -0800 (PST) Date: Thu, 4 Dec 2025 10:03:22 -0600 From: Nathan Bossart To: Andres Freund Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Add pg_atomic_unlocked_write_u64 Message-ID: References: <6a7i4g5rroen3jyok4jxpd76tpg7nkicq4o75cdprp5thdlkbn@dfwr7ts43rsm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a7i4g5rroen3jyok4jxpd76tpg7nkicq4o75cdprp5thdlkbn@dfwr7ts43rsm> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Dec 04, 2025 at 10:56:12AM -0500, Andres Freund wrote: > The whole point of the _unlocked_ function is to use it for modifying an > atomic that doesn't need to actually be atomic when modified by that > function. The current use-case for it is to to modify BufferDesc->state for > temporary table buffers. Those obviously can't be shared across processes and > therefore don't need an atomic operation to be modified. In the referenced > thread I'm working on converting BufferDesc->state to be a 64bit atomic, hence > the need for pg_atomic_unlocked_write_u64(). > > I didn't notice that the comment for pg_atomic_unlocked_write_u32() makes that > claim about partial writes not being visible. I think we should just remove > that claim. +1 to updating the comment with this context. -- nathan