Skip to content

Change how TR_IPBCDataCallGraph entries are persisted into SCC - #15617

Merged
dsouzai merged 2 commits into
eclipse-openj9:masterfrom
mpirvu:iprofilerimprov
Aug 8, 2022
Merged

Change how TR_IPBCDataCallGraph entries are persisted into SCC#15617
dsouzai merged 2 commits into
eclipse-openj9:masterfrom
mpirvu:iprofilerimprov

Conversation

@mpirvu

@mpirvu mpirvu commented Jul 25, 2022

Copy link
Copy Markdown
Contributor

Before this change, each TR_IPBCDataCallGraph entry that is persisted can contain
up to 3 ROMClasses and their associates sampling frequencies. When loading from
SCC we need to convert from a ROMClass to a RAMClass. This is done with the
help of the matchRAMclassFromROMclass() frontend method, which first tries
the classloader of the method being compiled and then the bootstrap classloader.
If none of these attempts is successfull, we store NULL into the IProfiler entry
which is created from the SCC entry.

In this commit we change the mechanism to convert from a ROMClass to a RAMClass,
to match the mechanism that is used in AOT relocation records. Specifically, the
new code is using the mechanism that associates a classloader with the first class
that is loaded by that class loader (see ClassLoaderTable.cpp).
Thus, the IProfiler entry stored in SCC needs to contain two values now:
(1) The classchain for the class that is being traked and
(2) The classchain for the first class loaded by the classloader that loaded the class
being tracked.
Since in the new implementation we store more information, we will only track one
target class instead of 3.

This change is improving the throughput of some applications that rely on IProfiler
information stored in SCC.

Depends on eclipse-omr/omr#6638

Signed-off-by: Marius Pirvu mpirvu@ca.ibm.com

@mpirvu
mpirvu requested a review from dsouzai July 25, 2022 22:34

@dsouzai dsouzai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall looks ok to me.

Do you think it's worth having the verbose logging be printed to the vlog? As it stands, the only way to get this info is to rebuild.

Comment thread runtime/compiler/runtime/IProfiler.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
fprintf(stderr, "loadFromPersistentCopy: Cannot convert ROMClass to RAMClass. Cannot get the class chain of ROMMethod\n");
fprintf(stderr, "loadFromPersistentCopy: Cannot convert ROMClass to RAMClass. Cannot get the class chain of ROMClass\n");

@dsouzai dsouzai self-assigned this Aug 2, 2022
@dsouzai

dsouzai commented Aug 2, 2022

Copy link
Copy Markdown
Contributor

Also looks like there's a missing copyright update.

Before this change, each `TR_IPBCDataCallGraph` entry that is persisted can contain
up to 3 ROMClasses and their associates sampling frequencies. When loading from
SCC we need to convert from a ROMClass to a RAMClass. This is done with the
help of the `matchRAMclassFromROMclass()` frontend method, which first tries
the classloader of the method being compiled and then the bootstrap classloader.
If none of these attempts is successfull, we store NULL into the IProfiler entry
which is created from the SCC entry.

In this commit we change the mechanism to convert from a ROMClass to a RAMClass,
to match the mechanism that is used in AOT relocation records. Specifically, the
new code is using the mechanism that associates a classloader with the first class
that is loaded by that class loader (see ClassLoaderTable.cpp).
Thus, the IProfiler entry stored in SCC needs to contain two values now:
(1) The classchain for the class that is being traked and
(2) The classchain for the first class loaded by the classloader that loaded the class
being tracked.
Since in the new implementation we store more information, we will only track one
target class instead of 3.

This change is improving the throughput of some applications that rely on IProfiler
information stored in SCC.

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu

mpirvu commented Aug 4, 2022

Copy link
Copy Markdown
Contributor Author

Fixed copyright message.
I don't have a feel for how often we are going to use those verbose messages. I would need to add a new verbose option in OMR before continuing with this PR.

@mpirvu mpirvu added the depends:omr Pull request is dependent on a corresponding change in OMR label Aug 4, 2022
Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu

mpirvu commented Aug 5, 2022

Copy link
Copy Markdown
Contributor Author

Addressed review comments

@dsouzai

dsouzai commented Aug 5, 2022

Copy link
Copy Markdown
Contributor

jenkins test sanity.functional all jdk17

@mpirvu

mpirvu commented Aug 8, 2022

Copy link
Copy Markdown
Contributor Author

Tests have passed

@dsouzai
dsouzai merged commit 41430ff into eclipse-openj9:master Aug 8, 2022
@AlexeyKhrabrov

Copy link
Copy Markdown
Contributor

The test failure with the "Shared cache pointer out of bounds" assertion reported in #15609 appears to be the same race condition as discussed in #12405 and #12550. TR_J9SharedCache::offsetInSharedCacheFromPointer() is not safe to call for the result of a recent call to rememberClass(). I think this should be fixed.

@mpirvu
mpirvu deleted the iprofilerimprov branch August 11, 2022 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:jit depends:omr Pull request is dependent on a corresponding change in OMR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants