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 1rcwaO-0032nC-O8 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Feb 2024 00:05:13 +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 1rcwaN-007I17-AN for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Feb 2024 00:05:11 +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 1rcwaM-007I0z-T6 for pgsql-hackers@lists.postgresql.org; Thu, 22 Feb 2024 00:05:11 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcwaI-000LVo-UH for pgsql-hackers@postgresql.org; Thu, 22 Feb 2024 00:05:10 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4TgD0x0d0wz49PyJ; Thu, 22 Feb 2024 02:05:04 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1708560305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DmZgPpLM7ZvHFtydQv6IOwTcLZJFJKU/Svvrc58Bydo=; b=HpM8A98nKTmFcLf2525HpwTctnSBOSwi0bDivWa08RLAnHbppTiY2eYo5SMvjc4a0ExsDZ fYkHKs207SF3dE1I1UgdYXeBnrZMbW3CbNGOBthUT8Tc9bzH9fJoWvj7xMrYSsVBuiNq5Q vdvEDv4q4vBKHxgETFOnoQflpE3UbkuTfV9qW9YMyxoDkZ3nsBOk3m10K1B5wzkEv8CBUY WjPTOuXyFcdRsFZyjg2sSy03f4sKGHMO5TJHAnjuyTUmsMyDApJmOFYR2xmtmad963Bydu usinKu6tFkZcs5EDILEovr6XDCAoxSWzkB76VxQAiIbIynf6VMdZi+Dnnd6oLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1708560305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DmZgPpLM7ZvHFtydQv6IOwTcLZJFJKU/Svvrc58Bydo=; b=n2gqXTWpKA3gDgKtY9ch0Yx4/zpFBd6egX3sy4W9k2yiTJMscQLzmuBKoptY4VQeaymeLm E8u3opjwGVyW9WPIu5KJ0h87xIhoE3lO9JAqkvojsaLl5gr9ykMi5HE+XyMbxJgXOVj//F SUpd9gkB4W8gho7Xpz+r8//Ew2EHoxGvrLLao8lKuOqxNKypGLzCdgHl+xDVh3XZY1g7+f F49pXGtuUhVfE1YDBta/SaZ8j9cFW9Bcj/vb1BvgbeMovAJ54OfV7cT7fWUwlcu0iGqgey vAzyeUgPVSOPwnIzKMeg/ZmpDSfHYxXXNgdtN8CNfNAuDGjTnmAUsn6DaxH+CA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1708560305; a=rsa-sha256; cv=none; b=W88bKm2lJE1qsZfO7Pvax+DEF9YkftBgrJI7e0Jat1LJALghT8e5ozdsGyiYZFcCnjM3xo Vq94Sp2DyWfVGiFwmY279NdqVcKRljxvfvQ4pO34cTon7Mi5nBMjX+MeEAfq4oUZi/EJUX 7taleuZoxC9sC9hRps6MQrM/yxDjyCF1gRXxMjQZ0UX/fdpQ29gd/TTQEhHEoI5Bh1T8v1 VAd6tTBTF1yr0GPYaWc2hXGP3/9VTqGq9S4KqyWfSjsm4JlwE99ijlbgIMq2v3lZMfswrQ 80AdJvDRO2PxhajfKhUSbDTKfernPmxVjySwtRMeR3sKXOKIvC8lT8lXlEGb7w== Message-ID: Date: Thu, 22 Feb 2024 02:05:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: DSA_ALLOC_NO_OOM doesn't work Content-Language: en-US To: Thomas Munro Cc: Robert Haas , pgsql-hackers References: <5efa4a5e-2b8b-42dd-80ed-f920718cf5c0@iki.fi> <6030bdec-0de1-4da2-b0b3-335007eae97f@iki.fi> From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 22/02/2024 01:03, Thomas Munro wrote: > On Thu, Feb 22, 2024 at 10:30 AM Thomas Munro wrote: >> collisions arbitrarily far apart (just decide how many bits to use). > > . o O ( Perhaps if you also allocated slots using a FIFO freelist, > instead of the current linear search for the first free slot, you > could maximise the time before a slot is reused, improving the > collision-avoiding power of a generation scheme? ) We could also enlarge dsm_handle from 32-bits to 64-bits, if we're worried about collisions. I actually experimented with something like that too: I encoded the "is this in main region" in one of the high bits and let the implementation use the low bits. One small issue with that is that we have a few places that pass a DSM handle as the 'bgw_main' argument when launching a worker process, and on 32-bit platforms that would not be wide enough. Those could be changed to use the wider 'bgw_extra' field instead, though. -- Heikki Linnakangas Neon (https://neon.tech)