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

ERL-1079: High CPU usage with "+sbwtdio none" #4031

Closed
OTP-Maintainer opened this issue Oct 28, 2019 · 1 comment
Closed

ERL-1079: High CPU usage with "+sbwtdio none" #4031

OTP-Maintainer opened this issue Oct 28, 2019 · 1 comment
Assignees
Labels
bug Issue is reported as a bug priority:high team:VM Assigned to OTP team VM
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: huiliu
Affected version: OTP-22.0
Fixed in version: OTP-22.1.8
Component: erts
Migrated from: https://bugs.erlang.org/browse/ERL-1079


We are working on a I/O heavy application. Previously with OTP 21.2(erts-10.2), we disable busy waiting of dirty I/O scheduler by "+sbwtdio none". Recently we upgraded to OTP22.07(erts-10.4.4), we see way too much CPU usage with same "+sbwtdio none". 

I did some CPU profiling by Linux perf. It seems wake_dirty_scheduler in erl_process.c is the one who consumes most of cpu cycles. It is busy with a spinlock. Is that a known issue in OTP 22 that "+sbwtdio none" is broken?

BTW - if I switch to "+sbwtdio short"(default option), CPU usage is back to normal level.   
@OTP-Maintainer
Copy link
Author

rickard said:

Spinlocks are notoriously bad when they get highly contended. I pushed a branch {{rickard/dirty-sleepers-contention}} (based on OTP-22.1.7) to my [github repo|https://github.com/rickard-green/otp] which replace the usage of spinlocks with mutexes for this. The contention is still there, but it should behave much better. Please try and get back with the result.

I really would like to rewrite how dirty schedulers sleep and are woken, but haven't got time for that right now. Have put it on the todo-list though.

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:high labels Feb 10, 2021
@OTP-Maintainer OTP-Maintainer added this to the OTP-22.1.8 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:high team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants