RFR: 8355296: [leyden] Some methods are stuck at level=0 with -XX:-TieredCompilation
Aleksey Shipilev
shade at openjdk.org
Tue Apr 22 18:20:10 UTC 2025
On Tue, 22 Apr 2025 18:09:38 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Discovered this originally when testing Persistent Profiles PR in Leyden. In short, the transition from level=0 would not go to level=4 ever for some methods, if we disable intermediate levels. I believe this is one the causes for at least some performance artifacts I seen in Leyden testing last week.
>
> There are two bugs:
> 1. In `CompilationPolicy::common`: Trivial/native method shortcut was lost, so trivial methods enter through the normal profiled policy (without a good reason?)
> 2. In `CompilationPolicy::should_create_mdo`: When training data is used we _only_ create MDOs for methods that are referenced in TD. This has a major knock-on effect on _normal_ JIT compilations that want to see MDO invocation/backedge counters. Instead, MDO is missing, so interpreter only increments MCS counters, and then compilation policy misses the transitions.
>
> (1) is really subsumed by (2), so we can really only do (2).
>
> See reproducers and logs in the issue. More performance data in comments.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `runtime/cds`
On persistent profiles PR alone:
Before: 
After: 
For Leyden `premain`, `JavacBenchApp 50`:
# Before
Time (mean ± σ): 545.4 ms ± 3.8 ms [User: 777.4 ms, System: 64.6 ms]
Range (min … max): 538.1 ms … 552.3 ms 30 runs
# After
Time (mean ± σ): 536.5 ms ± 6.0 ms [User: 785.0 ms, System: 64.8 ms]
Range (min … max): 524.6 ms … 547.8 ms 30 runs
-------------
PR Comment: https://git.openjdk.org/leyden/pull/57#issuecomment-2822107505
More information about the leyden-dev
mailing list