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

Cache unresolvedInCP at the JIT Server #20654

Merged

Conversation

luke-li-2003
Copy link
Contributor

Cache the value of unresolvedInCP for virtual, static, and special calls when caching a resolved method at the JIT Server, instead of assuming it is true for all cases.

@luke-li-2003
Copy link
Contributor Author

@mpirvu

@mpirvu mpirvu self-assigned this Nov 20, 2024
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Nov 20, 2024
@@ -1477,12 +1477,18 @@ TR::CompilationInfoPerThreadRemote::getCachedIProfilerInfo(TR_OpaqueMethodBlock
* @param key Identifier used to identify a resolved method in resolved methods cache
* @param method The resolved method of interest
* @param vTableSlot The vTableSlot for the resolved method of interest
* @param unresolvedInCP The unresolvedInCP boolean value of interest
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: the parameter is called isUnresolvedInCP

@@ -1664,12 +1704,13 @@ TR_ResolvedJ9JITServerMethod::cacheResolvedMethodsCallees(int32_t ttlForUnresolv

// 2. Send a remote query to mirror all uncached resolved methods
_stream->write(JITServer::MessageType::ResolvedMethod_getMultipleResolvedMethods, (TR_ResolvedJ9Method *) _remoteMirror, methodTypes, cpIndices);
auto recv = _stream->read<std::vector<TR_OpaqueMethodBlock *>, std::vector<uint32_t>, std::vector<TR_ResolvedJ9JITServerMethodInfo>>();
auto recv = _stream->read<std::vector<TR_OpaqueMethodBlock *>, std::vector<uint32_t>, std::vector<TR_ResolvedJ9JITServerMethodInfo>, std::vector<bool>>();
Copy link
Contributor

Choose a reason for hiding this comment

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

You mentioned that vector is not working, but I see it used here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The boolean didn't work with write(), but it did work with read()

Copy link
Contributor

Choose a reason for hiding this comment

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

The type that is used for writing should match the type it is used for reading.

@luke-li-2003 luke-li-2003 force-pushed the ServerCacheUnresolvedInCP branch from 85f2719 to 8c59a7e Compare November 21, 2024 18:12
Cache the value of unresolvedInCP for virtual, static, and special calls
when caching a resolved method at the JIT Server, instead of assuming
it is true for all cases.

Signed-off-by: Luke Li <[email protected]>
@luke-li-2003 luke-li-2003 force-pushed the ServerCacheUnresolvedInCP branch from 8c59a7e to 2b95d24 Compare November 21, 2024 18:13
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

Looks good to me. As discussed, please run the AcmeAir benchmark with JITServer, with and without this change and see if there is any performance impact.

@mpirvu
Copy link
Contributor

mpirvu commented Nov 21, 2024

jenkins test sanity,extended,sanity.system,extended.system plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk17

@mpirvu
Copy link
Contributor

mpirvu commented Nov 22, 2024

plinux failed cmdLineTester_criu_jitserverPostRestore_3

16:15:14  Testing: Test SSL Failure Case with mismatched certificate
...
16:15:16   [ERR] can't bind server address: Address already in use

On xlinux we failed MathLoadTest_autosimd_5m_0

17:20:25  MLT Test failed:
17:20:25  MLT java.lang.RuntimeException: test failure
17:20:25  MLT 	at net.adoptopenjdk.test.autosimd.AutoSIMDTestLong.checkThat(AutoSIMDTestLong.java:583)
17:20:25  MLT 	at net.adoptopenjdk.test.autosimd.AutoSIMDTestLong.checkThat(AutoSIMDTestLong.java:578)
17:20:25  MLT 	at net.adoptopenjdk.test.autosimd.AutoSIMDTestLong.testSimpleBinary(AutoSIMDTestLong.java:373)
17:20:25  MLT 	at net.adoptopenjdk.test.autosimd.AutoSIMDTestLong.testSub(AutoSIMDTestLong.java:264)
17:20:25  MLT 	at jdk.internal.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
17:20:25  MLT 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:20:25  MLT 	at java.base/java.lang.reflect.Method.invoke(Method.java:575)
17:20:25  MLT 	at net.adoptopenjdk.loadTest.adaptors.ArbitraryJavaAdaptor.executeTest(ArbitraryJavaAdaptor.java:102)
17:20:25  MLT 	at net.adoptopenjdk.loadTest.LoadTestRunner$2.run(LoadTestRunner.java:182)
17:20:25  MLT 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
17:20:25  MLT 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
17:20:25  MLT 	at java.base/java.lang.Thread.run(Thread.java:853)
...
17:20:25  STF 18:20:24.785 - **FAILED** execute script failed. Expected return value=0 Actual=1

@mpirvu
Copy link
Contributor

mpirvu commented Nov 22, 2024

10 iteration grinder started here: https://openj9-jenkins.osuosl.org/job/Grinder/4000/

@mpirvu
Copy link
Contributor

mpirvu commented Nov 22, 2024

The grinder showed 4/10 failures.
I started another grinder wit JITServer disabled here: https://openj9-jenkins.osuosl.org/job/Grinder/4003/

@mpirvu
Copy link
Contributor

mpirvu commented Nov 22, 2024

Without JITServer, all the 10 grinders have passed.
@luke-li-2003 Please reproduce this and see if this PR has anything to do with it.

@luke-li-2003
Copy link
Contributor Author

luke-li-2003 commented Nov 22, 2024

By the way, AcmeAir showed no performance impact

Results for jdk: /team/lukeli/jdk21Master and opts: -Xmx256m -Xms256m -XX:+UseJITServer -Xshareclasses:cacheDir=/tmp/cacheDir                                                                                                               
Run 0    3708.3  4316.7 Avg= 4316.7  RSS=    255 MB  CompCPU= 12.0 sec  Startup=15906 ms                              
Run 1    3878.5  4298.7 Avg= 4298.7  RSS=    253 MB  CompCPU=  5.3 sec  Startup= 3143 ms                              
Run 2    4102.6  4404.7 Avg= 4404.7  RSS=    251 MB  CompCPU=  5.4 sec  Startup= 3004 ms                              
Run 3    3962.3  4405.3 Avg= 4405.3  RSS=    250 MB  CompCPU=  5.3 sec  Startup= 2873 ms                              
Run 4    3943.4  4400.5 Avg= 4400.5  RSS=    252 MB  CompCPU=  5.3 sec  Startup= 2880 ms                             
Run 5    3995.1  4402.3 Avg= 4402.3  RSS=    251 MB  CompCPU=  5.2 sec  Startup= 2919 ms                              
Run 6    3950.3  4421.3 Avg= 4421.3  RSS=    254 MB  CompCPU=  5.2 sec  Startup= 2896 ms                              
Run 7    3938.7  4436.8 Avg= 4436.8  RSS=    251 MB  CompCPU=  5.2 sec  Startup= 2941 ms                              
Run 8    3998.3  4394.5 Avg= 4394.5  RSS=    254 MB  CompCPU=  5.1 sec  Startup= 2922 ms                              
Run 9    4029.5  4412.3 Avg= 4412.3  RSS=    248 MB  CompCPU=  5.2 sec  Startup= 2837 ms                              
Avg:     3950.7  4389.3 Thr= 4389.3  RSS=    252 MB  CompCPU=  5.9 sec  Startup= 4232 ms                              
Throughput stats: Avg= 4389.3  StdDev=   44.8  Min= 4298.7  Max= 4436.8  Max/Min=   3% CI95=    0.7% numSamples= 10   
Footprint stats:  Avg=  251.9  StdDev=    2.3  Min=  247.6  Max=  255.5  Max/Min=   3% CI95=    0.7% numSamples= 10   
Comp CPU stats:   Avg=    5.9  StdDev=    2.1  Min=    5.1  Max=   12.0  Max/Min= 133% CI95=   25.6% numSamples= 10   
StartupTime stats:Avg= 4232.1  StdDev= 4102.7  Min= 2837.0  Max=15906.0  Max/Min= 461% CI95=   69.3% numSamples= 10 
Results for jdk: /team/lukeli/jdk21CacheCP and opts: -Xmx256m -Xms256m -XX:+UseJITServer -Xshareclasses:cacheDir=/tmp/cacheDir
Run 0    3812.5  4345.5 Avg= 4345.5  RSS=    247 MB  CompCPU= 10.0 sec  Startup=10039 ms
Run 1    3950.7  4417.8 Avg= 4417.8  RSS=    252 MB  CompCPU=  5.4 sec  Startup= 3054 ms
Run 2    3975.6  4445.3 Avg= 4445.3  RSS=    248 MB  CompCPU=  5.2 sec  Startup= 2910 ms
Run 3    3954.8  4407.7 Avg= 4407.7  RSS=    245 MB  CompCPU=  5.1 sec  Startup= 2919 ms
Run 4    3967.1  4448.0 Avg= 4448.0  RSS=    249 MB  CompCPU=  5.1 sec  Startup= 2842 ms
Run 5    3942.5  4417.1 Avg= 4417.1  RSS=    247 MB  CompCPU=  5.0 sec  Startup= 2817 ms
Run 6    3937.3  4390.7 Avg= 4390.7  RSS=    245 MB  CompCPU=  5.1 sec  Startup= 2841 ms
Run 7    3920.8  4393.2 Avg= 4393.2  RSS=    246 MB  CompCPU=  5.2 sec  Startup= 2837 ms
Run 8    3915.6  4375.9 Avg= 4375.9  RSS=    246 MB  CompCPU=  5.2 sec  Startup= 2942 ms
Run 9    4051.5  4268.7 Avg= 4268.7  RSS=    245 MB  CompCPU=  5.1 sec  Startup= 2836 ms
Avg:     3942.8  4391.0 Thr= 4391.0  RSS=    247 MB  CompCPU=  5.6 sec  Startup= 3604 ms
Throughput stats: Avg= 4391.0  StdDev=   52.8  Min= 4268.7  Max= 4448.0  Max/Min=   4% CI95=    0.9% numSamples= 10
Footprint stats:  Avg=  247.0  StdDev=    2.1  Min=  245.1  Max=  251.8  Max/Min=   3% CI95=    0.6% numSamples= 10
Comp CPU stats:   Avg=    5.6  StdDev=    1.5  Min=    5.0  Max=   10.0  Max/Min= 100% CI95=   19.7% numSamples= 10
StartupTime stats:Avg= 3603.7  StdDev= 2262.3  Min= 2817.0  Max=10039.0  Max/Min= 256% CI95=   44.9% numSamples= 10

@mpirvu
Copy link
Contributor

mpirvu commented Nov 22, 2024

Since MathLoadTest_autosimd_5m_0 fails with the nightly build as well, it means that it's not a new regression introduced by this PR. Hence, this PR is good to be merged.

@mpirvu mpirvu merged commit 9de8d6b into eclipse-openj9:master Nov 22, 2024
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants