[L] Change in dart/sdk[main]: [vm] Allocate separate cages for each isolate group under compressed ...

0 views
Skip to first unread message

Ryan Macnak (Gerrit)

unread,
Jun 17, 2026, 6:52:24 PM (6 days ago) Jun 17
to Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Aprelev

Ryan Macnak added 1 comment

File runtime/tests/vm/dart/isolates/send_list_typed_data_spawn_uri_test.dart
Line 25, Patchset 7 (Latest): onExit: exitPort.sendPort,
Ryan Macnak . unresolved

The group's heap still exists when this fires and we might accumulate too many groups and exhaust the usable address space. Is there a better way to way for the group to shut down before creating the next one?

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Aprelev
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I3919eb1ca8e5d282d9bf6394cf37973569bd021f
Gerrit-Change-Number: 513940
Gerrit-PatchSet: 7
Gerrit-Owner: Ryan Macnak <rma...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
Gerrit-Attention: Alexander Aprelev <a...@google.com>
Gerrit-Comment-Date: Wed, 17 Jun 2026 22:52:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Jun 22, 2026, 3:46:59 PM (yesterday) Jun 22
to Ryan Macnak, Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ryan Macnak

Alexander Aprelev voted and added 6 comments

Votes added by Alexander Aprelev

Code-Review+1

6 comments

File runtime/tests/vm/dart/isolates/send_list_typed_data_spawn_uri_test.dart
Line 25, Patchset 7 (Latest): onExit: exitPort.sendPort,
Ryan Macnak . unresolved

The group's heap still exists when this fires and we might accumulate too many groups and exhaust the usable address space. Is there a better way to way for the group to shut down before creating the next one?

Alexander Aprelev

Not sure.
Introduce vmservice event for that in lib/vmservice/constants.dart and wait for the event to show up?
Run the test via embedder that has isolate group cleanup callback set up?

File runtime/vm/heap/freelist_test.cc
Line 86, Patchset 7 (Latest): VirtualMemory::Allocate(kBlobSize, /* is_executable */ false, "test");
Alexander Aprelev . unresolved

`/*is_executable=*/false` ?

File runtime/vm/heap/page.h
Line 391, Patchset 7 (Latest): static constexpr intptr_t kCapacity = 128 * kWordSize;
Alexander Aprelev . unresolved

Perhaps add a comment on how to this relates to `kWordSize <=4 ? 16: 32` values for new_gen_semi_max_size specified in main_impl.cc.

File runtime/vm/heap/page.cc
Line 26, Patchset 7 (Latest):// Without compressed pointers, there is a process-wide cached. With compressed
Alexander Aprelev . unresolved

cache

Line 297, Patchset 7 (Latest): // We don't automatically use the cache based on size and type because a
// large page that happens to be the same size as a regular page can't
// use the cache. Large pages are expected to be zeroed on allocation but
// cached pages are dirty.
Alexander Aprelev . unresolved

Large page is just one example of why we can't reuse it right? There are also image and frozen page. Perhaps update comment to reflect that.

Line 317, Patchset 7 (Latest): // Allow caching up to one new-space worth of pages to avoid the cost unmap
Alexander Aprelev . unresolved

"cost of"? or "costly"?

Open in Gerrit

Related details

Attention is currently required from:
  • Ryan Macnak
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I3919eb1ca8e5d282d9bf6394cf37973569bd021f
Gerrit-Change-Number: 513940
Gerrit-PatchSet: 7
Gerrit-Owner: Ryan Macnak <rma...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
Gerrit-Attention: Ryan Macnak <rma...@google.com>
Gerrit-Comment-Date: Mon, 22 Jun 2026 19:46:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Ryan Macnak <rma...@google.com>
satisfied_requirement
open
diffy

Ryan Macnak (Gerrit)

unread,
1:38 PM (9 hours ago) 1:38 PM
to Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org

Ryan Macnak voted and added 6 comments

Votes added by Ryan Macnak

Commit-Queue+1

6 comments

File runtime/tests/vm/dart/isolates/send_list_typed_data_spawn_uri_test.dart
Line 25, Patchset 7: onExit: exitPort.sendPort,
Ryan Macnak . resolved

The group's heap still exists when this fires and we might accumulate too many groups and exhaust the usable address space. Is there a better way to way for the group to shut down before creating the next one?

Alexander Aprelev

Not sure.
Introduce vmservice event for that in lib/vmservice/constants.dart and wait for the event to show up?
Run the test via embedder that has isolate group cleanup callback set up?

Ryan Macnak

From a discussion with Nate, I added a flag to avoid allocating the guard regions, which may also be useful to anyone already using a large number of small isolate groups.

File runtime/vm/heap/freelist_test.cc
Line 86, Patchset 7: VirtualMemory::Allocate(kBlobSize, /* is_executable */ false, "test");
Alexander Aprelev . resolved

`/*is_executable=*/false` ?

Ryan Macnak

