1. 07 Aug, 2017 3 commits
  2. 06 Aug, 2017 1 commit
  3. 05 Aug, 2017 2 commits
  4. 04 Aug, 2017 10 commits
  5. 03 Aug, 2017 6 commits
  6. 02 Aug, 2017 5 commits
  7. 31 Jul, 2017 4 commits
    • Austin Clements's avatar
      [release-branch.go1.9] runtime: map bitmap and spans during heap initialization · 196492a2
      Austin Clements authored
      We lazily map the bitmap and spans areas as the heap grows. However,
      right now we're very slightly too lazy. Specifically, the following
      can happen on 32-bit:
      
      1. mallocinit fails to allocate any heap arena, so
         arena_used == arena_alloc == arena_end == bitmap.
      
      2. There's less than 256MB between the end of the bitmap mapping and
         the next mapping.
      
      3. On the first allocation, mheap.sysAlloc sees that there's not
         enough room in [arena_alloc, arena_end) because there's no room at
         all. It gets a 256MB mapping from somewhere *lower* in the address
         space than arena_used and sets arena_alloc and arena_end to this
         hole.
      
      4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
         doesn't bother to call mheap.setArenaUsed, so we still don't have a
         bitmap mapping or a spans array mapping.
      
      5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
         spans array and crashes.
      
      Fix this by mapping the metadata regions for the initial arena_used
      when the heap is initialized, rather than trying to wait for an
      allocation. This maintains the intended invariant that the structures
      are always mapped for [arena_start, arena_used).
      
      Fixes #21044.
      
      Cherry-pick of CL 51714. Fixes #21234.
      
      Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
      Reviewed-on: https://go-review.googlesource.com/52191
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      196492a2
    • Austin Clements's avatar
      [release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation · 1a6d87d4
      Austin Clements authored
      Right now, if it's possible to grow the arena reservation but
      mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
      However, on 32-bit we have a fallback path that uses much smaller
      mmaps that could take in this situation, but fail to.
      
      This commit fixes mheap.sysAlloc to use a common failure path in case
      it can't grow the reservation. On 32-bit, this path includes the
      fallback.
      
      Ideally, mheap.sysAlloc would attempt smaller reservation growths
      first, but taking the fallback path is a simple change for Go 1.9.
      
      Updates #21044 (fixes one of two issues).
      
      Cherry-pick of CL 51713. Updates #21234.
      
      Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
      Reviewed-on: https://go-review.googlesource.com/52190
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      1a6d87d4
    • Austin Clements's avatar
      runtime: map bitmap and spans during heap initialization · 623e2c46
      Austin Clements authored
      We lazily map the bitmap and spans areas as the heap grows. However,
      right now we're very slightly too lazy. Specifically, the following
      can happen on 32-bit:
      
      1. mallocinit fails to allocate any heap arena, so
         arena_used == arena_alloc == arena_end == bitmap.
      
      2. There's less than 256MB between the end of the bitmap mapping and
         the next mapping.
      
      3. On the first allocation, mheap.sysAlloc sees that there's not
         enough room in [arena_alloc, arena_end) because there's no room at
         all. It gets a 256MB mapping from somewhere *lower* in the address
         space than arena_used and sets arena_alloc and arena_end to this
         hole.
      
      4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
         doesn't bother to call mheap.setArenaUsed, so we still don't have a
         bitmap mapping or a spans array mapping.
      
      5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
         spans array and crashes.
      
      Fix this by mapping the metadata regions for the initial arena_used
      when the heap is initialized, rather than trying to wait for an
      allocation. This maintains the intended invariant that the structures
      are always mapped for [arena_start, arena_used).
      
      Fixes #21044.
      
      Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
      Reviewed-on: https://go-review.googlesource.com/51714
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      623e2c46
    • Austin Clements's avatar
      runtime: fall back to small mmaps if we fail to grow reservation · 780249ee
      Austin Clements authored
      Right now, if it's possible to grow the arena reservation but
      mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
      However, on 32-bit we have a fallback path that uses much smaller
      mmaps that could take in this situation, but fail to.
      
      This commit fixes mheap.sysAlloc to use a common failure path in case
      it can't grow the reservation. On 32-bit, this path includes the
      fallback.
      
      Ideally, mheap.sysAlloc would attempt smaller reservation growths
      first, but taking the fallback path is a simple change for Go 1.9.
      
      Updates #21044 (fixes one of two issues).
      
      Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
      Reviewed-on: https://go-review.googlesource.com/51713
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      780249ee
  8. 30 Jul, 2017 1 commit
  9. 28 Jul, 2017 1 commit
  10. 27 Jul, 2017 2 commits
  11. 26 Jul, 2017 2 commits
  12. 25 Jul, 2017 3 commits