• Michael Anthony Knyszek's avatar
    runtime: stop unnecessary span scavenges on free · 06be7cbf
    Michael Anthony Knyszek authored
    This change fixes a bug wherein freeing a scavenged span that didn't
    coalesce with any neighboring spans would result in that span getting
    scavenged again. This case may actually be a common occurance because
    "freeing" span trimmings and newly-grown spans end up using the same
    codepath. On systems where madvise is relatively expensive, this can
    have a large performance impact.
    
    This change also cleans up some of this logic in freeSpanLocked since
    a number of factors made the coalescing code somewhat difficult to
    reason about with respect to scavenging. Notably, the way the
    needsScavenge boolean is handled could be better expressed and the
    inverted conditions (e.g. !after.released) can make things even more
    confusing.
    
    Fixes #28595.
    
    Change-Id: I75228dba70b6596b90853020b7c24fbe7ab937cf
    Reviewed-on: https://go-review.googlesource.com/c/147559
    Run-TryBot: Michael Knyszek <mknyszek@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    06be7cbf
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...