• Austin Clements's avatar
    runtime: assist before allocating · 65aa2da6
    Austin Clements authored
    Currently, when the mutator allocates, the runtime first allocates the
    memory and then, if that G has done "enough" allocation, the runtime
    checks whether the G has assist debt to pay off and, if so, pays it
    off. This approach leads to under-assisting, where a G can allocate a
    large region (or many small regions) before paying for it, or can even
    exit with outstanding debt.
    
    This commit flips this around so that a G always acquires enough
    credit for an allocation before it can perform that allocation. We
    continue to amortize the cost of assists by requiring that they
    over-assist when triggered to build up credit for many allocations.
    
    Fixes #11967.
    
    Change-Id: Idac9f11133b328535667674d837be72c23ebd899
    Reviewed-on: https://go-review.googlesource.com/15409Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    Run-TryBot: Austin Clements <austin@google.com>
    65aa2da6
Name
Last commit
Last update
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...