go/src/time
Michael Pratt 72ccabc994 [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>
2021-04-29 18:45:57 +00:00
..
tzdata lib/time, time/tzdata: update tz data to 2020a 2020-04-30 08:07:39 +00:00
embed.go time/tzdata: new package 2020-04-14 19:34:31 +00:00
example_test.go runtime, time: gofmt 2020-05-26 22:06:26 +00:00
export_android_test.go
export_test.go time: use extended time format past end of zone transitions 2020-04-22 04:08:24 +00:00
export_windows_test.go
format.go time: note that formats may parse invalid strings 2020-06-02 22:20:47 +00:00
format_test.go time: quote original value in errors returned by ParseDuration 2020-04-14 00:01:14 +00:00
genzabbrs.go
internal_test.go time: stop referring to timerproc in comment 2020-03-13 00:19:08 +00:00
mono_test.go
sleep.go time, runtime: only call resetTimer from (*Timer).Reset 2020-04-06 03:35:33 +00:00
sleep_test.go [release-branch.go1.15] runtime, time: disable preemption in addtimer 2021-04-29 18:45:57 +00:00
sys_plan9.go
sys_unix.go
sys_windows.go
tick.go time: add Ticker.Reset 2020-02-24 01:50:28 +00:00
tick_test.go time: add Ticker.Reset 2020-02-24 01:50:28 +00:00
time.go time: use extended time format past end of zone transitions 2020-04-22 04:08:24 +00:00
time_test.go time: use extended time format past end of zone transitions 2020-04-22 04:08:24 +00:00
tzdata_test.go time/tzdata: new package 2020-04-14 19:34:31 +00:00
zoneinfo.go [release-branch.go1.15] time: use offset and isDST when caching zone from extend string 2021-04-12 21:24:29 +00:00
zoneinfo_abbrs_windows.go
zoneinfo_android.go
zoneinfo_android_test.go
zoneinfo_ios.go all: remove darwin/arm build-tags and files 2020-04-08 18:35:43 +00:00
zoneinfo_js.go
zoneinfo_plan9.go
zoneinfo_read.go [release-branch.go1.15] time: use offset and isDST when caching zone from extend string 2021-04-12 21:24:29 +00:00
zoneinfo_test.go [release-branch.go1.15] time: use offset and isDST when caching zone from extend string 2021-04-12 21:24:29 +00:00
zoneinfo_unix.go all: remove darwin/386 build-tags and files 2020-04-08 18:37:36 +00:00
zoneinfo_windows.go
zoneinfo_windows_test.go