I840D1: Add 2309 feature and bug fix for jdk17
This commit is contained in:
parent
d8d3719bb7
commit
8d81b0e541
457
add-8267185-Add-string-deduplication-support-to.patch
Normal file
457
add-8267185-Add-string-deduplication-support-to.patch
Normal file
@ -0,0 +1,457 @@
|
||||
From 5cdf192706cc66ab8228057151bd807ea6267222 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 16:44:51 +0800
|
||||
Subject: add 8267185-Add-string-deduplication-support-to
|
||||
|
||||
---
|
||||
.../gc/parallel/parallelScavengeHeap.cpp | 13 +++++
|
||||
.../gc/parallel/parallelScavengeHeap.hpp | 3 ++
|
||||
.../share/gc/parallel/psCompactionManager.cpp | 6 +++
|
||||
.../share/gc/parallel/psCompactionManager.hpp | 9 ++++
|
||||
.../parallel/psCompactionManager.inline.hpp | 7 +++
|
||||
.../share/gc/parallel/psParallelCompact.cpp | 3 ++
|
||||
.../share/gc/parallel/psPromotionManager.cpp | 1 +
|
||||
.../share/gc/parallel/psPromotionManager.hpp | 5 ++
|
||||
.../gc/parallel/psPromotionManager.inline.hpp | 7 +++
|
||||
.../share/gc/parallel/psStringDedup.hpp | 50 +++++++++++++++++++
|
||||
.../shared/stringdedup/stringDedupConfig.cpp | 2 +-
|
||||
.../TestStringDeduplicationAgeThreshold.java | 13 +++++
|
||||
.../TestStringDeduplicationFullGC.java | 13 +++++
|
||||
.../TestStringDeduplicationInterned.java | 13 +++++
|
||||
.../TestStringDeduplicationPrintOptions.java | 13 +++++
|
||||
.../TestStringDeduplicationTableResize.java | 13 +++++
|
||||
.../TestStringDeduplicationYoungGC.java | 13 +++++
|
||||
17 files changed, 183 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/hotspot/share/gc/parallel/psStringDedup.hpp
|
||||
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
index 16c7d91c4..cf9d34eb9 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "gc/shared/gcInitLogger.hpp"
|
||||
#include "gc/shared/locationPrinter.inline.hpp"
|
||||
#include "gc/shared/scavengableNMethods.hpp"
|
||||
+#include "gc/shared/suspendibleThreadSet.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "memory/metaspaceCounters.hpp"
|
||||
@@ -162,6 +163,18 @@ void ParallelScavengeHeap::initialize_serviceability() {
|
||||
|
||||
}
|
||||
|
||||
+void ParallelScavengeHeap::safepoint_synchronize_begin() {
|
||||
+ if (UseStringDeduplication) {
|
||||
+ SuspendibleThreadSet::synchronize();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void ParallelScavengeHeap::safepoint_synchronize_end() {
|
||||
+ if (UseStringDeduplication) {
|
||||
+ SuspendibleThreadSet::desynchronize();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
class PSIsScavengable : public BoolObjectClosure {
|
||||
bool do_object_b(oop obj) {
|
||||
return ParallelScavengeHeap::heap()->is_in_young(obj);
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
index 689400fbe..b35df689f 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
@@ -139,6 +139,9 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
// Returns JNI_OK on success
|
||||
virtual jint initialize();
|
||||
|
||||
+ virtual void safepoint_synchronize_begin();
|
||||
+ virtual void safepoint_synchronize_end();
|
||||
+
|
||||
void post_initialize();
|
||||
void update_counters();
|
||||
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.cpp b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
index b2c17140d..bab67b219 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
@@ -107,6 +107,12 @@ void ParCompactionManager::reset_all_bitmap_query_caches() {
|
||||
}
|
||||
}
|
||||
|
||||
+void ParCompactionManager::flush_all_string_dedup_requests() {
|
||||
+ uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
|
||||
+ for (uint i=0; i<=parallel_gc_threads; i++) {
|
||||
+ _manager_array[i]->flush_string_dedup_requests();
|
||||
+ }
|
||||
+}
|
||||
|
||||
ParCompactionManager*
|
||||
ParCompactionManager::gc_thread_compaction_manager(uint index) {
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
index 12b5d891d..86810d32c 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
@@ -26,6 +26,7 @@
|
||||
#define SHARE_GC_PARALLEL_PSCOMPACTIONMANAGER_HPP
|
||||
|
||||
#include "gc/parallel/psParallelCompact.hpp"
|
||||
+#include "gc/shared/stringdedup/stringDedup.hpp"
|
||||
#include "gc/shared/taskqueue.hpp"
|
||||
#include "gc/shared/taskTerminator.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
@@ -88,6 +89,8 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
oop _last_query_obj;
|
||||
size_t _last_query_ret;
|
||||
|
||||
+ StringDedup::Requests _string_dedup_requests;
|
||||
+
|
||||
static PSOldGen* old_gen() { return _old_gen; }
|
||||
static ObjectStartArray* start_array() { return _start_array; }
|
||||
static OopTaskQueueSet* oop_task_queues() { return _oop_task_queues; }
|
||||
@@ -126,6 +129,10 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
_last_query_ret = 0;
|
||||
}
|
||||
|
||||
+ void flush_string_dedup_requests() {
|
||||
+ _string_dedup_requests.flush();
|
||||
+ }
|
||||
+
|
||||
// Bitmap query support, cache last query and result
|
||||
HeapWord* last_query_begin() { return _last_query_beg; }
|
||||
oop last_query_object() { return _last_query_obj; }
|
||||
@@ -137,6 +144,8 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
|
||||
static void reset_all_bitmap_query_caches();
|
||||
|
||||
+ static void flush_all_string_dedup_requests();
|
||||
+
|
||||
RegionTaskQueue* region_stack() { return &_region_stack; }
|
||||
|
||||
static ParCompactionManager* get_vmthread_cm() { return _manager_array[ParallelGCThreads]; }
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
|
||||
index e40e3689d..45e8dae5a 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "gc/parallel/parMarkBitMap.hpp"
|
||||
#include "gc/parallel/psParallelCompact.inline.hpp"
|
||||
+#include "gc/parallel/psStringDedup.hpp"
|
||||
#include "gc/shared/taskqueue.inline.hpp"
|
||||
#include "oops/access.inline.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
@@ -108,6 +109,12 @@ inline void ParCompactionManager::mark_and_push(T* p) {
|
||||
|
||||
if (mark_bitmap()->is_unmarked(obj) && PSParallelCompact::mark_obj(obj)) {
|
||||
push(obj);
|
||||
+
|
||||
+ if (StringDedup::is_enabled() &&
|
||||
+ java_lang_String::is_instance_inlined(obj) &&
|
||||
+ psStringDedup::is_candidate_from_mark(obj)) {
|
||||
+ _string_dedup_requests.add(obj);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
index 3c276db70..8ac733fa5 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "gc/parallel/psRootType.hpp"
|
||||
#include "gc/parallel/psScavenge.hpp"
|
||||
#include "gc/parallel/psYoungGen.hpp"
|
||||
+#include "gc/parallel/psStringDedup.hpp"
|
||||
#include "gc/shared/gcCause.hpp"
|
||||
#include "gc/shared/gcHeapSummary.hpp"
|
||||
#include "gc/shared/gcId.hpp"
|
||||
@@ -1021,6 +1022,8 @@ void PSParallelCompact::post_compact()
|
||||
_space_info[id].publish_new_top();
|
||||
}
|
||||
|
||||
+ ParCompactionManager::flush_all_string_dedup_requests();
|
||||
+
|
||||
MutableSpace* const eden_space = _space_info[eden_space_id].space();
|
||||
MutableSpace* const from_space = _space_info[from_space_id].space();
|
||||
MutableSpace* const to_space = _space_info[to_space_id].space();
|
||||
diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.cpp b/src/hotspot/share/gc/parallel/psPromotionManager.cpp
|
||||
index c5f321f54..56e2683f3 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psPromotionManager.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.cpp
|
||||
@@ -121,6 +121,7 @@ bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) {
|
||||
promotion_failure_occurred = true;
|
||||
}
|
||||
manager->flush_labs();
|
||||
+ manager->flush_string_dedup_requests();
|
||||
}
|
||||
if (!promotion_failure_occurred) {
|
||||
// If there was no promotion failure, the preserved mark stacks
|
||||
diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.hpp
|
||||
index e94be81b6..462beec76 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psPromotionManager.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.hpp
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "gc/shared/copyFailedInfo.hpp"
|
||||
#include "gc/shared/gcTrace.hpp"
|
||||
#include "gc/shared/preservedMarks.hpp"
|
||||
+#include "gc/shared/stringdedup/stringDedup.hpp"
|
||||
#include "gc/shared/taskqueue.hpp"
|
||||
#include "memory/padded.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
@@ -92,6 +93,8 @@ class PSPromotionManager {
|
||||
PreservedMarks* _preserved_marks;
|
||||
PromotionFailedInfo _promotion_failed_info;
|
||||
|
||||
+ StringDedup::Requests _string_dedup_requests;
|
||||
+
|
||||
// Accessors
|
||||
static PSOldGen* old_gen() { return _old_gen; }
|
||||
static MutableSpace* young_space() { return _young_space; }
|
||||
@@ -146,6 +149,8 @@ class PSPromotionManager {
|
||||
static void restore_preserved_marks();
|
||||
|
||||
void flush_labs();
|
||||
+ void flush_string_dedup_requests() { _string_dedup_requests.flush(); }
|
||||
+
|
||||
void drain_stacks(bool totally_drain) {
|
||||
drain_stacks_depth(totally_drain);
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
|
||||
index a0149e447..e754d84b6 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "gc/parallel/psOldGen.hpp"
|
||||
#include "gc/parallel/psPromotionLAB.inline.hpp"
|
||||
#include "gc/parallel/psScavenge.inline.hpp"
|
||||
+#include "gc/parallel/psStringDedup.hpp"
|
||||
#include "gc/shared/taskqueue.inline.hpp"
|
||||
#include "gc/shared/tlab_globals.hpp"
|
||||
#include "logging/log.hpp"
|
||||
@@ -286,6 +287,12 @@ inline oop PSPromotionManager::copy_unmarked_to_survivor_space(oop o,
|
||||
} else {
|
||||
// we'll just push its contents
|
||||
push_contents(new_obj);
|
||||
+
|
||||
+ if (StringDedup::is_enabled() &&
|
||||
+ java_lang_String::is_instance_inlined(new_obj) &&
|
||||
+ psStringDedup::is_candidate_from_evacuation(new_obj, new_obj_is_tenured)) {
|
||||
+ _string_dedup_requests.add(o);
|
||||
+ }
|
||||
}
|
||||
return new_obj;
|
||||
} else {
|
||||
diff --git a/src/hotspot/share/gc/parallel/psStringDedup.hpp b/src/hotspot/share/gc/parallel/psStringDedup.hpp
|
||||
new file mode 100644
|
||||
index 000000000..d1debbddc
|
||||
--- /dev/null
|
||||
+++ b/src/hotspot/share/gc/parallel/psStringDedup.hpp
|
||||
@@ -0,0 +1,50 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
+ *
|
||||
+ * This code is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License version 2 only, as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
+ * version 2 for more details (a copy is included in the LICENSE file that
|
||||
+ * accompanied this code).
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License version
|
||||
+ * 2 along with this work; if not, write to the Free Software Foundation,
|
||||
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+ *
|
||||
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
+ * or visit www.oracle.com if you need additional information or have any
|
||||
+ * questions.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#ifndef SHARE_GC_PARALLEL_PSSTRINGDEDUP_HPP
|
||||
+#define SHARE_GC_PARALLEL_PSSTRINGDEDUP_HPP
|
||||
+
|
||||
+#include "gc/parallel/psScavenge.hpp"
|
||||
+#include "gc/shared/stringdedup/stringDedup.hpp"
|
||||
+#include "memory/allStatic.hpp"
|
||||
+#include "oops/oopsHierarchy.hpp"
|
||||
+
|
||||
+class psStringDedup : AllStatic {
|
||||
+public:
|
||||
+ static bool is_candidate_from_mark(oop java_string) {
|
||||
+ // Candidate if string is being evacuated from young to old but has not
|
||||
+ // reached the deduplication age threshold, i.e. has not previously been a
|
||||
+ // candidate during its life in the young generation.
|
||||
+ return PSScavenge::is_obj_in_young(java_string) &&
|
||||
+ StringDedup::is_below_threshold_age(java_string->age());
|
||||
+ }
|
||||
+
|
||||
+ static bool is_candidate_from_evacuation(oop obj,
|
||||
+ bool obj_is_tenured) {
|
||||
+ return obj_is_tenured ?
|
||||
+ StringDedup::is_below_threshold_age(obj->age()) :
|
||||
+ StringDedup::is_threshold_age(obj->age());
|
||||
+ }
|
||||
+};
|
||||
+#endif // SHARE_GC_PARALLEL_PSSTRINGDEDUP_HPP
|
||||
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp
|
||||
index 71ec8d563..258f497c5 100644
|
||||
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp
|
||||
@@ -116,7 +116,7 @@ size_t StringDedup::Config::desired_table_size(size_t entry_count) {
|
||||
bool StringDedup::Config::ergo_initialize() {
|
||||
if (!UseStringDeduplication) {
|
||||
return true;
|
||||
- } else if (!UseG1GC && !UseShenandoahGC) {
|
||||
+ } else if (!UseG1GC && !UseShenandoahGC && !UseParallelGC) {
|
||||
// String deduplication requested but not supported by the selected GC.
|
||||
// Warn and force disable, but don't error except in debug build with
|
||||
// incorrect default.
|
||||
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationAgeThreshold.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationAgeThreshold.java
|
||||
index ae57bf7df..f652b58d2 100644
|
||||
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationAgeThreshold.java
|
||||
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationAgeThreshold.java
|
||||
@@ -36,6 +36,19 @@ package gc.stringdedup;
|
||||
* @run driver gc.stringdedup.TestStringDeduplicationAgeThreshold G1
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test TestStringDeduplicationAgeThreshold
|
||||
+ * @summary Test string deduplication age threshold
|
||||
+ * @bug 8029075
|
||||
+ * @requires vm.gc.Parallel
|
||||
+ * @library /test/lib
|
||||
+ * @library /
|
||||
+ * @modules java.base/jdk.internal.misc:open
|
||||
+ * @modules java.base/java.lang:open
|
||||
+ * java.management
|
||||
+ * @run driver gc.stringdedup.TestStringDeduplicationAgeThreshold Parallel
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* @test TestStringDeduplicationAgeThreshold
|
||||
* @summary Test string deduplication age threshold
|
||||
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationFullGC.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationFullGC.java
|
||||
index 7e5bb9ae5..83a652a8e 100644
|
||||
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationFullGC.java
|
||||
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationFullGC.java
|
||||
@@ -36,6 +36,19 @@ package gc.stringdedup;
|
||||
* @run driver gc.stringdedup.TestStringDeduplicationFullGC G1
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test TestStringDeduplicationFullGC
|
||||
+ * @summary Test string deduplication during full GC
|
||||
+ * @bug 8029075
|
||||
+ * @requires vm.gc.Parallel
|
||||
+ * @library /test/lib
|
||||
+ * @library /
|
||||
+ * @modules java.base/jdk.internal.misc:open
|
||||
+ * @modules java.base/java.lang:open
|
||||
+ * java.management
|
||||
+ * @run driver gc.stringdedup.TestStringDeduplicationFullGC Parallel
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* @test TestStringDeduplicationFullGC
|
||||
* @summary Test string deduplication during full GC
|
||||
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java
|
||||
index 072f10e10..145adb946 100644
|
||||
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java
|
||||
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java
|
||||
@@ -36,6 +36,19 @@ package gc.stringdedup;
|
||||
* @run driver gc.stringdedup.TestStringDeduplicationInterned G1
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test TestStringDeduplicationInterned
|
||||
+ * @summary Test string deduplication of interned strings
|
||||
+ * @bug 8029075
|
||||
+ * @requires vm.gc.Parallel
|
||||
+ * @library /test/lib
|
||||
+ * @library /
|
||||
+ * @modules java.base/jdk.internal.misc:open
|
||||
+ * @modules java.base/java.lang:open
|
||||
+ * java.management
|
||||
+ * @run driver gc.stringdedup.TestStringDeduplicationInterned Parallel
|
||||
+ */
|
||||
+
|
||||
public class TestStringDeduplicationInterned {
|
||||
public static void main(String[] args) throws Exception {
|
||||
TestStringDeduplicationTools.selectGC(args);
|
||||
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationPrintOptions.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationPrintOptions.java
|
||||
index d57e726a5..c3f2f10dc 100644
|
||||
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationPrintOptions.java
|
||||
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationPrintOptions.java
|
||||
@@ -36,6 +36,19 @@ package gc.stringdedup;
|
||||
* @run driver gc.stringdedup.TestStringDeduplicationPrintOptions G1
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test TestStringDeduplicationPrintOptions
|
||||
+ * @summary Test string deduplication print options
|
||||
+ * @bug 8029075
|
||||
+ * @requires vm.gc.Parallel
|
||||
+ * @library /test/lib
|
||||
+ * @library /
|
||||
+ * @modules java.base/jdk.internal.misc:open
|
||||
+ * @modules java.base/java.lang:open
|
||||
+ * java.management
|
||||
+ * @run driver gc.stringdedup.TestStringDeduplicationPrintOptions Parallel
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* @test TestStringDeduplicationPrintOptions
|
||||
* @summary Test string deduplication print options
|
||||
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTableResize.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTableResize.java
|
||||
index 53c71f1ec..03070b1cb 100644
|
||||
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTableResize.java
|
||||
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTableResize.java
|
||||
@@ -36,6 +36,19 @@ package gc.stringdedup;
|
||||
* @run driver gc.stringdedup.TestStringDeduplicationTableResize G1
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test TestStringDeduplicationTableResize
|
||||
+ * @summary Test string deduplication table resize
|
||||
+ * @bug 8029075
|
||||
+ * @requires vm.gc.Parallel
|
||||
+ * @library /test/lib
|
||||
+ * @library /
|
||||
+ * @modules java.base/jdk.internal.misc:open
|
||||
+ * @modules java.base/java.lang:open
|
||||
+ * java.management
|
||||
+ * @run driver gc.stringdedup.TestStringDeduplicationTableResize Parallel
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* @test TestStringDeduplicationTableResize
|
||||
* @summary Test string deduplication table resize
|
||||
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationYoungGC.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationYoungGC.java
|
||||
index 02cf647e4..1f0e9a70e 100644
|
||||
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationYoungGC.java
|
||||
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationYoungGC.java
|
||||
@@ -36,6 +36,19 @@ package gc.stringdedup;
|
||||
* @run driver gc.stringdedup.TestStringDeduplicationYoungGC G1
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test TestStringDeduplicationYoungGC
|
||||
+ * @summary Test string deduplication during young GC
|
||||
+ * @bug 8029075
|
||||
+ * @requires vm.gc.Parallel
|
||||
+ * @library /test/lib
|
||||
+ * @library /
|
||||
+ * @modules java.base/jdk.internal.misc:open
|
||||
+ * @modules java.base/java.lang:open
|
||||
+ * java.management
|
||||
+ * @run driver gc.stringdedup.TestStringDeduplicationYoungGC Parallel
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* @test TestStringDeduplicationYoungGC
|
||||
* @summary Test string deduplication during young GC
|
||||
--
|
||||
2.22.0
|
||||
|
||||
49
add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch
Normal file
49
add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From fc855b8ef1862144827199a06d0bb13ddf696dd9 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 16:43:49 +0800
|
||||
Subject: add 8271579-G1-Move-copy-before-CAS-in-do_copy
|
||||
|
||||
---
|
||||
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp | 14 ++------------
|
||||
1 file changed, 2 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
|
||||
index 896c891ae..49d627205 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
|
||||
@@ -459,11 +459,11 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
|
||||
|
||||
// We're going to allocate linearly, so might as well prefetch ahead.
|
||||
Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
|
||||
+ Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, word_sz);
|
||||
|
||||
const oop obj = cast_to_oop(obj_ptr);
|
||||
const oop forward_ptr = old->forward_to_atomic(obj, old_mark, memory_order_relaxed);
|
||||
if (forward_ptr == NULL) {
|
||||
- Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, word_sz);
|
||||
|
||||
{
|
||||
const uint young_index = from_region->young_index_in_cset();
|
||||
@@ -475,19 +475,9 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
|
||||
if (dest_attr.is_young()) {
|
||||
if (age < markWord::max_age) {
|
||||
age++;
|
||||
- }
|
||||
- if (old_mark.has_displaced_mark_helper()) {
|
||||
- // In this case, we have to install the old mark word containing the
|
||||
- // displacement tag, and update the age in the displaced mark word.
|
||||
- markWord new_mark = old_mark.displaced_mark_helper().set_age(age);
|
||||
- old_mark.set_displaced_mark_helper(new_mark);
|
||||
- obj->set_mark(old_mark);
|
||||
- } else {
|
||||
- obj->set_mark(old_mark.set_age(age));
|
||||
+ obj->incr_age();
|
||||
}
|
||||
_age_table.add(age, word_sz);
|
||||
- } else {
|
||||
- obj->set_mark(old_mark);
|
||||
}
|
||||
|
||||
// Most objects are not arrays, so do one array check rather than
|
||||
--
|
||||
2.22.0
|
||||
|
||||
272
add-8292296-Use-multiple-threads-to-process-Par.patch
Normal file
272
add-8292296-Use-multiple-threads-to-process-Par.patch
Normal file
@ -0,0 +1,272 @@
|
||||
From e29cbf64958dc5728a40290e6150ed4bf158e1d9 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 16:45:13 +0800
|
||||
Subject: add 8292296-Use-multiple-threads-to-process-Par
|
||||
|
||||
---
|
||||
.../share/gc/parallel/psCompactionManager.cpp | 17 +++++-
|
||||
.../share/gc/parallel/psCompactionManager.hpp | 7 ++-
|
||||
.../share/gc/parallel/psParallelCompact.cpp | 58 +++++++------------
|
||||
.../share/gc/parallel/psParallelCompact.hpp | 18 ++----
|
||||
4 files changed, 47 insertions(+), 53 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.cpp b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
index bab67b219..1461dfe86 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -63,6 +63,8 @@ ParCompactionManager::ParCompactionManager() {
|
||||
_region_stack.initialize();
|
||||
|
||||
reset_bitmap_query_cache();
|
||||
+
|
||||
+ _deferred_obj_array = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapWord*>(10, mtGC);
|
||||
}
|
||||
|
||||
void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
|
||||
@@ -168,6 +170,15 @@ void ParCompactionManager::drain_region_stacks() {
|
||||
} while (!region_stack()->is_empty());
|
||||
}
|
||||
|
||||
+void ParCompactionManager::drain_deferred_objects() {
|
||||
+ while (!_deferred_obj_array->is_empty()) {
|
||||
+ HeapWord* addr = _deferred_obj_array->pop();
|
||||
+ assert(addr != NULL, "expected a deferred object");
|
||||
+ PSParallelCompact::update_deferred_object(this, addr);
|
||||
+ }
|
||||
+ _deferred_obj_array->clear_and_deallocate();
|
||||
+}
|
||||
+
|
||||
size_t ParCompactionManager::pop_shadow_region_mt_safe(PSParallelCompact::RegionData* region_ptr) {
|
||||
MonitorLocker ml(_shadow_region_monitor, Mutex::_no_safepoint_check_flag);
|
||||
while (true) {
|
||||
@@ -198,6 +209,10 @@ void ParCompactionManager::remove_all_shadow_regions() {
|
||||
_shadow_region_array->clear();
|
||||
}
|
||||
|
||||
+void ParCompactionManager::push_deferred_object(HeapWord* addr) {
|
||||
+ _deferred_obj_array->push(addr);
|
||||
+}
|
||||
+
|
||||
#ifdef ASSERT
|
||||
void ParCompactionManager::verify_all_marking_stack_empty() {
|
||||
uint parallel_gc_threads = ParallelGCThreads;
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
index 86810d32c..6ce30f827 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -75,6 +75,8 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
// type of TaskQueue.
|
||||
RegionTaskQueue _region_stack;
|
||||
|
||||
+ GrowableArray<HeapWord*>* _deferred_obj_array;
|
||||
+
|
||||
static ParMarkBitMap* _mark_bitmap;
|
||||
|
||||
// Contains currently free shadow regions. We use it in
|
||||
@@ -123,6 +125,8 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
return next_shadow_region();
|
||||
}
|
||||
|
||||
+ void push_deferred_object(HeapWord* addr);
|
||||
+
|
||||
void reset_bitmap_query_cache() {
|
||||
_last_query_beg = NULL;
|
||||
_last_query_obj = NULL;
|
||||
@@ -188,6 +192,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
|
||||
// Process tasks remaining on any stack
|
||||
void drain_region_stacks();
|
||||
+ void drain_deferred_objects();
|
||||
|
||||
void follow_contents(oop obj);
|
||||
void follow_array(objArrayOop array, int index);
|
||||
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
index 8ac733fa5..33e6efa5f 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -2522,6 +2522,10 @@ public:
|
||||
// Once a thread has drained it's stack, it should try to steal regions from
|
||||
// other threads.
|
||||
compaction_with_stealing_work(&_terminator, worker_id);
|
||||
+
|
||||
+ // At this point all regions have been compacted, so it's now safe
|
||||
+ // to update the deferred objects that cross region boundaries.
|
||||
+ cm->drain_deferred_objects();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2551,24 +2555,13 @@ void PSParallelCompact::compact() {
|
||||
ParallelScavengeHeap::heap()->workers().run_task(&task);
|
||||
|
||||
#ifdef ASSERT
|
||||
- // Verify that all regions have been processed before the deferred updates.
|
||||
+ // Verify that all regions have been processed.
|
||||
for (unsigned int id = old_space_id; id < last_space_id; ++id) {
|
||||
verify_complete(SpaceId(id));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- {
|
||||
- GCTraceTime(Trace, gc, phases) tm("Deferred Updates", &_gc_timer);
|
||||
- // Update the deferred objects, if any. In principle, any compaction
|
||||
- // manager can be used. However, since the current thread is VM thread, we
|
||||
- // use the rightful one to keep the verification logic happy.
|
||||
- ParCompactionManager* cm = ParCompactionManager::get_vmthread_cm();
|
||||
- for (unsigned int id = old_space_id; id < last_space_id; ++id) {
|
||||
- update_deferred_objects(cm, SpaceId(id));
|
||||
- }
|
||||
- }
|
||||
-
|
||||
DEBUG_ONLY(write_block_fill_histogram());
|
||||
}
|
||||
|
||||
@@ -2695,32 +2688,23 @@ PSParallelCompact::SpaceId PSParallelCompact::space_id(HeapWord* addr) {
|
||||
return last_space_id;
|
||||
}
|
||||
|
||||
-void PSParallelCompact::update_deferred_objects(ParCompactionManager* cm,
|
||||
- SpaceId id) {
|
||||
- assert(id < last_space_id, "bad space id");
|
||||
+void PSParallelCompact::update_deferred_object(ParCompactionManager* cm, HeapWord *addr) {
|
||||
+#ifdef ASSERT
|
||||
|
||||
ParallelCompactData& sd = summary_data();
|
||||
- const SpaceInfo* const space_info = _space_info + id;
|
||||
- ObjectStartArray* const start_array = space_info->start_array();
|
||||
+ size_t region_idx = sd.addr_to_region_idx(addr);
|
||||
+ assert(sd.region(region_idx)->completed(), "first region must be completed before deferred updates");
|
||||
+ assert(sd.region(region_idx + 1)->completed(), "second region must be completed before deferred updates");
|
||||
+#endif
|
||||
|
||||
- const MutableSpace* const space = space_info->space();
|
||||
- assert(space_info->dense_prefix() >= space->bottom(), "dense_prefix not set");
|
||||
- HeapWord* const beg_addr = space_info->dense_prefix();
|
||||
- HeapWord* const end_addr = sd.region_align_up(space_info->new_top());
|
||||
-
|
||||
- const RegionData* const beg_region = sd.addr_to_region_ptr(beg_addr);
|
||||
- const RegionData* const end_region = sd.addr_to_region_ptr(end_addr);
|
||||
- const RegionData* cur_region;
|
||||
- for (cur_region = beg_region; cur_region < end_region; ++cur_region) {
|
||||
- HeapWord* const addr = cur_region->deferred_obj_addr();
|
||||
- if (addr != NULL) {
|
||||
- if (start_array != NULL) {
|
||||
- start_array->allocate_block(addr);
|
||||
- }
|
||||
- cm->update_contents(cast_to_oop(addr));
|
||||
- assert(oopDesc::is_oop_or_null(cast_to_oop(addr)), "Expected an oop or NULL at " PTR_FORMAT, p2i(cast_to_oop(addr)));
|
||||
- }
|
||||
+ const SpaceInfo* const space_info = _space_info + space_id(addr);
|
||||
+ ObjectStartArray* const start_array = space_info->start_array();
|
||||
+ if (start_array != NULL) {
|
||||
+ start_array->allocate_block(addr);
|
||||
}
|
||||
+
|
||||
+ cm->update_contents(cast_to_oop(addr));
|
||||
+ assert(oopDesc::is_oop(cast_to_oop(addr)), "Expected an oop at " PTR_FORMAT, p2i(cast_to_oop(addr)));
|
||||
}
|
||||
|
||||
// Skip over count live words starting from beg, and return the address of the
|
||||
@@ -2967,7 +2951,6 @@ void PSParallelCompact::fill_region(ParCompactionManager* cm, MoveAndUpdateClosu
|
||||
if (closure.is_full()) {
|
||||
decrement_destination_counts(cm, src_space_id, src_region_idx,
|
||||
closure.source());
|
||||
- region_ptr->set_deferred_obj_addr(NULL);
|
||||
closure.complete_region(cm, dest_addr, region_ptr);
|
||||
return;
|
||||
}
|
||||
@@ -3012,7 +2995,7 @@ void PSParallelCompact::fill_region(ParCompactionManager* cm, MoveAndUpdateClosu
|
||||
if (status == ParMarkBitMap::would_overflow) {
|
||||
// The last object did not fit. Note that interior oop updates were
|
||||
// deferred, then copy enough of the object to fill the region.
|
||||
- region_ptr->set_deferred_obj_addr(closure.destination());
|
||||
+ cm->push_deferred_object(closure.destination());
|
||||
status = closure.copy_until_full(); // copies from closure.source()
|
||||
|
||||
decrement_destination_counts(cm, src_space_id, src_region_idx,
|
||||
@@ -3024,7 +3007,6 @@ void PSParallelCompact::fill_region(ParCompactionManager* cm, MoveAndUpdateClosu
|
||||
if (status == ParMarkBitMap::full) {
|
||||
decrement_destination_counts(cm, src_space_id, src_region_idx,
|
||||
closure.source());
|
||||
- region_ptr->set_deferred_obj_addr(NULL);
|
||||
closure.complete_region(cm, dest_addr, region_ptr);
|
||||
return;
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.hpp b/src/hotspot/share/gc/parallel/psParallelCompact.hpp
|
||||
index c4319a080..7c8b1873a 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psParallelCompact.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.hpp
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -243,13 +243,6 @@ public:
|
||||
// Reuse _source_region to store the corresponding shadow region index
|
||||
size_t shadow_region() const { return _source_region; }
|
||||
|
||||
- // The object (if any) starting in this region and ending in a different
|
||||
- // region that could not be updated during the main (parallel) compaction
|
||||
- // phase. This is different from _partial_obj_addr, which is an object that
|
||||
- // extends onto a source region. However, the two uses do not overlap in
|
||||
- // time, so the same field is used to save space.
|
||||
- HeapWord* deferred_obj_addr() const { return _partial_obj_addr; }
|
||||
-
|
||||
// The starting address of the partial object extending onto the region.
|
||||
HeapWord* partial_obj_addr() const { return _partial_obj_addr; }
|
||||
|
||||
@@ -312,7 +305,6 @@ public:
|
||||
void set_destination(HeapWord* addr) { _destination = addr; }
|
||||
void set_source_region(size_t region) { _source_region = region; }
|
||||
void set_shadow_region(size_t region) { _source_region = region; }
|
||||
- void set_deferred_obj_addr(HeapWord* addr) { _partial_obj_addr = addr; }
|
||||
void set_partial_obj_addr(HeapWord* addr) { _partial_obj_addr = addr; }
|
||||
void set_partial_obj_size(size_t words) {
|
||||
_partial_obj_size = (region_sz_t) words;
|
||||
@@ -948,8 +940,8 @@ inline void ParMarkBitMapClosure::decrement_words_remaining(size_t words) {
|
||||
// but do not have their references updated. References are not updated because
|
||||
// it cannot easily be determined if the klass pointer KKK for the object AAA
|
||||
// has been updated. KKK likely resides in a region to the left of the region
|
||||
-// containing AAA. These AAA's have there references updated at the end in a
|
||||
-// clean up phase. See the method PSParallelCompact::update_deferred_objects().
|
||||
+// containing AAA. These AAA's have their references updated at the end in a
|
||||
+// clean up phase. See the method PSParallelCompact::update_deferred_object().
|
||||
// An alternate strategy is being investigated for this deferral of updating.
|
||||
//
|
||||
// Compaction is done on a region basis. A region that is ready to be filled is
|
||||
@@ -1233,8 +1225,8 @@ class PSParallelCompact : AllStatic {
|
||||
// Fill in the block table for the specified region.
|
||||
static void fill_blocks(size_t region_idx);
|
||||
|
||||
- // Update the deferred objects in the space.
|
||||
- static void update_deferred_objects(ParCompactionManager* cm, SpaceId id);
|
||||
+ // Update a single deferred object.
|
||||
+ static void update_deferred_object(ParCompactionManager* cm, HeapWord* addr);
|
||||
|
||||
static ParMarkBitMap* mark_bitmap() { return &_mark_bitmap; }
|
||||
static ParallelCompactData& summary_data() { return _summary_data; }
|
||||
--
|
||||
2.22.0
|
||||
|
||||
92
add-Parallel-Full-gc-mark-stack-draining-should.patch
Normal file
92
add-Parallel-Full-gc-mark-stack-draining-should.patch
Normal file
@ -0,0 +1,92 @@
|
||||
From 1fe9667bb594b66f7363cec246ebc99cd0ac9103 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 16:43:24 +0800
|
||||
Subject: add Parallel-Full-gc-mark-stack-draining-should
|
||||
|
||||
---
|
||||
.../share/gc/parallel/psCompactionManager.cpp | 18 +++++++++++++++---
|
||||
.../share/gc/parallel/psCompactionManager.hpp | 1 +
|
||||
.../share/gc/parallel/psParallelCompact.cpp | 12 +++++-------
|
||||
3 files changed, 21 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.cpp b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
index 117817caa..b2c17140d 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
|
||||
@@ -115,12 +115,24 @@ ParCompactionManager::gc_thread_compaction_manager(uint index) {
|
||||
return _manager_array[index];
|
||||
}
|
||||
|
||||
+bool ParCompactionManager::transfer_from_overflow_stack(ObjArrayTask& task) {
|
||||
+ while (_objarray_stack.pop_overflow(task)) {
|
||||
+ if (!_objarray_stack.try_push_to_taskqueue(task)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void ParCompactionManager::follow_marking_stacks() {
|
||||
do {
|
||||
- // Drain the overflow stack first, to allow stealing from the marking stack.
|
||||
+ // First, try to move tasks from the overflow stack into the shared buffer, so
|
||||
+ // that other threads can steal. Otherwise process the overflow stack first.
|
||||
oop obj;
|
||||
while (marking_stack()->pop_overflow(obj)) {
|
||||
- follow_contents(obj);
|
||||
+ if (!marking_stack()->try_push_to_taskqueue(obj)) {
|
||||
+ follow_contents(obj);
|
||||
+ }
|
||||
}
|
||||
while (marking_stack()->pop_local(obj)) {
|
||||
follow_contents(obj);
|
||||
@@ -128,7 +140,7 @@ void ParCompactionManager::follow_marking_stacks() {
|
||||
|
||||
// Process ObjArrays one at a time to avoid marking stack bloat.
|
||||
ObjArrayTask task;
|
||||
- if (_objarray_stack.pop_overflow(task) || _objarray_stack.pop_local(task)) {
|
||||
+ if (transfer_from_overflow_stack(task) || _objarray_stack.pop_local(task)) {
|
||||
follow_array((objArrayOop)task.obj(), task.index());
|
||||
}
|
||||
} while (!marking_stacks_empty());
|
||||
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
index a73e898f0..12b5d891d 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
|
||||
@@ -94,6 +94,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||
|
||||
static void initialize(ParMarkBitMap* mbm);
|
||||
|
||||
+ bool transfer_from_overflow_stack(ObjArrayTask& task);
|
||||
protected:
|
||||
// Array of task queues. Needed by the task terminator.
|
||||
static RegionTaskQueueSet* region_task_queues() { return _region_task_queues; }
|
||||
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
index 8cf13bd1d..3c276db70 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
|
||||
@@ -2002,17 +2002,15 @@ void steal_marking_work(TaskTerminator& terminator, uint worker_id) {
|
||||
ParCompactionManager* cm =
|
||||
ParCompactionManager::gc_thread_compaction_manager(worker_id);
|
||||
|
||||
- oop obj = NULL;
|
||||
- ObjArrayTask task;
|
||||
do {
|
||||
- while (ParCompactionManager::steal_objarray(worker_id, task)) {
|
||||
+ oop obj = NULL;
|
||||
+ ObjArrayTask task;
|
||||
+ if (ParCompactionManager::steal_objarray(worker_id, task)) {
|
||||
cm->follow_array((objArrayOop)task.obj(), task.index());
|
||||
- cm->follow_marking_stacks();
|
||||
- }
|
||||
- while (ParCompactionManager::steal(worker_id, obj)) {
|
||||
+ } else if (ParCompactionManager::steal(worker_id, obj)) {
|
||||
cm->follow_contents(obj);
|
||||
- cm->follow_marking_stacks();
|
||||
}
|
||||
+ cm->follow_marking_stacks();
|
||||
} while (!terminator.offer_termination());
|
||||
}
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
42
fix-cds-SignedJar_java-test-fails.patch
Normal file
42
fix-cds-SignedJar_java-test-fails.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From a841b7338dbc6a806845116d0a03e57e7dcc6f6d Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 17:02:05 +0800
|
||||
Subject: fix cds SignedJar_java test fails
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvm.cpp | 20 --------------------
|
||||
1 file changed, 20 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp
|
||||
index 9057cc072..8baba8c38 100644
|
||||
--- a/src/hotspot/share/prims/jvm.cpp
|
||||
+++ b/src/hotspot/share/prims/jvm.cpp
|
||||
@@ -2852,26 +2852,6 @@ static void thread_entry(JavaThread* thread, TRAPS) {
|
||||
|
||||
|
||||
JVM_ENTRY(void, JVM_StartThread(JNIEnv* env, jobject jthread))
|
||||
-#if INCLUDE_CDS
|
||||
- if (DumpSharedSpaces) {
|
||||
- // During java -Xshare:dump, if we allow multiple Java threads to
|
||||
- // execute in parallel, symbols and classes may be loaded in
|
||||
- // random orders which will make the resulting CDS archive
|
||||
- // non-deterministic.
|
||||
- //
|
||||
- // Lucikly, during java -Xshare:dump, it's important to run only
|
||||
- // the code in the main Java thread (which is NOT started here) that
|
||||
- // creates the module graph, etc. It's safe to not start the other
|
||||
- // threads which are launched by class static initializers
|
||||
- // (ReferenceHandler, FinalizerThread and CleanerImpl).
|
||||
- if (log_is_enabled(Info, cds)) {
|
||||
- ResourceMark rm;
|
||||
- oop t = JNIHandles::resolve_non_null(jthread);
|
||||
- log_info(cds)("JVM_StartThread() ignored: %s", t->klass()->external_name());
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
-#endif
|
||||
JavaThread *native_thread = NULL;
|
||||
|
||||
// We cannot hold the Threads_lock when we throw an exception,
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -891,7 +891,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
|
||||
|
||||
Name: java-%{javaver}-%{origin}
|
||||
Version: %{newjavaver}.%{buildver}
|
||||
Release: 1
|
||||
Release: 2
|
||||
|
||||
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
|
||||
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
|
||||
@ -989,6 +989,13 @@ Patch24: 8275509-ModuleDescriptor.hashCode-isn-t-reproducible.patch
|
||||
Patch26: 8280872-Reorder-code-cache-segments-to-improv.patch
|
||||
Patch27: 8275509-ModuleDescriptor.hashCode-isn-t-rep.patch
|
||||
|
||||
# 17.0.8
|
||||
Patch28: add-Parallel-Full-gc-mark-stack-draining-should.patch
|
||||
Patch29: add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch
|
||||
Patch30: add-8267185-Add-string-deduplication-support-to.patch
|
||||
Patch31: add-8292296-Use-multiple-threads-to-process-Par.patch
|
||||
Patch32: fix-cds-SignedJar_java-test-fails.patch
|
||||
|
||||
############################################
|
||||
#
|
||||
# LoongArch64 specific patches
|
||||
@ -1243,6 +1250,12 @@ pushd %{top_level_dir_name}
|
||||
%patch24 -p1
|
||||
%patch26 -p1
|
||||
%patch27 -p1
|
||||
%patch28 -p1
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
%patch31 -p1
|
||||
%patch32 -p1
|
||||
|
||||
%ifarch riscv64
|
||||
%patch3000 -p1
|
||||
%endif
|
||||
@ -1808,6 +1821,13 @@ cjc.mainProgram(arg)
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Sep 25 2023 kuenking111 <wangkun49@huawei.com> - 1:17.0.8.7-2
|
||||
- add add-Parallel-Full-gc-mark-stack-draining-should.patch
|
||||
- add add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch
|
||||
- add add-8267185-Add-string-deduplication-support-to.patch
|
||||
- add add-8292296-Use-multiple-threads-to-process-Par.patch
|
||||
- add fix-cds-SignedJar_java-test-fails.patch
|
||||
|
||||
* Tue Aug 08 2023 misaka00251 <liuxin@iscas.ac.cn> - 1:17.0.8.7-1
|
||||
- Add riscv64 support
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user