diff --git a/8210473-JEP-345-NUMA-Aware-Memory-Allocation-for-G1.patch b/8210473-JEP-345-NUMA-Aware-Memory-Allocation-for-G1.patch index 7e508579d6c9e69ebfe0e9c54aea1cf5ab808d0f..8fae6dd6f3299ba7d1b5ac480beb3ee15b165c52 100644 --- a/8210473-JEP-345-NUMA-Aware-Memory-Allocation-for-G1.patch +++ b/8210473-JEP-345-NUMA-Aware-Memory-Allocation-for-G1.patch @@ -1,8 +1,70 @@ +From 84c7ddb13a933e193312e39707db9a84137e2372 Mon Sep 17 00:00:00 2001 +From: miaomiao +Date: Wed, 21 Sep 2022 11:01:25 +0800 +Subject: [PATCH] test1 + +--- + src/hotspot/os/bsd/os_bsd.cpp | 4 + + src/hotspot/os/linux/os_linux.cpp | 120 +++++-- + src/hotspot/os/linux/os_linux.hpp | 40 +++ + src/hotspot/os/solaris/os_solaris.cpp | 4 + + src/hotspot/os/windows/os_windows.cpp | 4 + + src/hotspot/share/gc/g1/g1AllocRegion.cpp | 18 +- + src/hotspot/share/gc/g1/g1AllocRegion.hpp | 19 +- + src/hotspot/share/gc/g1/g1Allocator.cpp | 185 ++++++++--- + src/hotspot/share/gc/g1/g1Allocator.hpp | 69 ++-- + .../share/gc/g1/g1Allocator.inline.hpp | 77 +++-- + src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 173 ++++++++-- + src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 37 +-- + src/hotspot/share/gc/g1/g1EdenRegions.hpp | 13 +- + src/hotspot/share/gc/g1/g1HeapTransition.cpp | 70 +++- + src/hotspot/share/gc/g1/g1HeapTransition.hpp | 6 + + src/hotspot/share/gc/g1/g1HeapVerifier.cpp | 2 +- + src/hotspot/share/gc/g1/g1InCSetState.hpp | 18 +- + src/hotspot/share/gc/g1/g1NUMA.cpp | 305 ++++++++++++++++++ + src/hotspot/share/gc/g1/g1NUMA.hpp | 152 +++++++++ + src/hotspot/share/gc/g1/g1NUMAStats.cpp | 232 +++++++++++++ + src/hotspot/share/gc/g1/g1NUMAStats.hpp | 119 +++++++ + .../share/gc/g1/g1PageBasedVirtualSpace.cpp | 5 + + .../share/gc/g1/g1PageBasedVirtualSpace.hpp | 6 +- + .../share/gc/g1/g1ParScanThreadState.cpp | 54 ++-- + .../share/gc/g1/g1ParScanThreadState.hpp | 33 +- + .../gc/g1/g1ParScanThreadState.inline.hpp | 25 ++ + .../share/gc/g1/g1RegionToSpaceMapper.cpp | 42 ++- + .../share/gc/g1/g1RegionToSpaceMapper.hpp | 2 + + src/hotspot/share/gc/g1/g1RegionsOnNodes.cpp | 59 ++++ + src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp | 51 +++ + src/hotspot/share/gc/g1/g1SurvivorRegions.cpp | 14 +- + src/hotspot/share/gc/g1/g1SurvivorRegions.hpp | 6 +- + src/hotspot/share/gc/g1/heapRegion.cpp | 17 +- + src/hotspot/share/gc/g1/heapRegion.hpp | 4 + + src/hotspot/share/gc/g1/heapRegionManager.cpp | 99 +++++- + src/hotspot/share/gc/g1/heapRegionManager.hpp | 28 +- + src/hotspot/share/gc/g1/heapRegionSet.cpp | 139 ++++---- + src/hotspot/share/gc/g1/heapRegionSet.hpp | 83 +++-- + .../share/gc/g1/heapRegionSet.inline.hpp | 104 +++++- + src/hotspot/share/gc/g1/heapRegionType.cpp | 5 + + src/hotspot/share/gc/g1/heapRegionType.hpp | 8 + + src/hotspot/share/logging/logPrefix.hpp | 1 + + src/hotspot/share/logging/logTag.hpp | 1 + + src/hotspot/share/prims/whitebox.cpp | 25 ++ + src/hotspot/share/runtime/os.hpp | 1 + + .../gc/g1/numa/TestG1NUMATouchRegions.java | 245 ++++++++++++++ + test/lib/sun/hotspot/WhiteBox.java | 3 + + 47 files changed, 2358 insertions(+), 369 deletions(-) + create mode 100644 src/hotspot/share/gc/g1/g1NUMA.cpp + create mode 100644 src/hotspot/share/gc/g1/g1NUMA.hpp + create mode 100644 src/hotspot/share/gc/g1/g1NUMAStats.cpp + create mode 100644 src/hotspot/share/gc/g1/g1NUMAStats.hpp + create mode 100644 src/hotspot/share/gc/g1/g1RegionsOnNodes.cpp + create mode 100644 src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp + create mode 100644 test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java + diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp -index e31b52935..b2cf2cde8 100644 +index f5e4c367c..6f5818969 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp -@@ -2079,6 +2079,10 @@ size_t os::numa_get_leaf_groups(int *ids, size_t size) { +@@ -2103,6 +2103,10 @@ size_t os::numa_get_leaf_groups(int *ids, size_t size) { return 0; } @@ -14,10 +76,10 @@ index e31b52935..b2cf2cde8 100644 return false; } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp -index 9c848c6b3..013c009c0 100644 +index f073aa63a..1323cc0ac 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -3025,6 +3025,19 @@ int os::numa_get_group_id() { +@@ -3232,6 +3232,19 @@ int os::numa_get_group_id() { return 0; } @@ -37,7 +99,7 @@ index 9c848c6b3..013c009c0 100644 int os::Linux::get_existing_num_nodes() { int node; int highest_node_number = Linux::numa_max_node(); -@@ -3151,11 +3164,17 @@ bool os::Linux::libnuma_init() { +@@ -3378,11 +3391,17 @@ bool os::Linux::libnuma_init() { libnuma_dlsym(handle, "numa_distance"))); set_numa_get_membind(CAST_TO_FN_PTR(numa_get_membind_func_t, libnuma_v2_dlsym(handle, "numa_get_membind"))); @@ -55,7 +117,7 @@ index 9c848c6b3..013c009c0 100644 // Create an index -> node mapping, since nodes are not always consecutive _nindex_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(0, true); rebuild_nindex_to_node_map(); -@@ -3282,9 +3301,14 @@ os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; +@@ -3530,9 +3549,14 @@ os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset; os::Linux::numa_distance_func_t os::Linux::_numa_distance; os::Linux::numa_get_membind_func_t os::Linux::_numa_get_membind; @@ -70,7 +132,7 @@ index 9c848c6b3..013c009c0 100644 bool os::pd_uncommit_memory(char* addr, size_t size) { uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE, -@@ -5202,6 +5226,75 @@ void os::pd_init_container_support() { +@@ -5477,6 +5501,75 @@ void os::pd_init_container_support() { OSContainer::init(); } @@ -146,7 +208,7 @@ index 9c848c6b3..013c009c0 100644 // this is called _after_ the global arguments have been parsed jint os::init_2(void) { -@@ -5245,32 +5338,7 @@ jint os::init_2(void) { +@@ -5520,32 +5613,7 @@ jint os::init_2(void) { Linux::libc_version(), Linux::libpthread_version()); if (UseNUMA) { @@ -181,10 +243,10 @@ index 9c848c6b3..013c009c0 100644 if (MaxFDLimit) { diff --git a/src/hotspot/os/linux/os_linux.hpp b/src/hotspot/os/linux/os_linux.hpp -index 721a3b649..3c42c23e1 100644 +index 62150144f..79eeb5489 100644 --- a/src/hotspot/os/linux/os_linux.hpp +++ b/src/hotspot/os/linux/os_linux.hpp -@@ -229,6 +229,7 @@ class Linux { +@@ -231,6 +231,7 @@ class Linux { // none present private: @@ -192,7 +254,7 @@ index 721a3b649..3c42c23e1 100644 static void expand_stack_to(address bottom); typedef int (*sched_getcpu_func_t)(void); -@@ -240,6 +241,8 @@ class Linux { +@@ -243,6 +244,8 @@ class Linux { typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); typedef void (*numa_interleave_memory_v2_func_t)(void *start, size_t size, struct bitmask* mask); typedef struct bitmask* (*numa_get_membind_func_t)(void); @@ -201,7 +263,7 @@ index 721a3b649..3c42c23e1 100644 typedef void (*numa_set_bind_policy_func_t)(int policy); typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); -@@ -257,9 +260,13 @@ class Linux { +@@ -261,9 +264,13 @@ class Linux { static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset; static numa_distance_func_t _numa_distance; static numa_get_membind_func_t _numa_get_membind; @@ -215,7 +277,7 @@ index 721a3b649..3c42c23e1 100644 static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; } static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; } -@@ -273,10 +280,22 @@ class Linux { +@@ -278,11 +285,23 @@ class Linux { static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; } static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; } static void set_numa_get_membind(numa_get_membind_func_t func) { _numa_get_membind = func; } @@ -227,7 +289,7 @@ index 721a3b649..3c42c23e1 100644 + static void set_numa_interleave_bitmask(struct bitmask* ptr) { _numa_interleave_bitmask = ptr ; } + static void set_numa_membind_bitmask(struct bitmask* ptr) { _numa_membind_bitmask = ptr ; } static int sched_getcpu_syscall(void); -+ + + enum NumaAllocationPolicy{ + NotInitialized, + Membind, @@ -235,10 +297,11 @@ index 721a3b649..3c42c23e1 100644 + }; + static NumaAllocationPolicy _current_numa_policy; + - ++ #ifdef __GLIBC__ struct glibc_mallinfo { -@@ -290,6 +309,24 @@ class Linux { + int arena; +@@ -328,6 +347,24 @@ class Linux { static int numa_tonode_memory(void *start, size_t size, int node) { return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1; } @@ -263,7 +326,7 @@ index 721a3b649..3c42c23e1 100644 static void numa_interleave_memory(void *start, size_t size) { // Use v2 api if available if (_numa_interleave_memory_v2 != NULL && _numa_all_nodes_ptr != NULL) { -@@ -306,6 +343,9 @@ class Linux { +@@ -344,6 +381,9 @@ class Linux { static int numa_distance(int node1, int node2) { return _numa_distance != NULL ? _numa_distance(node1, node2) : -1; } @@ -274,7 +337,7 @@ index 721a3b649..3c42c23e1 100644 static int get_existing_num_nodes(); // Check if numa node is configured (non-zero memory node). diff --git a/src/hotspot/os/solaris/os_solaris.cpp b/src/hotspot/os/solaris/os_solaris.cpp -index 2266eedaa..c907ec9e4 100644 +index ae5a7cd58..983c5c623 100644 --- a/src/hotspot/os/solaris/os_solaris.cpp +++ b/src/hotspot/os/solaris/os_solaris.cpp @@ -2441,6 +2441,10 @@ int os::numa_get_group_id() { @@ -289,10 +352,10 @@ index 2266eedaa..c907ec9e4 100644 bool os::get_page_info(char *start, page_info* info) { const uint_t info_types[] = { MEMINFO_VLGRP, MEMINFO_VPAGESIZE }; diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp -index eaa021b7a..9101d73aa 100644 +index ee826bbde..6ebe8410d 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp -@@ -3440,6 +3440,10 @@ size_t os::numa_get_leaf_groups(int *ids, size_t size) { +@@ -3525,6 +3525,10 @@ size_t os::numa_get_leaf_groups(int *ids, size_t size) { } } @@ -1028,10 +1091,10 @@ index 3eda8eb20..66baebc68 100644 // Create the maps which is used to identify archive objects. diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp -index dea8d9fdb..3bb5b56e8 100644 +index 3b0e6eb65..0c2009b7c 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp -@@ -97,6 +97,7 @@ +@@ -98,6 +98,7 @@ size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; @@ -1114,7 +1177,7 @@ index dea8d9fdb..3bb5b56e8 100644 if (result != NULL) { return result; } -@@ -958,7 +976,8 @@ HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size, +@@ -962,7 +980,8 @@ HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size, "the current alloc region was unexpectedly found to be non-NULL"); if (!is_humongous(word_size)) { @@ -1124,7 +1187,7 @@ index dea8d9fdb..3bb5b56e8 100644 } else { HeapWord* result = humongous_obj_allocate(word_size); if (result != NULL && g1_policy()->need_to_start_conc_mark("STW humongous allocation")) { -@@ -1013,10 +1032,9 @@ void G1CollectedHeap::abort_concurrent_cycle() { +@@ -1017,10 +1036,9 @@ void G1CollectedHeap::abort_concurrent_cycle() { void G1CollectedHeap::prepare_heap_for_full_collection() { // Make sure we'll choose a new allocation region afterwards. @@ -1136,7 +1199,7 @@ index dea8d9fdb..3bb5b56e8 100644 // We may have added regions to the current incremental collection // set between the last GC or pause and now. We need to clear the // incremental collection set and then start rebuilding it afresh -@@ -1051,7 +1069,7 @@ void G1CollectedHeap::prepare_heap_for_mutators() { +@@ -1058,7 +1076,7 @@ void G1CollectedHeap::prepare_heap_for_mutators() { // Start a new incremental collection set for the next pause start_new_collection_set(); @@ -1145,7 +1208,7 @@ index dea8d9fdb..3bb5b56e8 100644 // Post collection state updates. MetaspaceGC::compute_new_size(); -@@ -1367,6 +1385,19 @@ bool G1CollectedHeap::expand(size_t expand_bytes, WorkGang* pretouch_workers, do +@@ -1374,6 +1392,19 @@ bool G1CollectedHeap::expand(size_t expand_bytes, WorkGang* pretouch_workers, do return regions_to_expand > 0; } @@ -1165,7 +1228,7 @@ index dea8d9fdb..3bb5b56e8 100644 void G1CollectedHeap::shrink_helper(size_t shrink_bytes) { size_t aligned_shrink_bytes = ReservedSpace::page_align_size_down(shrink_bytes); -@@ -1406,7 +1437,67 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) { +@@ -1413,7 +1444,67 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) { _verifier->verify_region_sets_optional(); } @@ -1234,7 +1297,7 @@ index dea8d9fdb..3bb5b56e8 100644 G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) : CollectedHeap(), -@@ -1431,13 +1522,14 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) : +@@ -1438,13 +1529,14 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) : _is_alive_closure_cm(this), _is_subject_to_discovery_cm(this), _bot(NULL), @@ -1251,7 +1314,7 @@ index dea8d9fdb..3bb5b56e8 100644 _humongous_reclaim_candidates(), _has_humongous_reclaim_candidates(false), _archive_allocator(NULL), -@@ -1650,6 +1742,7 @@ jint G1CollectedHeap::initialize() { +@@ -1657,6 +1749,7 @@ jint G1CollectedHeap::initialize() { _in_cset_fast_test.initialize(start, end, granularity); _humongous_reclaim_candidates.initialize(start, end, granularity); } @@ -1259,7 +1322,7 @@ index dea8d9fdb..3bb5b56e8 100644 // Create the G1ConcurrentMark data structure and thread. // (Must do this late, so that "max_regions" is defined.) -@@ -1712,7 +1805,7 @@ jint G1CollectedHeap::initialize() { +@@ -1719,7 +1812,7 @@ jint G1CollectedHeap::initialize() { dummy_region->set_top(dummy_region->end()); G1AllocRegion::setup(this, dummy_region); @@ -1268,7 +1331,7 @@ index dea8d9fdb..3bb5b56e8 100644 // Do create of the monitoring and management support so that // values in the heap have been properly initialized. -@@ -2275,6 +2368,15 @@ void G1CollectedHeap::print_on(outputStream* st) const { +@@ -2310,6 +2403,15 @@ void G1CollectedHeap::print_on(outputStream* st) const { st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions, (size_t) survivor_regions * HeapRegion::GrainBytes / K); st->cr(); @@ -1284,7 +1347,7 @@ index dea8d9fdb..3bb5b56e8 100644 MetaspaceUtils::print_on(st); } -@@ -2462,6 +2564,9 @@ void G1CollectedHeap::gc_epilogue(bool full) { +@@ -2497,6 +2599,9 @@ void G1CollectedHeap::gc_epilogue(bool full) { // We have just completed a GC. Update the soft reference // policy with the new heap occupancy Universe::update_heap_info_at_gc(); @@ -1294,7 +1357,7 @@ index dea8d9fdb..3bb5b56e8 100644 } HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size, -@@ -2889,7 +2994,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { +@@ -2924,7 +3029,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // Forget the current alloc region (we might even choose it to be part // of the collection set!). @@ -1303,7 +1366,7 @@ index dea8d9fdb..3bb5b56e8 100644 // This timing is only used by the ergonomics to handle our pause target. // It is unclear why this should not include the full pause. We will -@@ -2983,7 +3088,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { +@@ -3018,7 +3123,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { allocate_dummy_regions(); @@ -1312,7 +1375,7 @@ index dea8d9fdb..3bb5b56e8 100644 { size_t expand_bytes = _heap_sizing_policy->expansion_amount(); -@@ -3196,9 +3301,8 @@ public: +@@ -3231,9 +3336,8 @@ public: if (log_is_enabled(Debug, gc, task, stats)) { MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); @@ -1324,7 +1387,7 @@ index dea8d9fdb..3bb5b56e8 100644 _g1h->print_termination_stats(worker_id, (os::elapsedTime() - start_sec) * 1000.0, /* elapsed time */ strong_roots_sec * 1000.0, /* strong roots time */ -@@ -4719,7 +4823,7 @@ public: +@@ -4755,7 +4859,7 @@ public: HeapRegionSet* old_set, HeapRegionManager* hrm) : _free_list_only(free_list_only), _old_set(old_set), _hrm(hrm), _total_used(0) { @@ -1333,7 +1396,7 @@ index dea8d9fdb..3bb5b56e8 100644 if (!free_list_only) { assert(_old_set->is_empty(), "pre-condition"); } -@@ -4784,13 +4888,15 @@ bool G1CollectedHeap::is_in_closed_subset(const void* p) const { +@@ -4820,13 +4924,15 @@ bool G1CollectedHeap::is_in_closed_subset(const void* p) const { // Methods for the mutator alloc region HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size, @@ -1352,7 +1415,7 @@ index dea8d9fdb..3bb5b56e8 100644 if (new_alloc_region != NULL) { set_region_short_lived_locked(new_alloc_region); _hr_printer.alloc(new_alloc_region, !should_allocate); -@@ -4826,20 +4932,27 @@ bool G1CollectedHeap::has_more_regions(InCSetState dest) { +@@ -4862,20 +4968,27 @@ bool G1CollectedHeap::has_more_regions(InCSetState dest) { } } @@ -1386,7 +1449,7 @@ index dea8d9fdb..3bb5b56e8 100644 _survivor.add(new_alloc_region); _verifier->check_bitmaps("Survivor Region Allocation", new_alloc_region); diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp -index 8a171dc6b..aafaf6a08 100644 +index 1f2029ab1..725eb32ca 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -40,6 +40,7 @@ @@ -1453,7 +1516,7 @@ index 8a171dc6b..aafaf6a08 100644 // Returns the PLAB statistics for a given destination. inline G1EvacStats* alloc_buffer_stats(InCSetState dest); -@@ -1235,20 +1244,12 @@ public: +@@ -1242,20 +1251,12 @@ public: const G1SurvivorRegions* survivor() const { return &_survivor; } @@ -1520,14 +1583,13 @@ index 6d16f8c59..8f4989265 100644 #endif // SHARE_VM_GC_G1_G1EDENREGIONS_HPP diff --git a/src/hotspot/share/gc/g1/g1HeapTransition.cpp b/src/hotspot/share/gc/g1/g1HeapTransition.cpp -index 907289f28..3ef4ff7fb 100644 +index 1a78f588d..8d5c26c95 100644 --- a/src/hotspot/share/gc/g1/g1HeapTransition.cpp +++ b/src/hotspot/share/gc/g1/g1HeapTransition.cpp -@@ -26,15 +26,38 @@ - #include "gc/g1/g1CollectedHeap.hpp" +@@ -27,13 +27,37 @@ #include "gc/g1/g1HeapTransition.hpp" #include "gc/g1/g1Policy.hpp" --#include "logging/log.hpp" + #include "logging/log.hpp" +#include "logging/logStream.hpp" #include "memory/metaspace.hpp" @@ -1536,12 +1598,10 @@ index 907289f28..3ef4ff7fb 100644 - _survivor_length = g1_heap->survivor_regions_count(); - _old_length = g1_heap->old_regions_count(); - _humongous_length = g1_heap->humongous_regions_count(); -- _metaspace_used_bytes = MetaspaceUtils::used_bytes(); +G1HeapTransition::Data::Data(G1CollectedHeap* g1_heap) : + _eden_length(g1_heap->eden_regions_count()), + _survivor_length(g1_heap->survivor_regions_count()), + _old_length(g1_heap->old_regions_count()), -+ _metaspace_used_bytes(MetaspaceUtils::used_bytes()), + _humongous_length(g1_heap->humongous_regions_count()), + _eden_length_per_node(NULL), + _survivor_length_per_node(NULL) { @@ -1562,14 +1622,14 @@ index 907289f28..3ef4ff7fb 100644 + } + } +} -+ ++ +G1HeapTransition::Data::~Data() { + FREE_C_HEAP_ARRAY(uint, _eden_length_per_node); + FREE_C_HEAP_ARRAY(uint, _survivor_length_per_node); } G1HeapTransition::G1HeapTransition(G1CollectedHeap* g1_heap) : _g1_heap(g1_heap), _before(g1_heap) { } -@@ -78,6 +101,34 @@ public: +@@ -77,6 +101,34 @@ public: } }; @@ -1604,7 +1664,7 @@ index 907289f28..3ef4ff7fb 100644 void G1HeapTransition::print() { Data after(_g1_heap); -@@ -98,12 +149,12 @@ void G1HeapTransition::print() { +@@ -97,12 +149,12 @@ void G1HeapTransition::print() { after._humongous_length, usage._humongous_region_count); } @@ -1622,12 +1682,12 @@ index 907289f28..3ef4ff7fb 100644 usage._survivor_used / K, ((after._survivor_length * HeapRegion::GrainBytes) - usage._survivor_used) / K); diff --git a/src/hotspot/share/gc/g1/g1HeapTransition.hpp b/src/hotspot/share/gc/g1/g1HeapTransition.hpp -index 97db50769..572dbd869 100644 +index e2c804762..037afa8e4 100644 --- a/src/hotspot/share/gc/g1/g1HeapTransition.hpp +++ b/src/hotspot/share/gc/g1/g1HeapTransition.hpp -@@ -37,7 +37,13 @@ class G1HeapTransition { +@@ -38,7 +38,13 @@ class G1HeapTransition { size_t _humongous_length; - size_t _metaspace_used_bytes; + const metaspace::MetaspaceSizesSnapshot _meta_sizes; + // Only includes current eden regions. + uint* _eden_length_per_node; @@ -2521,7 +2581,7 @@ index 000000000..fba9442c8 + +#endif // SHARE_VM_GC_G1_NODE_TIMES_HPP diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp -index 108180654..69c76967a 100644 +index ea1efdb5f..e20244847 100644 --- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp +++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp @@ -118,6 +118,11 @@ char* G1PageBasedVirtualSpace::page_start(size_t index) const { @@ -3989,10 +4049,10 @@ index 61bd16907..0ec37b2f6 100644 LOG_TAG(obsolete) \ LOG_TAG(oldobject) \ diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp -index 637740b21..c3326bf7a 100644 +index 2dc691957..75ee720f9 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp -@@ -528,6 +528,29 @@ WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env)) +@@ -529,6 +529,29 @@ WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env)) THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1AuxiliaryMemoryUsage: G1 GC is not enabled"); WB_END @@ -4022,7 +4082,7 @@ index 637740b21..c3326bf7a 100644 class OldRegionsLivenessClosure: public HeapRegionClosure { private: -@@ -2070,6 +2093,8 @@ static JNINativeMethod methods[] = { +@@ -2119,6 +2142,8 @@ static JNINativeMethod methods[] = { {CC"g1StartConcMarkCycle", CC"()Z", (void*)&WB_G1StartMarkCycle }, {CC"g1AuxiliaryMemoryUsage", CC"()Ljava/lang/management/MemoryUsage;", (void*)&WB_G1AuxiliaryMemoryUsage }, @@ -4032,10 +4092,10 @@ index 637740b21..c3326bf7a 100644 #endif // INCLUDE_G1GC #if INCLUDE_PARALLELGC diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp -index 15c43dae3..68d77566e 100644 +index d52a3e111..9f63d9fe8 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp -@@ -389,6 +389,7 @@ class os: AllStatic { +@@ -404,6 +404,7 @@ class os: AllStatic { static size_t numa_get_leaf_groups(int *ids, size_t size); static bool numa_topology_changed(); static int numa_get_group_id(); @@ -4295,7 +4355,7 @@ index 000000000..c5322849e + } +} diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java -index 34770d0ba..54f9688f8 100644 +index 475693035..47ff3c522 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -188,6 +188,9 @@ public class WhiteBox { @@ -4308,3 +4368,6 @@ index 34770d0ba..54f9688f8 100644 // Parallel GC public native long psVirtualSpaceAlignment(); +-- +2.30.1 (Apple Git-130) + diff --git a/8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch b/8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch new file mode 100644 index 0000000000000000000000000000000000000000..cfecb4278ce47e3f6525e1f81c41eb9539e68e00 --- /dev/null +++ b/8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch @@ -0,0 +1,145 @@ +diff --git a/src/hotspot/share/opto/stringopts.cpp b/src/hotspot/share/opto/stringopts.cpp +index e8e493bce..91a3c998e 100644 +--- a/src/hotspot/share/opto/stringopts.cpp ++++ b/src/hotspot/share/opto/stringopts.cpp +@@ -1028,6 +1028,21 @@ bool StringConcat::validate_control_flow() { + fail = true; + break; + } else if (ptr->is_Proj() && ptr->in(0)->is_Initialize()) { ++ // Check for side effect between Initialize and the constructor ++ for (SimpleDUIterator iter(ptr); iter.has_next(); iter.next()) { ++ Node* use = iter.get(); ++ if (!use->is_CFG() && !use->is_CheckCastPP() && !use->is_Load()) { ++#ifndef PRODUCT ++ if (PrintOptimizeStringConcat) { ++ tty->print_cr("unexpected control use of Initialize"); ++ ptr->in(0)->dump(); // Initialize node ++ use->dump(1); ++ } ++#endif ++ fail = true; ++ break; ++ } ++ } + ptr = ptr->in(0)->in(0); + } else if (ptr->is_Region()) { + Node* copy = ptr->as_Region()->is_copy(); +diff --git a/test/hotspot/jtreg/compiler/stringopts/SideEffectBeforeConstructor.jasm b/test/hotspot/jtreg/compiler/stringopts/SideEffectBeforeConstructor.jasm +new file mode 100644 +index 000000000..cbc6d754b +--- /dev/null ++++ b/test/hotspot/jtreg/compiler/stringopts/SideEffectBeforeConstructor.jasm +@@ -0,0 +1,58 @@ ++/* ++ * Copyright (c) 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 ++ * 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. ++ */ ++ ++super public class compiler/stringopts/SideEffectBeforeConstructor ++ version 51:0 ++{ ++ public static Field result:I; ++ ++ static Method "":"()V" ++ stack 2 locals 0 ++ { ++ iconst_0; ++ putstatic Field result:"I"; ++ return; ++ } ++ public Method "":"()V" ++ stack 1 locals 1 ++ { ++ aload_0; ++ invokespecial Method java/lang/Object."":"()V"; ++ return; ++ } ++ ++ public static Method test:"(Ljava/lang/String;)V" ++ stack 4 locals 1 ++ { ++ new class java/lang/StringBuffer; ++ dup; ++ getstatic Field result:"I"; ++ iconst_1; ++ iadd; ++ putstatic Field result:"I"; ++ aload_0; ++ invokespecial Method java/lang/StringBuffer."":"(Ljava/lang/String;)V"; ++ invokevirtual Method java/lang/StringBuffer.toString:"()Ljava/lang/String;"; ++ return; ++ } ++} +diff --git a/test/hotspot/jtreg/compiler/stringopts/TestSideEffectBeforeConstructor.java b/test/hotspot/jtreg/compiler/stringopts/TestSideEffectBeforeConstructor.java +new file mode 100644 +index 000000000..86c5eca1d +--- /dev/null ++++ b/test/hotspot/jtreg/compiler/stringopts/TestSideEffectBeforeConstructor.java +@@ -0,0 +1,49 @@ ++/* ++ * Copyright (c) 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 ++ * 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. ++ */ ++ ++/* ++ * @test ++ * @bug 8290705 ++ * @summary Test correctness of the string concatenation optimization with ++ * a store between StringBuffer allocation and constructor invocation. ++ * @compile SideEffectBeforeConstructor.jasm ++ * @run main/othervm -Xbatch compiler.stringopts.TestSideEffectBeforeConstructor ++ */ ++ ++package compiler.stringopts; ++ ++public class TestSideEffectBeforeConstructor { ++ ++ public static void main(String[] args) { ++ for (int i = 0; i < 100_000; ++i) { ++ try { ++ SideEffectBeforeConstructor.test(null); ++ } catch (NullPointerException npe) { ++ // Expected ++ } ++ } ++ if (SideEffectBeforeConstructor.result != 100_000) { ++ throw new RuntimeException("Unexpected result: " + SideEffectBeforeConstructor.result); ++ } ++ } ++} diff --git a/Add-KAE-implementation.patch b/Add-KAE-implementation.patch old mode 100755 new mode 100644 index f364cbe80c79af8d3dfa68fdd1ead2e744e474ae..3006f64e91171c742a9e466fcda08e6883b3daaa --- a/Add-KAE-implementation.patch +++ b/Add-KAE-implementation.patch @@ -1,12 +1,8 @@ -From 91191c089cd8ad301c9e5b423b657d18b98ad6c9 Mon Sep 17 00:00:00 2001 -From: hedongbo -Date: Mon, 13 Sep 2021 10:18:05 +0800 -Subject: [PATCH 7/8] Add KAE implementation +From a194df3ac3f63326436378e54b2d3aa64f429a3f Mon Sep 17 00:00:00 2001 +From: miaomiao +Date: Tue, 20 Sep 2022 21:32:41 +0800 +Subject: [PATCH] test2 -Summary: : Add KAE impl -LLT: test/jdk/org/openeuler/security/openssl/ -Patch Type: huawei -Bug url: NA --- make/ZipSecurity.gmk | 1 + make/autoconf/configure.ac | 1 + @@ -14,7 +10,7 @@ Bug url: NA make/autoconf/spec.gmk.in | 1 + make/common/Modules.gmk | 13 + make/copy/Copy-jdk.crypto.kaeprovider.gmk | 46 + - make/lib/Lib-jdk.crypto.kaeprovider.gmk | 45 ++ + make/lib/Lib-jdk.crypto.kaeprovider.gmk | 45 + make/nb_native/nbproject/configurations.xml | 104 +++ src/java.base/share/classes/module-info.java | 10 +- .../share/lib/security/default.policy | 5 + @@ -199,10 +195,10 @@ index 9d64b31bf..e20eafa60 100644 [ # diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in -index 39b4439cb..92cda01c9 100644 +index e1f2feb72..789126311 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in -@@ -761,6 +761,7 @@ TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@ +@@ -773,6 +773,7 @@ TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@ # Build setup ENABLE_AOT:=@ENABLE_AOT@ ENABLE_INTREE_EC:=@ENABLE_INTREE_EC@ @@ -295,7 +291,7 @@ index 000000000..ef0bfd88a +################################################################################ diff --git a/make/lib/Lib-jdk.crypto.kaeprovider.gmk b/make/lib/Lib-jdk.crypto.kaeprovider.gmk new file mode 100644 -index 000000000..516a957d0 +index 000000000..d4362f3a6 --- /dev/null +++ b/make/lib/Lib-jdk.crypto.kaeprovider.gmk @@ -0,0 +1,45 @@ @@ -467,10 +463,10 @@ index fb07d54c1..38da09395 100644 ex="false" tool="0" diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java -index 0cf61732d..2d7a2fea4 100644 +index 7351627db..21c317647 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java -@@ -274,11 +274,13 @@ module java.base { +@@ -275,11 +275,13 @@ module java.base { exports sun.security.internal.interfaces to jdk.crypto.cryptoki; exports sun.security.internal.spec to @@ -484,14 +480,15 @@ index 0cf61732d..2d7a2fea4 100644 jdk.naming.dns; exports sun.security.pkcs to jdk.crypto.ec, -@@ -287,11 +289,15 @@ module java.base { +@@ -288,12 +290,16 @@ module java.base { java.rmi, java.security.jgss, jdk.crypto.cryptoki, + jdk.crypto.kaeprovider, jdk.security.auth; exports sun.security.provider.certpath to - java.naming; + java.naming, + jdk.jartool; exports sun.security.rsa to - jdk.crypto.cryptoki; + jdk.crypto.cryptoki, @@ -501,7 +498,7 @@ index 0cf61732d..2d7a2fea4 100644 exports sun.security.ssl to java.security.jgss; exports sun.security.timestamp to -@@ -308,6 +314,7 @@ module java.base { +@@ -310,6 +316,7 @@ module java.base { java.xml.crypto, jdk.crypto.ec, jdk.crypto.cryptoki, @@ -509,7 +506,7 @@ index 0cf61732d..2d7a2fea4 100644 jdk.jartool, jdk.naming.ldap, jdk.security.auth, -@@ -319,6 +326,7 @@ module java.base { +@@ -321,6 +328,7 @@ module java.base { exports sun.security.x509 to jdk.crypto.ec, jdk.crypto.cryptoki, @@ -518,10 +515,10 @@ index 0cf61732d..2d7a2fea4 100644 exports sun.security.validator to jdk.jartool; diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy -index ab59a334c..d15870f8f 100644 +index 41f5979da..13b01d016 100644 --- a/src/java.base/share/lib/security/default.policy +++ b/src/java.base/share/lib/security/default.policy -@@ -121,6 +121,11 @@ grant codeBase "jrt:/jdk.crypto.ec" { +@@ -123,6 +123,11 @@ grant codeBase "jrt:/jdk.crypto.ec" { permission java.security.SecurityPermission "removeProviderProperty.SunEC"; }; @@ -9136,10 +9133,10 @@ index 000000000..13bd5976d + +#endif diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups -index 694d078a6..8d171ed04 100644 +index 4073eec20..8dc2abf86 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups -@@ -235,6 +235,9 @@ jdk_security = \ +@@ -242,6 +242,9 @@ jdk_security = \ jdk_security_infra = \ security/infra/java/security/cert/CertPathValidator/certification @@ -9644,7 +9641,7 @@ index aee691016..6433416de 100644 expected = "SunJCE"; } diff --git a/test/jdk/sun/security/krb5/auto/BasicProc.java b/test/jdk/sun/security/krb5/auto/BasicProc.java -index 152db351c..38a2cd4e8 100644 +index 9e681af03..311cc7212 100644 --- a/test/jdk/sun/security/krb5/auto/BasicProc.java +++ b/test/jdk/sun/security/krb5/auto/BasicProc.java @@ -297,7 +297,9 @@ public class BasicProc { @@ -11274,5 +11271,5 @@ index 000000000..e62e68c4c +} + -- -2.22.0 +2.30.1 (Apple Git-130) diff --git a/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch b/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch index 530d1817e1cc406a5c344806620f120451188090..127168dbd09be67ac6877af3d5601d88dc208ac4 100755 --- a/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch +++ b/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch @@ -367,4 +367,4 @@ index 000000000..85b49171c --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ -+11.0.16.0.13 ++11.0.17.0.13 diff --git a/PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch b/PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch old mode 100755 new mode 100644 index e510108be4557831636286a330f9a3735368be9f..6030300b1a4979e9026ed3ed1aa50be8c33af347 --- a/PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch +++ b/PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch @@ -1,3 +1,13 @@ +From c470ac79015ad99f1760784cbffcf4b92d5bc8dc Mon Sep 17 00:00:00 2001 +From: DXwangg +Date: Wed, 26 Oct 2022 12:52:55 +0800 +Subject: [PATCH] qqqqq + +--- + .../share/gc/parallel/parallel_globals.hpp | 6 +++++- + .../gc/parallel/psPromotionManager.inline.hpp | 18 ++++++++++++++++-- + 2 files changed, 21 insertions(+), 3 deletions(-) + diff --git a/src/hotspot/share/gc/parallel/parallel_globals.hpp b/src/hotspot/share/gc/parallel/parallel_globals.hpp index 5461bf04f..75ee84d4f 100644 --- a/src/hotspot/share/gc/parallel/parallel_globals.hpp @@ -15,10 +25,24 @@ index 5461bf04f..75ee84d4f 100644 #endif // SHARE_GC_PARALLEL_PARALLEL_GLOBALS_HPP diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp -index cc5a4aa98..9bf45f82b 100644 +index cc5a4aa98..5a71ca307 100644 --- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp -@@ -218,8 +218,15 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) { +@@ -35,6 +35,7 @@ + #include "logging/log.hpp" + #include "oops/access.inline.hpp" + #include "oops/oop.inline.hpp" ++#include "runtime/prefetch.inline.hpp" + + inline PSPromotionManager* PSPromotionManager::manager_array(uint index) { + assert(_manager_array != NULL, "access of NULL manager_array"); +@@ -214,12 +215,21 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) { + + assert(new_obj != NULL, "allocation should have succeeded"); + ++ Prefetch::write(new_obj, PrefetchCopyIntervalInBytes); ++ + // Copy obj Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); // Now we have to CAS in the header. @@ -36,14 +60,17 @@ index cc5a4aa98..9bf45f82b 100644 // We won any races, we "own" this object. assert(new_obj == o->forwardee(), "Sanity"); -@@ -275,6 +282,10 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) { +@@ -275,6 +285,10 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) { // This code must come after the CAS test, or it will print incorrect // information. + // When UsePSRelaxedForwardee is true or object o is gc leaf, CAS failed threads can't access forwardee's content, -+ // as relaxed CAS cann't gurantee new obj's content visible for these CAS failed threads.The below log output is ++ // as relaxed CAS cann't gurantee new obj's content visible for these CAS failed threads.The below log output is + // dangerous.So we just support UsePSRelaxedForwardee and gc leaf in product. + // Everywhere access forwardee's content must be careful. log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", should_scavenge(&new_obj) ? "copying" : "tenuring", new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); +-- +2.30.1 (Apple Git-130) + diff --git a/fast-serializer-jdk11.patch b/fast-serializer-jdk11.patch index 30ee4c29b76a01d742189fc9a23486ef270eb675..21b210959549c272b2cdc99eb4b0d82d5b1828cd 100644 --- a/fast-serializer-jdk11.patch +++ b/fast-serializer-jdk11.patch @@ -1,20 +1,23 @@ -diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java -index f779af6c6..7c4539562 100644 ---- a/src/java.base/share/classes/java/io/ObjectInputStream.java -+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java -@@ -38,6 +38,7 @@ import java.security.PrivilegedExceptionAction; - import java.util.Arrays; - import java.util.Map; - import java.util.Objects; -+import java.util.concurrent.ConcurrentHashMap; +From ad916087e4c2f096791bac009a74c10862d6c0d6 Mon Sep 17 00:00:00 2001 +From: miaomiao +Date: Wed, 21 Sep 2022 10:16:33 +0800 +Subject: [PATCH] test3 + +--- + src/hotspot/share/prims/unsafe.cpp | 9 +- + src/hotspot/share/runtime/globals.hpp | 4 + + .../classes/java/io/ObjectInputStream.java | 173 ++++++++++++++---- + .../classes/java/io/ObjectOutputStream.java | 44 ++++- + .../classes/java/io/ObjectStreamClass.java | 47 +++++ + .../java/io/ObjectStreamConstants.java | 5 + + .../classes/jdk/internal/misc/Unsafe.java | 2 +- + 7 files changed, 241 insertions(+), 43 deletions(-) - import jdk.internal.misc.SharedSecrets; - import jdk.internal.misc.Unsafe; diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp -index 2f14e01ce..d8f1679b4 100644 +index db5959405..7f2319bae 100644 --- a/src/hotspot/share/prims/unsafe.cpp +++ b/src/hotspot/share/prims/unsafe.cpp -@@ -1018,6 +1018,10 @@ UNSAFE_ENTRY(jint, Unsafe_GetLoadAverage0(JNIEnv *env, jobject unsafe, jdoubleAr +@@ -1007,6 +1007,10 @@ UNSAFE_ENTRY(jint, Unsafe_GetLoadAverage0(JNIEnv *env, jobject unsafe, jdoubleAr return ret; } UNSAFE_END @@ -25,7 +28,7 @@ index 2f14e01ce..d8f1679b4 100644 /// JVM_RegisterUnsafeMethods -@@ -1102,7 +1106,10 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { +@@ -1091,7 +1095,10 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, {CC "isBigEndian0", CC "()Z", FN_PTR(Unsafe_isBigEndian0)}, @@ -38,10 +41,10 @@ index 2f14e01ce..d8f1679b4 100644 #undef CC diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp -index 4b8dbe899..ec5a4e50c 100644 +index a14477b80..f49edbe2a 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp -@@ -2684,6 +2684,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G); +@@ -2686,6 +2686,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G); JFR_ONLY(product(ccstr, StartFlightRecording, NULL, \ "Start flight recording with options")) \ \ @@ -53,10 +56,18 @@ index 4b8dbe899..ec5a4e50c 100644 "Use platform unstable time where supported for timestamps only") diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java -index 939b7647e..f59a51316 100644 +index 02346fac8..996b6fe67 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java -@@ -331,6 +331,9 @@ public class ObjectInputStream +@@ -38,6 +38,7 @@ import java.security.PrivilegedExceptionAction; + import java.util.Arrays; + import java.util.Map; + import java.util.Objects; ++import java.util.concurrent.ConcurrentHashMap; + + import jdk.internal.misc.SharedSecrets; + import jdk.internal.event.DeserializationEvent; +@@ -327,6 +328,9 @@ public class ObjectInputStream /** if true, invoke resolveObject() */ private boolean enableResolve; @@ -66,7 +77,7 @@ index 939b7647e..f59a51316 100644 /** * Context during upcalls to class-defined readObject methods; holds * object currently being deserialized and descriptor for current class. -@@ -344,6 +347,25 @@ public class ObjectInputStream +@@ -340,6 +344,25 @@ public class ObjectInputStream */ private ObjectInputFilter serialFilter; @@ -92,7 +103,7 @@ index 939b7647e..f59a51316 100644 /** * Creates an ObjectInputStream that reads from the specified InputStream. * A serialization stream header is read from the stream and verified. -@@ -421,6 +443,9 @@ public class ObjectInputStream +@@ -417,6 +440,9 @@ public class ObjectInputStream * transitively so that a complete equivalent graph of objects is * reconstructed by readObject. * @@ -102,7 +113,7 @@ index 939b7647e..f59a51316 100644 *

The root object is completely restored when all of its fields and the * objects it references are completely restored. At this point the object * validation callbacks are executed in order based on their registered -@@ -709,11 +734,20 @@ public class ObjectInputStream +@@ -705,11 +731,20 @@ public class ObjectInputStream vlist.register(obj, prio); } @@ -123,7 +134,7 @@ index 939b7647e..f59a51316 100644 *

The corresponding method in ObjectOutputStream is * annotateClass. This method will be invoked only once for * each unique class in the stream. This method can be implemented by -@@ -752,16 +786,26 @@ public class ObjectInputStream +@@ -748,16 +783,26 @@ public class ObjectInputStream throws IOException, ClassNotFoundException { String name = desc.getName(); @@ -155,7 +166,7 @@ index 939b7647e..f59a51316 100644 } /** -@@ -935,9 +979,25 @@ public class ObjectInputStream +@@ -931,9 +976,25 @@ public class ObjectInputStream { short s0 = bin.readShort(); short s1 = bin.readShort(); @@ -184,7 +195,7 @@ index 939b7647e..f59a51316 100644 } } -@@ -951,6 +1011,11 @@ public class ObjectInputStream +@@ -947,6 +1008,11 @@ public class ObjectInputStream * this method reads class descriptors according to the format defined in * the Object Serialization specification. * @@ -196,7 +207,7 @@ index 939b7647e..f59a51316 100644 * @return the class descriptor read * @throws IOException If an I/O error has occurred. * @throws ClassNotFoundException If the Class of a serialized object used -@@ -961,6 +1026,29 @@ public class ObjectInputStream +@@ -957,6 +1023,29 @@ public class ObjectInputStream protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { @@ -226,7 +237,7 @@ index 939b7647e..f59a51316 100644 ObjectStreamClass desc = new ObjectStreamClass(); desc.readNonProxy(this); return desc; -@@ -2008,36 +2096,52 @@ public class ObjectInputStream +@@ -2014,36 +2103,52 @@ public class ObjectInputStream skipCustomData(); @@ -304,7 +315,7 @@ index 939b7647e..f59a51316 100644 } handles.finish(descHandle); -@@ -2936,8 +3040,6 @@ public class ObjectInputStream +@@ -2942,8 +3047,6 @@ public class ObjectInputStream } } @@ -314,10 +325,10 @@ index 939b7647e..f59a51316 100644 * Performs a "freeze" action, required to adhere to final field semantics. * diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java -index 135e5645a..044924593 100644 +index 99105f553..acaf76a71 100644 --- a/src/java.base/share/classes/java/io/ObjectOutputStream.java +++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java -@@ -36,6 +36,7 @@ import java.util.StringJoiner; +@@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.StringJoiner; @@ -325,7 +336,7 @@ index 135e5645a..044924593 100644 import sun.reflect.misc.ReflectUtil; /** -@@ -192,7 +193,6 @@ public class ObjectOutputStream +@@ -188,7 +189,6 @@ public class ObjectOutputStream private final boolean enableOverride; /** if true, invoke replaceObject() */ private boolean enableReplace; @@ -333,7 +344,7 @@ index 135e5645a..044924593 100644 // values below valid only during upcalls to writeObject()/writeExternal() /** * Context during upcalls to class-defined writeObject methods; holds -@@ -215,6 +215,14 @@ public class ObjectOutputStream +@@ -211,6 +211,14 @@ public class ObjectOutputStream new sun.security.action.GetBooleanAction( "sun.io.serialization.extendedDebugInfo")).booleanValue(); @@ -348,7 +359,7 @@ index 135e5645a..044924593 100644 /** * Creates an ObjectOutputStream that writes to the specified OutputStream. * This constructor writes the serialization stream header to the -@@ -328,6 +336,9 @@ public class ObjectOutputStream +@@ -324,6 +332,9 @@ public class ObjectOutputStream * object are written transitively so that a complete equivalent graph of * objects can be reconstructed by an ObjectInputStream. * @@ -358,7 +369,7 @@ index 135e5645a..044924593 100644 *

Exceptions are thrown for problems with the OutputStream and for * classes that should not be serialized. All exceptions are fatal to the * OutputStream, which is left in an indeterminate state, and it is up to -@@ -636,7 +647,11 @@ public class ObjectOutputStream +@@ -632,7 +643,11 @@ public class ObjectOutputStream * stream */ protected void writeStreamHeader() throws IOException { @@ -371,7 +382,7 @@ index 135e5645a..044924593 100644 bout.writeShort(STREAM_VERSION); } -@@ -651,6 +666,9 @@ public class ObjectOutputStream +@@ -647,6 +662,9 @@ public class ObjectOutputStream * By default, this method writes class descriptors according to the format * defined in the Object Serialization specification. * @@ -381,7 +392,7 @@ index 135e5645a..044924593 100644 *

Note that this method will only be called if the ObjectOutputStream * is not using the old serialization stream format (set by calling * ObjectOutputStream's useProtocolVersion method). If this -@@ -668,7 +686,14 @@ public class ObjectOutputStream +@@ -664,7 +682,14 @@ public class ObjectOutputStream protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { @@ -397,7 +408,7 @@ index 135e5645a..044924593 100644 } /** -@@ -1278,7 +1303,13 @@ public class ObjectOutputStream +@@ -1268,7 +1293,13 @@ public class ObjectOutputStream if (protocol == PROTOCOL_VERSION_1) { // do not invoke class descriptor write hook with old protocol @@ -412,7 +423,7 @@ index 135e5645a..044924593 100644 } else { writeClassDescriptor(desc); } -@@ -1291,8 +1322,9 @@ public class ObjectOutputStream +@@ -1281,8 +1312,9 @@ public class ObjectOutputStream annotateClass(cl); bout.setBlockDataMode(false); bout.writeByte(TC_ENDBLOCKDATA); @@ -425,10 +436,10 @@ index 135e5645a..044924593 100644 /** diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java -index 17739cdc7..ac3a92bef 100644 +index 1f7647bac..8db60cc96 100644 --- a/src/java.base/share/classes/java/io/ObjectStreamClass.java +++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java -@@ -560,6 +560,15 @@ public class ObjectStreamClass implements Serializable { +@@ -431,6 +431,15 @@ public class ObjectStreamClass implements Serializable { ObjectStreamClass() { } @@ -444,7 +455,7 @@ index 17739cdc7..ac3a92bef 100644 /** * Creates a PermissionDomain that grants no permission. */ -@@ -746,6 +755,44 @@ public class ObjectStreamClass implements Serializable { +@@ -617,6 +626,44 @@ public class ObjectStreamClass implements Serializable { initialized = true; } @@ -519,5 +530,5 @@ index 031b5aae5..d78caabdc 100644 private native long reallocateMemory0(long address, long bytes); private native void freeMemory0(long address); -- -2.19.0 +2.30.1 (Apple Git-130) diff --git a/jdk-updates-jdk11u-jdk-11.0.16-ga.tar.xz b/jdk-updates-jdk11u-jdk-11.0.17-ga.tar.xz similarity index 84% rename from jdk-updates-jdk11u-jdk-11.0.16-ga.tar.xz rename to jdk-updates-jdk11u-jdk-11.0.17-ga.tar.xz index 56350a94c0efede82f86f686a686d5343330cf53..b4825d78e3e1be0a59d15c085e7b85d2ae60d5d6 100644 Binary files a/jdk-updates-jdk11u-jdk-11.0.16-ga.tar.xz and b/jdk-updates-jdk11u-jdk-11.0.17-ga.tar.xz differ diff --git a/openjdk-11.spec b/openjdk-11.spec index 649a231538b0cc76007a00dfbd24cd302b39563a..be34e76221e123886c57c4f75594263779bd3de2 100644 --- a/openjdk-11.spec +++ b/openjdk-11.spec @@ -114,7 +114,7 @@ # New Version-String scheme-style defines %global majorver 11 -%global securityver 16 +%global securityver 17 # buildjdkver is usually same as %%{majorver}, # but in time of bootstrap of next jdk, it is majorver-1, # and this it is better to change it here, on single place @@ -135,7 +135,7 @@ %global project jdk-updates %global repo jdk11u -%global revision jdk-11.0.16-ga +%global revision jdk-11.0.17-ga %global full_revision %{project}-%{repo}-%{revision} # priority must be 7 digits in total # setting to 1, so debug ones can have 0 @@ -875,8 +875,10 @@ Patch89: downgrade-the-symver-of-memcpy-GLIBC_2.14-on-x86.patch # 11.0.16 Patch90: fix_Internal_and_external_code_inconsistency.patch +Patch91: 8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch +BuildRequires: elfutils-extra BuildRequires: autoconf BuildRequires: alsa-lib-devel BuildRequires: binutils @@ -884,6 +886,7 @@ BuildRequires: cups-devel BuildRequires: desktop-file-utils # elfutils only are OK for build without AOT BuildRequires: elfutils-devel +BuildRequires: elfutils-extra BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: giflib-devel @@ -1165,6 +1168,7 @@ pushd %{top_level_dir_name} %patch88 -p1 %patch89 -p1 %patch90 -p1 +%patch91 -p1 popd # openjdk # %patch1000 @@ -1674,6 +1678,20 @@ cjc.mainProgram(arg) %changelog +* Wed Oct 19 2022 DXwangg - 1:11.0.17.8-0 +- update to 11.0.17+8(GA) +- modified G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch +- modified PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch + +* Mon Sep 19 2022 DXwangg - 1:11.0.17.6-0 +- update to 11.0.17+5 +- modified NUMA-Aware-Implementation-humongous-region.patch +- modified Add-KAE-implementation.patch +- modified fast-serializer-jdk11.patch + +* Fri Aug 5 2022 kuenking111 - 1:11.0.16.8-1 +- add 8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch + * Tue Jul 26 2022 kuenking111 - 1:11.0.16.8-0 - modified 8224675-Late-GC-barrier-insertion-for-ZGC.patch - modified ZGC-Redesign-C2-load-barrier-to-expand-on-th.patch