On Mon, 23 Dec 2024 07:58:32 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:
>> I don't think this should ever get called during bootstrapping because >> thread stacks are only accounted lazily when a snapshot is created. I don't >> think an NMT snapshot would ever get created during bootstrapping, but just >> in case, I've added a check for `MemTracker::is_bootstrapping_done()`. > >> I don't think this should ever get called during bootstrapping because >> thread stacks are only accounted lazily when a snapshot is created. I don't >> think an NMT snapshot would ever get created during bootstrapping, but just >> in case, I've added a check for `MemTracker::is_bootstrapping_done()`. > > > It could be called as part of the NMT report error reporting during early JVM > initialization => between NMT bootstrap and Mutex system startup. That report > is only written though if NMT is enabled, and that requires NMT to have been > bootstrapped. Is NMT bootstrap after Mutex system bootstrap? Then we are fine > here. > > Man, I start warming up to your original idea of just using a plain OS-side > mutex for NMT lockes, @roberttoyonaga . One that always works. Problem is > missing deadlock detection. `MemTracker::initialize();` is called before Mutexes are ready. So it seems like that means this `assert_lock_strong` can be called before Mutexes can be used. So we do need that check for `MemTracker::is_bootstrapping_done()`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22745#discussion_r1895808205