RFR: 8316694: Implement relocation of nmethod within CodeCache [v7]
Chad Rakoczy
duke at openjdk.org
Wed Jul 16 00:00:57 UTC 2025
On Thu, 8 May 2025 20:25:50 GMT, Chad Rakoczy <duke at openjdk.org> wrote:
> Okay. Speaking of which, seems like the NMethodState_lock is held for way too long - usually just held when setting the Method code and updating the nmethod state after the initial state is set. Keeping the lock across other things makes me worried of deadlocks.
This is an old comment but looking at [JDK-8358821](https://bugs.openjdk.org/browse/JDK-8358821) made me wonder if `NMethodState_lock` actually should be held for the entirety of the relocation. Otherwise the nmethod could be marked not entrant after we perform the `is_in_use()` check. I don't think `CodeCache_lock` and `Compile_lock` are enough to prevent this. What do you think @dean-long @fisk ?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23573#issuecomment-3076155602
More information about the hotspot-compiler-dev
mailing list