]> Cypherpunks repositories - gostls13.git/commit
runtime: tune P retake logic
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 27 Jan 2014 19:17:46 +0000 (23:17 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 27 Jan 2014 19:17:46 +0000 (23:17 +0400)
commit179d41feccc29260d1a16294647df218f1a6746a
tree356442abe1e2e0850bc2b849437873f776bd0195
parentea86752206fd8801bce46cc21a0faf97d8d7cd01
runtime: tune P retake logic
When GOMAXPROCS>1 the last P in syscall is never retaken
(because there are already idle P's -- npidle>0).
This prevents sysmon thread from sleeping.
On a darwin machine the program from issue 6673 constantly
consumes ~0.2% CPU. With this change it stably consumes 0.0% CPU.
Fixes #6673.

R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant, khr
https://golang.org/cl/56990045
src/pkg/runtime/proc.c