代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-17 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8f29e9c5ec26a5f726ddd0557e046e66c1c94e10 Mon Sep 17 00:00:00 2001
Date: Wed, 8 Dec 2021 16:23:26 +0800
Subject: [PATCH] [Backport] 8272138: ZGC: Adopt relaxed ordering for self-healing
Reference: https://bugs.openjdk.java.net/browse/JDK-8272138
---
src/hotspot/share/gc/z/zBarrier.inline.hpp | 2 +-
src/hotspot/share/gc/z/zForwarding.inline.hpp | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/gc/z/zBarrier.inline.hpp b/src/hotspot/share/gc/z/zBarrier.inline.hpp
index 0fa611005..2eaebfcfd 100644
--- a/src/hotspot/share/gc/z/zBarrier.inline.hpp
+++ b/src/hotspot/share/gc/z/zBarrier.inline.hpp
@@ -117,7 +117,7 @@ inline void ZBarrier::self_heal(volatile oop* p, uintptr_t addr, uintptr_t heal_
for (;;) {
// Heal
- const uintptr_t prev_addr = Atomic::cmpxchg((volatile uintptr_t*)p, addr, heal_addr);
+ const uintptr_t prev_addr = Atomic::cmpxchg((volatile uintptr_t*)p, addr, heal_addr, memory_order_relaxed);
if (prev_addr == addr) {
// Success
return;
diff --git a/src/hotspot/share/gc/z/zForwarding.inline.hpp b/src/hotspot/share/gc/z/zForwarding.inline.hpp
index 31bf72929..cff6d7a90 100644
--- a/src/hotspot/share/gc/z/zForwarding.inline.hpp
+++ b/src/hotspot/share/gc/z/zForwarding.inline.hpp
@@ -136,8 +136,12 @@ inline uintptr_t ZForwarding::insert(uintptr_t from_index, uintptr_t to_offset,
const ZForwardingEntry new_entry(from_index, to_offset);
const ZForwardingEntry old_entry; // Empty
+ // Make sure that object copy is finished
+ // before forwarding table installation
+ OrderAccess::release();
+
for (;;) {
- const ZForwardingEntry prev_entry = Atomic::cmpxchg(entries() + *cursor, old_entry, new_entry);
+ const ZForwardingEntry prev_entry = Atomic::cmpxchg(entries() + *cursor, old_entry, new_entry, memory_order_relaxed);
if (!prev_entry.populated()) {
// Success
return to_offset;
--
2.19.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。