RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]

Mat Carter macarte at openjdk.org
Fri Nov 21 19:12:25 UTC 2025


On Tue, 28 Oct 2025 16:57:43 GMT, Mat Carter <macarte at openjdk.org> wrote:

>> src/hotspot/share/cds/aotMetaspace.cpp line 963:
>> 
>>> 961: bool AOTMetaspace::is_recording_preimage_static_archive() {
>>> 962:   if (CDSConfig::is_dumping_preimage_static_archive()) {
>>> 963:       return _preimage_static_archive_dumped == 0;
>> 
>> Do we need to use an acquiring load here? i.e. can the read here and the cmpxchg below happen in different threads?
>> n.b. I'm not just thinking about the behaviour when this patch makes the DCmd available but also what happens when we supplement it with the MXBean interface to end recordings.
>
> I think it's okay, as ending the recording is controlled by the cmpxchg, even if two threads think the recording is still going on, only one call to end the recording will work, and if the threads both check whether the recording has completed they will both see that it has (regardless of which thread 'won')

Andrew I'm going to add the AtomicAccess::load_acquire, or would AtomicAccess::load be enough

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2550719327


More information about the serviceability-dev mailing list