RFR: 8284578: Relax InterpreterCodelet stub alignment [v2]
Aleksey Shipilev
shade at openjdk.java.net
Wed Apr 13 09:15:14 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`
> - [x] Linux x86_64 fastdebug `tier2`
> - [x] Linux x86_64 fastdebug `tier3`
Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Relax slack space a bit
- Merge branch 'master' into JDK-8284578-intcodelet-align
- Initial implementation
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8159/files
- new: https://git.openjdk.java.net/jdk/pull/8159/files/952d52b4..3a42e573
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8159&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8159&range=00-01
Stats: 141369 lines in 1378 files changed: 100670 ins; 6900 del; 33799 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