svn commit: r259509 - head/sys/kern

Attilio Rao attilio at FreeBSD.org
Tue Dec 17 13:37:02 UTC 2013


Author: attilio
Date: Tue Dec 17 13:37:02 2013
New Revision: 259509
URL: http://svnweb.freebsd.org/changeset/base/259509

Log:
  - Assert for not leaking readers rw locks counter on userland return.
  - Use a correct spin_cnt for KDTRACE_HOOK case in rw read lock.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  head/sys/kern/kern_rwlock.c
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c	Tue Dec 17 13:18:41 2013	(r259508)
+++ head/sys/kern/kern_rwlock.c	Tue Dec 17 13:37:02 2013	(r259509)
@@ -440,6 +440,9 @@ __rw_rlock(volatile uintptr_t *c, const 
 					break;
 				cpu_spinwait();
 			}
+#ifdef KDTRACE_HOOKS
+			spin_cnt += rowner_loops - i;
+#endif
 			if (i != rowner_loops)
 				continue;
 		}

Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c	Tue Dec 17 13:18:41 2013	(r259508)
+++ head/sys/kern/subr_trap.c	Tue Dec 17 13:37:02 2013	(r259509)
@@ -152,6 +152,9 @@ userret(struct thread *td, struct trapfr
 	    ("userret: Returning in a critical section"));
 	KASSERT(td->td_locks == 0,
 	    ("userret: Returning with %d locks held", td->td_locks));
+	KASSERT(td->td_rw_rlocks == 0,
+	    ("userret: Returning with %d rwlocks held in read mode",
+	    td->td_rw_rlocks));
 	KASSERT((td->td_pflags & TDP_NOFAULTING) == 0,
 	    ("userret: Returning with pagefaults disabled"));
 	KASSERT(td->td_no_sleeping == 0,


More information about the svn-src-all mailing list