Done

File runtime/vm/heap/page.h
Line 391, Patchset 7: static constexpr intptr_t kCapacity = 128 * kWordSize;
Alexander Aprelev . resolved

Perhaps add a comment on how to this relates to `kWordSize <=4 ? 16: 32` values for new_gen_semi_max_size specified in main_impl.cc.

Ryan Macnak

Done

File runtime/vm/heap/page.cc
Line 26, Patchset 7:// Without compressed pointers, there is a process-wide cached. With compressed
Alexander Aprelev . resolved

cache

Ryan Macnak

Done

Line 297, Patchset 7: // We don't automatically use the cache based on size and type because a

// large page that happens to be the same size as a regular page can't
// use the cache. Large pages are expected to be zeroed on allocation but
// cached pages are dirty.
Alexander Aprelev . resolved

Large page is just one example of why we can't reuse it right? There are also image and frozen page. Perhaps update comment to reflect that.

Ryan Macnak

Done

Line 317, Patchset 7: // Allow caching up to one new-space worth of pages to avoid the cost unmap
Alexander Aprelev . resolved

"cost of"? or "costly"?

Ryan Macnak

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I3919eb1ca8e5d282d9bf6394cf37973569bd021f
Gerrit-Change-Number: 513940
Gerrit-PatchSet: 8
Gerrit-Owner: Ryan Macnak <rma...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 17:38:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Alexander Aprelev <a...@google.com>
Comment-In-Reply-To: Ryan Macnak <rma...@google.com>
satisfied_requirement
open
diffy

Ryan Macnak (Gerrit)

unread,
4:01 PM (7 hours ago) 4:01 PM
to Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org

Ryan Macnak voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I3919eb1ca8e5d282d9bf6394cf37973569bd021f
Gerrit-Change-Number: 513940
Gerrit-PatchSet: 9
Gerrit-Owner: Ryan Macnak <rma...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 20:01:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
4:02 PM (7 hours ago) 4:02 PM
to Ryan Macnak, Alexander Aprelev, rev...@dartlang.org, vm-...@dartlang.org

dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

Unreviewed changes

7 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: runtime/vm/heap/page.cc
Insertions: 11, Deletions: 7.

The diff is too large to show. Please review the diff.
```
```
The name of the file: runtime/vm/heap/freelist_test.cc
Insertions: 4, Deletions: 4.

The diff is too large to show. Please review the diff.
```
```
The name of the file: runtime/tests/vm/dart/isolates/send_list_typed_data_spawn_uri_test.dart
Insertions: 2, Deletions: 0.

The diff is too large to show. Please review the diff.
```
```
The name of the file: runtime/vm/virtual_memory_compressed.cc
Insertions: 18, Deletions: 4.

The diff is too large to show. Please review the diff.
```
```
The name of the file: runtime/vm/heap/page.h
Insertions: 4, Deletions: 1.

The diff is too large to show. Please review the diff.
```

Change information

Commit message:
[vm] Allocate separate cages for each isolate group under compressed pointers.

TEST=ci, local Fuchsia build
Change-Id: I3919eb1ca8e5d282d9bf6394cf37973569bd021f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/513940
Reviewed-by: Alexander Aprelev <a...@google.com>
Commit-Queue: Ryan Macnak <rma...@google.com>
Files:
  • M pkg/test_runner/lib/src/fuchsia.dart
  • M runtime/tests/vm/dart/isolates/send_list_typed_data_spawn_uri_test.dart
  • M runtime/vm/ffi_callback_metadata.cc
  • M runtime/vm/heap/compactor.cc
  • M runtime/vm/heap/freelist_test.cc
  • M runtime/vm/heap/heap.cc
  • M runtime/vm/heap/heap.h
  • M runtime/vm/heap/heap_test.cc
  • M runtime/vm/heap/page.cc
  • M runtime/vm/heap/page.h
  • M runtime/vm/heap/pages.cc
  • M runtime/vm/heap/scavenger.cc
  • M runtime/vm/heap/scavenger.h
  • M runtime/vm/profiler.cc
  • M runtime/vm/timeline.cc
  • M runtime/vm/virtual_memory.cc
  • M runtime/vm/virtual_memory.h
  • M runtime/vm/virtual_memory_compressed.cc
  • M runtime/vm/virtual_memory_compressed.h
  • M runtime/vm/virtual_memory_fuchsia.cc
  • M runtime/vm/virtual_memory_posix.cc
  • M runtime/vm/virtual_memory_test.cc
  • M runtime/vm/virtual_memory_win.cc
  • M runtime/vm/zone.cc
Change size: L
Delta: 24 files changed, 534 insertions(+), 410 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Alexander Aprelev
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I3919eb1ca8e5d282d9bf6394cf37973569bd021f
Gerrit-Change-Number: 513940
Gerrit-PatchSet: 10
Gerrit-Owner: Ryan Macnak <rma...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages