Re: pgsql: Add function to get memory context stats for processes

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Rahila Syed <rahilasyed90(at)gmail(dot)com>
Subject: Re: pgsql: Add function to get memory context stats for processes
Date: 2025-04-22 08:11:43
Message-ID: 8EBFBFBC-DAC2-4521-AE16-069F7FD8EFBC@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

> On 17 Apr 2025, at 16:42, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Tue, Apr 15, 2025 at 6:11 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>> There very well could be a CFI - but it better be somewhere where the
>> in-memory state is consistent. Otherwise an error inside raised in the CFI
>> would lead the in-memory state inconsistent which then would cause problems
>> when cleaning up the dsa during resowner release or process exit.
>>
>> What am I missing here?
>
> I think maybe you're only thinking about gathering the data. What
> about publishing it? If the DSA code were interrupted at a CFI and the
> interrupting code went and tried to perform a DSA allocation to store
> the resulting data and then returned to the interrupted DSA operation,
> would you expect the code to cope with that? I do not believe we have
> anywhere enough guarantees about reentrancy for that to be safe.

Do you mean that an interrupt handler will make DSA allocations? I don't think
that would be something we'd want to allow regardless of this patch. Or did I
misunderstand the above?

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2025-04-22 16:58:28 Re: pgsql: Add function to get memory context stats for processes
Previous Message Michael Paquier 2025-04-22 03:42:16 pgsql: doc: Mention naming convention used by injection points

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-04-22 08:13:53 Re: What's our minimum supported Python version?
Previous Message Nikolay Shaplov 2025-04-22 07:45:15 Re: [PATCH] Check for TupleTableSlot nullness before dereferencing