[master] Integrated: Prepare for smaller-than-22-bit class pointers
Thomas Stuefe
stuefe at openjdk.org
Wed Jun 19 08:22:37 UTC 2024
On Sat, 27 Apr 2024 07:43:22 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> This PR prepares using arbitrary klass pointer sizes (e.g. 16). It cleans up a few places and corrects comments.
>
> The changes in detail:
>
> - exposes a new function `CompressedKlassPointers::max_encoding_range_size()` that returns the maximum possible size of the encoding range given the current nKlass geometry (e.g. 16 bit klass pointers with a max. shift of 10 bits can encode 64MB of class space).
>
> - In Metaspace::ergo_initialize(), where we ergo-adjust the CompressedClassSpaceSize, the maximum possible encoding range size flows into this adjustment now. We also print clearer warnings in case the user specifies CCS size explicitly, and we override that decision.
>
> - removed any hard-wiredness of a "max class space size/encoding range size of 4GB" since with smaller geometries that does not hold true anymore. Instead, we now use `CompressedKlassPointers::max_encoding_range_size()`.
>
> - made the requirements on klass_alignment_in_bytes clearer when setting up class space
>
> - removed remnant code (TinyClassPointerShift) left over from development
>
>
> Note: One still unsolved problem—unsolved in Lilliput as well as upstream—is to correctly limit the compressed class space size in the presence of CDS. Upstream "solves" this by capping CCS size at 3GB, which leaves 1GB for CDS archives. There is no solution if CDS would ever exceed this limit, and it's a waste of space for CCS.
>
> In Lilliput, if we limit the class pointer size such that we drastically reduce the klass encoding range size, we need to be better at splitting that klass encoding range between CDS and class space. For example, we could map CDS and then use the remaining space completely for class space. But that would require more serious reshuffling for initialization code, and CDS setup is horrendously complex.
>
> For this patch, if one wants to reduce class pointer size, one may have to disable CDS to run.
>
> Tested: Mac m1, fastdebug, with 32, 22 and 16 bit class pointers. GHAs in process.
This pull request has now been integrated.
Changeset: 3875ec2b
Author: Thomas Stuefe <stuefe at openjdk.org>
URL: https://git.openjdk.org/lilliput/commit/3875ec2b51fc3c74451ad11287e76070cdbfc31d
Stats: 91 lines in 4 files changed: 46 ins; 26 del; 19 mod
Prepare for smaller-than-22-bit class pointers
Reviewed-by: rkennke
-------------
PR: https://git.openjdk.org/lilliput/pull/172
More information about the lilliput-dev
mailing list