RFR: 8284578: Relax InterpreterCodelet stub alignment

Dean Long dlong at openjdk.java.net
Mon Apr 11 22:59:44 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`
>  - [ ] Linux x86_64 fastdebug `tier2`
>  - [ ] Linux x86_64 fastdebug `tier3`

Does your change make this recent change obsolete, or is it still needed?

https://github.com/openjdk/jdk/blob/026b85303c01326bc49a1105a89853d7641fcd50/src/hotspot/share/interpreter/templateInterpreter.cpp#L53

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

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


More information about the hotspot-dev mailing list