Re: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Reid Thompson <reid(dot)thompson(at)crunchydata(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated
Date: 2022-07-29 17:55:10
Message-ID: 3903241.1659117310@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> On Fri, Jul 29, 2022 at 12:43:45PM -0400, Reid Thompson wrote:
>> slab.c
>> does not in SlabContextCreate(). Is this intentional, it seems to be an
>> oversight to me.

> IIUC this is because the header is tracked separately from the first
> regular block, unlike aset.c.

That doesn't make it not an oversight, though. It looks like aset.c
thinks that mem_allocated includes all the context's overhead, whereas
this implementation doesn't seem to have that result. The comments
associated with mem_allocated are sufficiently vague that it's impossible
to tell which implementation is correct. Maybe we don't really care,
but ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-07-29 18:12:53 Re: making relfilenodes 56 bits
Previous Message Alvaro Herrera 2022-07-29 17:53:51 Re: Should fix a comment referring to stats collector?