• Austin Clements's avatar
    runtime: fix preemption of root marking jobs · d70b0fe6
    Austin Clements authored
    The current logic in gcDrain conflates non-blocking with preemptible
    draining for root jobs. As a result, if you do a non-blocking (but
    *not* preemptible) drain, like dedicated workers do, the root job
    drain will stop if preempted and fall through to heap marking jobs,
    which won't stop until it fails to get a heap marking job.
    
    This commit fixes the condition on root marking jobs so they only stop
    when preempted if the drain is preemptible.
    
    Coincidentally, this also fixes a nil pointer dereference if we call
    gcDrain with gcDrainNoBlock and without a user G, since it tries to
    get the preempt flag from the nil user G. This combination never
    happens right now, but will in the future.
    
    Change-Id: Ia910ec20a9b46237f7926969144a33b1b4a7b2f9
    Reviewed-on: https://go-review.googlesource.com/32291
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    d70b0fe6
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...