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 1vgWdE-00EmlY-2V for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 23:20:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vgWdD-001p89-2o for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 23:20:00 +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 1vgWdD-001p7z-1p for pgsql-hackers@lists.postgresql.org; Thu, 15 Jan 2026 23:19:59 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vgWdA-000eMD-2C for pgsql-hackers@postgresql.org; Thu, 15 Jan 2026 23:19:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60FNJfr6938363; Thu, 15 Jan 2026 18:19:41 -0500 From: Tom Lane To: Andres Freund cc: Chao Li , Kirill Reshke , Heikki Linnakangas , Melanie Plageman , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Noah Misch , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) In-reply-to: References: <9C2494E1-F446-42DF-B070-7E231B8E6221@gmail.com> <58821140-0182-4FF3-9A4F-5B168DDB9243@gmail.com> <732580B4-962F-4EBD-8811-F4667D79747D@gmail.com> <934395.1768518154@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Thu, 15 Jan 2026 18:16:07 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <938361.1768519181.1@sss.pgh.pa.us> Date: Thu, 15 Jan 2026 18:19:41 -0500 Message-ID: <938362.1768519181@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > Can't quite decide between just using always_inline - after all the buffer > locking really is a rather crucial code path - and just initializing > wait_event to 0. Either seems better than using a default:. Yeah, I agree with not using a default: in case we ever extend the mode enum. I'd be inclined to fix it like this: case BUFFER_LOCK_UNLOCK: pg_unreachable(); + /* silence possible compiler warning: */ + wait_event = 0; } regards, tom lane