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 1naAe4-0001cG-G3 for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Apr 2022 06:20:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1naAe1-00049F-Mu for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Apr 2022 06:20:25 +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 1naAe1-00046j-CR for pgsql-bugs@lists.postgresql.org; Fri, 01 Apr 2022 06:20:25 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1naAdz-0003ab-0g for pgsql-bugs@lists.postgresql.org; Fri, 01 Apr 2022 06:20:24 +0000 Received: by mail-pl1-x631.google.com with SMTP id j8so1618952pll.11 for ; Thu, 31 Mar 2022 23:20:22 -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=2Jgi9tbuSjMj472MxnFCrZeeottHzDX0bTLZ+A3GrZ0=; b=llS2N2lq3rebk5yDnI6GxDioDSAL4VjzGeGUlXn8anF4Pcwk5CU99fVNxeMVHrpkE4 433OWHqpCnnFJoqbOyR6DtRtDSR5olB4ohVdvI0z2OrSfcmeetghHDaJolX+ouy3Kkk8 IlVW4+2p3ddNV91Hh5NLuYu6uTzO5B0XTuINxU+/72aUlcyauP25mECWAE3/fNnNkRvy 5G95p33JnzioaK+G/f0UdsbKplpSBvLaurvVTjrOqU7vRTmcv/EBDs4C4e+Ra/gGOeud eHmqLGHlRsPAcyFpOfUs/dFYoh7YA8wKsT2saBLIPp+/5JVyklJG9giK+NWGr0HoZKPZ 9FuQ== 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=2Jgi9tbuSjMj472MxnFCrZeeottHzDX0bTLZ+A3GrZ0=; b=yg+q4VgTF3Yrpglbp47VyTPEw2Mes8chQdhEJVBpKT3mXqNkZEelK82LFEVPev9dhB zz9bhe98RNRwrl8EI/FPu9klBBMr72MmZK59+kJlBKQMUE9ntlDcpBBd87r8YXy0li4B o5MlR/7GZLJqgO6mdcOpUcsihauFYX8HT/gcexZLtZjLLEZvselvD36lojOKLM1EY00S A31BGLvk8loHJmt1iwrBd8NTDdwvpXZJaHB3tFb2n19+WrW0LvNsIEbEv1cP+Rx6A1bp J+Io/uuOOXtuuIgRImYJTfE5dMt8s6zdUISMJh1Ha+bGwHslVpbr+hJM0WJNAvkQ4Rou 8QLw== X-Gm-Message-State: AOAM531DZqGka1fPvbRhbXjhep1t0M6y6JbOvdnYYndRQ7d7BkAvZvp/ YD0CKhM3AwoYYc1DJz0KzXU= X-Google-Smtp-Source: ABdhPJyNLL/pKrt3mpxwbrRXdSUZV/Vuh33jCCsnt1TiC/ZLa0yjkhNiiAvtib1a5+bdc4cpuZ1W3g== X-Received: by 2002:a17:902:f54e:b0:154:8219:ce02 with SMTP id h14-20020a170902f54e00b001548219ce02mr8911100plf.62.1648794021856; Thu, 31 Mar 2022 23:20:21 -0700 (PDT) Received: from jrouhaud (1-171-176-243.dynamic-ip.hinet.net. [1.171.176.243]) by smtp.gmail.com with ESMTPSA id j23-20020a17090ae61700b001c6bb352763sm1178199pjy.52.2022.03.31.23.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 23:20:20 -0700 (PDT) Date: Fri, 1 Apr 2022 14:19:46 +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: 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 On Fri, Apr 01, 2022 at 02:59:22PM +0900, Michael Paquier wrote: > On Thu, Mar 31, 2022 at 07:03:09PM +0800, Julien Rouhaud wrote: > > There's no such indication on IsWindowsVersionOrGreater(), but after seeing > > various comments on forums from angry people, it may be a hint that it behaves > > similarly. I'm not sure what to do at this point, maybe just always use the > > flag (the PG_ version which may be 0), hoping that hopefully windows won't > > define it if it can't handle it? > > Looking at the internals of versionhelpers.h, would it work to use as > arguments for IsWindowsVersionOrGreater() the following, in this > order? As of: > - HIBYTE(_WIN32_WINNT_WINTHRESHOLD) > - LOBYTE(_WIN32_WINNT_WINTHRESHOLD) > - 1703 > > Just to drop an idea. I will test that in a bit. I still think that at least some API exists to give the real answer since winver and similar report correct info, I just don't know what those are. Note that if you want to test yourself you could use this script [1] using the evaluation virtual machine [2] to automatically setup a windows 11 environment with everything needed to compile postgres with a extra dependencies. The whole process is a bit long though, so I can also give you access to my vm if you prefer, probably the latency shouldn't be too bad :) [1] https://github.com/rjuju/pg_msvc_generator/blob/master/bootstrap.ps1 [2] https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/