From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by sourceware.org (Postfix) with ESMTPS id 719313856DEA for ; Fri, 13 May 2022 11:04:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 719313856DEA Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MvKL3-1o7Y0q3cY5-00rFBh for ; Fri, 13 May 2022 13:04:37 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id DB432A80756; Fri, 13 May 2022 13:04:36 +0200 (CEST) Date: Fri, 13 May 2022 13:04:36 +0200 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: load average calculation failing -- fixed by Windows update Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <3a3edd10-2617-0919-4eb0-7ca965b48963@maxrnd.com> <223aa826-7bf9-281a-aed8-e16349de5b96@dronecode.org.uk> <53664601-5858-ffd5-f854-a5c10fc25613@maxrnd.com> <670cea06-e202-3c90-e567-b78d737f5156@dronecode.org.uk> <2c7d326d-3de0-9787-897f-54c62bf3bbcc@maxrnd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:CVoSJVsoryG83wmqoWXVBx0L6v3Tz0VGXZEuXYTWnKMbmDFkafH Ss5sshvB6XdbAVo+mSd7CUHkn/ZATiE/A6+LyR9LloFhfYfA4XpDYIK6wgpo05pvqIxQGXV CEhzmvObSUSLgo0slNH5lWIcPa+DOxjGjE97NzLsuSFWzb7hFYWDczdYlX2NfABhQMQvopr Yg2UniwTtHgPTI9xPRYkg== X-UI-Out-Filterresults: notjunk:1;V03:K0:HqAPt2c56nI=:ZPUiR3DJj5GfekFnujhtb4 QVJqBpHmYsgzAzq5r2lzlu23Ww1+JOMBCLCukdKSMbTe2IJ+DakNcw9m+yz/zFsJfY/mqcZI8 I4bG5hMl8aE+d1kNU1d4SQju1gBeUr9FZSsGU0J0M5pqhFLLAMGiMV4uiM6rneuv4M3xkFEfq RxH5wfM/VumY6Wa7EaxND+ElR61kA6hCtrPA8Kl/HDKCZSpUWmuCZ0c17RIR8oss5d95Qdaa+ 6XlfK5XbzhVymFYH0f3mOGn7cdSq/H77vVMk73HVa64yfsqfsz+gE3qdsEx86cQkDUsIMGF5q LOlnrMjmdiA9ZcMvBr+vPWoVKI/zkaxfqemQXKVB0XAPMSFUiMjwmuOfA2Z20x+WtBMpTS1B4 EPpQ6/028gL5jVCx2z238lCg0JYR7xBT5rhWhZwIZKJxhi752Gbj3FeBjY36wboizJim/ulFv yLUBKvCQbupceJEtphQx1wFvS+sXynu40OCiTf4f9lA/V0LR08kvSibmoPD2BCE51zeO8VZkH xsgokYiqYOfGaLtihgF0T6gOCrvFPVPuOQnZxEWB1zN7LL2Xmf4+lKbDA7sJ49V3zUEin4tsX sGAPiBr+SsgdrodYFVyjgE/YzFNMGGHSy0oJqaTbHoPovgoE633wWogPYvBmRzf5WB1inpyZO bYuXUvs5t0qnbS8fPpZcnHJdKoIYt8+wxCVEyldfgYh9ixPyvdBRAevukoaq9xlCCSRriUjba nNuZ0PAHD9gbkd0o X-Spam-Status: No, score=-95.3 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_FAIL, SPF_HELO_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 11:04:41 -0000 On May 13 11:34, Jon Turney wrote: > On 12/05/2022 10:48, Corinna Vinschen wrote: > > On May 11 16:40, Mark Geisert wrote: > > > > > > The first counter read now gets error 0xC0000BC6 == PDH_INVALID_DATA, but no > > > errors on subsequent counter reads. This sounds like it now matches what > > > Corinna reported for W11. I wonder if she's running build 1706 already. > > > > Erm... looks like I didn't read your mail throughly enough. > > > > This behaviour, the first call returning with PDH_INVALID_DATA and only > > subsequent calls returning valid(?) values, is what breaks the > > getloadavg function and, consequentially, /proc/loadavg. So maybe xload > > now works, but Cygwin is still broken. > > The first attempt to read '% Processor Time' is expected to fail with > PDH_INVALID_DATA, since it doesn't have a value at a particular instant, but > one averaged over a period of time. > > This is what the following comment is meant to record: > > "Note that PDH will only return data for '% Processor Time' after the second > call to PdhCollectQueryData(), as it's computed over an interval, so the > first attempt to estimate load will fail and 0.0 will be returned." But. Every invocation of getloadavg() returns 0. Even under load. Calling `cat /proc/loadavg' is an excercise in futility. The only way to make getloadavg() work is to call it in a loop from the same process with a 1 sec pause between invocations. In that case, even a parallel `cat /proc/loadavg' shows the same load values. However, as soon as I stop the looping process, the /proc/loadavg values are frozen in the last state they had when stopping that process. Any suggestions how to fix this? Corinna