http://bugs.winehq.org/show_bug.cgi?id=60462 Bug ID: 60462 Summary: NtPowerInformation(ProcessorInformation) opens two cpufreq files per CPU on every call Product: Wine Version: unspecified Hardware: aarch64 OS: Android Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@list.winehq.org Reporter: tarikcaramanico@gmail.com Target Milestone: --- NtPowerInformation(ProcessorInformation) (dlls/ntdll/unix/system.c, master 63f62f7cd696, lines 4682-4730) opens /sys/devices/system/cpu/cpuN/cpufreq/cpuinfo_max_freq and scaling_max_freq for every CPU on every call, with no caching (CurrentMhz is set to MaxMhz anyway). Some games call CallNtPowerInformation(ProcessorInformation) every frame. Age of Empires IV does, about 45 times per second in a match. On an 8-core Snapdragon 8 Gen 2 (Proton 11 ARM64EC through GameNative, Android) one call took 228.5 us on average (200 calls, game idle at its menu), and in a late-game replay the call took 11 % of the game's main thread. Answering repeat calls from a cache for 250 ms (done outside Wine, in the emulator layer, as a test) brought that to 1.7 % and gave about +0.5 FPS. Possible fix: read cpuinfo_max_freq once, and cache scaling_max_freq for a short time (it can change with power and thermal policy, so not forever). See also bug 58397: battery state queries through NtPowerInformation also read sysfs on every call. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.