• Austin Clements's avatar
    runtime: make assists preemptible · 45652830
    Austin Clements authored
    Currently, assists are non-preemptible, which means a heavily
    assisting G can block other Gs from running. At the beginning of a GC
    cycle, it can also delay scang, which will spin until the assist is
    done. Since scanning is currently done sequentially, this can
    seriously extend the length of the scan phase.
    
    Fix this by making assists preemptible. Since the assist holds work
    buffers and runs on the system stack, this must be done cooperatively:
    we make gcDrainN return on preemption, and make the assist return from
    the system stack and voluntarily Gosched.
    
    This is prerequisite to enlarging the work buffers. Without this
    change, the delays and spinning in scang increase significantly.
    
    This has no effect on the go1 benchmarks.
    
    name              old time/op  new time/op  delta
    XBenchGarbage-12  5.72ms ± 4%  5.37ms ± 5%  -6.11%  (p=0.000 n=20+20)
    
    Change-Id: I829e732a0f23b126da633516a1a9ec1a508fdbf1
    Reviewed-on: https://go-review.googlesource.com/15894Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    45652830
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...