merge master

This commit is contained in:
Noah 2021-03-23 23:40:02 +08:00
commit 8fcaf4bb42
8 changed files with 3268 additions and 1 deletions

View File

@ -0,0 +1,858 @@
From 65e9f0b4c719146b0958cb3c01fd31e11e49ec37 Mon Sep 17 00:00:00 2001
Date: Tue, 16 Mar 2021 07:09:57 +0000
Subject: [PATCH 4/4] backport JDK-8214535 to support Jmap parallel
---
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 25 ++++
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 4 +
.../gc/parallel/parallelScavengeHeap.cpp | 64 +++++++++++
.../gc/parallel/parallelScavengeHeap.hpp | 22 +++-
src/hotspot/share/gc/parallel/psOldGen.cpp | 32 ++++++
src/hotspot/share/gc/parallel/psOldGen.hpp | 11 ++
src/hotspot/share/gc/shared/collectedHeap.hpp | 11 ++
.../share/gc/shared/vmGCOperations.cpp | 2 +-
.../share/gc/shared/vmGCOperations.hpp | 5 +-
src/hotspot/share/gc/shared/workgroup.hpp | 21 ++++
src/hotspot/share/memory/heapInspection.cpp | 108 ++++++++++++++++--
src/hotspot/share/memory/heapInspection.hpp | 44 ++++++-
src/hotspot/share/runtime/arguments.hpp | 12 +-
src/hotspot/share/services/attachListener.cpp | 15 ++-
.../share/classes/sun/tools/jmap/JMap.java | 41 +++++--
test/jdk/sun/tools/jmap/BasicJMapTest.java | 55 +++++++++
16 files changed, 442 insertions(+), 30 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index 7e9c6254c..fd2da14a3 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -77,6 +77,7 @@
#include "gc/shared/weakProcessor.hpp"
#include "logging/log.hpp"
#include "memory/allocation.hpp"
+#include "memory/heapInspection.hpp"
#include "memory/iterator.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
@@ -2208,6 +2209,30 @@ void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
heap_region_iterate(&blk);
}
+class G1ParallelObjectIterator : public ParallelObjectIterator {
+private:
+ G1CollectedHeap* _heap;
+ HeapRegionClaimer _claimer;
+
+public:
+ G1ParallelObjectIterator(uint thread_num) :
+ _heap(G1CollectedHeap::heap()),
+ _claimer(thread_num == 0 ? G1CollectedHeap::heap()->workers()->active_workers() : thread_num) {}
+
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) {
+ _heap->object_iterate_parallel(cl, worker_id, &_claimer);
+ }
+};
+
+ParallelObjectIterator* G1CollectedHeap::parallel_object_iterator(uint thread_num) {
+ return new G1ParallelObjectIterator(thread_num);
+}
+
+void G1CollectedHeap::object_iterate_parallel(ObjectClosure* cl, uint worker_id, HeapRegionClaimer* claimer) {
+ IterateObjectClosureRegionClosure blk(cl);
+ heap_region_par_iterate_from_worker_offset(&blk, claimer, worker_id);
+}
+
void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
_hrm.iterate(cl);
}
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
index bb46cae83..82f59d69b 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
@@ -1125,9 +1125,13 @@ public:
// Iteration functions.
+ void object_iterate_parallel(ObjectClosure* cl, uint worker_id, HeapRegionClaimer* claimer);
+
// Iterate over all objects, calling "cl.do_object" on each.
virtual void object_iterate(ObjectClosure* cl);
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num);
+
virtual void safe_object_iterate(ObjectClosure* cl) {
object_iterate(cl);
}
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
index 29f967fb3..66e1b32a6 100644
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
@@ -523,6 +523,70 @@ void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
old_gen()->object_iterate(cl);
}
+// The HeapBlockClaimer is used during parallel iteration over the heap,
+// allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these.
+// The eden and survivor spaces are treated as single blocks as it is hard to divide
+// these spaces.
+// The old space is divided into fixed-size blocks.
+class HeapBlockClaimer : public StackObj {
+ size_t _claimed_index;
+
+public:
+ static const size_t InvalidIndex = SIZE_MAX;
+ static const size_t EdenIndex = 0;
+ static const size_t SurvivorIndex = 1;
+ static const size_t NumNonOldGenClaims = 2;
+
+ HeapBlockClaimer() : _claimed_index(EdenIndex) { }
+ // Claim the block and get the block index.
+ size_t claim_and_get_block() {
+ size_t block_index;
+ block_index = Atomic::add(1u, &_claimed_index) - 1; // TODO: original impl is: Atomic::fetch_and_add(&_claimed_index, 1u);
+
+ PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen();
+ size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims;
+
+ return block_index < num_claims ? block_index : InvalidIndex;
+ }
+};
+
+void ParallelScavengeHeap::object_iterate_parallel(ObjectClosure* cl,
+ HeapBlockClaimer* claimer) {
+ size_t block_index = claimer->claim_and_get_block();
+ // Iterate until all blocks are claimed
+ if (block_index == HeapBlockClaimer::EdenIndex) {
+ young_gen()->eden_space()->object_iterate(cl);
+ block_index = claimer->claim_and_get_block();
+ }
+ if (block_index == HeapBlockClaimer::SurvivorIndex) {
+ young_gen()->from_space()->object_iterate(cl);
+ young_gen()->to_space()->object_iterate(cl);
+ block_index = claimer->claim_and_get_block();
+ }
+ while (block_index != HeapBlockClaimer::InvalidIndex) {
+ old_gen()->object_iterate_block(cl, block_index - HeapBlockClaimer::NumNonOldGenClaims);
+ block_index = claimer->claim_and_get_block();
+ }
+}
+
+class PSScavengeParallelObjectIterator : public ParallelObjectIterator {
+private:
+ ParallelScavengeHeap* _heap;
+ HeapBlockClaimer _claimer;
+
+public:
+ PSScavengeParallelObjectIterator() :
+ _heap(ParallelScavengeHeap::heap()),
+ _claimer() {}
+
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) {
+ _heap->object_iterate_parallel(cl, &_claimer);
+ }
+};
+
+ParallelObjectIterator* ParallelScavengeHeap::parallel_object_iterator(uint thread_num) {
+ return new PSScavengeParallelObjectIterator();
+}
HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
if (young_gen()->is_in_reserved(addr)) {
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
index 5d18efb92..0a9b7bd3f 100644
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
@@ -44,6 +44,7 @@
class AdjoiningGenerations;
class GCHeapSummary;
class GCTaskManager;
+class HeapBlockClaimer;
class MemoryManager;
class MemoryPool;
class PSAdaptiveSizePolicy;
@@ -79,6 +80,8 @@ class ParallelScavengeHeap : public CollectedHeap {
MemoryPool* _survivor_pool;
MemoryPool* _old_pool;
+ WorkGang _workers;
+
virtual void initialize_serviceability();
void trace_heap(GCWhen::Type when, const GCTracer* tracer);
@@ -93,7 +96,20 @@ class ParallelScavengeHeap : public CollectedHeap {
public:
ParallelScavengeHeap(GenerationSizer* policy) :
- CollectedHeap(), _collector_policy(policy), _death_march_count(0) { }
+ CollectedHeap(),
+ _collector_policy(policy),
+ _death_march_count(0),
+ _young_manager(NULL),
+ _old_manager(NULL),
+ _eden_pool(NULL),
+ _survivor_pool(NULL),
+ _old_pool(NULL),
+ _workers("GC Thread",
+ ParallelGCThreads,
+ true /* are_GC_task_threads */,
+ false /* are_ConcurrentGC_threads */) {
+ _workers.initialize_workers();
+ }
// For use by VM operations
enum CollectionType {
@@ -217,6 +233,8 @@ class ParallelScavengeHeap : public CollectedHeap {
void object_iterate(ObjectClosure* cl);
void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); }
+ void object_iterate_parallel(ObjectClosure* cl, HeapBlockClaimer* claimer);
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num);
HeapWord* block_start(const void* addr) const;
size_t block_size(const HeapWord* addr) const;
@@ -232,6 +250,8 @@ class ParallelScavengeHeap : public CollectedHeap {
virtual void gc_threads_do(ThreadClosure* tc) const;
virtual void print_tracing_info() const;
+ virtual WorkGang* get_safepoint_workers() { return &_workers; }
+
void verify(VerifyOption option /* ignored */);
// Resize the young generation. The reserved space for the
diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp
index 35844b14b..dbb5148fd 100644
--- a/src/hotspot/share/gc/parallel/psOldGen.cpp
+++ b/src/hotspot/share/gc/parallel/psOldGen.cpp
@@ -213,6 +213,38 @@ HeapWord* PSOldGen::allocate(size_t word_size) {
return res;
}
+size_t PSOldGen::num_iterable_blocks() const {
+ return (object_space()->used_in_bytes() + IterateBlockSize - 1) / IterateBlockSize;
+}
+
+void PSOldGen::object_iterate_block(ObjectClosure* cl, size_t block_index) {
+ size_t block_word_size = IterateBlockSize / HeapWordSize;
+ assert((block_word_size % (ObjectStartArray::block_size)) == 0,
+ "Block size not a multiple of start_array block");
+
+ MutableSpace *space = object_space();
+
+ HeapWord* begin = space->bottom() + block_index * block_word_size;
+ HeapWord* end = MIN2(space->top(), begin + block_word_size);
+
+ if (!start_array()->object_starts_in_range(begin, end)) {
+ return;
+ }
+
+ // Get object starting at or reaching into this block.
+ HeapWord* start = start_array()->object_start(begin);
+ if (start < begin) {
+ start += oop(start)->size();
+ }
+ assert(start >= begin,
+ "Object address" PTR_FORMAT " must be larger or equal to block address at " PTR_FORMAT,
+ p2i(start), p2i(begin));
+ // Iterate all objects until the end.
+ for (HeapWord* p = start; p < end; p += oop(p)->size()) {
+ cl->do_object(oop(p));
+ }
+}
+
HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
expand(word_size*HeapWordSize);
if (GCExpandToAllocateDelayMillis > 0) {
diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp
index fa27f5a04..fa6e4849b 100644
--- a/src/hotspot/share/gc/parallel/psOldGen.hpp
+++ b/src/hotspot/share/gc/parallel/psOldGen.hpp
@@ -59,6 +59,9 @@ class PSOldGen : public CHeapObj<mtGC> {
const size_t _min_gen_size;
const size_t _max_gen_size;
+ // Block size for parallel iteration
+ static const size_t IterateBlockSize = 1024 * 1024;
+
// Used when initializing the _name field.
static inline const char* select_name();
@@ -195,6 +198,14 @@ class PSOldGen : public CHeapObj<mtGC> {
void oop_iterate(OopIterateClosure* cl) { object_space()->oop_iterate(cl); }
void object_iterate(ObjectClosure* cl) { object_space()->object_iterate(cl); }
+ // Number of blocks to be iterated over in the used part of old gen.
+ size_t num_iterable_blocks() const;
+ // Iterate the objects starting in block block_index within [bottom, top) of the
+ // old gen. The object just reaching into this block is not iterated over.
+ // A block is an evenly sized non-overlapping part of the old gen of
+ // IterateBlockSize bytes.
+ void object_iterate_block(ObjectClosure* cl, size_t block_index);
+
// Debugging - do not use for time critical operations
virtual void print() const;
virtual void print_on(outputStream* st) const;
diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp
index 47acf22cb..bcd4da29a 100644
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp
@@ -28,6 +28,7 @@
#include "gc/shared/gcCause.hpp"
#include "gc/shared/gcWhen.hpp"
#include "memory/allocation.hpp"
+#include "memory/heapInspection.hpp"
#include "runtime/handles.hpp"
#include "runtime/perfData.hpp"
#include "runtime/safepoint.hpp"
@@ -42,6 +43,7 @@
// class defines the functions that a heap must implement, and contains
// infrastructure common to all heaps.
+class AbstractGangTask;
class AdaptiveSizePolicy;
class BarrierSet;
class CollectorPolicy;
@@ -83,6 +85,11 @@ class GCHeapLog : public EventLogBase<GCMessage> {
}
};
+class ParallelObjectIterator : public CHeapObj<mtGC> {
+public:
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) = 0;
+};
+
//
// CollectedHeap
// GenCollectedHeap
@@ -434,6 +441,10 @@ class CollectedHeap : public CHeapObj<mtInternal> {
// Iterate over all objects, calling "cl.do_object" on each.
virtual void object_iterate(ObjectClosure* cl) = 0;
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num) {
+ return NULL;
+ }
+
// Similar to object_iterate() except iterates only
// over live objects.
virtual void safe_object_iterate(ObjectClosure* cl) = 0;
diff --git a/src/hotspot/share/gc/shared/vmGCOperations.cpp b/src/hotspot/share/gc/shared/vmGCOperations.cpp
index b02305a6e..728290a7b 100644
--- a/src/hotspot/share/gc/shared/vmGCOperations.cpp
+++ b/src/hotspot/share/gc/shared/vmGCOperations.cpp
@@ -154,7 +154,7 @@ void VM_GC_HeapInspection::doit() {
}
HeapInspection inspect(_csv_format, _print_help, _print_class_stats,
_columns);
- inspect.heap_inspection(_out);
+ inspect.heap_inspection(_out, _parallel_thread_num);
}
diff --git a/src/hotspot/share/gc/shared/vmGCOperations.hpp b/src/hotspot/share/gc/shared/vmGCOperations.hpp
index 65876e559..ef73b45de 100644
--- a/src/hotspot/share/gc/shared/vmGCOperations.hpp
+++ b/src/hotspot/share/gc/shared/vmGCOperations.hpp
@@ -125,18 +125,21 @@ class VM_GC_HeapInspection: public VM_GC_Operation {
private:
outputStream* _out;
bool _full_gc;
+ uint _parallel_thread_num;
bool _csv_format; // "comma separated values" format for spreadsheet.
bool _print_help;
bool _print_class_stats;
const char* _columns;
public:
- VM_GC_HeapInspection(outputStream* out, bool request_full_gc) :
+ VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
+ uint parallel_thread_num = 1) :
VM_GC_Operation(0 /* total collections, dummy, ignored */,
GCCause::_heap_inspection /* GC Cause */,
0 /* total full collections, dummy, ignored */,
request_full_gc) {
_out = out;
_full_gc = request_full_gc;
+ _parallel_thread_num = parallel_thread_num;
_csv_format = false;
_print_help = false;
_print_class_stats = false;
diff --git a/src/hotspot/share/gc/shared/workgroup.hpp b/src/hotspot/share/gc/shared/workgroup.hpp
index 8b46d3bc4..109649df0 100644
--- a/src/hotspot/share/gc/shared/workgroup.hpp
+++ b/src/hotspot/share/gc/shared/workgroup.hpp
@@ -228,6 +228,27 @@ protected:
virtual AbstractGangWorker* allocate_worker(uint which);
};
+// Temporarily try to set the number of active workers.
+// It's not guaranteed that it succeeds, and users need to
+// query the number of active workers.
+class WithUpdatedActiveWorkers : public StackObj {
+private:
+ AbstractWorkGang* const _gang;
+ const uint _old_active_workers;
+
+public:
+ WithUpdatedActiveWorkers(AbstractWorkGang* gang, uint requested_num_workers) :
+ _gang(gang),
+ _old_active_workers(gang->active_workers()) {
+ uint capped_num_workers = MIN2(requested_num_workers, gang->total_workers());
+ gang->update_active_workers(capped_num_workers);
+ }
+
+ ~WithUpdatedActiveWorkers() {
+ _gang->update_active_workers(_old_active_workers);
+ }
+};
+
// Several instances of this class run in parallel as workers for a gang.
class AbstractGangWorker: public WorkerThread {
public:
diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp
index 9c2cdc117..dbc0eb274 100644
--- a/src/hotspot/share/memory/heapInspection.cpp
+++ b/src/hotspot/share/memory/heapInspection.cpp
@@ -31,6 +31,7 @@
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "oops/reflectionAccessorImplKlassHelper.hpp"
+#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
@@ -236,6 +237,41 @@ size_t KlassInfoTable::size_of_instances_in_words() const {
return _size_of_instances_in_words;
}
+// Return false if the entry could not be recorded on account
+// of running out of space required to create a new entry.
+bool KlassInfoTable::merge_entry(const KlassInfoEntry* cie) {
+ Klass* k = cie->klass();
+ KlassInfoEntry* elt = lookup(k);
+ // elt may be NULL if it's a new klass for which we
+ // could not allocate space for a new entry in the hashtable.
+ if (elt != NULL) {
+ elt->set_count(elt->count() + cie->count());
+ elt->set_words(elt->words() + cie->words());
+ _size_of_instances_in_words += cie->words();
+ return true;
+ }
+ return false;
+}
+
+class KlassInfoTableMergeClosure : public KlassInfoClosure {
+ private:
+ KlassInfoTable* _dest;
+ bool _success;
+ public:
+ KlassInfoTableMergeClosure(KlassInfoTable* table) : _dest(table), _success(true) {}
+ void do_cinfo(KlassInfoEntry* cie) {
+ _success &= _dest->merge_entry(cie);
+ }
+ bool success() { return _success; }
+};
+
+// merge from table
+bool KlassInfoTable::merge(KlassInfoTable* table) {
+ KlassInfoTableMergeClosure closure(this);
+ table->iterate(&closure);
+ return closure.success();
+}
+
int KlassInfoHisto::sort_helper(KlassInfoEntry** e1, KlassInfoEntry** e2) {
return (*e1)->compare(*e1,*e2);
}
@@ -687,7 +723,7 @@ class HistoClosure : public KlassInfoClosure {
class RecordInstanceClosure : public ObjectClosure {
private:
KlassInfoTable* _cit;
- size_t _missed_count;
+ uintx _missed_count;
BoolObjectClosure* _filter;
public:
RecordInstanceClosure(KlassInfoTable* cit, BoolObjectClosure* filter) :
@@ -701,7 +737,7 @@ class RecordInstanceClosure : public ObjectClosure {
}
}
- size_t missed_count() { return _missed_count; }
+ uintx missed_count() { return _missed_count; }
private:
bool should_visit(oop obj) {
@@ -709,15 +745,73 @@ class RecordInstanceClosure : public ObjectClosure {
}
};
-size_t HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *filter) {
- ResourceMark rm;
+// Heap inspection for every worker.
+// When native OOM hanppens for KlassInfoTable, set _success to false.
+void ParHeapInspectTask::work(uint worker_id) {
+ uintx missed_count = 0;
+ bool merge_success = true;
+ if (!Atomic::load(&_success)) {
+ // other worker has failed on parallel iteration.
+ return;
+ }
+ KlassInfoTable cit(false);
+ if (cit.allocation_failed()) {
+ // fail to allocate memory, stop parallel mode
+ Atomic::store(false, &_success);
+ return;
+ }
+ RecordInstanceClosure ric(&cit, _filter);
+ _poi->object_iterate(&ric, worker_id);
+ missed_count = ric.missed_count();
+ {
+ MutexLocker x(&_mutex);
+ merge_success = _shared_cit->merge(&cit);
+ }
+ if (merge_success) {
+ Atomic::add(missed_count, &_missed_count);
+ } else {
+ Atomic::store(false, &_success);
+ }
+}
+
+size_t HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *filter, uint parallel_thread_num) {
+ // Try parallel first.
+ if (parallel_thread_num > 1) {
+ ResourceMark rm;
+
+ WorkGang* gang = Universe::heap()->get_safepoint_workers();
+ if (gang != NULL) {
+ // The GC provided a WorkGang to be used during a safepoint.
+
+ // Can't run with more threads than provided by the WorkGang.
+ WithUpdatedActiveWorkers update_and_restore(gang, parallel_thread_num);
+
+ ParallelObjectIterator* poi = Universe::heap()->parallel_object_iterator(gang->active_workers());
+ if (poi != NULL) {
+ // The GC supports parallel object iteration.
+
+ ParHeapInspectTask task(poi, cit, filter);
+ // Run task with the active workers.
+
+ gang->run_task(&task);
+
+ delete poi;
+ if (task.success()) {
+ return task.missed_count();
+ }
+ }
+ }
+ }
+
+ ResourceMark rm;
+ // If no parallel iteration available, run serially.
RecordInstanceClosure ric(cit, filter);
Universe::heap()->safe_object_iterate(&ric);
return ric.missed_count();
}
-void HeapInspection::heap_inspection(outputStream* st) {
+void HeapInspection::heap_inspection(outputStream* st, uint parallel_thread_num) {
ResourceMark rm;
if (_print_help) {
@@ -741,9 +835,9 @@ void HeapInspection::heap_inspection(outputStream* st) {
KlassInfoTable cit(_print_class_stats);
if (!cit.allocation_failed()) {
// populate table with object allocation info
- size_t missed_count = populate_table(&cit);
+ uintx missed_count = populate_table(&cit, NULL, parallel_thread_num);
if (missed_count != 0) {
- st->print_cr("WARNING: Ran out of C-heap; undercounted " SIZE_FORMAT
+ st->print_cr("WARNING: Ran out of C-heap; undercounted " UINTX_FORMAT
" total instances in data below",
missed_count);
}
diff --git a/src/hotspot/share/memory/heapInspection.hpp b/src/hotspot/share/memory/heapInspection.hpp
index d8935dc68..026293bf7 100644
--- a/src/hotspot/share/memory/heapInspection.hpp
+++ b/src/hotspot/share/memory/heapInspection.hpp
@@ -25,12 +25,15 @@
#ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP
#define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
+#include "gc/shared/workgroup.hpp"
#include "memory/allocation.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.hpp"
#include "oops/annotations.hpp"
#include "utilities/macros.hpp"
+class ParallelObjectIterator;
+
#if INCLUDE_SERVICES
@@ -261,6 +264,8 @@ class KlassInfoTable: public StackObj {
void iterate(KlassInfoClosure* cic);
bool allocation_failed() { return _buckets == NULL; }
size_t size_of_instances_in_words() const;
+ bool merge(KlassInfoTable* table);
+ bool merge_entry(const KlassInfoEntry* cie);
friend class KlassInfoHisto;
friend class KlassHierarchy;
@@ -364,11 +369,46 @@ class HeapInspection : public StackObj {
bool print_class_stats, const char *columns) :
_csv_format(csv_format), _print_help(print_help),
_print_class_stats(print_class_stats), _columns(columns) {}
- void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
- size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0);
+ void heap_inspection(outputStream* st, uint parallel_thread_num = 1) NOT_SERVICES_RETURN;
+ size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL, uint parallel_thread_num = 1) NOT_SERVICES_RETURN_(0);
static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
private:
void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
};
+// Parallel heap inspection task. Parallel inspection can fail due to
+// a native OOM when allocating memory for TL-KlassInfoTable.
+// _success will be set false on an OOM, and serial inspection tried.
+class ParHeapInspectTask : public AbstractGangTask {
+private:
+ ParallelObjectIterator *_poi;
+ KlassInfoTable *_shared_cit;
+ BoolObjectClosure *_filter;
+ uintx _missed_count;
+ bool _success;
+ Mutex _mutex;
+
+public:
+ ParHeapInspectTask(ParallelObjectIterator *poi,
+ KlassInfoTable *shared_cit,
+ BoolObjectClosure *filter) :
+ AbstractGangTask("Iterating heap"),
+ _poi(poi),
+ _shared_cit(shared_cit),
+ _filter(filter),
+ _missed_count(0),
+ _success(true),
+ _mutex(Mutex::leaf, "Parallel heap iteration data merge lock") {}
+
+ uintx missed_count() const {
+ return _missed_count;
+ }
+
+ bool success() {
+ return _success;
+ }
+
+ virtual void work(uint worker_id);
+};
+
#endif // SHARE_VM_MEMORY_HEAPINSPECTION_HPP
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
index bd439aab0..9827a4c66 100644
--- a/src/hotspot/share/runtime/arguments.hpp
+++ b/src/hotspot/share/runtime/arguments.hpp
@@ -450,12 +450,6 @@ class Arguments : AllStatic {
static ArgsRange check_memory_size(julong size, julong min_size, julong max_size);
static ArgsRange parse_memory_size(const char* s, julong* long_arg,
julong min_size, julong max_size = max_uintx);
- // Parse a string for a unsigned integer. Returns true if value
- // is an unsigned integer greater than or equal to the minimum
- // parameter passed and returns the value in uintx_arg. Returns
- // false otherwise, with uintx_arg undefined.
- static bool parse_uintx(const char* value, uintx* uintx_arg,
- uintx min_size);
// methods to build strings from individual args
static void build_jvm_args(const char* arg);
@@ -493,6 +487,12 @@ class Arguments : AllStatic {
public:
// Parses the arguments, first phase
static jint parse(const JavaVMInitArgs* args);
+ // Parse a string for a unsigned integer. Returns true if value
+ // is an unsigned integer greater than or equal to the minimum
+ // parameter passed and returns the value in uintx_arg. Returns
+ // false otherwise, with uintx_arg undefined.
+ static bool parse_uintx(const char* value, uintx* uintx_arg,
+ uintx min_size);
// Apply ergonomics
static jint apply_ergo();
// Adjusts the arguments after the OS have adjusted the arguments
diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp
index fc77970a0..b0f3b2e87 100644
--- a/src/hotspot/share/services/attachListener.cpp
+++ b/src/hotspot/share/services/attachListener.cpp
@@ -258,9 +258,11 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
//
// Input arguments :-
// arg0: "-live" or "-all"
+// arg1: parallel thread number
static jint heap_inspection(AttachOperation* op, outputStream* out) {
bool live_objects_only = true; // default is true to retain the behavior before this change is made
const char* arg0 = op->arg(0);
+ uint parallel_thread_num = MAX2<uint>(1, (uint)os::initial_active_processor_count() * 3 / 8);
if (arg0 != NULL && (strlen(arg0) > 0)) {
if (strcmp(arg0, "-all") != 0 && strcmp(arg0, "-live") != 0) {
out->print_cr("Invalid argument to inspectheap operation: %s", arg0);
@@ -268,7 +270,18 @@ static jint heap_inspection(AttachOperation* op, outputStream* out) {
}
live_objects_only = strcmp(arg0, "-live") == 0;
}
- VM_GC_HeapInspection heapop(out, live_objects_only /* request full gc */);
+
+ const char* num_str = op->arg(1);
+ if (num_str != NULL && num_str[0] != '\0') {
+ uintx num;
+ if (!Arguments::parse_uintx(num_str, &num, 0)) {
+ out->print_cr("Invalid parallel thread number: [%s]", num_str);
+ return JNI_ERR;
+ }
+ parallel_thread_num = num == 0 ? parallel_thread_num : (uint)num;
+ }
+
+ VM_GC_HeapInspection heapop(out, live_objects_only /* request full gc */, parallel_thread_num);
VMThread::execute(&heapop);
return JNI_OK;
}
diff --git a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
index f2db61ab7..9af74f362 100644
--- a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
+++ b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
@@ -149,18 +149,28 @@ public class JMap {
throws AttachNotSupportedException, IOException,
UnsupportedEncodingException {
String liveopt = "-all";
- if (options.equals("") || options.equals("all")) {
- // pass
- }
- else if (options.equals("live")) {
- liveopt = "-live";
- }
- else {
- usage(1);
+ String parallel = null;
+ String subopts[] = options.split(",");
+
+ for (int i = 0; i < subopts.length; i++) {
+ String subopt = subopts[i];
+ if (subopt.equals("") || subopt.equals("all")) {
+ // pass
+ } else if (subopt.equals("live")) {
+ liveopt = "-live";
+ } else if (subopt.startsWith("parallel=")) {
+ parallel = subopt.substring("parallel=".length());
+ if (parallel == null) {
+ System.err.println("Fail: no number provided in option: '" + subopt + "'");
+ System.exit(1);
+ }
+ } else {
+ usage(1);
+ }
}
// inspectHeap is not the same as jcmd GC.class_histogram
- executeCommandForPid(pid, "inspectheap", liveopt);
+ executeCommandForPid(pid, "inspectheap", liveopt, parallel);
}
private static void dump(String pid, String options)
@@ -246,9 +256,8 @@ public class JMap {
System.err.println(" to connect to running process and print class loader statistics");
System.err.println(" jmap -finalizerinfo <pid>");
System.err.println(" to connect to running process and print information on objects awaiting finalization");
- System.err.println(" jmap -histo[:live] <pid>");
+ System.err.println(" jmap -histo:<histo-options> <pid>");
System.err.println(" to connect to running process and print histogram of java object heap");
- System.err.println(" if the \"live\" suboption is specified, only count live objects");
System.err.println(" jmap -dump:<dump-options> <pid>");
System.err.println(" to connect to running process and dump java heap");
System.err.println(" jmap -? -h --help");
@@ -261,6 +270,16 @@ public class JMap {
System.err.println(" file=<file> dump heap to <file>");
System.err.println("");
System.err.println(" Example: jmap -dump:live,format=b,file=heap.bin <pid>");
+ System.err.println("");
+ System.err.println(" histo-options:");
+ System.err.println(" live count only live objects");
+ System.err.println(" all count all objects in the heap (default if one of \"live\" or \"all\" is not specified)");
+ System.err.println(" parallel=<number> parallel threads number for heap iteration:");
+ System.err.println(" parallel=0 default behavior, use predefined number of threads");
+ System.err.println(" parallel=1 disable parallel heap iteration");
+ System.err.println(" parallel=<N> use N threads for parallel heap iteration");
+ System.err.println("");
+ System.err.println(" Example: jmap -histo:live,parallel=2 <pid>");
System.exit(exit);
}
}
diff --git a/test/jdk/sun/tools/jmap/BasicJMapTest.java b/test/jdk/sun/tools/jmap/BasicJMapTest.java
index c0432dede..960705e24 100644
--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java
+++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java
@@ -45,6 +45,35 @@ import jdk.testlibrary.ProcessTools;
* @build jdk.test.lib.hprof.util.*
* @run main/timeout=240 BasicJMapTest
*/
+
+/*
+ * @test id=Parallel
+ * @summary Unit test for jmap utility (Parallel GC)
+ * @key intermittent
+ * @library /lib/testlibrary
+ * @library /test/lib
+ * @build jdk.testlibrary.*
+ * @build jdk.test.lib.hprof.*
+ * @build jdk.test.lib.hprof.model.*
+ * @build jdk.test.lib.hprof.parser.*
+ * @build jdk.test.lib.hprof.util.*
+ * @run main/othervm/timeout=240 -XX:+UseParallelGC BasicJMapTest
+ */
+
+/*
+ * @test id=G1
+ * @summary Unit test for jmap utility (G1 GC)
+ * @key intermittent
+ * @library /lib/testlibrary
+ * @library /test/lib
+ * @build jdk.testlibrary.*
+ * @build jdk.test.lib.hprof.*
+ * @build jdk.test.lib.hprof.model.*
+ * @build jdk.test.lib.hprof.parser.*
+ * @build jdk.test.lib.hprof.util.*
+ * @run main/othervm/timeout=240 -XX:+UseG1GC BasicJMapTest
+ */
+
public class BasicJMapTest {
private static ProcessBuilder processBuilder = new ProcessBuilder();
@@ -68,6 +97,32 @@ public class BasicJMapTest {
output.shouldHaveExitValue(0);
}
+ private static void testHistoParallelZero() throws Exception {
+ OutputAnalyzer output = jmap("-histo:parallel=0");
+ output.shouldHaveExitValue(0);
+ }
+
+ private static void testHistoParallel() throws Exception {
+ OutputAnalyzer output = jmap("-histo:parallel=2");
+ output.shouldHaveExitValue(0);
+ }
+
+ private static void testHistoNonParallel() throws Exception {
+ OutputAnalyzer output = jmap("-histo:parallel=1");
+ output.shouldHaveExitValue(0);
+ }
+
+ private static void testHistoMultipleParameters() throws Exception {
+ OutputAnalyzer output = jmap("-histo:parallel=2,live");
+ output.shouldHaveExitValue(0);
+ output = jmap("-histo:live,parallel=2");
+ output.shouldHaveExitValue(0);
+ output = jmap("-histo:parallel=2,all");
+ output.shouldHaveExitValue(0);
+ output = jmap("-histo:all,parallel=2");
+ output.shouldHaveExitValue(0);
+ }
+
private static void testFinalizerInfo() throws Exception {
OutputAnalyzer output = jmap("-finalizerinfo");
output.shouldHaveExitValue(0);
--
2.19.0

View File

@ -0,0 +1,263 @@
From 8da2787209da1906e3a92fff95dc46abe793b433 Mon Sep 17 00:00:00 2001
Date: Thu, 18 Mar 2021 12:36:13 +0000
Subject: [PATCH 3/4] 8217918: C2 -XX:+AggressiveUnboxing is broken
---
src/hotspot/share/opto/cfgnode.hpp | 4 +-
src/hotspot/share/opto/phaseX.cpp | 96 ++++++++++++++++++++++++------
src/hotspot/share/opto/phaseX.hpp | 10 ++++
src/hotspot/share/opto/type.cpp | 16 +++++
src/hotspot/share/opto/type.hpp | 4 ++
5 files changed, 111 insertions(+), 19 deletions(-)
diff --git a/src/hotspot/share/opto/cfgnode.hpp b/src/hotspot/share/opto/cfgnode.hpp
index 0d8c9b33b..04029ca91 100644
--- a/src/hotspot/share/opto/cfgnode.hpp
+++ b/src/hotspot/share/opto/cfgnode.hpp
@@ -118,11 +118,13 @@ class JProjNode : public ProjNode {
// can turn PhiNodes into copys in-place by NULL'ing out their RegionNode
// input in slot 0.
class PhiNode : public TypeNode {
+ friend class PhaseRenumberLive;
+
const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes.
// The following fields are only used for data PhiNodes to indicate
// that the PhiNode represents the value of a known instance field.
int _inst_mem_id; // Instance memory id (node index of the memory Phi)
- const int _inst_id; // Instance id of the memory slice.
+ int _inst_id; // Instance id of the memory slice.
const int _inst_index; // Alias index of the instance memory slice.
// Array elements references have the same alias_idx but different offset.
const int _inst_offset; // Offset of the instance memory slice.
diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp
index 9d5d4deed..f4a38cd28 100644
--- a/src/hotspot/share/opto/phaseX.cpp
+++ b/src/hotspot/share/opto/phaseX.cpp
@@ -463,55 +463,115 @@ PhaseRemoveUseless::PhaseRemoveUseless(PhaseGVN *gvn, Unique_Node_List *worklist
PhaseRenumberLive::PhaseRenumberLive(PhaseGVN* gvn,
Unique_Node_List* worklist, Unique_Node_List* new_worklist,
PhaseNumber phase_num) :
- PhaseRemoveUseless(gvn, worklist, Remove_Useless_And_Renumber_Live) {
-
+ PhaseRemoveUseless(gvn, worklist, Remove_Useless_And_Renumber_Live),
+ _new_type_array(C->comp_arena()),
+ _old2new_map(C->unique(), C->unique(), -1),
+ _delayed(Thread::current()->resource_area()),
+ _is_pass_finished(false),
+ _live_node_count(C->live_nodes())
+{
assert(RenumberLiveNodes, "RenumberLiveNodes must be set to true for node renumbering to take place");
assert(C->live_nodes() == _useful.size(), "the number of live nodes must match the number of useful nodes");
assert(gvn->nodes_size() == 0, "GVN must not contain any nodes at this point");
+ assert(_delayed.size() == 0, "should be empty");
- uint old_unique_count = C->unique();
- uint live_node_count = C->live_nodes();
uint worklist_size = worklist->size();
- // Storage for the updated type information.
- Type_Array new_type_array(C->comp_arena());
-
// Iterate over the set of live nodes.
- uint current_idx = 0; // The current new node ID. Incremented after every assignment.
- for (uint i = 0; i < _useful.size(); i++) {
- Node* n = _useful.at(i);
- // Sanity check that fails if we ever decide to execute this phase after EA
- assert(!n->is_Phi() || n->as_Phi()->inst_mem_id() == -1, "should not be linked to data Phi");
- const Type* type = gvn->type_or_null(n);
- new_type_array.map(current_idx, type);
+ for (uint current_idx = 0; current_idx < _useful.size(); current_idx++) {
+ Node* n = _useful.at(current_idx);
bool in_worklist = false;
if (worklist->member(n)) {
in_worklist = true;
}
+ const Type* type = gvn->type_or_null(n);
+ _new_type_array.map(current_idx, type);
+
+ assert(_old2new_map.at(n->_idx) == -1, "already seen");
+ _old2new_map.at_put(n->_idx, current_idx);
+
n->set_idx(current_idx); // Update node ID.
if (in_worklist) {
new_worklist->push(n);
}
- current_idx++;
+ if (update_embedded_ids(n) < 0) {
+ _delayed.push(n); // has embedded IDs; handle later
+ }
}
assert(worklist_size == new_worklist->size(), "the new worklist must have the same size as the original worklist");
- assert(live_node_count == current_idx, "all live nodes must be processed");
+ assert(_live_node_count == _useful.size(), "all live nodes must be processed");
+
+ _is_pass_finished = true; // pass finished; safe to process delayed updates
+
+ while (_delayed.size() > 0) {
+ Node* n = _delayed.pop();
+ int no_of_updates = update_embedded_ids(n);
+ assert(no_of_updates > 0, "should be updated");
+ }
// Replace the compiler's type information with the updated type information.
- gvn->replace_types(new_type_array);
+ gvn->replace_types(_new_type_array);
// Update the unique node count of the compilation to the number of currently live nodes.
- C->set_unique(live_node_count);
+ C->set_unique(_live_node_count);
// Set the dead node count to 0 and reset dead node list.
C->reset_dead_node_list();
}
+int PhaseRenumberLive::new_index(int old_idx) {
+ assert(_is_pass_finished, "not finished");
+ if (_old2new_map.at(old_idx) == -1) { // absent
+ // Allocate a placeholder to preserve uniqueness
+ _old2new_map.at_put(old_idx, _live_node_count);
+ _live_node_count++;
+ }
+ return _old2new_map.at(old_idx);
+}
+
+int PhaseRenumberLive::update_embedded_ids(Node* n) {
+ int no_of_updates = 0;
+ if (n->is_Phi()) {
+ PhiNode* phi = n->as_Phi();
+ if (phi->_inst_id != -1) {
+ if (!_is_pass_finished) {
+ return -1; // delay
+ }
+ int new_idx = new_index(phi->_inst_id);
+ assert(new_idx != -1, "");
+ phi->_inst_id = new_idx;
+ no_of_updates++;
+ }
+ if (phi->_inst_mem_id != -1) {
+ if (!_is_pass_finished) {
+ return -1; // delay
+ }
+ int new_idx = new_index(phi->_inst_mem_id);
+ assert(new_idx != -1, "");
+ phi->_inst_mem_id = new_idx;
+ no_of_updates++;
+ }
+ }
+
+ const Type* type = _new_type_array.fast_lookup(n->_idx);
+ if (type != NULL && type->isa_oopptr() && type->is_oopptr()->is_known_instance()) {
+ if (!_is_pass_finished) {
+ return -1; // delay
+ }
+ int old_idx = type->is_oopptr()->instance_id();
+ int new_idx = new_index(old_idx);
+ const Type* new_type = type->is_oopptr()->with_instance_id(new_idx);
+ _new_type_array.map(n->_idx, new_type);
+ no_of_updates++;
+ }
+
+ return no_of_updates;
+}
//=============================================================================
//------------------------------PhaseTransform---------------------------------
diff --git a/src/hotspot/share/opto/phaseX.hpp b/src/hotspot/share/opto/phaseX.hpp
index 3b33a8cb2..ef5eb488e 100644
--- a/src/hotspot/share/opto/phaseX.hpp
+++ b/src/hotspot/share/opto/phaseX.hpp
@@ -157,6 +157,16 @@ public:
// Phase that first performs a PhaseRemoveUseless, then it renumbers compiler
// structures accordingly.
class PhaseRenumberLive : public PhaseRemoveUseless {
+protected:
+ Type_Array _new_type_array; // Storage for the updated type information.
+ GrowableArray<int> _old2new_map;
+ Node_List _delayed;
+ bool _is_pass_finished;
+ uint _live_node_count;
+
+ int update_embedded_ids(Node* n);
+ int new_index(int old_idx);
+
public:
PhaseRenumberLive(PhaseGVN* gvn,
Unique_Node_List* worklist, Unique_Node_List* new_worklist,
diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp
index 0078b8773..964f9d247 100644
--- a/src/hotspot/share/opto/type.cpp
+++ b/src/hotspot/share/opto/type.cpp
@@ -3456,6 +3456,12 @@ const TypePtr* TypeOopPtr::with_inline_depth(int depth) const {
return make(_ptr, _offset, _instance_id, _speculative, depth);
}
+//------------------------------with_instance_id--------------------------------
+const TypePtr* TypeOopPtr::with_instance_id(int instance_id) const {
+ assert(_instance_id != -1, "should be known");
+ return make(_ptr, _offset, instance_id, _speculative, _inline_depth);
+}
+
//------------------------------meet_instance_id--------------------------------
int TypeOopPtr::meet_instance_id( int instance_id ) const {
// Either is 'TOP' instance? Return the other instance!
@@ -4059,6 +4065,11 @@ const TypePtr *TypeInstPtr::with_inline_depth(int depth) const {
return make(_ptr, klass(), klass_is_exact(), const_oop(), _offset, _instance_id, _speculative, depth);
}
+const TypePtr *TypeInstPtr::with_instance_id(int instance_id) const {
+ assert(is_known_instance(), "should be known");
+ return make(_ptr, klass(), klass_is_exact(), const_oop(), _offset, instance_id, _speculative, _inline_depth);
+}
+
//=============================================================================
// Convenience common pre-built types.
const TypeAryPtr *TypeAryPtr::RANGE;
@@ -4529,6 +4540,11 @@ const TypePtr *TypeAryPtr::with_inline_depth(int depth) const {
return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, _instance_id, _speculative, depth);
}
+const TypePtr *TypeAryPtr::with_instance_id(int instance_id) const {
+ assert(is_known_instance(), "should be known");
+ return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
+}
+
//=============================================================================
//------------------------------hash-------------------------------------------
diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp
index ca92fe3ab..e9ed7ce40 100644
--- a/src/hotspot/share/opto/type.hpp
+++ b/src/hotspot/share/opto/type.hpp
@@ -1048,6 +1048,8 @@ public:
virtual bool would_improve_type(ciKlass* exact_kls, int inline_depth) const;
virtual const TypePtr* with_inline_depth(int depth) const;
+ virtual const TypePtr* with_instance_id(int instance_id) const;
+
virtual const Type *xdual() const; // Compute dual right now.
// the core of the computation of the meet for TypeOopPtr and for its subclasses
virtual const Type *xmeet_helper(const Type *t) const;
@@ -1124,6 +1126,7 @@ class TypeInstPtr : public TypeOopPtr {
// Speculative type helper methods.
virtual const Type* remove_speculative() const;
virtual const TypePtr* with_inline_depth(int depth) const;
+ virtual const TypePtr* with_instance_id(int instance_id) const;
// the core of the computation of the meet of 2 types
virtual const Type *xmeet_helper(const Type *t) const;
@@ -1211,6 +1214,7 @@ public:
// Speculative type helper methods.
virtual const Type* remove_speculative() const;
virtual const TypePtr* with_inline_depth(int depth) const;
+ virtual const TypePtr* with_instance_id(int instance_id) const;
// the core of the computation of the meet of 2 types
virtual const Type *xmeet_helper(const Type *t) const;
--
2.19.0

View File

@ -0,0 +1,218 @@
From 0f9ef0bc57aa0e7d8457b645374be74d510ea7ae Mon Sep 17 00:00:00 2001
Date: Thu, 18 Mar 2021 12:35:14 +0000
Subject: [PATCH 2/4] 8254078: DataOutputStream is very slow post disabling
---
.../classes/java/io/DataInputStream.java | 7 +-
.../classes/java/io/DataOutputStream.java | 24 ++--
.../bench/java/io/DataOutputStreamTest.java | 124 ++++++++++++++++++
3 files changed, 144 insertions(+), 11 deletions(-)
create mode 100644 test/micro/org/openjdk/bench/java/io/DataOutputStreamTest.java
diff --git a/src/java.base/share/classes/java/io/DataInputStream.java b/src/java.base/share/classes/java/io/DataInputStream.java
index f92c4f91b..114857691 100644
--- a/src/java.base/share/classes/java/io/DataInputStream.java
+++ b/src/java.base/share/classes/java/io/DataInputStream.java
@@ -31,9 +31,10 @@ package java.io;
* way. An application uses a data output stream to write data that
* can later be read by a data input stream.
* <p>
- * DataInputStream is not necessarily safe for multithreaded access.
- * Thread safety is optional and is the responsibility of users of
- * methods in this class.
+ * A DataInputStream is not safe for use by multiple concurrent
+ * threads. If a DataInputStream is to be used by more than one
+ * thread then access to the data input stream should be controlled
+ * by appropriate synchronization.
*
* @author Arthur van Hoff
* @see java.io.DataOutputStream
diff --git a/src/java.base/share/classes/java/io/DataOutputStream.java b/src/java.base/share/classes/java/io/DataOutputStream.java
index 392abba92..7c0962442 100644
--- a/src/java.base/share/classes/java/io/DataOutputStream.java
+++ b/src/java.base/share/classes/java/io/DataOutputStream.java
@@ -29,6 +29,11 @@ package java.io;
* A data output stream lets an application write primitive Java data
* types to an output stream in a portable way. An application can
* then use a data input stream to read the data back in.
+ * <p>
+ * A DataOutputStream is not safe for use by multiple concurrent
+ * threads. If a DataOutputStream is to be used by more than one
+ * thread then access to the data output stream should be controlled
+ * by appropriate synchronization.
*
* @author unascribed
* @see java.io.DataInputStream
@@ -164,8 +169,9 @@ class DataOutputStream extends FilterOutputStream implements DataOutput {
* @see java.io.FilterOutputStream#out
*/
public final void writeShort(int v) throws IOException {
- out.write((v >>> 8) & 0xFF);
- out.write((v >>> 0) & 0xFF);
+ writeBuffer[0] = (byte)(v >>> 8);
+ writeBuffer[1] = (byte)(v >>> 0);
+ out.write(writeBuffer, 0, 2);
incCount(2);
}
@@ -179,8 +185,9 @@ class DataOutputStream extends FilterOutputStream implements DataOutput {
* @see java.io.FilterOutputStream#out
*/
public final void writeChar(int v) throws IOException {
- out.write((v >>> 8) & 0xFF);
- out.write((v >>> 0) & 0xFF);
+ writeBuffer[0] = (byte)(v >>> 8);
+ writeBuffer[1] = (byte)(v >>> 0);
+ out.write(writeBuffer, 0, 2);
incCount(2);
}
@@ -194,10 +201,11 @@ class DataOutputStream extends FilterOutputStream implements DataOutput {
* @see java.io.FilterOutputStream#out
*/
public final void writeInt(int v) throws IOException {
- out.write((v >>> 24) & 0xFF);
- out.write((v >>> 16) & 0xFF);
- out.write((v >>> 8) & 0xFF);
- out.write((v >>> 0) & 0xFF);
+ writeBuffer[0] = (byte)(v >>> 24);
+ writeBuffer[1] = (byte)(v >>> 16);
+ writeBuffer[2] = (byte)(v >>> 8);
+ writeBuffer[3] = (byte)(v >>> 0);
+ out.write(writeBuffer, 0, 4);
incCount(4);
}
diff --git a/test/micro/org/openjdk/bench/java/io/DataOutputStreamTest.java b/test/micro/org/openjdk/bench/java/io/DataOutputStreamTest.java
new file mode 100644
index 000000000..2f573e6dd
--- /dev/null
+++ b/test/micro/org/openjdk/bench/java/io/DataOutputStreamTest.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2020, Red Hat Inc. 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.
+ */
+
+package org.openjdk.bench.java.io;
+
+import org.openjdk.jmh.annotations.*;
+
+import java.io.*;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@OutputTimeUnit(TimeUnit.MICROSECONDS)
+@Fork(value = 1, warmups = 0)
+@Measurement(iterations = 6, time = 1)
+@Warmup(iterations=2, time = 2)
+@State(Scope.Benchmark)
+public class DataOutputStreamTest {
+
+ public enum BasicType {CHAR, SHORT, INT, STRING}
+ @Param({"CHAR", "SHORT", "INT", /* "STRING"*/}) BasicType basicType;
+
+ @Param({"4096"}) int size;
+
+ final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(size);
+ File f;
+ String outputString;
+ FileOutputStream fileOutputStream;
+ DataOutput bufferedFileStream, rawFileStream, byteArrayStream;
+
+ @Setup(Level.Trial)
+ public void setup() throws Exception {
+ f = File.createTempFile("DataOutputStreamTest","out");
+ fileOutputStream = new FileOutputStream(f);
+ byteArrayStream = new DataOutputStream(byteArrayOutputStream);
+ rawFileStream = new DataOutputStream(fileOutputStream);
+ bufferedFileStream = new DataOutputStream(new BufferedOutputStream(fileOutputStream));
+ outputString = new String(new byte[size]);
+ }
+
+ public void writeChars(DataOutput dataOutput)
+ throws Exception {
+ for (int i = 0; i < size; i += 2) {
+ dataOutput.writeChar(i);
+ }
+ }
+
+ public void writeShorts(DataOutput dataOutput)
+ throws Exception {
+ for (int i = 0; i < size; i += 2) {
+ dataOutput.writeShort(i);
+ }
+ }
+
+ public void writeInts(DataOutput dataOutput)
+ throws Exception {
+ for (int i = 0; i < size; i += 4) {
+ dataOutput.writeInt(i);
+ }
+ }
+
+ public void writeString(DataOutput dataOutput)
+ throws Exception {
+ dataOutput.writeChars(outputString);
+ }
+
+ public void write(DataOutput dataOutput)
+ throws Exception {
+ switch (basicType) {
+ case CHAR:
+ writeChars(dataOutput);
+ break;
+ case SHORT:
+ writeShorts(dataOutput);
+ break;
+ case INT:
+ writeInts(dataOutput);
+ break;
+ case STRING:
+ writeString(dataOutput);
+ break;
+ }
+ }
+
+ @Benchmark
+ public void dataOutputStreamOverByteArray() throws Exception {
+ byteArrayOutputStream.reset();
+ write(byteArrayStream);
+ byteArrayOutputStream.flush();
+ }
+
+ @Benchmark
+ public void dataOutputStreamOverRawFileStream() throws Exception {
+ fileOutputStream.getChannel().position(0);
+ write(rawFileStream);
+ fileOutputStream.flush();
+ }
+
+ @Benchmark
+ public void dataOutputStreamOverBufferedFileStream() throws Exception{
+ fileOutputStream.getChannel().position(0);
+ write(bufferedFileStream);
+ fileOutputStream.flush();
+ }
+}
--
2.19.0

View File

@ -0,0 +1,23 @@
From ae703c0e86c278359f1bddcf35ccba87b556d901 Mon Sep 17 00:00:00 2001
Date: Thu, 18 Mar 2021 12:37:11 +0000
Subject: [PATCH 4/4] Fix the memcpy symbol issue during JDK11 x64 build
---
make/lib/Awt2dLibraries.gmk | 1 +
1 file changed, 1 insertion(+)
diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk
index 207a459ae..7b0441507 100644
--- a/make/lib/Awt2dLibraries.gmk
+++ b/make/lib/Awt2dLibraries.gmk
@@ -597,6 +597,7 @@ else
$(eval $(call SetupJdkLibrary, BUILD_LIBHARFBUZZ, \
NAME := harfbuzz, \
EXCLUDE_FILES := $(LIBHARFBUZZ_EXCLUDE_FILES), \
+ EXTRA_FILES := $(LIBMEMCPY_FILES), \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBHARFBUZZ_CFLAGS), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBHARFBUZZ_CFLAGS), \
--
2.19.0

752
add-G1-Full-GC-optimization.patch Executable file
View File

@ -0,0 +1,752 @@
From 54bd3b89d00c7eba9119e3dfa3d49b7c9ec79d30 Mon Sep 17 00:00:00 2001
Date: Tue, 16 Mar 2021 07:09:02 +0000
Subject: [PATCH 3/4] add G1 Full GC optimization
---
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 15 +++-
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 2 +-
src/hotspot/share/gc/g1/g1FullCollector.cpp | 5 ++
src/hotspot/share/gc/g1/g1FullCollector.hpp | 3 +
.../share/gc/g1/g1FullGCCompactTask.cpp | 14 +++
.../share/gc/g1/g1FullGCCompactTask.hpp | 1 +
src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp | 2 +
.../share/gc/g1/g1FullGCMarker.inline.hpp | 5 ++
.../share/gc/g1/g1FullGCPrepareTask.cpp | 52 ++++++++---
.../share/gc/g1/g1FullGCPrepareTask.hpp | 7 +-
src/hotspot/share/gc/g1/g1MarkLiveWords.cpp | 37 ++++++++
src/hotspot/share/gc/g1/g1MarkLiveWords.hpp | 34 +++++++
src/hotspot/share/gc/g1/g1MarkRegionCache.cpp | 49 +++++++++++
src/hotspot/share/gc/g1/g1MarkRegionCache.hpp | 40 +++++++++
src/hotspot/share/gc/g1/g1_globals.hpp | 10 ++-
src/hotspot/share/gc/g1/heapRegion.cpp | 3 +-
src/hotspot/share/gc/g1/heapRegion.hpp | 9 +-
src/hotspot/share/gc/g1/heapRegionManager.hpp | 1 +
src/hotspot/share/gc/g1/heapRegionSet.cpp | 15 ----
src/hotspot/share/gc/g1/heapRegionSet.hpp | 2 -
test/hotspot/jtreg/gc/g1/TestG1NoMoving.java | 88 +++++++++++++++++++
21 files changed, 359 insertions(+), 35 deletions(-)
create mode 100644 src/hotspot/share/gc/g1/g1MarkLiveWords.cpp
create mode 100644 src/hotspot/share/gc/g1/g1MarkLiveWords.hpp
create mode 100644 src/hotspot/share/gc/g1/g1MarkRegionCache.cpp
create mode 100644 src/hotspot/share/gc/g1/g1MarkRegionCache.hpp
create mode 100644 test/hotspot/jtreg/gc/g1/TestG1NoMoving.java
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index 130f8ec0a..7e9c6254c 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -2571,6 +2571,17 @@ void G1CollectedHeap::gc_epilogue(bool full) {
_numa->print_statistics();
}
+void G1CollectedHeap::verify_numa_regions(const char* desc) {
+ LogTarget(Trace, gc, heap, verify) lt;
+
+ if (lt.is_enabled()) {
+ LogStream ls(lt);
+ // Iterate all heap regions to print matching between preferred numa id and actual numa id.
+ G1NodeIndexCheckClosure cl(desc, _numa, &ls);
+ heap_region_iterate(&cl);
+ }
+}
+
HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
uint gc_count_before,
bool* succeeded,
@@ -2975,7 +2986,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
_verifier->verify_before_gc(verify_type);
_verifier->check_bitmaps("GC Start");
-
+ verify_numa_regions("GC Start");
#if COMPILER2_OR_JVMCI
DerivedPointerTable::clear();
#endif
@@ -3129,7 +3140,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
_verifier->verify_after_gc(verify_type);
_verifier->check_bitmaps("GC End");
-
+ verify_numa_regions("GC End");
assert(!_ref_processor_stw->discovery_enabled(), "Postcondition");
_ref_processor_stw->verify_no_references_recorded();
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
index aafaf6a08..bb46cae83 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
@@ -722,7 +722,7 @@ private:
void print_taskqueue_stats() const;
void reset_taskqueue_stats();
#endif // TASKQUEUE_STATS
-
+ void verify_numa_regions(const char* desc);
// Schedule the VM operation that will do an evacuation pause to
// satisfy an allocation request of word_size. *succeeded will
// return whether the VM operation was successful (it did do an
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.cpp b/src/hotspot/share/gc/g1/g1FullCollector.cpp
index 4362ee87e..661a3dd9f 100644
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp
@@ -37,6 +37,7 @@
#include "gc/g1/g1OopClosures.hpp"
#include "gc/g1/g1Policy.hpp"
#include "gc/g1/g1StringDedup.hpp"
+#include "gc/g1/g1MarkRegionCache.hpp"
#include "gc/shared/adaptiveSizePolicy.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/preservedMarks.hpp"
@@ -120,9 +121,11 @@ G1FullCollector::G1FullCollector(G1CollectedHeap* heap, GCMemoryManager* memory_
_preserved_marks_set.init(_num_workers);
_markers = NEW_C_HEAP_ARRAY(G1FullGCMarker*, _num_workers, mtGC);
_compaction_points = NEW_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _num_workers, mtGC);
+ _no_moving_region_compaction_points = NEW_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _num_workers, mtGC);
for (uint i = 0; i < _num_workers; i++) {
_markers[i] = new G1FullGCMarker(i, _preserved_marks_set.get(i), mark_bitmap());
_compaction_points[i] = new G1FullGCCompactionPoint();
+ _no_moving_region_compaction_points[i] = new G1FullGCCompactionPoint();
_oop_queue_set.register_queue(i, marker(i)->oop_stack());
_array_queue_set.register_queue(i, marker(i)->objarray_stack());
}
@@ -132,9 +135,11 @@ G1FullCollector::~G1FullCollector() {
for (uint i = 0; i < _num_workers; i++) {
delete _markers[i];
delete _compaction_points[i];
+ delete _no_moving_region_compaction_points[i];
}
FREE_C_HEAP_ARRAY(G1FullGCMarker*, _markers);
FREE_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _compaction_points);
+ FREE_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _no_moving_region_compaction_points);
}
void G1FullCollector::prepare_collection() {
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.hpp b/src/hotspot/share/gc/g1/g1FullCollector.hpp
index 0b97abeea..f81fe1059 100644
--- a/src/hotspot/share/gc/g1/g1FullCollector.hpp
+++ b/src/hotspot/share/gc/g1/g1FullCollector.hpp
@@ -66,6 +66,8 @@ class G1FullCollector : StackObj {
G1IsAliveClosure _is_alive;
ReferenceProcessorIsAliveMutator _is_alive_mutator;
+ G1FullGCCompactionPoint** _no_moving_region_compaction_points;
+
static uint calc_active_workers();
G1FullGCSubjectToDiscoveryClosure _always_subject_to_discovery;
@@ -83,6 +85,7 @@ public:
uint workers() { return _num_workers; }
G1FullGCMarker* marker(uint id) { return _markers[id]; }
G1FullGCCompactionPoint* compaction_point(uint id) { return _compaction_points[id]; }
+ G1FullGCCompactionPoint* no_moving_region_compaction_point(uint id) { return _no_moving_region_compaction_points[id]; }
OopQueueSet* oop_queue_set() { return &_oop_queue_set; }
ObjArrayTaskQueueSet* array_queue_set() { return &_array_queue_set; }
PreservedMarksSet* preserved_mark_set() { return &_preserved_marks_set; }
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
index 0c2fc088f..eab1b2121 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
@@ -87,6 +87,11 @@ void G1FullGCCompactTask::compact_region(HeapRegion* hr) {
hr->complete_compaction();
}
+void G1FullGCCompactTask::process_no_moving_region(HeapRegion* hr) {
+ collector()->mark_bitmap()->clear_region(hr);
+ hr->reset_no_compaction_region_during_compaction();
+}
+
void G1FullGCCompactTask::work(uint worker_id) {
Ticks start = Ticks::now();
GrowableArray<HeapRegion*>* compaction_queue = collector()->compaction_point(worker_id)->regions();
@@ -96,6 +101,15 @@ void G1FullGCCompactTask::work(uint worker_id) {
compact_region(*it);
}
+ if (G1FullGCNoMoving) {
+ GrowableArray<HeapRegion*>* no_move_region_queue = collector()->no_moving_region_compaction_point(worker_id)->regions();
+ for (GrowableArrayIterator<HeapRegion*> it = no_move_region_queue->begin();
+ it != no_move_region_queue->end();
+ ++it) {
+ process_no_moving_region(*it);
+ }
+ }
+
G1ResetHumongousClosure hc(collector()->mark_bitmap());
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&hc, &_claimer, worker_id);
log_task("Compaction task", worker_id, start);
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.hpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.hpp
index 6c8eaf596..25221599a 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.hpp
@@ -41,6 +41,7 @@ protected:
private:
void compact_region(HeapRegion* hr);
+ void process_no_moving_region(HeapRegion* hr);
public:
G1FullGCCompactTask(G1FullCollector* collector) :
diff --git a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp
index d2c4b8d60..d982ef94a 100644
--- a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp
@@ -29,6 +29,7 @@
#include "gc/g1/g1FullGCMarkTask.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/g1FullGCReferenceProcessorExecutor.hpp"
+#include "gc/g1/g1MarkLiveWords.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "memory/iterator.inline.hpp"
@@ -42,6 +43,7 @@ G1FullGCMarkTask::G1FullGCMarkTask(G1FullCollector* collector) :
}
void G1FullGCMarkTask::work(uint worker_id) {
+ G1MarkLiveWords g1_mark_live_words;
Ticks start = Ticks::now();
ResourceMark rm;
G1FullGCMarker* marker = collector()->marker(worker_id);
diff --git a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
index 98a2fe7f1..78555b30f 100644
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
@@ -31,6 +31,7 @@
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/g1StringDedupQueue.hpp"
+#include "gc/g1/g1MarkLiveWords.hpp"
#include "gc/shared/preservedMarks.inline.hpp"
#include "oops/access.inline.hpp"
#include "oops/compressedOops.inline.hpp"
@@ -68,6 +69,10 @@ template <class T> inline void G1FullGCMarker::mark_and_push(T* p) {
if (!CompressedOops::is_null(heap_oop)) {
oop obj = CompressedOops::decode_not_null(heap_oop);
if (mark_object(obj)) {
+ uint hr_index = G1CollectedHeap::heap()->addr_to_region((HeapWord*)obj);
+ if (_tl_live_words_cache != NULL) {
+ _tl_live_words_cache->inc_live(hr_index, (size_t)obj->size());
+ }
_oop_stack.push(obj);
assert(_bitmap->is_marked(obj), "Must be marked now - map self");
} else {
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
index 3f0e18fc8..2cc9c87d0 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
@@ -78,7 +78,8 @@ bool G1FullGCPrepareTask::has_freed_regions() {
void G1FullGCPrepareTask::work(uint worker_id) {
Ticks start = Ticks::now();
G1FullGCCompactionPoint* compaction_point = collector()->compaction_point(worker_id);
- G1CalculatePointersClosure closure(collector()->mark_bitmap(), compaction_point);
+ G1FullGCCompactionPoint* no_moving_regions_compaction_point = collector()->no_moving_region_compaction_point(worker_id);
+ G1CalculatePointersClosure closure(collector()->mark_bitmap(), compaction_point, no_moving_regions_compaction_point);
G1CollectedHeap::heap()->heap_region_par_iterate_from_start(&closure, &_hrclaimer);
// Update humongous region sets
@@ -93,11 +94,14 @@ void G1FullGCPrepareTask::work(uint worker_id) {
}
G1FullGCPrepareTask::G1CalculatePointersClosure::G1CalculatePointersClosure(G1CMBitMap* bitmap,
- G1FullGCCompactionPoint* cp) :
+ G1FullGCCompactionPoint* cp,
+ G1FullGCCompactionPoint* no_moving_regions_cp) :
_g1h(G1CollectedHeap::heap()),
_bitmap(bitmap),
_cp(cp),
- _humongous_regions_removed(0) { }
+ _no_moving_regions_cp(no_moving_regions_cp),
+ _humongous_regions_removed(0),
+ _hr_live_bytes_threshold((size_t)HeapRegion::GrainBytes * G1NoMovingRegionLiveBytesLowerThreshold / 100) { }
void G1FullGCPrepareTask::G1CalculatePointersClosure::free_humongous_region(HeapRegion* hr) {
FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
@@ -113,7 +117,7 @@ void G1FullGCPrepareTask::G1CalculatePointersClosure::free_humongous_region(Heap
void G1FullGCPrepareTask::G1CalculatePointersClosure::reset_region_metadata(HeapRegion* hr) {
hr->rem_set()->clear();
hr->clear_cardtable();
-
+ hr->set_live_words_after_mark((size_t)0);
if (_g1h->g1_hot_card_cache()->use_cache()) {
_g1h->g1_hot_card_cache()->reset_card_counts(hr);
}
@@ -151,13 +155,41 @@ void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction_wor
}
void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction(HeapRegion* hr) {
- if (!_cp->is_initialized()) {
- hr->set_compaction_top(hr->bottom());
- _cp->initialize(hr, true);
+ size_t live_bytes_after_mark = hr->live_bytes_after_mark();
+ if(!G1FullGCNoMoving || live_bytes_after_mark < _hr_live_bytes_threshold || hr->is_humongous()) {
+ if (!_cp->is_initialized()) {
+ hr->set_compaction_top(hr->bottom());
+ _cp->initialize(hr, true);
+ }
+ // Add region to the compaction queue and prepare it.
+ _cp->add(hr);
+ prepare_for_compaction_work(_cp, hr);
+ } else {
+ prepare_no_moving_region(hr);
+ _no_moving_regions_cp->add(hr);
+ log_debug(gc, phases)("no moving region index: %u, live bytes: "SIZE_FORMAT, hr->hrm_index(), live_bytes_after_mark);
+ }
+}
+
+void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_no_moving_region(const HeapRegion* hr) {
+ const HeapRegion* current = hr;
+ assert(!current->is_humongous(), "Should be no humongous regions");
+ HeapWord* limit = current->top();
+ HeapWord* next_addr = current->bottom();
+ while (next_addr < limit) {
+ Prefetch::write(next_addr, PrefetchScanIntervalInBytes);
+ oop obj = oop(next_addr);
+ size_t obj_size = obj->size();
+ if (_bitmap->is_marked(next_addr)) {
+ if (obj->forwardee() != NULL) {
+ obj->init_mark_raw();
+ }
+ } else {
+ // Fill dummy object to replace dead object
+ Universe::heap()->fill_with_dummy_object(next_addr, next_addr + obj_size, true);
+ }
+ next_addr += obj_size;
}
- // Add region to the compaction queue and prepare it.
- _cp->add(hr);
- prepare_for_compaction_work(_cp, hr);
}
void G1FullGCPrepareTask::prepare_serial_compaction() {
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp
index fcaf797a1..57b53c9dd 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp
@@ -39,7 +39,6 @@ class G1FullGCPrepareTask : public G1FullGCTask {
protected:
volatile bool _freed_regions;
HeapRegionClaimer _hrclaimer;
-
void set_freed_regions();
public:
@@ -54,16 +53,20 @@ protected:
G1CollectedHeap* _g1h;
G1CMBitMap* _bitmap;
G1FullGCCompactionPoint* _cp;
+ G1FullGCCompactionPoint* _no_moving_regions_cp;
uint _humongous_regions_removed;
+ size_t _hr_live_bytes_threshold;
virtual void prepare_for_compaction(HeapRegion* hr);
void prepare_for_compaction_work(G1FullGCCompactionPoint* cp, HeapRegion* hr);
void free_humongous_region(HeapRegion* hr);
void reset_region_metadata(HeapRegion* hr);
+ void prepare_no_moving_region(const HeapRegion* hr);
public:
G1CalculatePointersClosure(G1CMBitMap* bitmap,
- G1FullGCCompactionPoint* cp);
+ G1FullGCCompactionPoint* cp,
+ G1FullGCCompactionPoint* no_moving_regions_cp);
void update_sets();
bool do_heap_region(HeapRegion* hr);
diff --git a/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp b/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp
new file mode 100644
index 000000000..32da3800a
--- /dev/null
+++ b/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2021, Huawei Technologies Co. Ltd. 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. Alibaba designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+#include "gc/g1/g1MarkLiveWords.hpp"
+
+__thread G1MarkRegionCache* _tl_live_words_cache;
+
+G1MarkLiveWords::G1MarkLiveWords() {
+ if (G1FullGCNoMoving) {
+ _tl_live_words_cache = new G1MarkRegionCache();
+ }
+}
+
+G1MarkLiveWords::~G1MarkLiveWords() {
+ if (G1FullGCNoMoving) {
+ delete _tl_live_words_cache;
+ _tl_live_words_cache = NULL;
+ }
+}
diff --git a/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp b/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp
new file mode 100644
index 000000000..a11a4ca52
--- /dev/null
+++ b/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2021, Huawei Technologies Co. Ltd. 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. Alibaba designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+#ifndef SHARE_VM_GC_G1_G1MARKLIVEWORDS_HPP
+#define SHARE_VM_GC_G1_G1MARKLIVEWORDS_HPP
+
+#include "gc/g1/g1MarkRegionCache.hpp"
+
+extern __thread G1MarkRegionCache* _tl_live_words_cache;
+class G1MarkLiveWords {
+public:
+ G1MarkLiveWords();
+ ~G1MarkLiveWords();
+};
+
+#endif
diff --git a/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp b/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp
new file mode 100644
index 000000000..37922e8cf
--- /dev/null
+++ b/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021, Huawei Technologies Co. Ltd. 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. Alibaba designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+#include "gc/g1/g1MarkRegionCache.hpp"
+#include "gc/g1/heapRegion.inline.hpp"
+#include "runtime/atomic.hpp"
+
+G1MarkRegionCache::G1MarkRegionCache() {
+ _cache = NEW_C_HEAP_ARRAY(size_t, G1CollectedHeap::heap()->max_regions(), mtGC);
+ memset(_cache, 0 , sizeof(size_t)*G1CollectedHeap::heap()->max_regions());
+}
+void G1MarkRegionCache::inc_live(uint hr_index, size_t words) {
+ _cache[hr_index] += words;
+}
+
+void* G1MarkRegionCache::operator new(size_t size) {
+ return (address)AllocateHeap(size, mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL);
+}
+
+void G1MarkRegionCache::operator delete(void* p) {
+ FreeHeap(p);
+}
+
+G1MarkRegionCache::~G1MarkRegionCache() {
+ for (uint i = 0; i < G1CollectedHeap::heap()->max_regions(); ++i) {
+ if (_cache[i]) {
+ Atomic::add(_cache[i], G1CollectedHeap::heap()->region_at(i)->live_words_addr());
+ }
+ }
+ FREE_C_HEAP_ARRAY(size_t, _cache);
+}
diff --git a/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp b/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp
new file mode 100644
index 000000000..0615fcab6
--- /dev/null
+++ b/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2021, Huawei Technologies Co. Ltd. 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. Alibaba designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+#ifndef SHARE_VM_GC_G1_G1MARKREGIONCACHE_HPP
+#define SHARE_VM_GC_G1_G1MARKREGIONCACHE_HPP
+
+#include "memory/allocation.hpp"
+
+class G1MarkRegionCache {
+private:
+ size_t* _cache;
+public:
+ G1MarkRegionCache();
+ void inc_live(uint hr_index, size_t words);
+
+ void* operator new(size_t size);
+ void operator delete(void* p);
+
+ ~G1MarkRegionCache();
+};
+
+#endif
diff --git a/src/hotspot/share/gc/g1/g1_globals.hpp b/src/hotspot/share/gc/g1/g1_globals.hpp
index 8c7aec847..e035e0713 100644
--- a/src/hotspot/share/gc/g1/g1_globals.hpp
+++ b/src/hotspot/share/gc/g1/g1_globals.hpp
@@ -302,6 +302,14 @@
"Verify the code root lists attached to each heap region.") \
\
develop(bool, G1VerifyBitmaps, false, \
- "Verifies the consistency of the marking bitmaps")
+ "Verifies the consistency of the marking bitmaps") \
+ \
+ product(double, G1NoMovingRegionLiveBytesLowerThreshold, 98.0, \
+ "The Lower Threshold of Heap Region Live bytes percent" \
+ "in G1 Mark Sweep phase") \
+ range(50.0, 100.0) \
+ \
+ product(bool, G1FullGCNoMoving, false, \
+ "full gc support no moving region mode ")
#endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP
diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp
index 85840bc6f..c81695eae 100644
--- a/src/hotspot/share/gc/g1/heapRegion.cpp
+++ b/src/hotspot/share/gc/g1/heapRegion.cpp
@@ -243,7 +243,8 @@ HeapRegion::HeapRegion(uint hrm_index,
_surv_rate_group(NULL), _age_index(-1),
_prev_top_at_mark_start(NULL), _next_top_at_mark_start(NULL),
_recorded_rs_length(0), _predicted_elapsed_time_ms(0),
- _node_index(G1NUMA::UnknownNodeIndex)
+ _node_index(G1NUMA::UnknownNodeIndex),
+ _live_words(0)
{
_rem_set = new HeapRegionRemSet(bot, this);
diff --git a/src/hotspot/share/gc/g1/heapRegion.hpp b/src/hotspot/share/gc/g1/heapRegion.hpp
index 12a4eb8c3..023febbfc 100644
--- a/src/hotspot/share/gc/g1/heapRegion.hpp
+++ b/src/hotspot/share/gc/g1/heapRegion.hpp
@@ -246,7 +246,7 @@ class HeapRegion: public G1ContiguousSpace {
// in each heap region.
size_t _prev_marked_bytes; // Bytes known to be live via last completed marking.
size_t _next_marked_bytes; // Bytes known to be live via in-progress marking.
-
+ size_t _live_words;
// The calculated GC efficiency of the region.
double _gc_efficiency;
@@ -320,6 +320,10 @@ class HeapRegion: public G1ContiguousSpace {
~((1 << (size_t) LogOfHRGrainBytes) - 1);
}
+ void reset_no_compaction_region_during_compaction() {
+ zero_marked_bytes();
+ init_top_at_mark_start();
+ }
// Returns whether a field is in the same region as the obj it points to.
template <typename T>
@@ -369,6 +373,9 @@ class HeapRegion: public G1ContiguousSpace {
// The number of bytes marked live in the region in the last marking phase.
size_t marked_bytes() { return _prev_marked_bytes; }
+ size_t* live_words_addr() { return &_live_words; }
+ size_t live_bytes_after_mark() { return _live_words * HeapWordSize; }
+ void set_live_words_after_mark(size_t live_words) { _live_words = live_words; }
size_t live_bytes() {
return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();
}
diff --git a/src/hotspot/share/gc/g1/heapRegionManager.hpp b/src/hotspot/share/gc/g1/heapRegionManager.hpp
index 3edc1a9fb..85e6e024e 100644
--- a/src/hotspot/share/gc/g1/heapRegionManager.hpp
+++ b/src/hotspot/share/gc/g1/heapRegionManager.hpp
@@ -29,6 +29,7 @@
#include "gc/g1/g1NUMA.hpp"
#include "gc/g1/g1RegionToSpaceMapper.hpp"
#include "gc/g1/heapRegionSet.hpp"
+#include "gc/g1/g1RegionsOnNodes.hpp"
#include "services/memoryUsage.hpp"
class HeapRegion;
diff --git a/src/hotspot/share/gc/g1/heapRegionSet.cpp b/src/hotspot/share/gc/g1/heapRegionSet.cpp
index eb8430ff6..322f0e32a 100644
--- a/src/hotspot/share/gc/g1/heapRegionSet.cpp
+++ b/src/hotspot/share/gc/g1/heapRegionSet.cpp
@@ -244,21 +244,6 @@ void FreeRegionList::remove_starting_at(HeapRegion* first, uint num_regions) {
verify_optional();
}
-uint FreeRegionList::num_of_regions_in_range(uint start, uint end) const {
- HeapRegion* cur = _head;
- uint num = 0;
- while (cur != NULL) {
- uint index = cur->hrm_index();
- if (index > end) {
- break;
- } else if (index >= start) {
- num++;
- }
- cur = cur->next();
- }
- return num;
-}
-
void FreeRegionList::verify() {
// See comment in HeapRegionSetBase::verify() about MT safety and
// verification.
diff --git a/src/hotspot/share/gc/g1/heapRegionSet.hpp b/src/hotspot/share/gc/g1/heapRegionSet.hpp
index 71b89668a..2ad10acf7 100644
--- a/src/hotspot/share/gc/g1/heapRegionSet.hpp
+++ b/src/hotspot/share/gc/g1/heapRegionSet.hpp
@@ -230,8 +230,6 @@ public:
virtual void verify();
- uint num_of_regions_in_range(uint start, uint end) const;
-
using HeapRegionSetBase::length;
uint length(uint node_index) const;
};
diff --git a/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java b/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java
new file mode 100644
index 000000000..2f892773b
--- /dev/null
+++ b/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2021, Huawei Technologies Co. Ltd. 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. Alibaba designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+/*
+ * @test TestG1NoMoving
+ * @summary Test that a full gc with -XX:+G1FullGCNoMoving
+ * @key gc
+ * @requires vm.gc.G1
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ * java.management
+ * @run main/othervm TestG1NoMoving
+ */
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jdk.test.lib.Platform;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+public class TestG1NoMoving {
+ public static void runTest() throws Exception {
+ final String[] arguments = {
+ "-XX:+UseG1GC",
+ "-XX:+G1FullGCNoMoving",
+ "-Xmx8m",
+ "-Xms8M",
+ "-Xlog:gc+phases=debug",
+ "-XX:G1HeapRegionSize=1m",
+ GCTest.class.getName()
+ };
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments);
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ System.out.println(output.getStdout());
+
+ String pattern = ".*no moving region.*";
+ Pattern r = Pattern.compile(pattern);
+ Matcher m = r.matcher(output.getStdout());
+
+ if (!m.find()) {
+ throw new RuntimeException("Could not find any no moving region output");
+ }
+
+ }
+
+ public static void main(String[] args) throws Exception {
+ runTest();
+ }
+
+ static class GCTest {
+ public static List<char[]> memory;
+ public static void main(String[] args) throws Exception {
+ memory = new ArrayList<>();
+ try {
+ while (true) {
+ memory.add(new char[1024]);
+ System.gc();
+ }
+ } catch (OutOfMemoryError e) {
+ memory = null;
+ System.gc();
+ }
+ }
+ }
+}
+
--
2.19.0

1078
add-LazyBox-feature.patch Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
From f9a030a58fcae2352e1b4a629901b6047c2f6610 Mon Sep 17 00:00:00 2001
Date: Thu, 18 Mar 2021 12:34:06 +0000
Subject: [PATCH 1/4] downgrade the symver of log2f posix spawn
---
src/hotspot/share/opto/parse2.cpp | 8 ++++++++
src/java.base/unix/native/libjava/ProcessImpl_md.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/src/hotspot/share/opto/parse2.cpp b/src/hotspot/share/opto/parse2.cpp
index 4cbc57eb8..2b21881bc 100644
--- a/src/hotspot/share/opto/parse2.cpp
+++ b/src/hotspot/share/opto/parse2.cpp
@@ -45,6 +45,14 @@
#include "runtime/deoptimization.hpp"
#include "runtime/sharedRuntime.hpp"
+#ifdef AARCH64
+ __asm__(".symver log2f,log2f@GLIBC_2.17");
+#endif
+
+#ifdef AMD64
+ __asm__(".symver log2f,log2f@GLIBC_2.2.5");
+#endif
+
#ifndef PRODUCT
extern int explicit_null_checks_inserted,
explicit_null_checks_elided;
diff --git a/src/java.base/unix/native/libjava/ProcessImpl_md.c b/src/java.base/unix/native/libjava/ProcessImpl_md.c
index d0c2543ce..09d71b874 100644
--- a/src/java.base/unix/native/libjava/ProcessImpl_md.c
+++ b/src/java.base/unix/native/libjava/ProcessImpl_md.c
@@ -48,6 +48,10 @@
#include "childproc.h"
+#if defined(amd64)
+ __asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2.5");
+#endif
+
/*
* There are 4 possible strategies we might use to "fork":
*
--
2.19.0

View File

@ -740,7 +740,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
Name: java-%{javaver}-%{origin}
Version: %{newjavaver}.%{buildver}
Release: 2
Release: 6
# 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
# also included the epoch in their virtual provides. This created a
@ -847,6 +847,13 @@ Patch59: add-SVE-backend-feature.patch
#11.0.10
Patch60: 8240353.patch
Patch61: downgrade-the-symver-of-log2f-posix-spawn.patch
Patch62: 8254078-DataOutputStream-is-very-slow-post-disabling.patch
Patch63: 8217918-C2-XX-AggressiveUnboxing-is-broken.patch
Patch64: Fix-the-memcpy-symbol-issue-during-JDK11-x64-build.patch
Patch65: add-LazyBox-feature.patch
Patch66: add-G1-Full-GC-optimization.patch
Patch67: 8214535-support-Jmap-parallel.patch
BuildRequires: autoconf
BuildRequires: alsa-lib-devel
@ -1117,6 +1124,13 @@ pushd %{top_level_dir_name}
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
popd # openjdk
%patch1000
@ -1620,6 +1634,21 @@ require "copy_jdk_configs.lua"
%changelog
* Fri Mar 19 2021 aijm <aijiaming1@huawei.com> - 1:11.0.10.9-6
- add 8214535-support-Jmap-parallel.patch
* Fri Mar 19 2021 aijm <aijiaming1@huawei.com> - 1:11.0.10.9-5
- add add-G1-Full-GC-optimization.patch
* Fri Mar 19 2021 kuenking111 <wangkun49@huawei.com> - 1:11.0.10.9-4
- add add-LazyBox-feature.patch
* Fri Mar 19 2021 aijm <aijiaming1@huawei.com> - 1:11.0.10.9-3
- add downgrade-the-symver-of-log2f-posix-spawn.patch
- add 8254078-DataOutputStream-is-very-slow-post-disabling.patch
- add 8217918-C2-XX-AggressiveUnboxing-is-broken.patch
- add Fix-the-memcpy-symbol-issue-during-JDK11-x64-build.patch
* Sun Feb 7 2021 jdkboy <ge.guo@huawei.com> - 1:11.0.10.9-2
- remove redundant file info