Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 2015 22:26:03 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285706 - head/sys/kern
Message-ID:  <201507192226.t6JMQ3ZR006228@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sun Jul 19 22:26:02 2015
New Revision: 285706
URL: https://svnweb.freebsd.org/changeset/base/285706

Log:
  Don't increment the spin count until after the first attempt to acquire a
  rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire
  spuriously.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_rwlock.c

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c	Sun Jul 19 22:25:16 2015	(r285705)
+++ head/sys/kern/kern_rwlock.c	Sun Jul 19 22:26:02 2015	(r285706)
@@ -382,9 +382,6 @@ __rw_rlock(volatile uintptr_t *c, const 
 	state = rw->rw_lock;
 #endif
 	for (;;) {
-#ifdef KDTRACE_HOOKS
-		spin_cnt++;
-#endif
 		/*
 		 * Handle the easy case.  If no other thread has a write
 		 * lock, then try to bump up the count of read locks.  Note
@@ -413,6 +410,9 @@ __rw_rlock(volatile uintptr_t *c, const 
 			}
 			continue;
 		}
+#ifdef KDTRACE_HOOKS
+		spin_cnt++;
+#endif
 #ifdef HWPMC_HOOKS
 		PMC_SOFT_CALL( , , lock, failed);
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507192226.t6JMQ3ZR006228>