Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the limitation on the number of concurrently running mutators #54687

Open
mraleph opened this issue Jan 22, 2024 · 5 comments · Fixed by dart-lang/site-www#6182
Open
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team

Comments

@mraleph
Copy link
Member

mraleph commented Jan 22, 2024

We should decide what we want to do with the currently existing limitation on the number of concurrently running mutators.

We should either make it more known (e.g. document it) or we should remove it.

We could even add a runtime warning: when we are trying to enter isolate as a mutator and are waiting for too long due to the limit on the number of mutators - we should consider reporting this error.

I don't think the limitation itself is all that bad for mobile usages - because it does not make sense to spawn so many concurrently running isolates anyway, but it might be causing real issues to server side / batch uses of Dart.

/cc @mkustermann @aam @rmacnak-google @a-siva

@mraleph mraleph added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jan 22, 2024
@mkustermann
Copy link
Member

There's a set of different aspects we can document

  • Semantically one can run only into trouble if N>limit isolates try to synchronously communicate with each other (e.g. by stepping out of the pure Dart safety zone with FFI)
  • If one stays in the pure isolates world: isolates communicate via message passing and run async code / often yield to event loop (which is needed to e.g. receive messages), then there's no risk of deadlocks etc. One can have thousands of isolates in that case.
  • A dart program cannot take advantage of more cores than this limit. Though as a language focused more on the client-side, it's currently also not a goal to scale to 100s of cores.
  • If there's oversubscription: more isolates want to run than the limit, they do schedule round-robin and we're not guaranteed to distribute CPU fairly among them. If there's no oversubscription (number if isolates ready to run is less that the limit), then we run all ready isolates in parallel and OS distributes CPU cycles (hopefully fairly) among them.

@mraleph
Copy link
Member Author

mraleph commented Jan 22, 2024

A dart program cannot take advantage of more cores than this limit. Though as a language focused more on the client-side, it's currently also not a goal to scale to 100s of cores.

It might not be goal to scale to 100s of cores, but neither it is a goal to make it impossible to discover why you hit a scalability issue.

We would like to see Dart used more and more outside of client-side context - so it makes sense to avoid adding hidden limitations like this or at least make them easier to discover.

@mkustermann
Copy link
Member

@mraleph Yes, the list I wrote above is what we can/should document. We can of course phrase it differently and just point out it's due to a technical limitation.

@parlough
Copy link
Member

parlough commented Jan 22, 2024

\cc @ericwindmill Just so you're aware of the discussion and possibilities here :) - Perhaps you have some thoughts too!

@a-siva a-siva added the P2 A bug or feature request we're likely to work on label Jan 25, 2024
@a-siva a-siva added the triaged Issue has been triaged by sub team label Jan 25, 2024
@mraleph
Copy link
Member Author

mraleph commented Nov 21, 2024

I would like to repurpose this issue to investigate if we could simply lift this limitation. So I am retitling this accordingly.

@mraleph mraleph reopened this Nov 21, 2024
@mraleph mraleph changed the title Document or remove the limitation on the number of concurrently running mutators Remove the limitation on the number of concurrently running mutators Nov 21, 2024
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This prevents such an isolate from occupying one of the limited number of mutator slots and blocking other isolates in the same group from running.

TEST=ci
Bug: #51254
Bug: #54687
Bug: #57119
Change-Id: Ic04bbaa7f482d533ad0ecf2c6da17ea9f00c264e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398927
Reviewed-by: Alexander Aprelev <[email protected]>
Commit-Queue: Ryan Macnak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants