Skip to content

Avoid touching the SCC as much as possible during stack walk #21972

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

gacholio
Copy link
Contributor

@gacholio gacholio commented May 28, 2025

Cache localmap/stackmap/argbits to avoid walking bytecodes.

Related: #21812

This feature is disabled by default. Enable with -XX:+CacheMaps

@gacholio gacholio force-pushed the cacbe branch 13 times, most recently from 5a4b9ec to 67784cd Compare June 1, 2025 14:06
@gacholio gacholio changed the title Do not merge Avoid touching the SCC as much as possible during stack walk Jun 1, 2025
@gacholio gacholio requested a review from tajila June 1, 2025 14:08
@gacholio gacholio force-pushed the cacbe branch 7 times, most recently from baac1c4 to b98dc99 Compare June 2, 2025 16:24
@gacholio gacholio requested a review from dmitripivkine June 2, 2025 16:35
@gacholio
Copy link
Contributor Author

gacholio commented Jun 2, 2025

@dmitripivkine Please take a look at the GC changes. What I intend is to flush the appropriate class loader cache when a class is unloaded. I may have the flush a bit too deep if classes can only be unloaded when their loaded is unloaded. What about anon classes? IIRC, they get unloaded piecemeal.

@gacholio gacholio force-pushed the cacbe branch 3 times, most recently from fc04d09 to 9aab46b Compare June 2, 2025 16:54
@dmitripivkine
Copy link
Contributor

dmitripivkine commented Jun 2, 2025

@dmitripivkine Please take a look at the GC changes. What I intend is to flush the appropriate class loader cache when a class is unloaded. I may have the flush a bit too deep if classes can only be unloaded when their loaded is unloaded. What about anon classes? IIRC, they get unloaded piecemeal.

Classes are unloaded on class loader basis (except Anonymous), there is no case some classes can be unloaded but entire class loader not. So I think flushing should be done once. I assume it should be done before class loader unloading (cleanup).

Anonymous classes can be unloaded individually, but there is a trick. Anonymous class loader is just technical storage for Anonymous classes (and it can not be unloaded by design). Each Anonymous class however has pointer to its parent class loader (not an Anonymous one).

@gacholio
Copy link
Contributor Author

jenkins compile xlinux jdk17

@tajila
Copy link
Contributor

tajila commented Jun 11, 2025

Thanks GAC, we are going to do some perf runs on it.

@gacholio
Copy link
Contributor Author

jenkins compile xlinux jdk17

@gacholio gacholio force-pushed the cacbe branch 2 times, most recently from 4565bf5 to 7360339 Compare June 16, 2025 15:29
@tajila
Copy link
Contributor

tajila commented Jun 17, 2025

jenkins test sanity.functional win jdk8

@tajila
Copy link
Contributor

tajila commented Jun 17, 2025

jenkins test amac sanity,extended.functional amac jdk17

@gacholio
Copy link
Contributor Author

jenkins test sanity,extended.functional amac jdk17

@tajila
Copy link
Contributor

tajila commented Jun 18, 2025

Consistent crash here:

