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 1njDEM-00044H-RU for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Apr 2022 04:55:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1njDEL-0002R0-Fj for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Apr 2022 04:55:17 +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 1njDEL-0002Qq-4m for pgsql-hackers@lists.postgresql.org; Tue, 26 Apr 2022 04:55:17 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1njDEF-0003I4-KZ for pgsql-hackers@lists.postgresql.org; Tue, 26 Apr 2022 04:55:16 +0000 Received: by mail-pg1-x52d.google.com with SMTP id v10so4051063pgl.11 for ; Mon, 25 Apr 2022 21:55:11 -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=NzAxk2FuZYYh/Z/Jcc4Hs1nsSkoOJD1aVev+YF3MClk=; b=E+aT3juanI0SoXuHMPcCZyOlYCGBCLFbeZBsMe24A6xXFzczfu6gz2KOc7mSBwj0Gf JGpyc4cUUjpo1aJJAhWGnCHm4pPy81ZIUCF/xj5NJ0FH3OJ3l+NUdu7T+dBDqxsVegKA 57b41WNXFxUDc5DY/jNlvk1809f+yHpyAg8TLezMh4FDhkAX1kmOt7TV3SL3H766q0iZ GsIwIvDNjF0gjccEdhFc/uGrHgO3JKZmdP3T0DFHBDythbbSZnTr7Nmlf4gF7mqsHEwL JUoDopeLL5g9QIyiGfxggdVNK/5+sD7IykA6Z/mPFbJIGimtQjyoZPsUe3tCibqlCS3d yFTw== 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=NzAxk2FuZYYh/Z/Jcc4Hs1nsSkoOJD1aVev+YF3MClk=; b=PTrGd5mZzxCiy19qAaBRapZokRYSYe42HaOsdRNzH5wSq2CbhSmhwEbRwcFADCOtIE GZTKl/JttzVjmeDpk8Zpu9ptM2/Ptv0OPChBzBjrshieFNBe6vJ1WW8w+gEjOb18UJld rnjtTnX/4FbHw65WPD2/D+cCdep0Scer6PrJaGyjfJPFxlYB/FZl08rDSb3W6ThtDA8R 28JfB8nVIofngx7ImCJpxnf4atnizpo47IVclkDq0yDd8WCymk/FX/RCWjkoMorY9wXx DGg0BODbGqshPsoA+x46qEPGCA4wUiuNTKHIR7IVpPH4+ZuERf4YR7byyp/q5zbj2XoW RLKQ== X-Gm-Message-State: AOAM533ZJguBd2AUDyMWOcmrNlEpbj/DrVo9FGyF19hCAxHbStem4KNL 9VI3Y7QWMQCYNSUi9AWwjU4YPHPcNgg= X-Google-Smtp-Source: ABdhPJy74znxQIpkjYexXI1U/YivhMy5+cv3/AIQ+FEgV8gfHz27/9Z9s1IDWYnWu2OIGFeUeHvsAQ== X-Received: by 2002:a05:6a00:14c4:b0:50a:9524:67bf with SMTP id w4-20020a056a0014c400b0050a952467bfmr22295109pfu.55.1650948910450; Mon, 25 Apr 2022 21:55:10 -0700 (PDT) Received: from jrouhaud (1-171-165-53.dynamic-ip.hinet.net. [1.171.165.53]) by smtp.gmail.com with ESMTPSA id x129-20020a623187000000b0050835f6d6a1sm13205797pfx.9.2022.04.25.21.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 21:55:09 -0700 (PDT) Date: Tue, 26 Apr 2022 12:54:35 +0800 From: Julien Rouhaud To: Wilm Hoyer Cc: pgsql-hackers@lists.postgresql.org Subject: Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work. Message-ID: References: <20220326082408.moh55zuecxjmewnm@jrouhaud> <20220331045908.bm5edcacvymgwwv2@jrouhaud> <20220331080055.hjrrsrd4lxwlt7f5@jrouhaud> <20220331104659.ol6pqe7s3tpkymuk@jrouhaud> <20220331110309.ws25d6dl5yyzprye@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Please keep the list in copy, especially if that's about Windows specific as I'm definitely not very knowledgeable about it. On Fri, Apr 01, 2022 at 09:18:03AM +0000, Wilm Hoyer wrote: > > If you don't wanna go the manifest way, maybe the RtlGetVersion function is the one you need: > https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlgetversion?redirectedfrom=MSDN Thanks for the info! I tried to use the function but trying to include either wdm.h or Ntddk.h errors out. Unfortunately I don't know how to look for a file in Windows so I don't even know if those files are present. I searched a bit and apparently some people are using this function directly opening some dll, which seems wrong. > Another Idea on windows machines would be to use the commandline to execute > ver in a separate Process and store the result in a file. That also seems hackish, I don't think that we want to rely on something like that. > >> While winver.exe on the same vm says windows 11, version 21H2, build 22000.493. > > > So, what GetVersionEx returns is actually "it depends", and this is documented: > > >> With the release of Windows 8.1, the behavior of the GetVersionEx API > >> has changed in the value it will return for the operating system > >> version. The value returned by the GetVersionEx function now depends > >> on how the application is manifested. > >> > >> Applications not manifested for Windows 8.1 or Windows 10 will return > >> the Windows 8 OS version value (6.2). Once an application is > >> manifested for a given operating system version, GetVersionEx will > >> always return the version that the application is manifested for in > >> future releases. To manifest your applications for Windows 8.1 or > >> Windows 10, refer to Targeting your application for Windows. > > The documentation is a bit unclear - with the correct functions you should get the: > Minimum( actualOS-Version, Maximum(Manifested OS Versions)) > The Idea behind, as I understand it, is to better support virtualization and > backward compatibility - you manifest only Windows 8.1 -> than you always get > a System that behaves like Windows 8.1 in every aspect. (Every Aspect not > true in some corner cases due to security patches) Well, it clearly does *NOT* behave as a Windows 8.1, even if for some reason large pages relies on security patches. Their API is entirely useless, so I'm still on the opinion that we should unconditionally use the FILE_MAP_LARGE_PAGES flag if it's defined and call it a day.