pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 17:21:35 +0900
Message-ID: <YECYj2KORHb06xbA@paquier.xyz> (raw)
In-Reply-To: <20210304072333.4yydog47md7cfrda@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>
	<YECGppkDKJArPOUb@paquier.xyz>
	<20210304072333.4yydog47md7cfrda@nol>

On Thu, Mar 04, 2021 at 03:23:33PM +0800, Julien Rouhaud wrote:
> I was also considering adding new (add|mull)_*_size functions to avoid having
> too messy code.  I'm not terribly happy with xxx_shm_size(), as not all call to
> those functions would require an alignment.  Maybe (add|mull)shmemalign_size?
> 
> But before modifying dozens of calls, should we really fix those or only
> increase a bit the "slop factor", or a mix of it?
> 
> For instance, I can see that for instance BackendStatusShmemSize() never had
> any padding consideration, while others do.
> 
> Maybe only fixing contribs, some macro like PredXactListDataSize that already
> do a MAXALIGN, SimpleLruShmemSize and hash_estimate_size() would be a short
> patch and should significantly improve the estimation.

The lack of complaints in this area looks to me like a sign that we
may not really need to backpatch something, so I would not be against
a precise chirurgy, with a separate set of {add,mul}_size() routines
that are used where adapted, so as it is easy to track down which size
estimations expect an extra padding.  I would be curious to hear more
thoughts from others here.

Saying that, calling a new routine something like add_shmem_align_size
makes it clear what's its purpose.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (16+ messages)  latest in thread

Message-ID: <YECYj2KORHb06xbA@paquier.xyz>
Permalink:  ../YECYj2KORHb06xbA@paquier.xyz/
Also on:    postgresql.org/message-id/YECYj2KORHb06xbA@paquier.xyz

 · 

reply

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: <YECYj2KORHb06xbA@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