• Dominik Inführ's avatar
    Reland "[heap] Support multiple clients in shared GC" · 2c88cec4
    Dominik Inführ authored
    This is a reland of 90a9d6cb
    
    The original CL got reverted because of two different issues:
    
    * The DCHECK failure on AllowGarbageCollection::IsAllowed() got fixed
      in https://crrev.com/c/3289625.
    * The crash with the incremental marking job were because of a nested
      GC started from a SafepointScope. This CL adds IgnoreLocalGCRequests
      scopes to SafepointScopes in src/heap.
    
    In addition this CL prevents shared GCs during isolate deserialization
    by locking the clients_mutex_ until the isolate is fully deserialized.
    The original GC used a DisallowSafepoints scope to prevent shared GCs
    from interrupting isolate deserialization.
    
    Original change's description:
    > [heap] Support multiple clients in shared GC
    >
    > Add support for safepointing multiple isolates as described in the
    > design doc (link is below). A safepoint across multiple isolates is
    > considered a global safepoint to distinguish it from regular safepoints.
    >
    > The basic idea behind the implementation is that we reach a
    > safepoint for each client. What's new is that now also main threads
    > need to participate in the safepointing protocol and need to give up
    > control in time. The slow paths of Park(), Unpark() and Safepoint() on
    > the main thread need to be adjusted for this reason as well.
    >
    > This CL introduces GlobalSafepoint and GlobalSafepointScope to mirror
    > IsolateSafepoint and IsolateSafepointScope.
    >
    > This CL adds the type IgnoreLocalGCRequests, it is used to prevent
    > Park() and Unpark() from honoring the request from background threads
    > to perform a local GC. This is used heap-internally to not have GCs
    > (or even nested GCs) in certain locations. E.g. when initiating a
    > safepoint to perform a GC we don't want a "recursive" GC to occur.
    >
    > Design doc: https://docs.google.com/document/d/1y6C9zAACEr0sBYMIYk3YpXosnkF3Ak4CEuWJu1-3zXs/edit?usp=sharing
    >
    > Bug: v8:11708
    > Change-Id: I5aca8f5f24873279271a53be3bb093fc92a1a1eb
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3009224
    > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
    > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
    > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#77812}
    
    Bug: v8:11708, v8:12375, v8:12377
    Change-Id: I9d1af6fbc06a3a8b6f216ec5e9027665ad071809
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283067
    Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
    Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78013}
    2c88cec4
Name
Last commit
Last update
.github Loading commit data...
bazel Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.bazelrc Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.mailmap Loading commit data...
.vpython Loading commit data...
.vpython3 Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.bazel Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LOONG_OWNERS Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
RISCV_OWNERS Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
WORKSPACE Loading commit data...
codereview.settings Loading commit data...