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 1mNobQ-0004qi-3S for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Sep 2021 03:50:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mNobN-0004Mr-Iu for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Sep 2021 03:50: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 1mNobM-0004Mj-F8 for pgsql-hackers@lists.postgresql.org; Wed, 08 Sep 2021 03:50:21 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNobJ-0002q0-N6 for pgsql-hackers@postgresql.org; Wed, 08 Sep 2021 03:50:19 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C09B23200951; Tue, 7 Sep 2021 23:50:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 07 Sep 2021 23:50:15 -0400 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=fm2; bh=vJYu4m3+OCrNhsJ3nEnOObCbpQd p1iaE7floHnrJhDA=; b=aoyzzvPqPs507RGLsyGMlKhZAsTiY7W18a4jAGNehf+ KoOZnXbXKFf+zyWaB7CzQ2Ec6DzLJuP/CO23WUKx0FvCy5yEC27+wZTDP6a0A86R oVfV87xsbmTAOLWhlnjpHbbxuENHSpEOI5Z3Sxba2lWeDbj+A0XIbDEPuDnYd9KI 4TxCszwl2u1EtufrtiHxvLNjArZfpsBRlZfzGbNBYisr+6DvU50LFcsK3YXWJQB8 NDtTJkFO1BrAIeY6nvtNkCuUkCpYYhw4yLZdCmbje5dd/UDy+MrvLCyIWDk1jXTk B195E1EJHsVUy8vFQ3ATUE60yQU2S7vG9hsO51Ef1FA== 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=fm3; bh=vJYu4m 3+OCrNhsJ3nEnOObCbpQdp1iaE7floHnrJhDA=; b=YYK8/4V5iMa53hwP3eJBwX 2q/LiSdfwsSYC0iTUzb+/PXQvoavXYV0LnYdv1wJP+jFREPPoQjGOriWSTu8MPAO Pxctnuaa6WM9Iavr7hINc1gW27QSnAbFHTd3tgkSP9fmju3MKeWp/OU4y/q9naba X1bJ+rcuvstOsTu6o+l7Z3ungfvqZqveyL8Cc2smhmUMTctuQ8bm23YeBmZpyIYn 4fA8WXHOATgs567JPSS5Yzsn2ilsKgX3AgyDLY2l8aQrAhdj35cThU927P8Bmylt utlEDy1auugFInKacD22RuHklGupmp67WiDmB5YMbN55zGvbrhQyLb1Q2BIz7FUw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudefiedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Sep 2021 23:50:11 -0400 (EDT) Date: Wed, 8 Sep 2021 12:50:08 +0900 From: Michael Paquier To: "Bossart, Nathan" Cc: Justin Pryzby , Andres Freund , Magnus Hagander , Mark Dilger , Don Seiler , "pgsql-hackers@postgresql.org" Subject: Re: Estimating HugePages Requirements? Message-ID: References: <298B6D88-7B71-4E1B-BFC4-E7BF3A32960D@amazon.com> <23F67FC0-E432-4324-BEA4-F99B126510EA@amazon.com> <7ED221D0-0D75-46F8-8D6C-8AF70D8EABE7@amazon.com> <89EFD5FB-3C28-459C-9D6D-C9F93F7C2A54@amazon.com> <578A8F79-FD13-4408-865F-4D31EE5D8123@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0VgjkN/ZFaCFQmSp" Content-Disposition: inline In-Reply-To: <578A8F79-FD13-4408-865F-4D31EE5D8123@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0VgjkN/ZFaCFQmSp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 07, 2021 at 05:08:43PM +0000, Bossart, Nathan wrote: > On 9/6/21, 9:00 PM, "Michael Paquier" wrote: >> + sprintf(buf, "%lu MB", size_mb); >> + SetConfigOption("shared_memory_size", buf, PGC_INTERNAL, PGC_S_OVERR= IDE); >> One small-ish comment about 0002: there is no need to add the unit >> into the buffer set as GUC_UNIT_MB would take care of that. The patch >> looks fine. >=20 > I fixed this in v7. Switched the variable name to shared_memory_size_mb for easier grepping, moved it to a more correct location with the other read-only GUCS, and applied 0002. Well, 0001 here. >> +#ifndef WIN32 >> +#include >> +#endif >> So, this is needed in ipci.c to check for MAP_HUGETLB. I am not much >> a fan of moving around platform-specific checks when these have >> remained local to each shmem implementation. Could it be cleaner to >> add GetHugePageSize() to win32_shmem.c and make it always declared in >> the SysV implementation? >=20 > I don't know if it's really all that much cleaner, but I did it this > way in v7. IMO it's a little weird that GetHugePageSize() doesn't > return the value from GetLargePageMinimum(), but that's what we'd need > to do to avoid setting huge_pages_required for Windows without any > platform-specific checks. Thanks. Keeping MAP_HUGETLB within the SysV portions is an improvement IMO. That's subject to one's taste, perhaps. After sleeping on it, I'd be fine to live with the logic based on the new GUC flag called GUC_RUNTIME_COMPUTED to control if a parameter can be looked at either an earlier or a later stage of the startup sequences, with the later stage meaning that such parameters cannot be checked if a server is running. This case was originally broken anyway, so it does not make it worse, just better. + This can be used on a running server for most parameters. However, + the server must be shut down for some runtime-computed parameters + (e.g., ). Perhaps we should add a couple of extra parameters here, like shared_memory_size, and perhaps wal_segment_size? The list does not have to be complete, just meaningful enough. -- Michael --0VgjkN/ZFaCFQmSp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmE4MvAACgkQnvQgOdby QH0pUhAAmQNffOrxpZ6R3Qk8AE+Zi1XS48Y/42TUEmAO/BPbICSApAbYkrGwWs9F m3FnMrCPJIPnbFZa1o7TrIDnF1IJoMJAXVa2i+adXFb86tb2gp/upEYOqNjBaXSk 2WOPBbw+8o/AaHQsg2E5qHU5jlVN+oG+Nvax3/U+Xm8NtxR/WYZiADfknJcpIT7L BylTi8OsJAv1GcSdIpDGYwhIRU31ntGHHlLrR1Qk3smSexH5rPggwO997/h8xDU4 0+lOUn7M3V8cY2AMKtcN3dAXWVhuaSc+W6pXwRRHAyfKde74P3NFJBv3fZOUMXNt 3wjDhU7vao3xU00Yk0WNqqi62DdU2XSk+Y0oiGmH/w85B0rtaVTMJ0fL6FO7yHgV Yr44OKNMvZLRCS0mWjp8ws241me/FpkchdbJrGlwY2++CHXJ2vHwtQOIuPvX35lG qCWUBztNoI0h/OM68Y5Oom8NSyQdjuB5L3Ap7QQqMDLLK4a9ax7LXRMEtW+q2o2D jrRfxbnGqhAgpMQHNjM4JIU0j1VZh4IMYqU2qTVia5d/bh88e636YedJeE20Lr8l CW9b8BGNqB2rtkTeRXALm/arlui7ws5I6RiBLvba56eP5F7y/hbAPo9852IOTmKc j9DO4MlxgSeYkEKItk0cb67br0x4ZDkcmMn1UvtL2q7jEUnzoAs= =pnzK -----END PGP SIGNATURE----- --0VgjkN/ZFaCFQmSp--