aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lock.h
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2008-08-13 18:24:22 +0000
committerAttilio Rao <attilio@FreeBSD.org>2008-08-13 18:24:22 +0000
commit3d06b4b3304c3b402b46d2401bf774853d019fab (patch)
treeb4ece0856763de28567b799429bb98b056903ff3 /sys/sys/lock.h
parent8fced8fcdf6f98bacd4225b0f21441d5b095a9bf (diff)
downloadsrc-3d06b4b3304c3b402b46d2401bf774853d019fab.tar.gz
src-3d06b4b3304c3b402b46d2401bf774853d019fab.zip
Introduce some WITNESS improvements:
- Speedup the lock orderings lookup modifying the witness graph from a linked tree to a matrix. A table lookup caches the lock orderings in order to make a O(1) access for them. Any witness object has an unique index withing this lookup cache table. - Reduce the lock contention on w_mtx acquiring it only when the LOR actually happens and not in a sane case. In order to do this don't totally flush lock lists (per-CPU spinlocks list and per-thread sleeplocks list) but check for ll_count anytime we need to have to verify allocations sanity. - Introduce the function witness_thread_exit() in the witness namespace which should verify a thread doesn't hold any witness occurrence why exiting. - Rename the sysctl debug.witness.graphs into debug.witness.fullgraph and add debug.witness.badstacks which prints out stacks for LOR revealed. This is implemented using the stack(9) support, which makes WITNESS to be dependent by the STACK option or by the DDB (including STACK) option. - Fix style(9) for src/sys/kern/subr_witness.c The hash table approach has been developed by Ilya Maykov on the behalf of Isilon Systems which kindly released the patch. Jeff Roberson, ported the patch to -CURRENT and fixed w_mtx contention, on the behalf of Nokia. Submitted by: Ilya Maykov <ivmaykov at gmail dot com> (Isilon Systems), jeff Sponsored by: Nokia
Notes
Notes: svn path=/head/; revision=181695
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r--sys/sys/lock.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 2bde0879bd9f..b10cc23a1dad 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -216,6 +216,7 @@ void witness_assert(struct lock_object *, int, const char *, int);
void witness_display_spinlock(struct lock_object *, struct thread *);
int witness_line(struct lock_object *);
const char *witness_file(struct lock_object *);
+void witness_thread_exit(struct thread *);
#ifdef WITNESS