Hi,
On Sat, Apr 05, 2025 at 03:23:38PM +0200, Tomas Vondra wrote:
> Something like that. But I think it should be "align the size of ...",
> we're not aligning the start.
>
> >> - There's a comment at the end which talks about "ignored segments".
> >> IMHO that type of information should be in the function comment,
> >> but I'm
> >> also not quite sure I understand what "output shared memory" is ...
> >
> > I think that comes from the comments that are already in
> > pg_get_shmem_allocations().
> >
> > I think that those are located here and worded that way to ease to understand
> > what is not in with pg_get_shmem_allocations_numa() if one look at both
> > functions. That said, I'm +1 to put this kind of comments in the function comment.
> >
>
> OK. But I'm still not sure what "output shared memory" is about. Can you
> explain what shmem segments are not included?
Looking at pg_get_shmem_allocations() and the pg_shmem_allocations view
documentation, I would say the wording is linked to "anonymous allocations" and
"unused memory" (i.e the ones reported with <anonymous> or NULL as name in the
pg_shmem_allocations view). Using output in this comment sounds confusing while
it makes sense in pg_get_shmem_allocations() because it really reports those.
I think that we could just mention in the function comment that
pg_get_shmem_allocations_numa() does not handle anonymous allocations and unused
memory.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com