https://bugs.winehq.org/show_bug.cgi?id=56981
Bug ID: 56981 Summary: Mouse movement causes huge CPU spikes when using WINEESYNC. Product: Wine-staging Version: 9.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: logos128@gmail.com CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Regression SHA1: e479cad86f1f7de5d2a0a0d1398e7733c0aaef3e Distribution: ArchLinux
The problem occurs every time when Wine is launched with WINEESYNC=1 - doesn't matter the application or the type of desktop used (virtual/non-virtual). It also happens when wine apps are in background, i.e. the topmost window is from a Linux app, etc. (As a side note Proton's fsync patchset is also affected.)
The process with highest CPU usage is c:\windows\system32\explorer.exe (~70%) followed by /usr/bin/wineserver (~40%) - on a 6 core Intel CPU (12 virtual cores). Normally these processes have very low CPU usage (<1%) on mouse movement.
I did manual bisect on the wine-development tree and found that commit 90dcd2eaa6b6a2afaf298f1e457938350b0becfc "win32u: Use the thread message queue shared memory in peek_message." was causing the problem with the eventfd_synchronization patchset. After reverting this commit + the other two related win32u commits, CPU usage is back to normal when using esync.
Steps to reproduce: 1. Launch any Wine app - for example "winecfg". 2. Move the mouse pointer intensively. 3. See the CPU usage.
https://bugs.winehq.org/show_bug.cgi?id=56981
--- Comment #1 from Ivo Ivanov logos128@gmail.com --- Created attachment 76809 --> https://bugs.winehq.org/attachment.cgi?id=76809 wine-stg-esync-9_13.gz
WINEESYNC=1 WINEDEBUG=-all,+timestamp,+pid,+tid,+sync,+esync,+msg
https://bugs.winehq.org/show_bug.cgi?id=56981
--- Comment #2 from Ivo Ivanov logos128@gmail.com --- Created attachment 76810 --> https://bugs.winehq.org/attachment.cgi?id=76810 wine-stg-9_13.gz
WINEDEBUG=-all,+timestamp,+pid,+tid,+sync,+esync,+msg
https://bugs.winehq.org/show_bug.cgi?id=56981
Ivo Ivanov logos128@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=56981
--- Comment #3 from RĂ©mi Bernon rbernon@codeweavers.com --- This might require something like https://github.com/ValveSoftware/wine/commit/9ceae59cebd111f0fb06d63ad1495ea..., although I'm not sure it applies cleanly. The problem is that with esync/fsync and now the shared memory, we don't call anymore into wineserver to clear some message bits after having waited, and the queue stays signaled.
https://bugs.winehq.org/show_bug.cgi?id=56981
--- Comment #4 from Ivo Ivanov logos128@gmail.com --- Thanks. Will see if I can apply it to the wine-dev tree.