Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(149)

Issue 9776044: code review 9776044: runtime: fix CPU underutilization (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by dvyukov
Modified:
11 years, 5 months ago
Reviewers:
rsc
CC:
rsc, gobot, golang-dev
Visibility:
Public.

Description

runtime: fix CPU underutilization runtime.newproc/ready are deliberately sloppy about waking new M's, they only ensure that there is at least 1 spinning M. Currently to compensate for that, schedule() checks if the current P has local work and there are no spinning M's, it wakes up another one. It does not work if goroutines do not call schedule. With this change a spinning M wakes up another M when it finds work to do. It's also not ideal, but it fixes the underutilization. A proper check would require to know the exact number of runnable G's, but it's too expensive to maintain. Fixes issue 5586.

Patch Set 1 #

Patch Set 2 : diff -r 1c764773c6ce https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r ca145611fa96 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r ca145611fa96 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r ca145611fa96 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r 0581827a7481 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 7 : diff -r eee1cf757110 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 8 : diff -r 3a9551481ad1 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -14 lines) Patch
M src/pkg/runtime/proc.c View 1 2 3 4 5 6 3 chunks +27 lines, -14 lines 0 comments Download
M src/pkg/runtime/proc_test.go View 1 2 3 4 5 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 7
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
12 years, 1 month ago (2013-06-05 20:43:08 UTC) #1
gobot
R=rsc (assigned by dvyukov)
12 years ago (2013-06-14 14:27:01 UTC) #2
rsc
LGTM "spinning" means that the M is waiting for a G, right? If so, can ...
12 years ago (2013-06-21 19:39:29 UTC) #3
rsc
I should not have reviewed this. My mistake. Do not submit until the runtime CL ...
12 years ago (2013-06-21 19:56:19 UTC) #4
dvyukov
On Fri, Jun 21, 2013 at 11:39 PM, <rsc@golang.org> wrote: > LGTM > > "spinning" ...
12 years ago (2013-06-27 16:51:42 UTC) #5
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=1e280889f997 *** runtime: fix CPU underutilization runtime.newproc/ready are deliberately sloppy about waking ...
12 years ago (2013-06-27 16:52:32 UTC) #6
remyoudompheng
11 years, 11 months ago (2013-07-20 20:11:14 UTC) #7
R=close
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b