RFR: 8344032: InterpreterRuntime::verify_mdp() missing lock while printing MethodData on failure
    Aleksey Shipilev 
    shade at openjdk.org
       
    Wed Nov 13 18:38:57 UTC 2024
    
    
  
On Wed, 13 Nov 2024 17:20:48 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> Added locking.  I injected some MethodData printing with logging to test this to verify that there wasn't a lock ranking assert.
> 
> Tested with tier1-4.
src/hotspot/share/oops/methodData.cpp line 1561:
> 1559: 
> 1560: void MethodData::print_data_on(outputStream* st) const {
> 1561:   MutexLocker ml(extra_data_lock(), Mutex::_no_safepoint_check_flag);
Are we sure nothing calls this method when lock is already held? Safer to use `ConditionalMutexLocker` with self-locked check?
src/hotspot/share/oops/methodData.hpp line 2514:
> 2512:   void clean_method_data(bool always_clean);
> 2513:   void clean_weak_method_links();
> 2514:   Mutex* extra_data_lock() const { return const_cast<Mutex*>(&_extra_data_lock); }
Not sure what this const-ness gains us :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22082#discussion_r1840981366
PR Review Comment: https://git.openjdk.org/jdk/pull/22082#discussion_r1840981990
    
    
More information about the hotspot-dev
mailing list