From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Julien Rouhaud <rjuju123@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Cc: robertmhaas@gmail.com
Subject: Re: Shared memory size computation oversight?
Date: Thu, 12 Aug 2021 15:34:27 +0200
Message-ID: <da2a9fd1-b135-5dc4-ff5d-3e3447a6b3c9@enterprisedb.com> (raw)
In-Reply-To: <20210227080815.jryyhy6lrn6gahkm@nol>
References: <20210227080815.jryyhy6lrn6gahkm@nol>
On 27.02.21 09:08, Julien Rouhaud wrote:
> PFA a patch that fixes pg_prewarm and pg_stat_statements explicit alignment to
> CACHELINEALIGN, and also update the alignment in hash_estimate_size() to what I
> think ShmemInitHash will actually consume.
For extensions, wouldn't it make things better if
RequestAddinShmemSpace() applied CACHELINEALIGN() to its argument?
If you consider the typical sequence of RequestAddinShmemSpace(mysize())
and later ShmemInitStruct(..., mysize(), ...), then the size gets
rounded up to cache-line size in the second case and not the first. The
premise in your patch is that the extension should figure that out
before calling RequestAddinShmemSpace(), but that seems wrong.
Btw., I think your patch was wrong to apply CACHELINEALIGN() to
intermediate results rather than at the end.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, rjuju123@gmail.com, pgsql-hackers@lists.postgresql.org, robertmhaas@gmail.com
Subject: Re: Shared memory size computation oversight?
In-Reply-To: <da2a9fd1-b135-5dc4-ff5d-3e3447a6b3c9@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox