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 1mLhV5-0003nN-1n for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Sep 2021 07:51:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLhV3-0006Dy-2B for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Sep 2021 07:51:05 +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 1mLhV2-0006Dk-QB for pgsql-hackers@lists.postgresql.org; Thu, 02 Sep 2021 07:51:04 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLhUy-0002Yr-5X for pgsql-hackers@postgresql.org; Thu, 02 Sep 2021 07:51:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B00A05C0051; Thu, 2 Sep 2021 03:50:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 02 Sep 2021 03:50:58 -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=RSOsoYgMyyB6HyWJyT3QcRYlNcy y+txLTyUpZqjwdvU=; b=hNLyY1Mjnb3CPra/pgFu/5jRxuaBspaVACAs2v0U/nZ Hzvgew+JcQQ0ePQlV4t+4GRwzupGxzATZ1WpBbOos30CwQ6ApsE+N07k2VjSvlrB TszD+GF5xrgapfWFjXW6TLLrPiSxxVShug7P0Av448iDFKPqY7U71bl29vfMbgKU iD5yTDc6eBj0jMVxBN3jbHTaDYu+uYC2kd4/Q4qWPbojbxZd1sYqPwplswdEJyJJ fzKLPQ/RQwRSwZqAl+EI3Zz+sFLyk0focPHkmXS45d1LRIDUgilXDF+RRdwSMjb+ oxn5F8J8FURpY3zQnA01nfhvI7uqRgTQaKItjJG85Yg== 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=RSOsoY gMyyB6HyWJyT3QcRYlNcyy+txLTyUpZqjwdvU=; b=tRksdcTrq76g0P1DXgvV3i +KZz2IMbmgqaQriSNJUxgQfkwCwl5XzGyPxjMADDEvRS2t0qUUXgBDbgGjKEb3cA XwlKgWK55FDwxWGgrXgYhPijI0CzmH/BdAI/jpaaGccLK0fMpBSokLUIwnd+K1+o 4YoTg8AnTJK4P7yniHSUy2socz2iEpNjm7z3/EIU2zKAmg4H6yS2KLrbNMwsjGkL MXz4IoOqGsBC6zVAuZ1xIH/mktXy2JIWy2vcjetk9abZ33vW3LCn7y/g7elkAnXO qRoL5EGbCq7u5lDjckWIuhDiLdzGWa66t3xsNLLRZooPp9yKrjg/62tVsV+Nf+wg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvgedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepleeuhedtjeeffeelgfeigeev jeegffelvdetveegfedvfeeugeeuleefvdeuveefnecuffhomhgrihhnpehmihgtrhhosh hofhhtrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Sep 2021 03:50:54 -0400 (EDT) Date: Thu, 2 Sep 2021 16:50:52 +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: <071DC95B-4CA8-4D2B-BD24-1A66B3EFFE28@amazon.com> <20210827193813.oqo5lamvyzahs35o@alap3.anarazel.de> <0D1645F3-ADFD-4B2F-9F34-961BDFBB881B@amazon.com> <20210828035722.GQ26465@telsasoft.com> <82E1E183-691F-479E-B661-9BE8EC70BD21@amazon.com> <48795AC4-289F-4CDE-88F5-4FD1ED2BD3DD@amazon.com> <298B6D88-7B71-4E1B-BFC4-E7BF3A32960D@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oreY5uI08bHQkdmZ" Content-Disposition: inline In-Reply-To: <298B6D88-7B71-4E1B-BFC4-E7BF3A32960D@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --oreY5uI08bHQkdmZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 01, 2021 at 06:28:21PM +0000, Bossart, Nathan wrote: > On 8/31/21, 11:54 PM, "Michael Paquier" wrote: >> Hmm. I am not sure about the addition of huge_pages_required, knowing >> that we would have shared_memory_size. I'd rather let the calculation >> part to the user with a scan of /proc/meminfo. >=20 > I included this based on some feedback from Andres upthread [0]. I > went ahead and split the patch set into 3 pieces in case we end up > leaving it out. Thanks. Anyway, we don't really need huge_pages_required on Windows, do we? The following docs of Windows tell what do to when using large pages: https://docs.microsoft.com/en-us/windows/win32/memory/large-page-support The backend code does that as in PGSharedMemoryCreate(), now that I look at it. And there is no way to change the minimum large page size there as far as I can see because that's decided by the processor, no? There is a case for shared_memory_size on Windows to be able to adjust the sizing of the memory of the host, though. >> +#elif defined(WIN32) >> + hp_size =3D GetLargePageMinimum(); >> +#endif >> + >> +#if defined(MAP_HUGETLB) || defined(WIN32) >> + hp_required =3D (size_b / hp_size) + 1; >> As of [1], there is the following description: >> "If the processor does not support large pages, the return value is >> zero." >> So there is a problem here. >=20 > I've fixed this in v4. At the end it would be nice to not finish with two GUCs. Both depend on the reordering of the actions done by the postmaster, so I'd be curious to hear the thoughts of others on this particular point. -- Michael --oreY5uI08bHQkdmZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmEwglwACgkQnvQgOdby QH28ag/+PbuH8dM6BuVy/Wpm0dgm3Be72qA83p9d8jacdsHZ3vexJNjLtZna8+FV JvjMx3tstfMsKBlO6ZkSg+l9siLDpv0XuqHa7X/FdMHk0Lj3ul4nCroSYeqQg2Yx mRIgpH2M+FdpBl2iKJquvJ4GLDLlnB/JAKHl17MWcTuQcBopZ2AQYAgvAitTLCe1 Y9NEXmqQ1pHht0wGpKZcdh+WhwmBnvAMB8a9+4ArNIzzkNLhRdwrk4KmshdY85In V/3sNRdHr8k2FJsciFRe+idyuNOhPGGCxK9JBDt6yLfYaM2RSYsWaF4dnObPuvd8 5ihqf39EKMqiHZRfF2VL6bXwF4OSS083AqWrVhJ+xneygSne7YlLAdPiVpp3Leqk SwGlpvEoPC+GCWA2AwzodOrUvjjywZPJA4awSSj9IoyrZXJOHRNiE2q2HQdcKbWR K/a0j/gXilPZt7IJd1njqItyXarXqSNCb7GW7VTIPyoejCYn2C7bSkHVleJLH4vr +4/wbWIVWQimWac6I10fHGSBH82Qey0AHIHWkM+jnuPrVkJBQFWkp7gB7kD0F1h8 EcTPu5smUvTgrcMDnViEKanap+OgEuDqMaE/wRTPo5iwWuOYiLJHDbD+40wbj1Hv q/BKKekJmQ7WWYK59lXvn1JKhbllTTuKGKP0o3N3FIoQImaw5Zc= =GuP2 -----END PGP SIGNATURE----- --oreY5uI08bHQkdmZ--