Re: DSA_ALLOC_NO_OOM doesn't work

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DSA_ALLOC_NO_OOM doesn't work
Date: 2024-02-22 00:05:04
Message-ID: e6b13c4e-2924-47f9-9f95-0cfcbfa265c7@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 22/02/2024 01:03, Thomas Munro wrote:
> On Thu, Feb 22, 2024 at 10:30 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)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)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kyotaro Horiguchi 2024-02-22 02:46:00 Re: BUG #18354: Aborted transaction aborted during cleanup when temp_file_limit exceeded
Previous Message Thomas Munro 2024-02-21 23:03:07 Re: DSA_ALLOC_NO_OOM doesn't work

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2024-02-22 00:13:14 Re: Patch: Add parse_type Function
Previous Message Michael Paquier 2024-02-21 23:59:03 Re: Add lookup table for replication slot invalidation causes