RFR: 8306767: Concurrent repacking of extra data in MethodData is potentially unsafe [v19]

Coleen Phillimore coleenp at openjdk.org
Wed Jan 17 16:33:55 UTC 2024


On Wed, 17 Jan 2024 16:29:34 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Ah ok. Thanks for the hint. I will look into this. It is a bit confusing what the locks do and do not do with SafePoints. Do they just not safepoint when trying to acquire the lock, or also verify that no safepoint is made while holding the lock?
>
> They verify that no safepoints happen while holding the lock.  There's a counter in JavaThread.
> 
> 
> #ifdef ASSERT
>   // Debug support for checking if code allows safepoints or not.
>   // Safepoints in the VM can happen because of allocation, invoking a VM operation, or blocking on
>   // mutex, or blocking on an object synchronizer (Java locking).
>   // If _no_safepoint_count is non-zero, then an assertion failure will happen in any of
>   // the above cases. The class NoSafepointVerifier is used to set this counter.
>   int _no_safepoint_count;                             // If 0, thread allow a safepoint to happen

I guess the comment should be updated to say we increment this when taking out a no-safepoint-check mutex.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16840#discussion_r1456016934


More information about the hotspot-dev mailing list