-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High CPU usage from syscall conflict in pf-kernel 5.15 #5346
Comments
Hello @literal-0x4e, this sounds like #5271. What kernel are you using, and does it have out of tree patches which include the former futex2 patch set which was obsoleted by futex waitv? Does setting a game to |
Thank You for a speedy reply. I just tried three variations as per linked bug description: |
I have found that when running games on affected proton versions with
Now, as to why I am affected despite not having any The fix to disable fsync from the aforementioned bug report (commit inb4 this gets the "CLOSED NOTABUG" –Poettering treatment. |
Thanks for looking into the details @literal-0x4e, it looks like this syscall conflict is already resolved in pf-kernel v5.16-pf0 (possibly a pre-release version) https://gitlab.com/post-factum/pf-kernel/-/blob/pf-5.16/arch/arm64/include/asm/unistd32.h#L908. |
Is there a reason why those kernels use the next free syscall number for their downstream patches (the old futex2 is guilty of this as well) instead of something a bit more random to even try to avoid problem with backwards/forward-compability? That's bound to cause problems.
The syscall number is now reserved upstream. There's a bunch of downstream kernelsthat are popular among enthusiast that we want to support. Zen and TKG both rock the upstream cherry-picks in their 5.15 versions.
Wineserver is single-threaded and caches the state of fsync enablement. syscall( __NR_futex_waitv, 0, 0, 0, 0, 0);
do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; If self.check_environment("PROTON_NO_FSYNC", "nofsync")
# ...
if "nofsync" in self.compat_config:
self.env.pop("WINEFSYNC", "")
else:
self.env["WINEFSYNC"] = "1" There may be one of those calls coming per non-server process due to dlls/ntdll/unix/fsync.c:160, but that does not explain the behavior you are seeing. That's the bit that could use some more investigation and fixing. |
I cannot tell if there's a reason other than simplicity, but as far as I've seen, sometimes sysfs entries to get the syscall number exist, e.g.
That's exactly why I assumed detection based on the minor version would be undesirable :)
Oh yeah, I saw that bit and somehow (probably due to being a bit ill at the time) it did not register to me yesterday that
Okay, I shall try to investigate deeper. Although as it's been some seven years since my last wine patch / last time I tried to hack on wine, it might take a while for me to recall how to deal with this peculiar piece of software properly, so don't hold your breath. |
When using
proton-6.3-8
ORproton experimental
, proton/wine components (not counting the actual game itself) produce some insane CPU usage, on average some 14 cores worth (!!!) of load. I tried various games and it happens with every single game I tried.it looks something like this (tested with Disgaea 1 here, but it's more or less the same with other games, too)
note how wine/proton adds up to 14 cores worth of load, while the game itself only uses up 1/8th (12.4%) of a core.
I bisected this regression and found this to be the offending commit:
Unfortunately, this commit just updates a bunch of submodules, yet I am not sure how to bisect submodules correctly, so I cannot pinpoint what exactly causes this regression at this time. Although if you so require of me, I can try figuring that out and bisect the submodules, too, to find the exact change.
For the sake of comparison, this is how the CPU usage looks like on that very same game when running on commit
ea7eaa41d15ad3c27b53297946ae9a2ca2ed3974
(i.e. the commit right before the "bad" commit). Note how wine/proton itself basically doesn't use any cpu timeP.S. I do have a 16c/32t processor, so I got cores to spare either way, but this high usage is just silly – I'll get blamed for global warming if this keeps up 😂👌
The text was updated successfully, but these errors were encountered: