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 1lHi36-0002pU-GT for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 07:05:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHi35-0002sm-Ff for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 07:05:27 +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 1lHi34-0002pL-RZ for pgsql-hackers@lists.postgresql.org; Thu, 04 Mar 2021 07:05:27 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHi2y-0000eP-13 for pgsql-hackers@lists.postgresql.org; Thu, 04 Mar 2021 07:05:26 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AC2E85C02D4; Thu, 4 Mar 2021 02:05:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 04 Mar 2021 02:05:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=6AQVQ2cRdzWTgHZSP1NNm9sDgTW PhD/7k82IqrzIjUY=; b=bftA2h5sROqvHvK0QHlCqowcOtpe/2dqS6I982gAZ4v z1gIsD+MN7oCIn5nm7mrFkW994qPjYHS8YFYapsj3ieJ7ne1qGFccN70fBjoyYE/ ifjuuV0PhM18gGtgr9LDcbfEAOHueZnSsU8elHP03t8Hi3Q5+Dx/gp8TcYPxWdGY pmSazTZYg8gs7iYnNV8B/vcZesXHFYv2cQvpj49icc95nPPeP8SN/KO+pCJxqVlW 7JomJeW5yZUDu5YKNaVH9GO+tW9mh7FaZwQKINZ0S55lzrk7T6p5Ai5lSAfo3dtx yUBmuqYsWckAInirtv925DJcHpcYEcI6NB/O0z+0Bxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=6AQVQ2 cRdzWTgHZSP1NNm9sDgTWPhD/7k82IqrzIjUY=; b=sVhcG89PednF6ILAUaiSPT K/J0JpBRsClVP5EsQ9iamDXVEiP0zJhz/nPvaNaIWUWZiXuBYbnjz+gFRLXM2cYP Kh9hmFZDRm9kDqv7iaw7zvxs8qwKr9d7iCIQGTH267AoSbUCulXGIU1Gm71jpllX HHQHPHChxeFfoUk7uFGwuCaasWG5LMTH3K6gD4xqDe/9NA+2AQeaVRkxT9mnjcdQ +L5898nYx+h3aic1c43GdeUC/JvA5/mDrHgwHs+4VfSxRoXlIO0frTtGn3/VXGxr c76+Om55cVjKq4BPGsyKFfcRoC1WE1msA+sGJ6g4XnVmEKH2KOsWV+EErVA05fKQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtfedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtroertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeehgedtueehkeetgeeuvedtleel keeggeefteefjeejgfekheeikeevjeehudejheenucfkphepudduuddruddtvddrudektd drudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D2FA240057; Thu, 4 Mar 2021 02:05:14 -0500 (EST) Date: Thu, 4 Mar 2021 16:05:10 +0900 From: Michael Paquier To: Julien Rouhaud Cc: Tom Lane , Georgios , Julien Rouhaud , PostgreSQL Hackers , "robertmhaas@gmail.com" Subject: Re: Shared memory size computation oversight? Message-ID: References: <20210227080815.jryyhy6lrn6gahkm@nol> <1183451.1614788634@sss.pgh.pa.us> <20210303164052.f336wina7qpchabd@nol> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5G2Dci954KlbvOGo" Content-Disposition: inline In-Reply-To: <20210303164052.f336wina7qpchabd@nol> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --5G2Dci954KlbvOGo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 04, 2021 at 12:40:52AM +0800, Julien Rouhaud wrote: > On Wed, Mar 03, 2021 at 11:23:54AM -0500, Tom Lane wrote: >> I have not looked at this patch, but I think the concern is basically th= at >> if we have space-estimation infrastructure that misestimates what it is >> supposed to estimate, then if that infrastructure is used to estimate the >> size of any of the "big hog" data structures, we might misestimate by >> enough that the slop factor wouldn't hide it. >=20 > Exactly. And now that I looked deeper I can see that multiple estimates = are > entirely ignoring the padding alignment (e.g. ProcGlobalShmemSize()), whi= ch can > exceed the 6kB originally estimated by Robert. We are going to have a hard time catching up all the places that are doing an incorrect estimation, and have an even harder time making sure that similar errors don't happen in the future. Should we add a=20 {add,mul}_shmem_size() to make sure that the size calculated is correctly aligned, that uses CACHELINEALIGN before returning the result size? -- Michael --5G2Dci954KlbvOGo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmBAhqYACgkQnvQgOdby QH2V+RAAoFdUvds1O9klyHUjDeMx33rHEvu9fQJSAXgqKR7HTj4/5bcKcSa54YWb iLdWZTVtq23BK5ppoGQ5QrP8KuXi1K4MZ16VPgMzfB++K+Hgqw1gEL5brpkQe1Ta 0TxQKInQ/49buBwFKuJHtANLf6Bd+xN5LDyKNa15fRllJOE5BlPQUAf6A8Ua40ox qcjYXVArT+cIH2+jXyDEHi4YPpWxZ27D6eFrsm8m1ZHpxcXjghA14kLP2meUv+mx Yj/nPDQiR8J+YYbtQtj5I5QYUjN40iAQNKYVwNw34NldyyOcKjK67SH5tVS3pwVg Ka3NPmof0b7cV1tWz97wouIwj/Cq7Vw5uuoA18NHRoasG3jLCKROG5I2+2/jtzQV V/hzYmConst5bpbV14A+btHUPQkq2qEyPoLA/VpO2RKUNCTgGj7UivM/GFk4IjSi rFafR89FiB7r5PuR2iqHWARyFT+ackRYGffUJ7XcIu2vWMKygjSgvMFYaeCjsvSi kQbAGjxgjOqB4l196ex526UocUG6+oui4uh1SXLPxZrnce40hejFWvafPtwJhSIf iOaEmTPh59K7HDAZaXW1kPuVkwFdx/f4DVcgqA46LaOip6gHtPGcFgs3evoKuQWf L9NC1AgvCMTeROci9DRH6kPOYyhKw1dHXWfpPJorinSIS26TR8M= =dac3 -----END PGP SIGNATURE----- --5G2Dci954KlbvOGo--