Skip to content

runtime: MHeap_ReclaimList undercounts reclaimed pages #9048

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
rsc opened this issue Nov 2, 2014 · 0 comments
Closed

runtime: MHeap_ReclaimList undercounts reclaimed pages #9048

rsc opened this issue Nov 2, 2014 · 0 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Nov 2, 2014

MHeap_ReclaimList is asked to reclaim at least npages pages, but it counts the number of
spans reclaimed, not the number of pages reclaimed. The number of spans reclaimed is
strictly larger than the number of pages, so this is not wrong, but it may be forcing
more reclamation than was intended by the caller. The offending line is:

            n += runtime·MSpan_Sweep(s, false);

This is adding a bool (whether the span was completely freed) to the page count n. It
should instead be adding the number of pages in the span, if MSpan_Sweep returns true.

This appears to have been introduced in Feb 2014 as part of the concurrent sweep code. 
https://golang.org/cl/46430043

Working well enough for Go 1.4 but maybe worth tightening up for Go 1.5.
@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014
@rsc rsc removed accepted labels Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 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

3 participants