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

Issue 1541073002: Implement safepointing of threads (Closed)

Created:
5 years ago by siva
Modified:
4 years, 10 months ago
Reviewers:
zra, rmacnak, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Implement safepointing of threads : - uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint - introduces a monitor per Thread object - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread. The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL. R=rmacnak@google.com, zra@google.com Committed: https://github.com/dart-lang/sdk/commit/e72c1fb47d311a79df5fc608c76ffe6bd13c86e6

Patch Set 1 #

Patch Set 2 : merge-tot #

Patch Set 3 : allow-marking-threads #

Patch Set 4 : fix-thread-state #

Patch Set 5 : some-cleanups #

Patch Set 6 : fix_test_cases #

Patch Set 7 : refactor-changes #

Patch Set 8 : use-wait-wth-safepoint-checl #

Patch Set 9 : more-refactoring #

Patch Set 10 : use-cas-uint32 #

Patch Set 11 : more-refactoring #

Patch Set 12 : self-review-comments #

Total comments: 22

Patch Set 13 : address-code-review-comments #

Total comments: 4

Patch Set 14 : fix-tests #

Total comments: 2

Patch Set 15 : fix-typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1675 lines, -861 lines) Patch
M runtime/lib/isolate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M runtime/lib/vmservice.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/benchmark_test.cc View 1 2 3 4 5 6 7 8 9 6 chunks +6 lines, -3 lines 0 comments Download
M runtime/vm/bootstrap.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/code_descriptors_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +8 lines, -2 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -5 lines 0 comments Download
M runtime/vm/compiler_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +8 lines, -8 lines 0 comments Download
M runtime/vm/coverage_test.cc View 1 2 3 4 5 4 chunks +4 lines, -3 lines 0 comments Download
M runtime/vm/custom_isolate_test.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/dart_api_impl.h View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 chunks +61 lines, -22 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 53 chunks +294 lines, -181 lines 0 comments Download
M runtime/vm/dart_entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/debugger.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +9 lines, -6 lines 0 comments Download
M runtime/vm/exceptions_test.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/find_code_object_test.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/gc_marker.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/gc_sweeper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/vm/heap.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/heap.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +11 lines, -11 lines 0 comments Download
M runtime/vm/heap_test.cc View 1 2 3 4 5 4 chunks +4 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -9 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -9 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -3 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -9 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -5 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +12 lines, -12 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +80 lines, -9 lines 0 comments Download
M runtime/vm/lockers.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
A runtime/vm/lockers.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
M runtime/vm/native_api_impl.cc View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/native_arguments.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/native_entry.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/native_entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +51 lines, -52 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +8 lines, -6 lines 0 comments Download
M runtime/vm/object_graph_test.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object_id_ring_test.cc View 1 2 3 4 5 4 chunks +8 lines, -5 lines 0 comments Download
M runtime/vm/object_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 77 chunks +78 lines, -78 lines 0 comments Download
M runtime/vm/os_thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/pages.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +119 lines, -119 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +14 lines, -9 lines 0 comments Download
M runtime/vm/runtime_entry.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
A runtime/vm/safepoint.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +328 lines, -0 lines 0 comments Download
A runtime/vm/safepoint.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +174 lines, -0 lines 0 comments Download
M runtime/vm/scavenger.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +3 lines, -4 lines 0 comments Download
M runtime/vm/service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 1 2 3 4 5 8 chunks +16 lines, -9 lines 0 comments Download
M runtime/vm/stack_frame_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +139 lines, -2 lines 0 comments Download
M runtime/vm/thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +33 lines, -25 lines 0 comments Download
M runtime/vm/thread_registry.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +18 lines, -52 lines 0 comments Download
M runtime/vm/thread_registry.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +30 lines, -136 lines 0 comments Download
M runtime/vm/thread_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +43 lines, -46 lines 0 comments Download
M runtime/vm/timeline.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/unit_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +26 lines, -5 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
siva
(The CL looks big but most of the files have single line changes to track ...
4 years, 11 months ago (2016-01-08 01:53:53 UTC) #5
rmacnak
https://chromiumcodereview.appspot.com/1541073002/diff/220001/runtime/vm/thread.h File runtime/vm/thread.h (right): https://chromiumcodereview.appspot.com/1541073002/diff/220001/runtime/vm/thread.h#newcode576 runtime/vm/thread.h:576: uint32_t safepoint_state_; Check this in NoSafepointScope.
4 years, 11 months ago (2016-01-08 21:51:17 UTC) #6
zra
https://codereview.chromium.org/1541073002/diff/220001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): https://codereview.chromium.org/1541073002/diff/220001/runtime/vm/dart_api_impl.cc#newcode1551 runtime/vm/dart_api_impl.cc:1551: Thread* thread = Thread::Current(); It looks like TransitionNativeToVM transition(thread) ...
4 years, 11 months ago (2016-01-08 23:32:07 UTC) #7
siva
- Addressed review comments - Synched upto TOT - --background_compilation --optimization_counter_threshold=10 is able to run ...
4 years, 11 months ago (2016-01-12 21:26:22 UTC) #8
zra
lgtm with questions/comments If I fail to do a TransitionXXXToYYY somewhere, I wonder if it'll ...
4 years, 11 months ago (2016-01-13 22:16:13 UTC) #9
siva
The transitions are documented in safepoint.h and I have ensured that the VM code has ...
4 years, 11 months ago (2016-01-27 19:07:51 UTC) #10
rmacnak
lgtm https://codereview.chromium.org/1541073002/diff/260001/runtime/vm/isolate.h File runtime/vm/isolate.h (right): https://codereview.chromium.org/1541073002/diff/260001/runtime/vm/isolate.h#newcode698 runtime/vm/isolate.h:698: Thread* thread, bool is_mutator, bool bypass_sfepoint = false); ...
4 years, 11 months ago (2016-01-27 21:42:32 UTC) #11
siva
Ivan should I wait for your review? https://codereview.chromium.org/1541073002/diff/260001/runtime/vm/isolate.h File runtime/vm/isolate.h (right): https://codereview.chromium.org/1541073002/diff/260001/runtime/vm/isolate.h#newcode698 runtime/vm/isolate.h:698: Thread* thread, ...
4 years, 10 months ago (2016-01-28 18:22:46 UTC) #12
siva
4 years, 10 months ago (2016-02-01 18:57:39 UTC) #14
Message was sent while issue was closed.
Committed patchset #15 (id:280001) manually as
e72c1fb47d311a79df5fc608c76ffe6bd13c86e6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698