HomeFreeBSD

several lockstat improvements

Description

several lockstat improvements

0. For spin events report time spent spinning, not a loop count.
While loop count is much easier and cheaper to obtain it is hard
to reason about the reported numbers, espcially for adaptive locks
where both spinning and sleeping can happen.
So, it's better to compare apples and apples.

  1. Teach lockstat about FreeBSD rw locks.

This is done in part by changing the corresponding probes
and in part by changing what probes lockstat should expect.

  1. Teach lockstat that rw locks are adaptive and can spin on FreeBSD.
  1. Report lock acquisition events for successful rw try-lock operations.
  1. Teach lockstat about FreeBSD sx locks.

Reporting of events for those locks completely mirrors
rw locks.

  1. Report spin and block events before acquisition event.

This is behavior documented for the upstream, so it makes sense to stick
to it. Note that because of FreeBSD adaptive lock implementations
both the spin and block events may be reported for the same acquisition
while the upstream reports only one of them.

Differential Revision: https://reviews.freebsd.org/D2727
Reviewed by: markj
MFC after: 17 days
Relnotes: yes
Sponsored by: ClusterHQ

Details

Provenance
avgAuthored on
Reviewer
markj
Differential Revision
D2727: some lockstat improvements
Parents
rS284296: xen-blk{front/back}: remove broken FreeBSD extensions
Branches
Unknown
Tags
Unknown