RFR: 8344363: FullGCForwarding::initialize_flags is called after ObjLayout::initialize [v3]
Roman Kennke
rkennke at openjdk.org
Thu Nov 21 11:15:55 UTC 2024
> From the bug description:
> ObjLayout::initialize() is called in Arguments::parse(const JavaVMInitArgs*) which sets ObjLayout::_klass_mode. FullGCForwarding::initialize_flags(size_t) is called in init_globals() which seems to be later in the Threads::create_vm(JavaVMInitArgs*, bool*) routine. The latter, however, can unset the UseCompactObjectHeaders flag, which leads to a potential mismatch with ObjLayout::_klass_mode, firing the asserts in ObjLayout::klass_mode().
>
> There is also a related (and somewhat minor) problem: In Arguments::parse() we enable a bunch of stuff when UseCompactObjectHeaders is on (LW locking, but that's the default anyway, and object-monitor-tables, which are otherwise off), but then may disable UseCompactObjectHeaders, e.g. in the GC or when -UseCompressedClassPointers is requested. This then leaves the odd situation that we run without compact headers, but have object monitor tables turned on.
>
> The fix to both issues is:
> - First disable UCOH
> - and do that in apply_ergo() (e.g. GCs should do it in GCArguments::initialize())
> - then enable any flags required by compact headers
> - Initialize ObjLayout after all flags are done (it's in the correct place, already)
>
> Testing:
> - [x] tier1 -UCOH (default)
> - [ ] tier1 +UCOH
> - [x] Manual testing several flag combinations
Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
Rename setup_compact_headers
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/22255/files
- new: https://git.openjdk.org/jdk/pull/22255/files/6f8b5adf..a42d4900
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=22255&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=22255&range=01-02
Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/22255.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22255/head:pull/22255
PR: https://git.openjdk.org/jdk/pull/22255
More information about the shenandoah-dev
mailing list