14:17:41  Unhandled exception
14:17:41  Type=Segmentation error vmState=0x00000000
14:17:41  J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000002
14:17:41  Handler1=0000000104E8DC9C Handler2=0000000104B86318 InaccessibleAddress=FFFFFFFFFFFFFFF8
14:17:41  x0=0000600000F243E0 x1=0000000000000000 x2=0000000000000000 x3=000000013903297C
14:17:41  x4=000000017EF7D160 x5=0000000000000000 x6=000000000000006D x7=000000017EF7D228
14:17:41  x8=0000000000000000 x9=0000000000000000 x10=00000001228513F0 x11=000000017EF7D1A0
14:17:41  x12=0000000000000000 x13=0000000000000000 x14=000000017EF7D770 x15=0000000000000000
14:17:41  x16=000000019162EA10 x17=00000002035AA6F0 x18=0000000149076B00 x19=0000000149076B00
14:17:41  x20=0000000149076E58 x21=00000001056FC278 x22=00000001228513D0 x23=0000000104FC26EA
14:17:41  x24=0000000149076DF8 x25=00000000102C0810 x26=0000000104FCE454 x27=0000000104FB751D
14:17:41  x28=0000000000000000 x29(FP)=000000017EF7D220 x30(LR)=0000000104EC54B0 x31(SP)=000000017EF7D160
14:17:41  PC=0000000104EC608C SP=000000017EF7D160
14:17:41  v0=0000000360208ee0 (f: 1612746496.000000, d: 7.162790e-314)
14:17:41  v1=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v2=0706050403020100 (f: 50462976.000000, d: 7.949929e-275)
14:17:41  v3=000000610000006a (f: 106.000000, d: 2.058336e-312)
14:17:41  v4=373cd4c5ab654ba8 (f: 2875542528.000000, d: 1.292833e-42)
14:17:41  v5=000000004b018f79 (f: 1258393472.000000, d: 6.217290e-315)
14:17:41  v6=94446f0194446f01 (f: 2487512832.000000, d: -4.855772e-211)
14:17:41  v7=000e1781000e1781 (f: 923521.000000, d: 1.959708e-308)
14:17:41  v8=000003c10000745f (f: 29791.000000, d: 2.039238e-311)
14:17:41  v9=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v10=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v11=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v12=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v13=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v14=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v15=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v16=bfd0000000000000 (f: 0.000000, d: -2.500000e-01)
14:17:41  v17=3fd54347b9e77555 (f: 3118953728.000000, d: 3.322315e-01)
14:17:41  v18=3f720373bc053116 (f: 3154456832.000000, d: 4.397823e-03)
14:17:41  v19=3fe62e42fefa39ef (f: 4277811712.000000, d: 6.931472e-01)
14:17:41  v20=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v21=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v22=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v23=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v24=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v25=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v26=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v27=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v28=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v29=0000000000000000 (f: 0.000000, d: 0.000000e+00)
14:17:41  v30=6974752e6176616a (f: 1635148160.000000, d: 9.787117e+199)
14:17:41  v31=76616a4c293b7265 (f: 691761792.000000, d: 1.713702e+262)
14:17:41  Module=/Users/jenkins/workspace/Test_openjdk17_j9_sanity.openjdk_aarch64_mac_Personal_testList_2/jdkbinary/j2sdk-image/lib/default/libj9vm29.dylib
14:17:41  Module_base_address=0000000104E68000 Symbol=walkStackFrames
14:17:41  Symbol_address=0000000104EC540C
14:17:41  Target=2_90_20250618_788 (Mac OS X 15.3.1)
14:17:41  CPU=aarch64 (8 logical CPUs) (0x400000000 RAM)
14:17:41  ----------- Stack Backtrace -----------
14:17:41  ---------------------------------------
14:17:41  JVMDUMP039I Processing dump event "gpf", detail "" at

@gacholio
Copy link
Contributor Author

Failures seem to be related to use of the StackWalker class.

@gacholio gacholio marked this pull request as draft June 19, 2025 18:08
@gacholio gacholio force-pushed the cacbe branch 3 times, most recently from dff3748 to aa353bf Compare June 20, 2025 20:41
Cache localmap/stackmap/argbits to avoid walking bytecodes.

Signed-off-by: Graham Chapman <graham_chapman@ca.ibm.com>
@gacholio gacholio marked this pull request as ready for review June 20, 2025 21:18
@eclipse-openj9 eclipse-openj9 deleted a comment from tajila Jun 20, 2025
@gacholio
Copy link
Contributor Author

jenkins line endings check

@gacholio
Copy link
Contributor Author

jenkins test sanity,extended.functional xlinux jdk17

@eclipse-openj9 eclipse-openj9 deleted a comment from tajila Jun 23, 2025
@gacholio
Copy link
Contributor Author

jenkins test sanity,extended.functional zlinux jdk21

@tajila tajila merged commit 2d955b7 into eclipse-openj9:master Jun 24, 2025
11 checks passed
gacholio added a commit to gacholio/openj9 that referenced this pull request Jun 24, 2025
The logic was reversed.

Related: eclipse-openj9#21972

Signed-off-by: Graham Chapman <graham_chapman@ca.ibm.com>
@gacholio gacholio deleted the cacbe branch June 24, 2025 14:08
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.

4 participants