From: Michael Paquier <michael@paquier.xyz>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Georgios <gkokolatos@protonmail.com>
Cc: Julien Rouhaud <julien.rouhaud@free.fr>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: robertmhaas@gmail.com <robertmhaas@gmail.com>
Subject: Re: Shared memory size computation oversight?
Date: Thu, 4 Mar 2021 16:05:10 +0900
Message-ID: <YECGppkDKJArPOUb@paquier.xyz> (raw)
In-Reply-To: <20210303164052.f336wina7qpchabd@nol>
References: <20210227080815.jryyhy6lrn6gahkm@nol>
<SeVx6SxBxMHIm_66gE4M8rzAn5vqXw8akcyJ-26bJxHeNC_wW9fN-xDr_G3AGiSH328-rxMzXbNf6H4TsaNIG-OJFE8LvmdflG9Zb-yIKq4=@protonmail.com>
<1183451.1614788634@sss.pgh.pa.us>
<20210303164052.f336wina7qpchabd@nol>
On Thu, Mar 04, 2021 at 12:40:52AM +0800, Julien Rouhaud wrote:
> On Wed, Mar 03, 2021 at 11:23:54AM -0500, Tom Lane wrote:
>> I have not looked at this patch, but I think the concern is basically that
>> if we have space-estimation infrastructure that misestimates what it is
>> supposed to estimate, then if that infrastructure is used to estimate the
>> size of any of the "big hog" data structures, we might misestimate by
>> enough that the slop factor wouldn't hide it.
>
> Exactly. And now that I looked deeper I can see that multiple estimates are
> entirely ignoring the padding alignment (e.g. ProcGlobalShmemSize()), which can
> exceed the 6kB originally estimated by Robert.
We are going to have a hard time catching up all the places that are
doing an incorrect estimation, and have an even harder time making
sure that similar errors don't happen in the future. Should we add a
{add,mul}_shmem_size() to make sure that the size calculated is
correctly aligned, that uses CACHELINEALIGN before returning the
result size?
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, rjuju123@gmail.com, tgl@sss.pgh.pa.us, gkokolatos@protonmail.com, julien.rouhaud@free.fr, pgsql-hackers@lists.postgresql.org, robertmhaas@gmail.com
Subject: Re: Shared memory size computation oversight?
In-Reply-To: <YECGppkDKJArPOUb@paquier.xyz>
* 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