From: Austin Clements Date: Fri, 19 Aug 2016 20:03:14 +0000 (-0400) Subject: runtime: fix check for vacuous page boundary rounding again X-Git-Tag: go1.8beta1~1766 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3de7dbb19145dcc6b7db8da7aef695961dbb5ece;p=gostls13.git runtime: fix check for vacuous page boundary rounding again The previous fix for this, commit 336dad2a, had everything right in the commit message, but reversed the test in the code. Fix the test in the code. This reversal effectively disabled the scavenger on large page systems *except* in the rare cases where this code was originally wrong, which is why it didn't obviously show up in testing. Fixes #16644. Again. :( Change-Id: I27cce4aea13de217197db4b628f17860f27ce83e Reviewed-on: https://go-review.googlesource.com/27402 Run-TryBot: Austin Clements Reviewed-by: Brad Fitzpatrick --- diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 3f873267ba..8db2fcc288 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -917,7 +917,9 @@ func scavengelist(list *mSpanList, now, limit uint64) uintptr { // more memory than we want.) start = (start + sys.PhysPageSize - 1) &^ (sys.PhysPageSize - 1) end &^= sys.PhysPageSize - 1 - if start <= end { + if end <= start { + // start and end don't span a + // whole physical page. continue } }