]> Cypherpunks repositories - gostls13.git/commit
runtime: eliminate runqvictims and a copy from runqsteal
authorAustin Clements <austin@google.com>
Wed, 13 May 2015 21:08:16 +0000 (17:08 -0400)
committerAustin Clements <austin@google.com>
Sun, 17 May 2015 01:08:42 +0000 (01:08 +0000)
commita0fc306023d77e5605203c14ca92f368bdbce3ae
tree48a38a96eee0d0b96186e9a5f2a92fd6e1d92e55
parentab4e7988bb30eaf43ef9c5b4dcedc30502a0b0e6
runtime: eliminate runqvictims and a copy from runqsteal

Currently, runqsteal steals Gs from another P into an intermediate
buffer and then copies those Gs into the current P's run queue. This
intermediate buffer itself was moved from the stack to the P in commit
c4fe503 to eliminate the cost of zeroing it on every steal.

This commit follows up c4fe503 by stealing directly into the current
P's run queue, which eliminates the copy and the need for the
intermediate buffer. The update to the tail pointer is only committed
once the entire steal operation has succeeded, so the semantics of
stealing do not change.

Change-Id: Icdd7a0eb82668980bf42c0154b51eef6419fdd51
Reviewed-on: https://go-review.googlesource.com/9998
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
src/runtime/proc1.go
src/runtime/runtime2.go