Revert "[vm, gc] Run parallel GC tasks on mutator threads blocked for the safepoint instead of new thread pool workers."

This reverts commit 111e64de39.

Reason for revert: timeouts on multiple Flutter HHH bots
(flutter-linux-framework-coverage, flutter-linux-framework-tests-libraries, flutter-linux-framework-tests-misc, flutter-linux-framework-tests-widgets, flutter-linux-customer-testing).
"Run *** tests" step increased from 8-13m to 1.5h+.

Original change's description:
> [vm, gc] Run parallel GC tasks on mutator threads blocked for the safepoint instead of new thread pool workers.
>
> unit_test_suites.dart --skipTestsThatRequireGit -j8
> 6:59 -> 6:23 (-8.6%)
>
> TEST=ci
> Bug: https://github.com/dart-lang/sdk/issues/55713
> Change-Id: I5256175abf4751b3b5e877ed5abdc76a90cd2fb3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381383
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Bug: https://github.com/dart-lang/sdk/issues/55713
Change-Id: I34dc15e80451d39cefa123e0e49c54cd17b068c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381900
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov
2024-08-22 20:10:52 +00:00
committed by Commit Queue
parent e0d140c01e
commit 48f66ec572
10 changed files with 103 additions and 241 deletions
+6 -8
View File
@@ -396,6 +396,11 @@ void Thread::EnterIsolate(Isolate* isolate) {
ASSERT(thread->scheduled_dart_mutator_isolate_ == isolate);
ASSERT(thread->isolate() == isolate);
ASSERT(thread->isolate_group() == isolate->group());
{
// Descheduled isolates are reloadable (if nothing else prevents it).
RawReloadParticipationScope enable_reload(thread);
thread->ExitSafepoint();
}
} else {
thread = AddActiveThread(group, isolate, /*is_dart_mutator*/ true,
/*bypass_safepoint=*/false);
@@ -406,14 +411,6 @@ void Thread::EnterIsolate(Isolate* isolate) {
isolate->scheduled_mutator_thread_ = thread;
ResumeDartMutatorThreadInternal(thread);
if (is_resumable) {
// Descheduled isolates are reloadable (if nothing else prevents it).
RawReloadParticipationScope enable_reload(thread);
thread->ExitSafepoint();
}
ASSERT(!thread->IsAtSafepoint());
}
static bool ShouldSuspend(bool isolate_shutdown, Thread* thread) {
@@ -559,6 +556,7 @@ void Thread::SuspendDartMutatorThreadInternal(Thread* thread,
}
void Thread::ResumeThreadInternal(Thread* thread) {
ASSERT(!thread->IsAtSafepoint());
ASSERT(thread->isolate_group() != nullptr);
ASSERT(thread->execution_state() == Thread::kThreadInNative);
ASSERT(thread->vm_tag() == VMTag::kInvalidTagId ||