Integrated: 8284578: Relax InterpreterCodelet stub alignment

Aleksey Shipilev shade at openjdk.java.net
Thu Apr 14 07:33:12 UTC 2022


On Fri, 8 Apr 2022 11:45:13 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> `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`

This pull request has now been integrated.

Changeset: 2241a057
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/2241a057050ed521cfbfbe8a758353e621dee15f
Stats:     46 lines in 5 files changed: 16 ins; 5 del; 25 mod

8284578: Relax InterpreterCodelet stub alignment

Reviewed-by: kvn, dlong

-------------

PR: https://git.openjdk.java.net/jdk/pull/8159


More information about the hotspot-dev mailing list