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

JITServer AOT test #16428

Open
llxia opened this issue Dec 7, 2022 · 8 comments
Open

JITServer AOT test #16428

llxia opened this issue Dec 7, 2022 · 8 comments

Comments

@llxia
Copy link
Contributor

llxia commented Dec 7, 2022

Thanks @mpirvu's suggestion. We are going to add a JITServer AOT test by leveraging the existing system test - MiniMix_5m. We will mimic the scenario of the server and client, but to make the testing easy, we will run everything on one machine. We may also want to increase MiniMix_5m to 10mins (e.g., MiniMix_10m).

Details:

  • Start JITServer with -XX:+JITServerUseAOTCache
  • Run MiniMix_10m with -Xshareclasses and -XX:+JITServerUseAOTCache
  • Destroy the sharedclasses at the client
  • Run MiniMix_10m again with -Xshareclasses and -XX:+JITServerUseAOTCache
  • Stop JITServer
  • clean up

This test will be added to the extended.system.

Related: #15401

@llxia llxia added the comp:test label Dec 7, 2022
@llxia
Copy link
Contributor Author

llxia commented Dec 7, 2022

@LongyuZhang could you take care of this? Thanks

@cjjdespres
Copy link
Contributor

This would be good to have as a start on adding more JITServer AOT cache tests to the test suite, especially since we've been making some fairly significant changes to the AOT cache recently. Could work on this be restarted?

@llxia
Copy link
Contributor Author

llxia commented May 2, 2024

@cjjdespres Do we still need the MiniMix_10m with JITServer with -XX:+JITServerUseAOTCache test that is mentioned above? Also, can you provide more details about adding more JITServer AOT cache tests to the test suite? What tests/scenarios are you referring to?

@cjjdespres
Copy link
Contributor

Yes, I I think the test outlined in the #16428 (comment) is needed.

I don't think we have a list of exactly the extra tests/scenarios that should be added. That's just a goal of ours, to improve JITServer AOT cache testing coverage.

One other scenario I can think of is the test in #16428 (comment), except that the client running MiniMix_10m will have the options -XX:+JITServerUseAOTCache -XX:+JITServerAOTCacheIgnoreLocalSCC in both runs. The client might or might not have -Xshareclasses set up in both cases, I suppose.

Maybe @mpirvu and @AlexeyKhrabrov have ideas.

@mpirvu
Copy link
Contributor

mpirvu commented May 2, 2024

I am thinking of making -XX:+JITServerAOTCacheIgnoreLocalSCC the default, so going forward the sequence mentioned in the description (#16428 (comment)) is good enough.
A variation could be where the client does not specify -Xshareclasses, but only -XX:+JITServerUseAOTCache

Further down the line we may want to test AOT cache persistence. The sequence of operations in that case is:

  1. Start JITServer with -XX:+JITServerUseAOTCache -XX:+JITServerAOTCachePersistence
  2. Start client with -XX:+JITServerUseAOTCache
  3. Remove client, remove server
  4. Repeat step 1
  5. Repeat step 2

@llxia
Copy link
Contributor Author

llxia commented May 8, 2024

#16428 (comment) and #16428 (comment) describe single tests.

Do we have a plan to run all tests with JITServer with -XX:+JITServerUseAOTCache -XX:+JITServerAOTCacheIgnoreLocalSCC or -XX:+JITServerUseAOTCache -XX:+JITServerAOTCachePersistence?

We currently have TEST_FLAG= JITAAS, where JITServer will start before running tests
https://github.com/adoptium/TKG/blob/6e73a9fa473738b6e92c7a65e59588b5b0f408a8/testEnv.mk#L23-L26

Is this something that we will do for JITServer AOT?

@cjjdespres
Copy link
Contributor

Is this something that we will do for JITServer AOT?

I think that could be valuable for -XX:+JITServerUseAOTCache -XX:+JITServerAOTCacheIgnoreLocalSCC. I caught a couple of bugs doing that myself manually, running sanity.functional with a JITServer with AOT cache enabled running on the side throughout.

Would the tests be run twice in this mode? That would hopefully test both the compiling/storing of methods and the loading of methods in the JITServer AOT cache.

The -XX:+JITServerAOTCachePersistence feature works by periodically saving the content of the AOT cache to a file on disk, so that future JITServer instances that start up can read the cache from that file. We could test that in the same way as TEST_FLAG=JITAAS, but we'd have to make sure that fresh servers are started somewhat regularly so the reading-from-disk part of the feature was actually tested.

@cjjdespres
Copy link
Contributor

Now that #19584 has been merged, the JITServer no longer needs the option -XX:+JITServerUseAOTCache. The client will still need the option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

3 participants