pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Yura Sokolov <y.sokolov@postgrespro.ru>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Reducing the chunk header sizes on all memory context types
Date: Thu, 06 Oct 2022 21:00:14 -0400
Message-ID: <3032206.1665104414@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvqhOF+6-eo7O7s2gEkYkj1vBhfrByU=cAuszoe62tM87Q@mail.gmail.com>
References: <555399.1663636988@sss.pgh.pa.us>
	<CAApHDvoBxz7RiJiyGzi-wN4c-vLg9TGQ8yTmFW1j6eUJPsP4DA@mail.gmail.com>
	<1693074.1664825870@sss.pgh.pa.us>
	<1913788.1664898906@sss.pgh.pa.us>
	<CAApHDvoOWpxq0UucD0W11=99GopDwozTr=+bt2AmZFgHi87gmg@mail.gmail.com>
	<2869610.1665077908@sss.pgh.pa.us>
	<2910981.1665080361@sss.pgh.pa.us>
	<20221006190058.rgk4gxa34d6rg77o@awork3.anarazel.de>
	<2921309.1665083444@sss.pgh.pa.us>
	<20221006191454.yviucagfzayak3x6@awork3.anarazel.de>
	<2922295.1665084196@sss.pgh.pa.us>
	<2963487.1665086713@sss.pgh.pa.us>
	<2975022.1665093421@sss.pgh.pa.us>
	<2983672.1665097833@sss.pgh.pa.us>
	<3023166.1665099327@sss.pgh.pa.us>
	<CAApHDvqhOF+6-eo7O7s2gEkYkj1vBhfrByU=cAuszoe62tM87Q@mail.gmail.com>

David Rowley <dgrowleyml@gmail.com> writes:
> On Fri, 7 Oct 2022 at 12:35, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Which leaves me with the attached proposed wording.

> No objections here.

Cool, I'll push in a little bit.

> With these comments I'd be using slot MCTX_UNUSED4_ID first, then I'd
> probably be looking at MCTX_UNUSED5_ID after adjusting wipe_mem to do
> something other than setting bytes to 0x7F.

Well, the only way that you could free up a bitpattern that way is
to make wipe_mem use something ending in 000 or 001.  I'd be against
using 000 because then wiped memory might appear to contain valid
(aligned) pointers.  But perhaps 001 would be ok.

> I'd then use
> MCTX_UNUSED3_ID since that pattern is only used for larger chunks with
> glibc (per your findings).  After that, I'd probably start looking
> into making more than 3 bits available. If that wasn't possible, I'd
> be using MCTX_UNUSED2_ID and at last resort MCTX_UNUSED1_ID.

If we get to having three-quarters or seven-eighths of the bitpatterns
being valid IDs, we'll have precious little ability to detect garbage.
So personally I'd put "find a fourth bit" higher on the priority list.

In any case, we needn't invest more effort here until someone comes
with a fifth context method ... and I don't recall hearing discussions
of even a fourth one yet.

			regards, tom lane





view thread (152+ messages)  latest in thread

Message-ID: <3032206.1665104414@sss.pgh.pa.us>
Permalink:  ../3032206.1665104414@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3032206.1665104414@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, andres@anarazel.de, rjuju123@gmail.com, robertmhaas@gmail.com, y.sokolov@postgrespro.ru
  Subject: Re: Reducing the chunk header sizes on all memory context types
  In-Reply-To: <3032206.1665104414@sss.pgh.pa.us>
  References: <555399.1663636988@sss.pgh.pa.us> <CAApHDvoBxz7RiJiyGzi-wN4c-vLg9TGQ8yTmFW1j6eUJPsP4DA@mail.gmail.com> <1693074.1664825870@sss.pgh.pa.us> <1913788.1664898906@sss.pgh.pa.us> <CAApHDvoOWpxq0UucD0W11=99GopDwozTr=+bt2AmZFgHi87gmg@mail.gmail.com> <2869610.1665077908@sss.pgh.pa.us> <2910981.1665080361@sss.pgh.pa.us> <20221006190058.rgk4gxa34d6rg77o@awork3.anarazel.de> <2921309.1665083444@sss.pgh.pa.us> <20221006191454.yviucagfzayak3x6@awork3.anarazel.de> <2922295.1665084196@sss.pgh.pa.us> <2963487.1665086713@sss.pgh.pa.us> <2975022.1665093421@sss.pgh.pa.us> <2983672.1665097833@sss.pgh.pa.us> <3023166.1665099327@sss.pgh.pa.us> <CAApHDvqhOF+6-eo7O7s2gEkYkj1vBhfrByU=cAuszoe62tM87Q@mail.gmail.com> <3032206.1665104414@sss.pgh.pa.us>

* 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