From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: DSA_ALLOC_NO_OOM doesn't work
Date: Thu, 22 Feb 2024 02:05:04 +0200
Message-ID: <e6b13c4e-2924-47f9-9f95-0cfcbfa265c7@iki.fi> (raw)
In-Reply-To: <CA+hUKGJe+8Qr+tWDVuMqCO++SW=LDLJRH8O+XdUcVEkm98JgYw@mail.gmail.com>
References: <5efa4a5e-2b8b-42dd-80ed-f920718cf5c0@iki.fi>
<6030bdec-0de1-4da2-b0b3-335007eae97f@iki.fi>
<CA+TgmoZB8cZn5ezyNGZdDOj62Cp2P_2ZAoZkB+qiYiA93=ud7w@mail.gmail.com>
<cf35fccb-957e-48de-8ea0-a083e9d7843d@iki.fi>
<CA+hUKGKYqo0POxm9QZtTeLH_HUHvg0vBsW3SunjKeY5jo8i75A@mail.gmail.com>
<CA+hUKGJe+8Qr+tWDVuMqCO++SW=LDLJRH8O+XdUcVEkm98JgYw@mail.gmail.com>
On 22/02/2024 01:03, Thomas Munro wrote:
> On Thu, Feb 22, 2024 at 10:30 AM Thomas Munro <thomas.munro@gmail.com> 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: hlinnaka@iki.fi, thomas.munro@gmail.com, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: DSA_ALLOC_NO_OOM doesn't work
In-Reply-To: <e6b13c4e-2924-47f9-9f95-0cfcbfa265c7@iki.fi>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox