git: kernel - Refactor smp collision statistics
Matthew Dillon
dillon at crater.dragonflybsd.org
Mon Oct 16 11:30:34 PDT 2017
commit 5b49787bf81ce6370fea5dfb5cde2d0dddc5c13b
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Wed Oct 4 21:46:57 2017 -0700
kernel - Refactor smp collision statistics
* 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.
Summary of changes:
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/sched_getcpu.c => sys/sys/indefinite.h | 34 ++--
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, 351 insertions(+), 172 deletions(-)
copy lib/libc/sys/sched_getcpu.c => sys/sys/indefinite.h (79%)
create mode 100644 sys/sys/indefinite2.h
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5b49787bf81ce6370fea5dfb5cde2d0dddc5c13b
--
DragonFly BSD source repository
More information about the Commits
mailing list