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

8338440: Parallel: Improve fragmentation mitigation in Full GC #20590

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
@@ -178,30 +178,30 @@ void SplitInfo::record(size_t split_region_idx, HeapWord* split_point, size_t pr
}

_split_region_idx = split_region_idx;
_split_destination = split_destination;
_split_point = split_point;
_preceding_live_words = preceding_live_words;
_split_destination_count = split_destination_count;
_preceding_destination = split_destination;
_preceding_destination_count = split_destination_count;
}

void SplitInfo::clear()
{
_split_region_idx = 0;
_split_destination = nullptr;
_split_point = nullptr;
_preceding_live_words = 0;
_split_destination_count = 0;
_preceding_destination = nullptr;
_preceding_destination_count = 0;
assert(!is_valid(), "sanity");
}

#ifdef ASSERT
void SplitInfo::verify_clear()
{
assert(_split_region_idx == 0, "not clear");
assert(_split_destination == nullptr, "not clear");
assert(_split_point == nullptr, "not clear");
assert(_preceding_live_words == 0, "not clear");
assert(_split_destination_count == 0, "not clear");
assert(_preceding_destination == nullptr, "not clear");
assert(_preceding_destination_count == 0, "not clear");
}
#endif // #ifdef ASSERT

@@ -484,7 +484,7 @@ bool ParallelCompactData::summarize(SplitInfo& split_info,
}

uint destination_count = split_info.is_split(cur_region)
? split_info.split_destination_count()
? split_info.preceding_destination_count()
: 0;

HeapWord* const last_addr = dest_addr + words - 1;
@@ -1612,9 +1612,9 @@ void PSParallelCompact::forward_to_new_addr() {

if (split_info.is_split(cur_region)) {
// Part 1: will be relocated to space-1
HeapWord* split_destination = split_info.split_destination();
HeapWord* preceding_destination = split_info.preceding_destination();
HeapWord* split_point = split_info.split_point();
forward_objs_in_range(cm, region_start + live_words, split_point, split_destination + live_words);
forward_objs_in_range(cm, region_start + live_words, split_point, preceding_destination + live_words);

// Part 2: will be relocated to space-2
HeapWord* destination = region_ptr->destination();
@@ -2056,7 +2056,7 @@ HeapWord* PSParallelCompact::first_src_addr(HeapWord* const dest_addr,
if (dest_addr == src_region_destination) {
return split_info.split_point();
}
region_start_destination = split_info.split_destination();
region_start_destination = split_info.preceding_destination();
} else {
region_start_destination = src_region_destination;
}
22 changes: 11 additions & 11 deletions src/hotspot/share/gc/parallel/psParallelCompact.hpp
Original file line number Diff line number Diff line change
@@ -121,22 +121,22 @@ class SplitInfo
// Return true if this split holds data for the specified source region.
inline bool is_split(size_t region_idx) const;

// A split region has two "destinations", living in two spaces. This method
// returns the split (first) one -- destination for the first live word on
// this split region.
HeapWord* split_destination() const {
assert(_split_destination != nullptr, "inv");
return _split_destination;
}

// Obj at the split point doesn't fit the previous space and will be relocated to the next space.
HeapWord* split_point() const { return _split_point; }

// Number of live words before the split point on this region.
size_t preceding_live_words() const { return _preceding_live_words; }

// A split region has two "destinations", living in two spaces. This method
// returns the first one -- destination for the first live word on
// this split region.
HeapWord* preceding_destination() const {
assert(_preceding_destination != nullptr, "inv");
return _preceding_destination;
}

// Number of regions the preceding live words are relocated into.
uint split_destination_count() const { return _split_destination_count; }
uint preceding_destination_count() const { return _preceding_destination_count; }

void record(size_t split_region_idx, HeapWord* split_point, size_t preceding_live_words);

@@ -146,10 +146,10 @@ class SplitInfo

private:
size_t _split_region_idx;
HeapWord* _split_destination;
HeapWord* _split_point;
size_t _preceding_live_words;
uint _split_destination_count;
HeapWord* _preceding_destination;
uint _preceding_destination_count;
};

inline bool SplitInfo::is_split(size_t region_idx) const