• Austin Clements's avatar
    runtime: fix preemption of fractional and idle mark workers · dd500193
    Austin Clements authored
    Currently, gcDrain looks for the preemption flag at getg().preempt.
    However, commit d6625caf moved mark worker draining to the system
    stack, which means getg() returns the g0, which never has the preempt
    flag set, so idle and fractional workers don't get preempted after
    10ms and just run until they run out of work. As a result, if there's
    enough idle time, GC becomes effectively STW.
    
    Fix this by looking for the preemption flag on getg().m.curg, which
    will always be the user G (where the preempt flag is set), regardless
    of whether gcDrain is running on the user or the g0 stack.
    
    Change-Id: Ib554cf49a705b86ccc3d08940bc869f868c50dd2
    Reviewed-on: https://go-review.googlesource.com/32251
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    dd500193
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...