Skip to content

Conversation

@mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Oct 28, 2025

PR #22216 introduced a change in the code generator for x86 to check a few entries from the iTable if the lastITable cache test fails. While this change improves the score of some benchmarks (like pmd from DaCapo) it may regress others (Daytrader8 1%, AcmeAirEE8 0.8%, Liberty startup 2%).

This commit allows the iTable entries check only for compilations at hot or above opt levels.
To allow the iTable entries check at opt levels lower than hot the user needs to use the following Xjit/Xaot command line option:enableITableIterationsAfterLastITableCacheCheckAtWarm
To disable the iTable entries check at all opt levels, the user needs to use the following Xjit/Xaot option: disableITableIterationsAfterLastITableCacheCheck

Depends on: eclipse-omr/omr#8009

@mpirvu
Copy link
Contributor Author

mpirvu commented Oct 28, 2025

@0xdaryl Could you please review/merge this PR? Thanks

FYI: @a7ehuo @BradleyWood @vijaysun-omr

This change keeps the improvements in DaCapo-pmd and avoids the regressions in Liberty benchmarks.

Copy link
Member

@BradleyWood BradleyWood left a comment

Choose a reason for hiding this comment

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

Did you benchmark this change with other optLevel thresholds?

@mpirvu
Copy link
Contributor Author

mpirvu commented Oct 29, 2025

Did you benchmark this change with other optLevel thresholds?

No. Liberty apps have a flat profile where very few methods (if any) reach hot/scorching. Performance is dictated by what happens in warm bodies.

generateX86MemoryReference(scratchReg, fej9->getOffsetOfInterfaceClassFromITableField(), cg()),
interfaceClassReg, cg());
}
static bool enableITableIterationsAfterLastITableCacheCheckAtWarm = feGetEnv("TR_EnableITableIterationsAfterLastITableCacheCheckAtWarm") != NULL;
Copy link
Contributor

@0xdaryl 0xdaryl Oct 29, 2025

Choose a reason for hiding this comment

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

Is there a reason why this "enable" option is an env var and the "disable" option is an Option? That is, why not make them both Options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no strong reason for the env var. It wasn't at all present in the first implementation of this solution. Then, I wanted to cover all basis by offering the user a way out and realized I have to open another omr PR which needs to propagate to openj9. The env var was a compromise to speed this PR up (FYI: the iTable code increases the JITServer CPU consumption a lot due to the many messages it generates).
I will create an omr PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dependency created in eclipse-omr/omr#8009

@vijaysun-omr
Copy link
Contributor

Is this not done on Power ? @zl-wang

@zl-wang
Copy link
Contributor

zl-wang commented Oct 29, 2025

Is this not done on Power ? @zl-wang

this was done already on Power, but we had done it in a better way in my opinion (done it in PicBuilder naturally without taking up extra codeCache).

@mpirvu mpirvu force-pushed the jitserver-cpuimprov branch from 757b3b7 to 8cbc7a9 Compare October 29, 2025 17:57
@mpirvu mpirvu added the depends:omr Pull request is dependent on a corresponding change in OMR label Oct 29, 2025
@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 30, 2025

OMR with the option change has promoted.

Please fix your commit and PR title--it is a bit long. Perhaps just: "Do not check iTable entries after lastITable cache test"

PR eclipse-openj9#22216 introduced a
change in the code generator for x86 to check a few entries from
the iTable if the lastITable cache test fails. While this change
improves the score of some benchmarks (like pmd from DaCapo) it
may regress others (Daytrader8 1%, AcmeAirEE8 0.8%, Liberty startup 2%).

This commit allows the iTable entries check only for compilations
at `hot` or above opt levels.
To allow the iTable entries check at opt levels lower than `hot`
the user needs to use the following Xjit/Xaot command line option:
`enableITableIterationsAfterLastITableCacheCheckAtWarm`
To disable the iTable entries check at all opt levels, the user needs
to use the following Xjit/Xaot option:
`disableITableIterationsAfterLastITableCacheCheck`

Depends on: eclipse-omr/omr#8009

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu mpirvu changed the title For warm optLevels, do not check iTable entries after lastITable cach… Do not check iTable entries after lastITable cache test at warm Oct 30, 2025
@mpirvu mpirvu force-pushed the jitserver-cpuimprov branch from 8cbc7a9 to afaad94 Compare October 30, 2025 21:52
@mpirvu
Copy link
Contributor Author

mpirvu commented Oct 30, 2025

I reduced the length of the PR/commit title.

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 30, 2025

Jenkins test sanity xlinux,win,zlinux jdk21

@0xdaryl 0xdaryl self-assigned this Oct 31, 2025
static bool disableITableIterationsAfterLastITableCacheCheck = feGetEnv("TR_DisableITableIterationsAfterLastITableCacheCheck") != NULL;

if (disableITableIterationsAfterLastITableCacheCheck)
if (comp->getOption(TR_DisableITableIterationsAfterLastITableCacheCheck))
Copy link
Contributor

Choose a reason for hiding this comment

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

My apologies, I should have asked this earlier. Is throttling this optimization for the warm opt level applicable to Z as well?

@mpirvu
Copy link
Contributor Author

mpirvu commented Oct 31, 2025

My apologies, I should have asked this earlier. Is throttling this optimization for the warm opt level applicable to Z as well?

No, it does not apply on Z. Experiments need to be performed on that platform before taking a decision.

@0xdaryl 0xdaryl merged commit 3a88c81 into eclipse-openj9:master Oct 31, 2025
12 checks passed
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.

5 participants