RFR: 8344831: [REDO] CDS: Parallel relocation [v4]

Aleksey Shipilev shade at openjdk.org
Fri Nov 29 10:42:40 UTC 2024


On Fri, 29 Nov 2024 02:41:17 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Atomicity improvements
>
> I will run through our CI

Hey again @dholmes-ora, you are the expert in this. @tstuefe's question about Thread lifecycle made me realize we also need to properly delete the started threads. But I am confused about the native thread lifecycle.

It looks like we are disallowed to delete threads (looks to be part of [JDK-8154715](https://bugs.openjdk.org/browse/JDK-8154715)) asynchronously. Fine, I think we can do it like `JfrThreadSampler` does it:
https://github.com/openjdk/jdk/blob/095e769f47682efe4e34bb46c0da2c5a2e283a7f/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp#L571-L574

...but that immediately runs into assert in `os::free_thread`, because we have already cleared `Thread::current` here:
https://github.com/openjdk/jdk/blob/095e769f47682efe4e34bb46c0da2c5a2e283a7f/src/hotspot/share/runtime/nonJavaThread.cpp#L119

I got it working with a hack in `os::free_thread` (see commits), but I am not at all sure this is correct. I am also puzzled how `JfrThreadSampler` does not run into the same trap; I suspect because it actually never gets to its own `post_run`?

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

PR Comment: https://git.openjdk.org/jdk/pull/22369#issuecomment-2507538336


More information about the hotspot-runtime-dev mailing list