A couple of benchmarks got obvious performance loss about 5~6% with changeset 55956, the problem was initially reproduced at Ampere eMAG aarch64 system, later on the similar loss can be seen on a x86 system as well.
https://bugs.openjdk.java.net/browse/JDK-8225670
https://hg.openjdk.java.net/jdk/jdk/rev/155b084cf384
On the aarch64 system, a few GC logs showed "Promotion failed" and 1-2 ~50s long pauses, which is very abnormal. A simple and straight-forward change is made as an experiment below, limiting the clear_row(row) with the (k!=NULL) condition, so the profiled data without a valid receiver stored in the original ReceiverTypeData would not be destroyed accidentally. In this way, the performance can be recovered (please note this is not a fix).
src/hotspot/share/ci/ciMethodData.cpp
if (k != NULL && k->is_loader_alive()) {
ciKlass* klass = CURRENT_ENV->get_klass(k);
set_receiver(row, klass);
} else {
// With concurrent class unloading, the MDO could have stale metadata; override it
+ if (k != NULL)
clear_row(row);
Another experiment is, setting -XX:TypeProfileWidth=0 could help confirm the issue can be related with this function, since the performance diffs are gone if we did so.
https://bugs.openjdk.java.net/browse/JDK-8225670
https://hg.openjdk.java.net/jdk/jdk/rev/155b084cf384
On the aarch64 system, a few GC logs showed "Promotion failed" and 1-2 ~50s long pauses, which is very abnormal. A simple and straight-forward change is made as an experiment below, limiting the clear_row(row) with the (k!=NULL) condition, so the profiled data without a valid receiver stored in the original ReceiverTypeData would not be destroyed accidentally. In this way, the performance can be recovered (please note this is not a fix).
src/hotspot/share/ci/ciMethodData.cpp
if (k != NULL && k->is_loader_alive()) {
ciKlass* klass = CURRENT_ENV->get_klass(k);
set_receiver(row, klass);
} else {
// With concurrent class unloading, the MDO could have stale metadata; override it
+ if (k != NULL)
clear_row(row);
Another experiment is, setting -XX:TypeProfileWidth=0 could help confirm the issue can be related with this function, since the performance diffs are gone if we did so.
- duplicates
-
JDK-8230020 [BACKOUT] compiler/types/correctness/* tests fail with "assert(recv == __null || recv->is_klass()) failed: wrong type"
-
- Resolved
-
- relates to
-
JDK-8225670 compiler/types/correctness/* tests fail with "assert(recv == __null || recv->is_klass()) failed: wrong type"
-
- Closed
-