Skip to content

runtime: embrace write barriers during scan #11971

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

Closed
aclements opened this issue Jul 31, 2015 · 1 comment
Closed

runtime: embrace write barriers during scan #11971

aclements opened this issue Jul 31, 2015 · 1 comment

Comments

@aclements
Copy link
Member

It was with some trepidation that we enabled the write barrier during the concurrent scan phase (commits 1303957 and b0532a9). At the time, this was the simplest way of fixing lost write barriers with stack barriers, but there's a big TODO in func gc about other ways to fix the problem.

While there are other solutions to this particular problem, enabling the write barrier earlier has another very important property: it lets us enable mutator assists during all concurrent phases of the GC. This is important for avoiding over-allocation. The other alternative is to block user goroutines when they allocate too much during concurrent scan, which runs contrary to the whole purpose of concurrent GC.

We should embrace enabling the write barrier during concurrent scan. We should clean up code that originally dealt with enabling write barriers later, such as the whole "install write barrier" step that no longer actually installs the write barrier. We should also start background marking during scan (there's effectively no difference between the scan and mark phases any more), which will also improve the performance of assists by building up background mark credit and probably simplify the state machine approach advanced by #11970.

@RLH @rsc

@aclements aclements added this to the Go1.6Early milestone Jul 31, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/16044 mentions this issue.

@golang golang locked and limited conversation to collaborators Oct 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants