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

thread: Implement idle more efficiently #83

Open
notYuriy opened this issue Aug 24, 2021 · 0 comments
Open

thread: Implement idle more efficiently #83

notYuriy opened this issue Aug 24, 2021 · 0 comments

Comments

@notYuriy
Copy link
Contributor

For now CPUs go to sleep as soon as

  • their per-cpu queue is empty
  • they are done with whatever they were running

In some cases such overly agressive idling scheme leads to serious performance issues. For example, if there is one posix server thread allocated to the core, it will often wake up for short periods of time. Between those wakeups, CPU will go to idle. In this case, every wakeup of posix server thread will require sending IPI, which is an expensive operation (especially so in VMs).

To fix this problem, dequeue method of ready queue can poll for a short period of time before actually going to sleep using arch-specific instruction. The only question is how to determine the length of this period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant