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 1oSwge-0001vY-Qy for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 08:33:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oSwgd-0005Yh-F8 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 08:33:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oSwgd-0005VM-5q for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 08:33:31 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oSwgZ-0005mA-5q for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 08:33:30 +0000 Received: by mail-ed1-x52a.google.com with SMTP id b44so13178532edf.9 for ; Tue, 30 Aug 2022 01:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=fT7ggcAeKiRNCpKjbW7OeNYMLjNJRKydSLeseKYRZT4=; b=NdDcUJxX7DHhCR1v8IKPIK458tdcgEaO8V7MUh+WYNstaPQ+9N6LI9xKViAJBK4xN5 sC7TpdpLP+lJQ6qglX8klsnr21+NZXUX1nHh3CwFcxBtM1GGoLmidih3Qv/ivzFdul2P zeC9jq8x7/Orb8GF1UwMNC2bvRKdQGiRKUgILlB7QZ04vDBC0vJfI9rBHvxvRA8Tk5t7 sd3+k9pS337FZpQJwvcvwrgUGkrFC3Odr92zDUrzJaIzr/wpkh3j79dsCxRIHtJ702EB deDtsORI8AlIUB3vvLD/Fldw8zNmnAUc04UHJKIdDFN6bMg3bl82rx7g2f1znJUaBLC7 3/uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=fT7ggcAeKiRNCpKjbW7OeNYMLjNJRKydSLeseKYRZT4=; b=Mhp/vCDtirjPLWsHrhKZQf4/ZjnqAaF7CJE17r0lkB4Nso9p5B/ILjHWTATaYodwLC 7Op7L39P8cfFqjoCh+cuMqt1R1QLmfZm+5gs47XcaFWDWAAEfVm8IeuaACQzydrZeVDU 7WO6Nh90h7VqoTc1DmT9x8UYqeJYbeomBLGwjQ2zU9vEJaM8xPdJquvAit7Md2vxoUyb gHzSfUEsWBboB+3Hb+ZA0H3KGvZGJSm7zLm98Wv+5ZdIzhvuf4RuPs2k7nKM5WZVEPth tV6maOm/6PDgSnPy8Jz7Vju/X8xGDjVchgN04uDXXEFG2KgAyucPD0zjmYtPMgpryOpT xwHQ== X-Gm-Message-State: ACgBeo1uDrw1ld4Zf5bU8O4F1DWlXULwusRwPpW4+cARFpaACfegF36E TC/Q+NeOrxrQ6kvH3MPNX95HfwtnG5YzdzyOSxzVmqr5VtkfJ65hee2WiAOr/Ojbv8wKD3xGkNA Dk7YcokC/tGbpdsh18itrAbeDn9R4ADF7J4ZkL5TcnZLOyHIC0bpANzbatH86+slp0lPq+n+Cmw MsO9XuXgOHqhc7TcRYwJwQKrL2DsXlNSDJxi5wN/EPW8mEOqLfdBlu X-Google-Smtp-Source: AA6agR6megGOE6qksriJ3l3QWJO8Dd9ApGydr9ScazAGOrPuasd00HJOn0D0/YVbqi2MBftNaBj+0A== X-Received: by 2002:a05:6402:24a4:b0:440:8c0c:8d2b with SMTP id q36-20020a05640224a400b004408c0c8d2bmr18863098eda.311.1661848406045; Tue, 30 Aug 2022 01:33:26 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-229-52.bb.vodafone.cz. [86.49.229.52]) by smtp.gmail.com with ESMTPSA id 18-20020a170906201200b007324aa2ca77sm5398075ejo.85.2022.08.30.01.33.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Aug 2022 01:33:25 -0700 (PDT) Message-ID: <387c9d5d-bf17-b970-1f05-bbeb8bcb23e4@enterprisedb.com> Date: Tue, 30 Aug 2022 10:33:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: Reducing the chunk header sizes on all memory context types Content-Language: en-US To: David Rowley Cc: Tom Lane , Amit Kapila , Andres Freund , Robert Haas , Yura Sokolov , PostgreSQL Developers References: <3137572.1661780863@sss.pgh.pa.us> <3205803.1661786437@sss.pgh.pa.us> <3209705.1661787794@sss.pgh.pa.us> <3407185.1661810248@sss.pgh.pa.us> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/30/22 03:04, David Rowley wrote: > On Tue, 30 Aug 2022 at 12:22, Tomas Vondra > wrote: >> I also suggested doing a similar check in MemoryChunkGetPointer, so that >> we catch the issue earlier - right after we allocate the chunk. Any >> opinion on that? > > I think it's probably a good idea. However, I'm not yet sure if we can > keep it as a macro or if it would need to become a static inline > function to do that. > I'd bet it can be done in the macro. See VARATT_EXTERNAL_GET_POINTER for example of a "do" block with an Assert. > What I'd really have wished for is a macro like AssertPointersEqual() > that spat out the two pointer values. That would probably have saved > more time on this issue. > Hmm, maybe. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company