Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Recursive lightweight locking #120

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

linade
Copy link
Collaborator

@linade linade commented Oct 29, 2024

Backport the following patches to address a [regression](https://aliyuque.antfin.com/yude.lyd/oz0e1u/zzxn78rdkxolwrap?singleDoc# 《Deflate regression》) in compact object headers :

8329091: [Lilliput/JDK21] Fix tests after LM_LIGHTWEIGHT backports
8329757: Crash with fatal error: DEBUG MESSAGE: Fast Unlock lock on stack
8319900: Recursive lightweight locking: riscv64 implementation
8319801: Recursive lightweight locking: aarch64 implementation
8319799: Recursive lightweight locking: x86 implementation
8319797: Recursive lightweight locking: Runtime implementation

patches apply cleanly except for
cpu/x86/c2_CodeStubs_x86.cpp conflict caused by 8319799

@linade linade requested review from kuaiwei and mmyxym October 29, 2024 06:39
@CLAassistant
Copy link

CLAassistant commented Oct 29, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 3 committers have signed the CLA.

❌ zifeihan
❌ xmas92
❌ rkennke
You have signed the CLA already but the status is still pending? Let us recheck it.

@linade
Copy link
Collaborator Author

linade commented Oct 29, 2024

The conflict in cpu/x86/c2_CodeStubs_x86.cpp is caused by this patch. It's not hard to resolve, since C2LoadNKlassStub is not relevant to the current PR.

$git show 64dff318febb -- src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp 
commit 64dff318febb7cf639d95e039591e4e89e4db0de
Author: Yude Lin <[email protected]>
Date:   Thu Jul 18 14:53:13 2024 +0800

    [Backport] 8316126: [Lilliput/JDK21] Cherry-pick: 8305895: Implementation: JEP 450: Compact Object Headers
    
    Summary: Backport
    8316126: [Lilliput/JDK21] Cherry-pick: 8305895: Implementation: JEP 450: Compact Object Headers (Experimental)
    8317954: [Lilliput/JDK21] Make C2 LoadNKlassCompactHeader more robust
    8316687: [Lilliput/JDK21] Various cleanups
    8319724: [Lilliput] ParallelGC: Forwarded objects found during heap inspection
    8316424: [Lilliput/JDK21] ZGC/CDS-related test fixes
    And make UseCompactObjectHeaders product
    
    Testing: CICD (all jtreg)
    
    Reviewers: mmyxym, lingjun-cg, kuaiwei
    
    Issue: https://github.com/dragonwell-project/dragonwell21/issues/75

diff --git a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
index cd5e87b29ec..a2f60bd2321 100644
--- a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
@@ -93,6 +93,18 @@ void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
 #endif
   __ jmp(continuation());
 }
+
+int C2LoadNKlassStub::max_size() const {
+  return 10;
+}
+
+void C2LoadNKlassStub::emit(C2_MacroAssembler& masm) {
+  __ bind(entry());
+  Register d = dst();
+  __ movq(d, Address(d, OM_OFFSET_NO_MONITOR_VALUE_TAG(header)));
+  __ jmp(continuation());
+}
+
 #endif
 
 #undef __


Copy link
Collaborator

@mmyxym mmyxym left a comment

Choose a reason for hiding this comment

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

LGTM

xmas92 and others added 6 commits October 30, 2024 16:31
Co-authored-by: Stefan Karlsson <[email protected]>
Co-authored-by: Erik Österlund <[email protected]>
Reviewed-by: rkennke, dcubed, coleenp, stefank
Co-authored-by: Stefan Karlsson <[email protected]>
Co-authored-by: Erik Österlund <[email protected]>
Reviewed-by: rkennke, coleenp, dcubed
Co-authored-by: Stefan Karlsson <[email protected]>
Co-authored-by: Erik Österlund <[email protected]>
Reviewed-by: rkennke, coleenp, dcubed, aph
Co-authored-by: Axel Boldt-Christmas <[email protected]>
Reviewed-by: fyang
Copy link
Collaborator

@jia-wei-tang jia-wei-tang left a comment

Choose a reason for hiding this comment

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

LGTM. The codes related to held_monitor_count may need to change a little when merge into AJDK since we solved the synchornized pinned problem and changed the logic of counting. The jtreg testsuit has contained related tests, so the potential problems will not be missed after merging.

@linade linade merged commit 52f70c1 into dragonwell-project:master Oct 31, 2024
77 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants