pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: David Rowley <dgrowleyml@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: Tue, 09 Aug 2022 17:23:00 -0400
Message-ID: <85733.1660080180@sss.pgh.pa.us> (raw)
In-Reply-To: <20220809210258.o7to2ymxuaq2j76r@awork3.anarazel.de>
References: <CAApHDvpjauCRXcgcaL6+e3eqecEHoeRm9D-kcbuvBitgPnW=vw@mail.gmail.com>
	<9dec1bd42fed3e263de294116380e5b51c427267.camel@postgrespro.ru>
	<20220712174404.polbc5it7j6mzmql@awork3.anarazel.de>
	<CAApHDvo+R56uR7Hd9d7f6+EKEeXs8azsshrAgL9HOsnj7K4-YA@mail.gmail.com>
	<CAApHDvrrYfcCXfuc_bZ0xsqBP8U62Y0i27agr9Qt-2geE_rv0Q@mail.gmail.com>
	<CA+TgmoZcHxSZRN1HhHKT-g=FBk2THH60zy1sK3YwB6cB4EQqtQ@mail.gmail.com>
	<20220809184410.g6yzu6pvttuphag5@awork3.anarazel.de>
	<36081.1660072917@sss.pgh.pa.us>
	<20220809210258.o7to2ymxuaq2j76r@awork3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2022-08-09 15:21:57 -0400, Tom Lane wrote:
>> Do we really need it to be that tight?  I know we only have 3 methods today,
>> but 8 doesn't seem that far away.  If there were six bits reserved for
>> this I'd be happier.

> We only have so many bits available, so that'd have to come from some other
> resource.  The current division is:

> + * 1.	3-bits to indicate the MemoryContextMethodID
> + * 2.	1-bit to indicate if the chunk is externally managed (see below)
> + * 3.	30-bits for the amount of memory which was reserved for the chunk
> + * 4.	30-bits for the number of bytes that must be subtracted from the chunk
> + *		to obtain the address of the block that the chunk is stored on.

> I suspect we could reduce 3) here a bit, which I think would end up with slab
> context's max chunkSize shrinking further. Which should still be fine.

Hmm, I suppose you mean we could reduce 4) if we needed to.  Yeah, that
seems like a reasonable place to buy more bits later if we run out of
MemoryContextMethodIDs.  Should be fine then.

			regards, tom lane





view thread (152+ messages)  latest in thread

Message-ID: <85733.1660080180@sss.pgh.pa.us>
Permalink:  ../85733.1660080180@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/85733.1660080180@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, andres@anarazel.de, robertmhaas@gmail.com, dgrowleyml@gmail.com, y.sokolov@postgrespro.ru
  Subject: Re: Reducing the chunk header sizes on all memory context types
  In-Reply-To: <85733.1660080180@sss.pgh.pa.us>
  References: <CAApHDvpjauCRXcgcaL6+e3eqecEHoeRm9D-kcbuvBitgPnW=vw@mail.gmail.com> <9dec1bd42fed3e263de294116380e5b51c427267.camel@postgrespro.ru> <20220712174404.polbc5it7j6mzmql@awork3.anarazel.de> <CAApHDvo+R56uR7Hd9d7f6+EKEeXs8azsshrAgL9HOsnj7K4-YA@mail.gmail.com> <CAApHDvrrYfcCXfuc_bZ0xsqBP8U62Y0i27agr9Qt-2geE_rv0Q@mail.gmail.com> <CA+TgmoZcHxSZRN1HhHKT-g=FBk2THH60zy1sK3YwB6cB4EQqtQ@mail.gmail.com> <20220809184410.g6yzu6pvttuphag5@awork3.anarazel.de> <36081.1660072917@sss.pgh.pa.us> <20220809210258.o7to2ymxuaq2j76r@awork3.anarazel.de> <85733.1660080180@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