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 1nZsKc-00071G-Qj for pgsql-bugs@arkaria.postgresql.org; Thu, 31 Mar 2022 10:47:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZsKb-0002Pu-5y for pgsql-bugs@arkaria.postgresql.org; Thu, 31 Mar 2022 10:47:09 +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 1nZsKa-0002Pj-ST for pgsql-bugs@lists.postgresql.org; Thu, 31 Mar 2022 10:47:08 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nZsKX-0003u6-Ss for pgsql-bugs@lists.postgresql.org; Thu, 31 Mar 2022 10:47:08 +0000 Received: by mail-pg1-x535.google.com with SMTP id s72so19694694pgc.5 for ; Thu, 31 Mar 2022 03:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xOpPBS17FY8hqU4Pl3XTe736+6GfV8yymxurSBFKjlg=; b=F2uHwVBjJ2aOrcsVQXAUIahbAD5OaLqlsCaeC72Te8Ms4B84gwi2RKV+TiCWCIrIWj A0nk1KacBO7hja2W32fyRFn7oMt7fPLvpjTXysHOla+IDIuo2lgDr+lVhTuBPUoldJSz PrGHUo8u9POeKjdNbL43c7es46J7wvArHGEuB6RsMvQpY13+NQ/YUj0SuPjM4xZrlmbo ZCeREz/oPEYiKvPsIhHIvUc5XPn2CnH7h9CKWn2vW+8mLicPxkwDp/ZZtnpmNO8chFzy VKxywzZzfkdhVQATceaxotMXbnWvuRzncJiq1QYRynXe+onnuA2qRPdBp4pWI6Skn/Xh tqig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xOpPBS17FY8hqU4Pl3XTe736+6GfV8yymxurSBFKjlg=; b=K5gTnl+P8hVhN5WXcWjUVt4Ej2bBTVNWYLaCmj0QXKO7oSH+wLPUda8GAct3PDMT6b PULSLiKIkEVKV1gGDJalL80ZHISenORaBsrN+z0dXRcnmG7HpDEEWmK3hJ8NnE7z9dcw WQe1ldopoJHEA0CMgimP4a0f5Z/e8hP9QdKG4Ag5hPnxOCEE/b+YF7s4OZHcWkJwXQxV miOfPcWdPOdoSh/tgQ8/6qFBRnaFCoOjIj0wRrBBXMdGqRLdsf85m5RfOSS8OGK0QqS1 AJct1T8UHrVJ71cXfmRo9lm6dO/icqiQ5aiuqHFKCbcSPX9QGNb20pisdrA5mgSoyFP4 83uA== X-Gm-Message-State: AOAM5321UO2BZc9lQ6VbocJsdD1hFffzUZQteoq6lqild3zTAyOYTQeg 0Q1aIEgRfwFvaxuZETfHUKc= X-Google-Smtp-Source: ABdhPJyyaQYr3lluPPBKh/rirOyQ000af1HpUoLqVJ4WyTEkoz/VUC0YV8dwK4BNkuC7lE1Vk33eow== X-Received: by 2002:a63:7e41:0:b0:398:2829:2d94 with SMTP id o1-20020a637e41000000b0039828292d94mr10504164pgn.173.1648723623650; Thu, 31 Mar 2022 03:47:03 -0700 (PDT) Received: from jrouhaud (2001-b011-1005-b35e-8420-3e61-3201-4aba.dynamic-ip6.hinet.net. [2001:b011:1005:b35e:8420:3e61:3201:4aba]) by smtp.gmail.com with ESMTPSA id d9-20020a056a00198900b004fafdb88076sm25072069pfl.117.2022.03.31.03.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 03:47:03 -0700 (PDT) Date: Thu, 31 Mar 2022 18:46:59 +0800 From: Julien Rouhaud To: Michael Paquier Cc: Thomas Munro , okano.naoki@jp.fujitsu.com, PostgreSQL mailing lists Subject: Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work. Message-ID: <20220331104659.ol6pqe7s3tpkymuk@jrouhaud> References: <17448-0a96583a67edb1f7@postgresql.org> <20220326082408.moh55zuecxjmewnm@jrouhaud> <20220331045908.bm5edcacvymgwwv2@jrouhaud> <20220331080055.hjrrsrd4lxwlt7f5@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331080055.hjrrsrd4lxwlt7f5@jrouhaud> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 31, 2022 at 04:00:55PM +0800, Julien Rouhaud wrote: > > Okano-san has mentioned VMMap upthread: > > https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap > > Yes, I totally missed that. Thomas Munro also mentioned it off-list, and > also found some reference [1] indicating that large pages should show up as > "Locked WS". I tested with and without the patch and in both case I don't see > any "Locked WS" usage. I also get the same Page Table size, which seems > consistent with large pages not being used. Now, this is a vm running with > virtualbox and we're not entirely sure that huge pages can be allocated with > it. I wish I could test on my windows 10 machine as it's not virtualized, but > I can't give the required privileges. > > [1] https://aloiskraus.wordpress.com/2016/10/03/windows-10-memory-compression-and-more/ So, after more digging it turns out that the patch is supposed to work. If I force using the PG_FILE_MAP_LARGE_PAGES, postgres starts and I do see "Locked WS" usage with VMMap, with a size in the order of magnitude of my shared_buffers. What is apparently not working on my VM is IsWindowsVersionOrGreater(10, 0, 1703). I added some debug around to check what GetVersionEx() [2] is saying, and I get: dwMajorVersion == 6 dwMinorVersion == 2 dwBuildNumber == 9200 While winver.exe on the same vm says windows 11, version 21H2, build 22000.493. I'm therefore extremely confused. The documentation of IsWindowsVersionOrGreater() at [3] is also highly confusing: > TRUE if the specified version matches, or is greater than, the version of the > current Windows OS; otherwise, FALSE. Isn't that supposed to be the opposite? [2] https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa [3] https://docs.microsoft.com/en-us/windows/win32/api/versionhelpers/nf-versionhelpers-iswindowsversionorgreater