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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
Cc: 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-10 13:31:00
Message-ID: CA+Tgmoaey-kOP1k5FaUnQFd1fR0majVebWcL8ogfLbG_nt-Ytg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Apr 8, 2025 at 5:10 AM Daniel Gustafsson
<dgustafsson(at)postgresql(dot)org> wrote:
> Add function to get memory context stats for processes

Apologies if this has already been discussed, but what is the argument
that it is safe to do everything in ProcessGetMemoryContextInterrupt()
at an arbitrary CHECK_FOR_INTERRUPTS() call? We have
CHECK_FOR_INTERRUPTS() calls in some quite low-level places, such as
walkdir() and copydir(). I don't think there's any guarantee that it's
safe to perform DSA operations at an arbitrary place where
CHECK_FOR_INTERRUPTS() is called, and I'm not even quite sure that
it's safe to assume that the local memory-context tree is in a
consistent state when CHECK_FOR_INTERRUPTS() is called. If there is
some existing discussion of this that I should read, please point me
in the right direction; I didn't see anything in a quick look through
the commit.

Thanks,

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2025-04-10 16:17:19 pgsql: Further cleanup for directory creation on pg_dump/pg_dumpall
Previous Message Laurenz Albe 2025-04-10 12:51:30 Re: pgsql: Add function to get memory context stats for processes

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-04-10 13:35:24 Re: Add os_page_num to pg_buffercache
Previous Message Bertrand Drouvot 2025-04-10 13:17:55 Add os_page_num to pg_buffercache