aboutsummaryrefslogtreecommitdiff
path: root/src/bytes
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-03-18 16:34:11 +0100
committerDmitry Vyukov <dvyukov@google.com>2016-05-03 10:06:32 +0000
commitfcd7c02c70a110c6f6dbac30ad4ac3eb435ac3fd (patch)
treeecf652d701125b971eb5e05edde7c1887d4d81bf /src/bytes
parent499cd3371997bdb6e33377266754d20782ef134d (diff)
downloadgo-fcd7c02c70a110c6f6dbac30ad4ac3eb435ac3fd.tar.xz
runtime: fix CPU underutilization
Runqempty is a critical predicate for scheduler. If runqempty spuriously returns true, then scheduler can fail to schedule arbitrary number of runnable goroutines on idle Ps for arbitrary long time. With the addition of runnext runqempty predicate become broken (can spuriously return true). Consider that runnext is not nil and the main array is empty. Runqempty observes that the array is empty, then it is descheduled for some time. Then queue owner pushes another element to the queue evicting runnext into the array. Then queue owner pops runnext. Then runqempty resumes and observes runnext is nil and returns true. But there were no point in time when the queue was empty. Fix runqempty predicate to not return true spuriously. Change-Id: Ifb7d75a699101f3ff753c4ce7c983cf08befd31e Reviewed-on: https://go-review.googlesource.com/20858 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/bytes')
0 files changed, 0 insertions, 0 deletions