From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by sourceware.org (Postfix) with ESMTPS id 8C78A3858C31 for ; Mon, 16 Jan 2023 13:08:27 +0000 (GMT) Authentication-Results: sourceware.org; dmarc=permerror 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 (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MVNF1-1p7kIr1ke7-00SP0r; Mon, 16 Jan 2023 14:08:22 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id AAC53A8088F; Mon, 16 Jan 2023 14:08:21 +0100 (CET) Date: Mon, 16 Jan 2023 14:08:21 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Cc: Achim Gratz Subject: Re: vmstat yields error 'Unable to create system stat structure' on W11x64 Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com, Achim Gratz References: <38D69F25-39D2-4A62-B2BD-94055EB2994B@prs.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Provags-ID: V03:K1:iQEWQ66NLVH3wDldVHbwY1YsbkVhulZT0NqgsACkG2zGuXjS1sl AxnP6ZMGjPOwa7BI2kvFyHe2xZULVGpV5dND2c+5+VRH3XivSxv/RqMQ/CZOjXM/jxfYAKt 2e9rElXEvI0yAYy9odj1eWnge/o6WhHppugMsKd0bcHtjsStuA/gRKjN0h9oyxKFbSyHbM+ yV8pkCZdgRCsoiNh4pXhA== UI-OutboundReport: notjunk:1;M01:P0:sRqn3pSHdPI=;dGpz7inSwGd400gYm8Qm/XKQz0V ayVaVSRQEQojbIkcxQNj3x8ClfsT6ap6tUe1YD1Y6nXSNeeN88fE+4fCMuUxBIcCswPtqanG5 EIUMOk4juQ7uJsosJJsrG8rGrIhlCO7qWorbSQ3js+QOFGXGjgYdwW5dij2kQMf0j79aM1jyN ZJoD0FzfaECgNKnHdPImVImJ2dnEM0LboTjRI0dlffZIOro5Ez/CfvpqaaNagoCU2MbRAr9k/ Bi6WjjtF9O3ChTunRavkEs3G4hBKNIRYlfKtaoQg6DxUBiU26Uo36gzI6A1dS5oXDbLldJ6q4 UBc6Nid2S5nIc2Cme38Y8zBBxGz4qR5eagbc5V1JnxeXHAVOfQ8O87CyOEcBTuQsOp4o9LOKY hLZWhcR5he4VLU1OGQiF+YOY4aD+XnbJkWY+Ps+KYzcd1FyUWlsVKG8WaWigZ73518RvDTG7X mbY5uJ3PxjWroPJp+voWLHjMu+iiZ4hSHyFFvTgUxMsQBKOs2EySIUpZYyBzGmNLN4P85Bko6 3tDvuM8U73NYFlwv4a3DZ5Bm2nGj4pRHKqWLM48cmh8iv0jkOuuWCYdi0/VKRYN9dbplE8vDn oHtr/StaY1vfEUtOYEqMBXup7TzskNcJ0dC7Vq+CSR5euxjw9VpVMDM6VW70l5EP6I6ilPRVZ /wPiPDWtxpTSQXtzHFIZz9PAiJzVzA7CtiZcWpzC4A== X-Spam-Status: No, score=-96.6 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_DMARC_STATUS,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_FAIL,SPF_HELO_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Jan 16 11:19, Corinna Vinschen via Cygwin wrote: > On Jan 15 22:04, System Administrator via Cygwin wrote: > > Hello, > > > > I am trying to migrate my framework to Windows 11 running Cygwin. > > When executing vmstat it returns the following error: > > > > "Unable to create system stat structureā€¯ > > [...] > I don't think this has anything to do with Windows10 or 11, but with the > version of procps-ng you're running. > > I tried vmstat from procps-ng-4.0.2-1 on both, W10 and W11, and I got > the above error in both cases. > > I switched back to procps-ng-3.3.17-1 and vmstat worked fine on both, > W10 and W11. > > I ran vmstat from procps-ng-4.0.2-1 under GDB and found that this > vmstat tries to dynamically load libnuma.so or libnuma.1.so, both > of which are naturally not available on Cygwin. So I guess vmstat > from procps-ng-4.x still needs another patch. While that's obviously wrong, it's not the problem. It turns out that vmstat from procps-ng 4.0.2 stumbles over the fact, that /proc/cpuinfo only prints the following fields if the CPU is a multi core CPU: "physical id" "siblings", "core id" "cpu cores" "apicid" "initial apicid" On Linux the output of those fields only depends on the configuration of the kernel. If it has been built with CONFIG_SMP, these fields are part of the /proc/cpuinfo output. On Cygwin, the output of these fields actually depends on the fact if the HTT CPU flag is set or not. If not, it's not a multi core CPU and the aforementioned fields are omitted. I could reproduce this issue by changing the CPU topology in my QEMU/KVM Windows 10 machine. The default topology was 4 CPUs with 1 core and 1 thread each. I changed that to 2 CPUs with 2 cores and 1 thread each. After restarting the W10 machine, vmstat from procps-ng 4.0.2 started working as desired. So we can fix this issue by tweaking Cygwin instead. I guess this will be fodder for the upcoming 3.4.4 release. I'll also provide a test release in a bit, stay tuned. Achim, I still wonder if vmstat shouldn't also work on Linux if the kernel hasn't been built with CONFIG_SMP. Does the vmstat code fail to take that into account? Corinna