Skip to content
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

sched_yield called nonstop, causing 100% cpu usage #1009

Open
GameParrot opened this issue Jun 23, 2024 · 4 comments
Open

sched_yield called nonstop, causing 100% cpu usage #1009

GameParrot opened this issue Jun 23, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@GameParrot
Copy link
Contributor

sched_yield() is called over and over by the game, causing very high cpu usage

To Reproduce
Steps to reproduce the behavior:

  1. start mcpelauncher-client with strace
  2. see sched_yield spam

Expected behavior
It should not be called this much

Desktop (please complete the following information):

  • OS: Linux
  • Version: built from source, also happens with latest appimage
  • Installation Type: built from source

Additional context
Stubbing sched_yield fixes the cpu usage issue, may cause other bugs

@GameParrot GameParrot added the bug Something isn't working label Jun 23, 2024
@GameParrot
Copy link
Contributor Author

GameParrot commented Jun 23, 2024

Doesn't always happen, possible race condition
Gets triggered by limiting fps and when getting low fps

@ChristopherHX
Copy link
Member

didn't observe this problem on ubuntu 22.04

@GameParrot
Copy link
Contributor Author

didn't observe this problem on ubuntu 22.04

Did you try limiting fps in video settings

@ChristopherHX
Copy link
Member

yes, 60, 50, 40, 20, 10 fps

The cpu usages is going back, between 20 and 10 there was almost no difference anymore

Maybe a very very powerfull cpu is the causing the difference, or mobile cpu's have different behavior here
I didn't trace any calls to yield, but if the same functions calls it over and over again then the OS might ignore the yield request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants