kernel - Refactor smp collision statistics

Operating Systems / DragonFlyBSD - Matthew Dillon [apollo.backplane.com] - 16 October 2017 14:30 EDT

- Add an indefinite wait timing API (sys/indefinite.h, sys/indefinite2.h). This interface uses the TSC and will record lock latencies to our pcpu stats in microseconds. The systat -pv 1 display shows this under smpcoll.

Note that latencies generated by tokens, lockmgr, and mutex locks do not necessarily reflect actual lost cpu time as the kernel will schedule other threads while those are blocked, if other threads are available.

- Formalize TSC operations more, supply a type (tsc_uclock_t and tsc_sclock_t).

- Reinstrument lockmgr, mutex, token, and spinlocks to use the new indefinite timing interface.

5b49787 kernel - Refactor smp collision statistics
sys/cpu/x86_64/include/cpufunc.h | 9 +-
sys/kern/kern_clock.c | 4 +-
sys/kern/kern_lock.c | 58 ++++++-----
sys/kern/kern_mutex.c | 22 +++--
sys/kern/kern_spinlock.c | 96 +++---------------
sys/kern/lwkt_thread.c | 10 +-
sys/kern/lwkt_token.c | 17 +++-
sys/net/altq/altq_subr.c | 2 +-
sys/platform/pc64/apic/lapic.c | 6 +-
sys/platform/pc64/include/clock.h | 6 +-
sys/platform/pc64/isa/clock.c | 23 +++--
sys/platform/pc64/x86_64/mp_machdep.c | 4 +-
sys/platform/pc64/x86_64/pmap_inval.c | 6 +-
sys/platform/pc64/x86_64/trap.c | 2 +-
sys/platform/vkernel64/include/clock.h | 6 +-
sys/platform/vkernel64/platform/init.c | 5 +-
sys/sys/buf2.h | 2 +-
sys/sys/indefinite.h | 56 +++++++++++
sys/sys/indefinite2.h | 172 +++++++++++++++++++++++++++++++++
sys/sys/lock.h | 3 +-
sys/sys/microtime_pcpu.h | 5 +-
sys/sys/mutex.h | 7 +-
sys/sys/mutex2.h | 12 +++
sys/sys/thread.h | 4 +
sys/sys/time.h | 4 +-
sys/vfs/nfs/nfs_vfsops.c | 4 +-
26 files changed, 386 insertions(+), 159 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share