[heap] Align allocation retry loop for oilpan with HeapAllocator (v8) [v8/v8 : main]

0 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
Oct 2, 2025, 11:27:52 AMOct 2
to Michael Lippautz, Dominik Inführ, Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ, Dominik Inführ and Michael Lippautz

Etienne Pierre-Doray added 3 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Etienne Pierre-Doray . resolved

PTAnL?

Commit Message
Line 11, Patchset 2:
Michael Lippautz . resolved

This needs a tracking bug.

Etienne Pierre-Doray

Done

File src/heap/cppgc/object-allocator.cc
Line 171, Patchset 2: GCConfig::FreeMemoryHandling::kLastResort};
Dominik Inführ . resolved

This would trigger the "last resort" GC (or actually only parts of it) the first time we encounter an allocation failure IIUC. That's likely too agressive. I would prefer being uniform with JS here and reuse the same logic: Doing 2 lightweight GCs first and if that's not enough call CollectAllAvailableGarbage(kLastResort). cppgc could have its own implementation of the retry implementation imho if reusing the implementation from JS isn't feasible (or too tricky).

Etienne Pierre-Doray

Done -> although this changes behavior a bit without a flag, I don't think it's worth experimenting the extra CollectAllAvailableGarbage.

if reusing the implementation from JS isn't feasible (or too tricky).

I'm looking into this but that seem tricky at this point because of a few considerations/differences (e.g. HeapAllocator supports any thread).

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Dominik Inführ
  • Michael Lippautz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib5a890d2dc69bee34b9b2e8dd9dff08c07ab54d8
Gerrit-Change-Number: 7002462
Gerrit-PatchSet: 6
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@google.com>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-CC: Dominik Inführ <dinf...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@google.com>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Oct 2025 15:27:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
unsatisfied_requirement
open
diffy

Dominik Inführ (Gerrit)

unread,
Oct 6, 2025, 7:40:12 AMOct 6
to Etienne Pierre-Doray, Michael Lippautz, Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ, Etienne Pierre-Doray and Michael Lippautz

Dominik Inführ added 2 comments

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Dominik Inführ . resolved

Thanks!

File src/heap/cppgc-js/cpp-heap.cc
Line 1303, Patchset 7 (Latest): if (config.free_memory_handling ==
Dominik Inführ . unresolved

Can we add a separate method CollectAllAvailableGarbage here as well? From the call site it is hard to see what GC is going to be triggered otherwise. I twould also be more uniform with what we have in V8. This feels like two different methods anyway. I suppose this would also allow us to get rid of FreeMemoryHandling::kLastResort and the second GCConfig. Otherwise this CL already looks good to me.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Etienne Pierre-Doray
  • Michael Lippautz
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib5a890d2dc69bee34b9b2e8dd9dff08c07ab54d8
    Gerrit-Change-Number: 7002462
    Gerrit-PatchSet: 7
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@google.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Dominik Inführ <dinf...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Dominik Inführ <dinf...@google.com>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Mon, 06 Oct 2025 11:40:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Dominik Inführ (Gerrit)

    unread,
    Oct 6, 2025, 7:42:30 AMOct 6
    to Etienne Pierre-Doray, Michael Lippautz, Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Dominik Inführ, Etienne Pierre-Doray and Michael Lippautz

    Dominik Inführ added 1 comment

    File src/heap/cppgc-js/cpp-heap.cc
    Line 1327, Patchset 7 (Latest): return v8_flags.ineffective_gcs_forces_last_resort &&
    Dominik Inführ . unresolved

    From the outside it is a bit hard to see that this only returns true with this particular flag. Let's just report `isolate_->heap()->HasConsecutiveIneffectiveMarkCompact()` here and use the flag at the call site in the retry loop.

    Gerrit-Comment-Date: Mon, 06 Oct 2025 11:42:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Oct 6, 2025, 3:12:15 PMOct 6
    to Michael Lippautz, Dominik Inführ, Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Dominik Inführ, Dominik Inführ and Michael Lippautz

    Etienne Pierre-Doray added 1 comment

    File src/heap/cppgc-js/cpp-heap.cc
    Line 1303, Patchset 7 (Latest): if (config.free_memory_handling ==
    Dominik Inführ . unresolved

    Can we add a separate method CollectAllAvailableGarbage here as well? From the call site it is hard to see what GC is going to be triggered otherwise. I twould also be more uniform with what we have in V8. This feels like two different methods anyway. I suppose this would also allow us to get rid of FreeMemoryHandling::kLastResort and the second GCConfig. Otherwise this CL already looks good to me.

    Etienne Pierre-Doray

    Come to think of it, I think this is better: https://chromium-review.googlesource.com/c/v8/v8/+/7011414
    This avoids exposing several new methods on GarbageCollector.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominik Inführ
    • Dominik Inführ
    • Michael Lippautz
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib5a890d2dc69bee34b9b2e8dd9dff08c07ab54d8
    Gerrit-Change-Number: 7002462
    Gerrit-PatchSet: 7
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@google.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Dominik Inführ <dinf...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Dominik Inführ <dinf...@google.com>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Comment-Date: Mon, 06 Oct 2025 19:12:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Oct 8, 2025, 12:05:21 PM (13 days ago) Oct 8
    to Michael Lippautz, Dominik Inführ, Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com

    Etienne Pierre-Doray abandoned this change

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: abandon
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages