Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(657)

Issue 297183003: Reduce CPU usage when no isolates need to be profiled. (Closed)

Created:
6 years, 7 months ago by Cutch
Modified:
6 years, 7 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Reduce CPU usage when no isolates need to be profiled (e.g. when an isolate calls readLineSync or sleep the isolate owns the thread but is blocked). This CL does the following: - Introduces two new API entry points: Dart_IsolateBlocked and Dart_IsolateUnblocked. - The thread interrupter thread goes into a deep sleep if no isolates need to be profiled (not scheduled on a thread or are in a blocking call). - When an isolate unblocks, the thread interrupter thread resumes regular interrupts. - dart:io readLineSync and sleep mark that they are making a blocking call. This fixes https://code.google.com/p/dart/issues/detail?id=18126 reducing CPU usage to 0% when waiting for stdin or sleeping. R=ajohnsen@google.com, iposva@google.com Committed: https://code.google.com/p/dart/source/detail?r=36632

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 15

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 2

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+173 lines, -22 lines) Patch
M runtime/bin/dartutils.h View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M runtime/bin/process.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/bin/stdio.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 2 chunks +23 lines, -0 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/isolate.cc View 1 2 4 5 6 7 1 chunk +11 lines, -2 lines 0 comments Download
M runtime/vm/profiler.h View 1 chunk +9 lines, -0 lines 0 comments Download
M runtime/vm/profiler.cc View 1 2 3 2 chunks +18 lines, -0 lines 0 comments Download
M runtime/vm/thread_interrupter.h View 1 2 3 3 chunks +11 lines, -4 lines 0 comments Download
M runtime/vm/thread_interrupter.cc View 1 2 3 4 5 6 7 8 7 chunks +74 lines, -15 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Cutch
+ajohnsen for the dart:io bits.
6 years, 7 months ago (2014-05-24 09:02:03 UTC) #1
Ivan Posva
https://codereview.chromium.org/297183003/diff/40001/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://codereview.chromium.org/297183003/diff/40001/runtime/include/dart_api.h#newcode2637 runtime/include/dart_api.h:2637: DART_EXPORT void Dart_BlockProfiler(); This is not just related to ...
6 years, 7 months ago (2014-05-25 12:25:16 UTC) #2
Anders Johnsen
lgtm lgtm https://codereview.chromium.org/297183003/diff/40001/runtime/bin/utils.h File runtime/bin/utils.h (right): https://codereview.chromium.org/297183003/diff/40001/runtime/bin/utils.h#newcode92 runtime/bin/utils.h:92: class ProfilerBlocker { Stuff like this usually ...
6 years, 7 months ago (2014-05-25 18:36:34 UTC) #3
Ivan Posva
-Ivan https://codereview.chromium.org/297183003/diff/40001/runtime/vm/thread_interrupter.cc File runtime/vm/thread_interrupter.cc (right): https://codereview.chromium.org/297183003/diff/40001/runtime/vm/thread_interrupter.cc#newcode248 runtime/vm/thread_interrupter.cc:248: profiled_isolate_count_ += isolate->ProfileInterrupt(); Please add a comment in ...
6 years, 7 months ago (2014-05-25 19:07:47 UTC) #4
Cutch
https://codereview.chromium.org/297183003/diff/40001/runtime/bin/utils.h File runtime/bin/utils.h (right): https://codereview.chromium.org/297183003/diff/40001/runtime/bin/utils.h#newcode92 runtime/bin/utils.h:92: class ProfilerBlocker { On 2014/05/25 18:36:34, Anders Johnsen wrote: ...
6 years, 7 months ago (2014-05-26 06:59:34 UTC) #5
Ivan Posva
https://codereview.chromium.org/297183003/diff/90001/runtime/vm/thread_interrupter.cc File runtime/vm/thread_interrupter.cc (right): https://codereview.chromium.org/297183003/diff/90001/runtime/vm/thread_interrupter.cc#newcode246 runtime/vm/thread_interrupter.cc:246: if (isolate->ProfileInterrupt()) { If ProfileInterrupt returned the number of ...
6 years, 7 months ago (2014-05-26 07:38:44 UTC) #6
Cutch
PTAL https://codereview.chromium.org/297183003/diff/90001/runtime/vm/thread_interrupter.cc File runtime/vm/thread_interrupter.cc (right): https://codereview.chromium.org/297183003/diff/90001/runtime/vm/thread_interrupter.cc#newcode246 runtime/vm/thread_interrupter.cc:246: if (isolate->ProfileInterrupt()) { On 2014/05/26 07:38:45, Ivan Posva ...
6 years, 7 months ago (2014-05-26 08:23:33 UTC) #7
Ivan Posva
LGTM -ip
6 years, 7 months ago (2014-05-26 08:25:22 UTC) #8
Cutch
6 years, 7 months ago (2014-05-26 11:54:13 UTC) #9
Message was sent while issue was closed.
Committed patchset #9 manually as r36632 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698