RFR: 8284578: Relax InterpreterCodelet stub alignment
Aleksey Shipilev
shade at openjdk.java.net
Fri Apr 8 11:53:21 UTC 2022
`InterpreterCodelet` is aligned by `CodeEntryAlignment` (`CAE`) twice. First, the entire stub is aligned, which aligns its data section. Then, the code section in the stub is aligned. Since `CAE` is usually larger than the size of `InterpreterCodelet`, we are wasting quite a bit of space for each codelet. In the extreme cases, like PPC that defaults to `CAE=128`, we have 16 bytes of codelet data effectively taking 128 bytes!
This can be made better by relaxing the `InterpreterCodelet` stub alignment to `HeapWordSize`, while leaving its code section alignment the same.
This tangentially touches the only other user for `StubQueue`: `ICStub`. Unfortunately, we cannot do the same kind of relaxation there, because there is a reverse lookup function that needs to reach data section from the code section, which forces us to keep the same alignment for both.
Interpreter sizes on Linux x86_64 release:
# Baseline, CEA=32 (default)
code size = 94K bytes
avg codelet size = 356 bytes
# Baseline, CEA=128 (PPC-like)
code size = 133K bytes
avg codelet size = 501 bytes
# Patched, CEA=32 (default)
code size = 89K bytes
avg codelet size = 338 bytes
# Patched, CEA=128 (PPC-like)
code size = 100K bytes
avg codelet size = 380 bytes
Point performance runs (SPECjvm2008:serial with `-Xint` on Linux x86_64 release):
Benchmark Mode Cnt Score Error Units
# Baseline, CEA=32
Serial.test thrpt 9 73.427 ± 0.152 ops/s
# Baseline, CEA=128
Serial.test thrpt 9 70.999 ± 0.246 ops/s
# Patched, CEA=32
Serial.test thrpt 9 73.991 ± 0.860 ops/s
# Patched, CEA=128
Serial.test thrpt 9 72.981 ± 0.301 ops/s
Additional testing:
- [x] Linux x86_64 fastdebug `tier1`
- [ ] Linux x86_64 fastdebug `tier2`
- [ ] Linux x86_64 fastdebug `tier3`
-------------
Commit messages:
- Initial implementation
Changes: https://git.openjdk.java.net/jdk/pull/8159/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8159&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8284578
Stats: 43 lines in 4 files changed: 16 ins; 5 del; 22 mod
Patch: https://git.openjdk.java.net/jdk/pull/8159.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8159/head:pull/8159
PR: https://git.openjdk.java.net/jdk/pull/8159
More information about the hotspot-dev
mailing list