components/golang-17/patches/0015-release-branch.go1.7-runtime-fix-check-for-vacuous-p.patch
author Shawn Walker-Salas <shawn.walker@oracle.com>
Tue, 20 Dec 2016 11:59:29 -0800
changeset 7518 c388d4e1d3ad
permissions -rw-r--r--
PSARC/2016/250 Google Go version 1.7 23170486 update to Google Go version 1.7 and add sparc64 support
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7518
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     1
From 40712a962573a9ad987c71ba2cb24e6d430b559d Mon Sep 17 00:00:00 2001
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     2
From: Austin Clements <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     3
Date: Fri, 19 Aug 2016 16:03:14 -0400
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     4
Subject: [PATCH 15/38] [release-branch.go1.7] runtime: fix check for vacuous
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     5
 page boundary rounding again
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     6
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     7
The previous fix for this, commit 336dad2a, had everything right in
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     8
the commit message, but reversed the test in the code. Fix the test in
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     9
the code.
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    10
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    11
This reversal effectively disabled the scavenger on large page systems
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    12
*except* in the rare cases where this code was originally wrong, which
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    13
is why it didn't obviously show up in testing.
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    14
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    15
Fixes #16644. Again. :(
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    16
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    17
Change-Id: I27cce4aea13de217197db4b628f17860f27ce83e
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    18
Reviewed-on: https://go-review.googlesource.com/27402
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    19
Run-TryBot: Austin Clements <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    20
Reviewed-by: Brad Fitzpatrick <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    21
Reviewed-on: https://go-review.googlesource.com/28631
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    22
Run-TryBot: Chris Broadfoot <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    23
---
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    24
 src/runtime/mheap.go | 4 +++-
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    25
 1 file changed, 3 insertions(+), 1 deletion(-)
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    26
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    27
diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    28
index db60f7a..8db2fcc 100644
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    29
--- a/src/runtime/mheap.go
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    30
+++ b/src/runtime/mheap.go
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    31
@@ -917,7 +917,9 @@ func scavengelist(list *mSpanList, now, limit uint64) uintptr {
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    32
 				// more memory than we want.)
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    33
 				start = (start + sys.PhysPageSize - 1) &^ (sys.PhysPageSize - 1)
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    34
 				end &^= sys.PhysPageSize - 1
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    35
-				if start == end {
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    36
+				if end <= start {
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    37
+					// start and end don't span a
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    38
+					// whole physical page.
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    39
 					continue
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    40
 				}
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    41
 			}
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    42
-- 
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    43
2.7.4
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    44