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 1mLK8Q-0003RY-V7 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 06:54:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLK8P-0008PF-Ps for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 06:54:09 +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 1mLK8O-0008P6-Uv for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 06:54:09 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLK8I-0002tR-4A for pgsql-hackers@postgresql.org; Wed, 01 Sep 2021 06:54:07 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8CBE65C021C; Wed, 1 Sep 2021 02:54:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 01 Sep 2021 02:54:00 -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=FI93AvDs6WYrpPyUHQgNUeXzV0B mkRF9v6MTRk0I6HA=; b=ECGQzCENh8ePcr4aup4pzSzbSGrCSUaaAFEZoKNMjDY sJFIUFPRBlgYHC46ycq+bEOnKh+9MYA+AaH0pb4kOt/UASd2djRk1w5TvHSsFe8Z 8sep9hNNO6t7Z/dPfvULVNMOoB89LOj6hHEBKalDCRbUN7GsJWZK4cZLAgQMK75B 8WkZWYBnKSC5ssXYYFEO4bLQP5cmb9AAlif+S/4upx1ksVMYYiw3ouv6S8HBmx2C EKuaNFD75+Ax+sdSYOlPb6cczFAcx2HDDpt9b0yXaDaC96QIx98Pq9wIe1TAkJYh zGcnENTkPxRguuw0nAzk5fDDVa9NsJuJGGP4v9xcbcg== 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=FI93Av Ds6WYrpPyUHQgNUeXzV0BmkRF9v6MTRk0I6HA=; b=p/6ectkUASBy1GMpgeVWZT bApZByIFqt8pW2ZaHc5hL1+Y/OpLyhm2VMbByr9OWQpCS6hLG9dYrSD2+8aZYEFH 890fKIi6tgCIz0Q/FmFuOCDdoH6WEQJ4u7fc7oMUueKOFy0RK7SoFL08Q/BOWKDe ThQVb2u1mTawpvX6BYqlPUJCyBttuJqWwrAdb6YT/JeVSUVQ9ilUY3F/pb7pPF9K YrZpAk7KBbuT0YAePw/U1VEzqzBPQ0g6V9w+F1BBPO3mmk4l/CxonH8M9K/vhWJy ViOyFkw07uLlixBCIyFyJk2CVKfgPRXx40184Lo/2TgwNOrceGOu7Jh3wPQgs1KQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvvddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepleeuhedtjeeffeelgfeigeev jeegffelvdetveegfedvfeeugeeuleefvdeuveefnecuffhomhgrihhnpehmihgtrhhosh hofhhtrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Sep 2021 02:53:57 -0400 (EDT) Date: Wed, 1 Sep 2021 15:53: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: <20210827184648.d3jbv73pgyccqwkz@alap3.anarazel.de> <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="szoheQ3vLFm+XoYp" Content-Disposition: inline In-Reply-To: <48795AC4-289F-4CDE-88F5-4FD1ED2BD3DD@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --szoheQ3vLFm+XoYp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 31, 2021 at 05:37:52AM +0000, Bossart, Nathan wrote: > I moved the GUC calculation to ipci.c, adjusted the docs, and added a > huge_pages_required GUC. It's still a little rough around the edges, > and I haven't tested it on Windows, but this seems like the direction > the patch is headed. 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. +#elif defined(WIN32) + hp_size = GetLargePageMinimum(); +#endif + +#if defined(MAP_HUGETLB) || defined(WIN32) + hp_required = (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. [1]: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-getlargepageminimum -- Michael --szoheQ3vLFm+XoYp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmEvI4AACgkQnvQgOdby QH1I+A/+JkE2qIZo4e9Xn9b301SpfeCRA3KZdIUwbzJ6y+eA6yJgiuMuPFJ1BM6a dNcIeS8kkgTn8aU9dkfVyG/LbWbCjA8VTqG6Klo2A7yfZ7sAj9/KEZBgUJuBF6RV tGRJnOTf8K3WIyinLVdPQR8ZpDvf1J88qMy5paDOAPU0vRcEw9RGaXVGHgAc+FzJ cpFhDmc0qC7YHM5u0U91Xy0HvvDXi2+WaP2qmmzs7DE9Q4KO3/XQF4VqmAB0H5Sh h1k/mK7qMo1sMzcXby7jqPODplRuCvd25m24P7nP8Wy2PRg8x5P/NAYGC2JM94Vf gfYcKF+Mqd5JVrv7/U9NIcyp8uYsLfCNuF1EUON2GjFP4gqd44nmTQDIZiV1evxp qpdhcSvN82swzTAgLbUvWUc0kq5tbWKXjxnQokdcg0js5XVh635NDq8n+jlXGJcK HJHXs7tJP/f0Aru7T2Y5Dp2bpwK2TyNuYYMRz56NMWrt/hr4BYlLZY6I/AcPercm Gl6Fokh+g5s5hKOFyQRWB5S0nQJgtmOY3Af5sHbrhph3owKh9iDCZC1ZlUu/nXU8 ymUOgUM1K0M5m0tp/3cyWNSwmpCwmR/K3C7fGt1KOVib16HqaoptpwHjj2dwU31d TGXe4vX6PEkto3g5NkAMZXQMUNbt8XkelwbpQNgC/XlV1ULCaVk= =wQFZ -----END PGP SIGNATURE----- --szoheQ3vLFm+XoYp--