• Krunal Bauskar's avatar
    MDEV-22544: Inconsistent and Incorrect rw-lock stats · dcb0bd59
    Krunal Bauskar authored
    - There are multiple inconsistency and incorrect way in which rw-lock
      stats are calculated.
    
    - shared rw-lock stats:
      "rounds" counter is incremented only once for N rounds done
      in spin-cycle.
    
    - all rw-lock stats:
      If the spin-cycle is short-circuited then attempts are re-counted.
      [If spin-cycle is interrupted, before it completes
       srv_n_spin_wait_rounds (default 30) rounds, spin_count is incremented
       to consider this. If thread resumes spin-cycle (due to unavailability
       of the locks) and is again interrupted or completed, spin_count
       is again incremented with the total count, failing to adjust the
       previous attempt increment].
    
    - s/x rw-lock stats:
      spin_loop counter is not incremented at-all instead it is projected
      as 0 (in show engine output) and division to calculate spin-round per
      spin-loop is adjusted.
      As per the original semantics spin_loop counter should be incremented
      once per spin_loop execution.
    
    - sx rw-lock stats:
      sx locks increments spin_loop counter but instead of incrementing it
      once for a spin_loop invocation it does it multiple times based on how
      many time spin_loop flow is repeated for same instance post os-wait.
    dcb0bd59
sync0rw.cc 33 KB