RFR: 8365407: Race condition in MethodTrainingData::verify() [v4]
Vladimir Kozlov
kvn at openjdk.org
Thu Aug 21 17:02:55 UTC 2025
On Thu, 21 Aug 2025 03:00:11 GMT, Igor Veresov <iveresov at openjdk.org> wrote:
>> This change fixes multiple issue with training data verification. While the current state of things in the mainline will not cause any issues (because of the absence of the call to `TD::verify()` during the shutdown) it does problems in the leyden repo. This change strengthens verification in the mainline (by adding the shutdown verify call), and fixes the problems that prevent it from working reliably.
>
> Igor Veresov has updated the pull request incrementally with one additional commit since the last revision:
>
> More cleanup
src/hotspot/share/compiler/compilationPolicy.cpp line 143:
> 141: void CompilationPolicy::wait_replay_training_at_init(JavaThread* THREAD) {
> 142: MonitorLocker locker(THREAD, TrainingReplayQueue_lock);
> 143: while (!_training_replay_queue.is_empty_unlocked() || _training_replay_queue.is_processing_unlocked()) {
Is this queue used in all phases?
src/hotspot/share/oops/trainingData.cpp line 86:
> 84:
> 85: void TrainingData::verify() {
> 86: if (TrainingData::have_data() && !TrainingData::assembling_data()) {
Why assembly phase excluded?
src/hotspot/share/oops/trainingData.cpp line 105:
> 103: });
> 104: }
> 105: if (TrainingData::need_data()) {
I assume this is "training" run. Right?
src/hotspot/share/oops/trainingData.cpp line 113:
> 111: } else if (td->is_MethodTrainingData()) {
> 112: MethodTrainingData* mtd = td->as_MethodTrainingData();
> 113: mtd->verify(false);
Why it is `false` here? Comment please.
src/hotspot/share/runtime/java.cpp line 522:
> 520: if (AOTVerifyTrainingData) {
> 521: EXCEPTION_MARK;
> 522: CompilationPolicy::wait_replay_training_at_init(THREAD);
It is called on VM exit but name is `_at_init`. May be drop that from name.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2291649772
PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2291646234
PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2291647689
PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2291642776
PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2291620321
More information about the hotspot-dev
mailing list