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
runtime: empty local run queue when executing dedicated GC worker #20011
Comments
CC @aclements @RLH |
You're right that there's no code to actively push these goroutines out of the queue, but other Ps will still steal them off the queue. I don't think it would be hard to kick them to the global queue; I just haven't seen concrete evidence that this is a problem. |
The stealling will occur when the local queues are empty of all other Ps and the global queue is also empty which is a quite no-busy state. I mean that if the P executing GC marking goroutines need other M to steal its goroutines, it will never happen when the system is busy. So the goroutines in the local queue of the P executing GC marking goroutine will come across large latency. If they are put into global queue, they will have more probabilities to be scheduled. @aclements |
Go doesn't have a fair goroutine scheduler. So if your system is > 100% loaded, you're going to have to starved goroutines no matter what. If you're below 100% loaded, you will have periods where there are no goroutines to run and any goroutines in queues will get stolen. |
CL https://golang.org/cl/46610 mentions this issue. |
For the dedicated goroutine doing marking work between STW1 and STW2, it can not be preempted until finishing the initial marking work. So how about the goroutines in the local queue of the P executing this gcmarking work goroutine. They are starving?
I doesn't find any codes to move the goroutines from local queue to global queue so that this goroutines can be scheduled. So please help me clear about it. If runtime doesn't do it, I think it's quite unfair for the goroutines in the local queue of the P executing the dedicated goroutine.
The text was updated successfully, but these errors were encountered: