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

8257145: Performance regression with -XX:-ResizePLAB after JDK-8079555 #1474

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1406,8 +1406,8 @@ G1CollectedHeap::G1CollectedHeap() :
_summary_bytes_used(0),
_bytes_used_during_gc(0),
_archive_allocator(NULL),
_survivor_evac_stats("Young", YoungPLABSize * ParallelGCThreads, PLABWeight),
_old_evac_stats("Old", OldPLABSize * ParallelGCThreads, PLABWeight),
_survivor_evac_stats("Young", YoungPLABSize, YoungPLABSize * ParallelGCThreads, PLABWeight),
_old_evac_stats("Old", OldPLABSize, OldPLABSize * ParallelGCThreads, PLABWeight),
Copy link
Contributor

@kstefanj kstefanj Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could leave those two unchanged and in the constructor for G1EvacStats do the multiplication with ParallelGCThreads for the desired value.

Copy link
Contributor

@tschatzl tschatzl Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And rename the default_plab_sz parameter to default_per_thread_plab_size (and remove the desired_net_plab_sz_ as suggested).

_expand_heap_after_alloc_failure(true),
_g1mm(NULL),
_humongous_reclaim_candidates(),
@@ -88,8 +88,8 @@ size_t G1EvacStats::compute_desired_plab_sz() {
return cur_plab_sz;
}

G1EvacStats::G1EvacStats(const char* description, size_t desired_plab_sz_, unsigned wt) :
PLABStats(description, desired_plab_sz_, wt),
G1EvacStats::G1EvacStats(const char* description, size_t default_plab_sz, size_t desired_plab_sz_, unsigned wt) :
PLABStats(description, default_plab_sz, desired_plab_sz_, wt), // desired_plab_size should be the total PLAB size for all threads.
_region_end_waste(0),
_regions_filled(0),
_direct_allocated(0),
@@ -56,7 +56,7 @@ class G1EvacStats : public PLABStats {
virtual size_t compute_desired_plab_sz();

public:
G1EvacStats(const char* description, size_t desired_plab_sz_, unsigned wt);
G1EvacStats(const char* description, size_t default_plab_sz, size_t desired_plab_sz_, unsigned wt);

~G1EvacStats();

@@ -135,6 +135,9 @@ void PLABStats::log_sizing(size_t calculated_words, size_t net_desired_words) {

// Calculates plab size for current number of gc worker threads.
size_t PLABStats::desired_plab_sz(uint no_of_gc_workers) {
if (!ResizePLAB) {
return _default_plab_sz;
}
return align_object_size(clamp(_desired_net_plab_sz / no_of_gc_workers, min_size(), max_size()));
}

@@ -151,6 +151,7 @@ class PLABStats : public CHeapObj<mtGC> {
size_t _wasted; // of which wasted (internal fragmentation)
size_t _undo_wasted; // of which wasted on undo (is not used for calculation of PLAB size)
size_t _unused; // Unused in last buffer
size_t _default_plab_sz;
size_t _desired_net_plab_sz;// Output of filter (below), suitably trimmed and quantized
AdaptiveWeightedAverage
_filter; // Integrator with decay
@@ -169,12 +170,13 @@ class PLABStats : public CHeapObj<mtGC> {
virtual size_t compute_desired_plab_sz();

public:
PLABStats(const char* description, size_t desired_net_plab_sz_, unsigned wt) :
PLABStats(const char* description, size_t default_plab_sz, size_t desired_net_plab_sz_, unsigned wt) :
Copy link
Contributor

@kstefanj kstefanj Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are touching this line it would be nice to remove the trailing _ in desired_net_plab_sz_.

_description(description),
_allocated(0),
_wasted(0),
_undo_wasted(0),
_unused(0),
_default_plab_sz(default_plab_sz),
_desired_net_plab_sz(desired_net_plab_sz_),
_filter(wt)
{ }