diff options
author | Michael Pratt <mpratt@google.com> | 2021-03-10 16:06:47 -0500 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-04-29 18:45:57 +0000 |
commit | 72ccabc99449b2cb5bb1438eb90244d55f7b02f5 (patch) | |
tree | 0d02e9744fda8a9ec46b72a1e05140fe3860c424 /src/runtime/symtab.go | |
parent | 5aed4ce3c854bdbbb6dd5c1ccfa15c23d4b6c989 (diff) | |
download | go-72ccabc99449b2cb5bb1438eb90244d55f7b02f5.tar.gz go-72ccabc99449b2cb5bb1438eb90244d55f7b02f5.zip |
[release-branch.go1.15] runtime, time: disable preemption in addtimer
The timerpMask optimization updates a mask of Ps (potentially)
containing timers in pidleget / pidleput. For correctness, it depends on
the assumption that new timers can only be added to a P's own heap.
addtimer violates this assumption if it is preempted after computing pp.
That G may then run on a different P, but adding a timer to the original
P's heap.
Avoid this by disabling preemption while pp is in use.
Other uses of doaddtimer should be OK:
* moveTimers: always moves to the current P's heap
* modtimer, cleantimers, addAdjustedTimers, runtimer: does not add net
new timers to the heap while locked
For #44868
Fixes #45731
Change-Id: I4a5d080865e854931d0a3a09a51ca36879101d72
Reviewed-on: https://go-review.googlesource.com/c/go/+/300610
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/313129
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/symtab.go')
0 files changed, 0 insertions, 0 deletions