Commit 30691690 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

Reland "[heap] Rework Worklist base type"

This is a reland of commit a19316d9

- Revert malloc_usable_size() changes temporarily to land them in
  isolation.
- Add cosmetics from https://crrev.com/c/3827876

Original change's description:
> [heap] Rework Worklist base type
>
> Worklist uses a singly-linked list of segments to hold entries.
> Segment size was based on a compile-time constant but already stored
> in the segment itself.
>
> Rework the segments to query `malloc_usable_size()` on allocation and
> adjust the capacity properly. For PartitionAlloc, it turns out that
> there's ~20% more capacity available for the 64-element segments.
>
> This slows down actual allocation of the segments with the upside of
> improving utilization and requiring 20% less segments.
>
> Change-Id: Ib8595c3fb9fb75b02e4022f6c525bb59a2df7ab7
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3826047
> Commit-Queue: Anton Bikineev <bikineev@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82432}

Change-Id: Ic8c5257cfe3c347b11eea5c513ca7f62e09f637f
Bug: v8:13193
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3829475Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82493}
parent ee89a269
......@@ -4,16 +4,12 @@
#include "src/heap/base/worklist.h"
namespace heap {
namespace base {
namespace internal {
namespace heap::base::internal {
// static
SegmentBase* SegmentBase::GetSentinelSegmentAddress() {
static SegmentBase kSentinelSegment(0);
return &kSentinelSegment;
static SegmentBase sentinel_segment(0);
return &sentinel_segment;
}
} // namespace internal
} // namespace base
} // namespace heap
} // namespace heap::base::internal
This diff is collapsed.
......@@ -704,7 +704,7 @@ void Scavenger::Process(JobDelegate* delegate) {
scavenge_visitor.Visit(object_and_size.first);
done = false;
if (delegate && ((++objects % kInterruptThreshold) == 0)) {
if (!copied_list_local_.IsEmpty()) {
if (!copied_list_local_.IsLocalEmpty()) {
delegate->NotifyConcurrencyIncrease();
}
}
......
......@@ -20,10 +20,10 @@ namespace heap {
void PublishSegment(MarkingWorklist* worklist, HeapObject object) {
MarkingWorklist::Local local(worklist);
for (size_t i = 0; i <= MarkingWorklist::kSegmentSize; i++) {
for (size_t i = 0; i < MarkingWorklist::kMinSegmentSizeForTesting; i++) {
local.Push(object);
}
CHECK(local.Pop(&object));
local.Publish();
}
TEST(ConcurrentMarking) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment