-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373114: Redundant MethodCounters in the preimage generated by training run #28670
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back asmehra! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@ashu-mehra The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
…ng run Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
ae1c841 to
f741349
Compare
|
@ashu-mehra Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Webrevs
|
|
I did a force-push to fix the bug id in the commit message. |
|
I'm not an expert in CDS, but the fix doesn't look right. It breaks Metadata traversal CDS relies on. Instead, if you don't want to keep around |
Right, this is not the correct fix. It breaks the Method->MethodCounters link for all the methods. We need to preserve the links for the MethodCounters that get added through MTD. |
hmm, I think I am wrong here again. We don't need to preserve the Method->MCS link. We only need the MTD->MCS link. |
|
I looked at the code again and unless I missed something it looks like the MCS from MTD are not used at all. I don't see their usage either in mainline or in leyden premain branch. Why do we even care to store MCS at all then? @veresov can you please comment about this? |
|
They are not used right now but @vnkozlov is going to use them for the A4 recompilation strategy. |
yes, I need it for A4 entry counter. Also I thought MC is used to cache MTD pointer: |
|
Yes, but caching is a runtime thing it's not really need in the archive. But for your work we probably do need it. |
Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
|
Okay, I updated the fix. Idea is the same as before - add MethodCounters reachable from MethodTrainingData, not from Method. But the new fix relies on updating Another approach I thought of was to add the filtering in |
|
What's the percentage of the memory usage in the archive do you typically see attributed to MCs? |
|
Before the patch with mainline: In final AOTCache: After the new fix, I see following stats: In pre-image: In final AOTCache: So the size of MethodCounters is 2.6% (before fix) vs 0.6% (after fix) in the preimage, and 1% (before fix) vs 0.6% (after fix) in the AOTCache. |
Details are mentioned in the bug report and this mail thread https://mail.openjdk.org/pipermail/leyden-dev/2025-December/002843.html
After this patch the number of MethodCounters in the preimage are much less than before this patch. Also the number of MethodCounters in the preimage is the same as in the final AOTCache (these numbers are obtained using -Xlog:aot=trace).
Before this patch for the training run:
Before this patch for the assembly phase:
After this patch for the training run:
After this patch for the assembly phase:
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28670/head:pull/28670$ git checkout pull/28670Update a local copy of the PR:
$ git checkout pull/28670$ git pull https://git.openjdk.org/jdk.git pull/28670/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28670View PR using the GUI difftool:
$ git pr show -t 28670Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28670.diff
Using Webrev
Link to Webrev Comment