RFR: 8291718: Remove mark_for_deoptimization from klass unloading [v7]
Axel Boldt-Christmas
duke at openjdk.org
Mon Aug 8 17:31:31 UTC 2022
> @stefank suggested creating a separate issue for this part of [JDK-8291237](https://bugs.openjdk.org/browse/JDK-8291237)
>
> Description from the original issue:
>> The klass unloading code currently sets the mark for deoptimzation flag on nmethods that depend on the klass being unloaded. That however is all it does, there is no guarantee that those nmethods will become not entrant and make_deoptimized. The current implementation may if some future deoptimization happens to trigger see these marks as it scans the whole code cache, but it is never triggered from klass unloading.
>>
>> Me and [~eosterlund] discussed this and this behaviour seems like some leftover from earlier versions of klass unloading. There should be no reason to eliminate the nmethods that depend on unloaded klasses except to eliminate dead code. It is probably better to let other mechanisms decide if an nmethod with dead code should be deoptimized than the klass unloading.
>>
>> It might be a future improvement to have some stats which record that an nmethod had some dependency to an unloaded klass which might effect the heuristic for selecting what methods are deoptimized.
>
> Testing: Tier 1-7
Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:
- Fix for shenandoah
- Merge remote-tracking branch 'upstream/master' into JDK-8291718
- Extend CodeCache::UnloadingScope to include klass unloading
- Remove double counting _perf_total_buckets_deallocated_count
- Fix indentation
- Revert "Simplify and assert in remove_all_dependents"
This reverts commit 0141b28d3b30745da31e12a4489ac71e14bd18e2.
- Fix indentation
- Simplify and assert in remove_all_dependents
- 8291718: Remove mark_for_deoptimization from klass unloading
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/9713/files
- new: https://git.openjdk.org/jdk/pull/9713/files/019d4d1c..25f33908
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=9713&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=9713&range=05-06
Stats: 3345 lines in 202 files changed: 1904 ins; 1139 del; 302 mod
Patch: https://git.openjdk.org/jdk/pull/9713.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9713/head:pull/9713
PR: https://git.openjdk.org/jdk/pull/9713
More information about the hotspot-dev
mailing list