1. 15 Apr, 2019 8 commits
  2. 14 Apr, 2019 2 commits
  3. 13 Apr, 2019 5 commits
  4. 12 Apr, 2019 11 commits
  5. 11 Apr, 2019 11 commits
  6. 10 Apr, 2019 3 commits
    • Michael Anthony Knyszek's avatar
      runtime: introduce treapForSpan to reduce code duplication · 7b33b627
      Michael Anthony Knyszek authored
      Currently which treap a span should be inserted into/removed from is
      checked by looking at the span's properties. This logic is repeated in
      four places. As this logic gets more complex, it makes sense to
      de-duplicate this, so introduce treapForSpan instead which captures this
      logic by returning the appropriate treap for the span.
      
      For #30333.
      
      Change-Id: I4bd933d93dc50c5fc7c7c7f56ceb95194dcbfbcc
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170857
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      7b33b627
    • Michael Anthony Knyszek's avatar
      runtime: add tests for runtime mTreap · d13a9312
      Michael Anthony Knyszek authored
      This change exports the runtime mTreap in export_test.go and then adds a
      series of tests which check that the invariants of the treap are
      maintained under different operations. These tests also include tests
      for the treap iterator type.
      
      Also, we note that the find() operation on the treap never actually was
      best-fit, so the tests just ensure that it returns an appropriately
      sized span.
      
      For #30333.
      
      Change-Id: If81f7c746dda6677ebca925cb0a940134701b894
      Reviewed-on: https://go-review.googlesource.com/c/go/+/164100
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      d13a9312
    • Michael Anthony Knyszek's avatar
      runtime: throw if scavenge necessary during coalescing · 2ab6d017
      Michael Anthony Knyszek authored
      Currently when coalescing if two adjacent spans are scavenged, we
      subtract their sizes from memstats and re-scavenge the new combined
      span. This is wasteful however, since the realignment semantics make
      this case of having to re-scavenge impossible.
      
      In realign() inside of coalesce(), there was also a bug: on systems
      where physPageSize > pageSize, we wouldn't realign because a condition
      had the wrong sign. This wasteful re-scavenging has been masking this
      bug this whole time. So, this change fixes that first.
      
      Then this change gets rid of the needsScavenge logic and instead checks
      explicitly for the possibility of unscavenged pages near the physical
      page boundary. If the possibility exists, it throws. The intent of
      throwing here is to catch changes to the runtime which cause this
      invariant to no longer hold, at which point it would likely be
      appropriate to scavenge the additional pages (and only the additional
      pages) at that point.
      
      Change-Id: I185e3d7b53e36e90cf9ace5fa297a9e8008d75f3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/158377
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      2ab6d017