RFR: 8343789: Move mutable nmethod data out of CodeCache [v8]
Boris Ulasevich
bulasevich at openjdk.org
Wed Jan 15 10:27:19 UTC 2025
> This change relocates mutable data (such as relocations, oops, and metadata) from the nmethod. The change follows the recent PR #18984, which relocated immutable nmethod data from the CodeCache.
>
> The core idea remains the same: use the CodeCache for executable code while moving additional data to the C heap. The primary motivations are improving security and enhancing code density.
>
> Although performance is not the main focus, testing on AArch64 CPUs, where code density plays a significant role, has shown a 1–2% performance improvement in specific scenarios, such as the CodeCacheStress test and the Renaissance Dotty benchmark.
>
> The numbers. Immutable data constitutes **~30%** on the nmehtod. Mutable data constitutes **~8%** of nmethod. Example (statistics collected on the CodeCacheStress benchmark):
> - nmethod_count:134000, total_compilation_time: 510460ms
> - total allocation time malloc_mutable/malloc_immutable/CodeCache_alloc: 62ms/114ms/6333ms,
> - total allocation size (mutable/immutable/nmentod): 64MB/192MB/488MB
>
> Functional testing: jtreg on arm/aarch/x86.
> Performance testing: renaissance/dacapo/SPECjvm2008 benchmarks.
>
> Alternative solution (see comments): In the future, relocations can be moved to _immutable_data.
Boris Ulasevich has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
Fixing TestFindInstMemRecursion test fail with XX:+StressReflectiveCode option:
_relocation_size can exceed 64Kb, in this case _metadata_offset do not fit into int16.
Fix: use _oops_size int16 field to calculate metadata offset
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/21276/files
- new: https://git.openjdk.org/jdk/pull/21276/files/2ee31cac..40fa9603
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=21276&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=21276&range=06-07
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/21276.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21276/head:pull/21276
PR: https://git.openjdk.org/jdk/pull/21276
More information about the hotspot-compiler-dev
mailing list