Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogbiw-0004Oa-PH for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Oct 2022 01:00:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ogbiv-0005jq-FJ for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Oct 2022 01:00:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogbiv-0005gc-63 for pgsql-hackers@lists.postgresql.org; Fri, 07 Oct 2022 01:00:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogbis-000882-To for pgsql-hackers@lists.postgresql.org; Fri, 07 Oct 2022 01:00:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29710E173032207; Thu, 6 Oct 2022 21:00:14 -0400 From: Tom Lane To: David Rowley cc: Andres Freund , Julien Rouhaud , Robert Haas , Yura Sokolov , PostgreSQL Developers Subject: Re: Reducing the chunk header sizes on all memory context types In-reply-to: References: <555399.1663636988@sss.pgh.pa.us> <1693074.1664825870@sss.pgh.pa.us> <1913788.1664898906@sss.pgh.pa.us> <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> Comments: In-reply-to David Rowley message dated "Fri, 07 Oct 2022 13:50:11 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3032205.1665104414.1@sss.pgh.pa.us> Date: Thu, 06 Oct 2022 21:00:14 -0400 Message-ID: <3032206.1665104414@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Fri, 7 Oct 2022 at 12:35, Tom Lane 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