[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-commits-all
Subject:    svn commit: r303584 - head/sys/kern
From:       Mateusz Guzik <mjg () FreeBSD ! org>
Date:       2016-07-31 12:11:55
Message-ID: 201607311211.u6VCBtR8043452 () repo ! freebsd ! org
[Download RAW message or body]

Author: mjg
Date: Sun Jul 31 12:11:55 2016
New Revision: 303584
URL: https://svnweb.freebsd.org/changeset/base/303584

Log:
  locks: change sleep_cnt and spin_cnt types to u_int
  
  Both variables are uint64_t, but they only count spins or sleeps.
  All reasonable values which we can get here comfortably hit in 32-bit range.
  
  Suggested by: kib
  MFC after:	1 week

Modified:
  head/sys/kern/kern_mutex.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Sun Jul 31 11:34:08 2016	(r303583)
+++ head/sys/kern/kern_mutex.c	Sun Jul 31 12:11:55 2016	(r303584)
@@ -409,8 +409,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
 	uint64_t waittime = 0;
 #endif
 #ifdef KDTRACE_HOOKS
-	uint64_t spin_cnt = 0;
-	uint64_t sleep_cnt = 0;
+	u_int spin_cnt = 0;
+	u_int sleep_cnt = 0;
 	int64_t sleep_time = 0;
 	int64_t all_time = 0;
 #endif

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c	Sun Jul 31 11:34:08 2016	(r303583)
+++ head/sys/kern/kern_rwlock.c	Sun Jul 31 12:11:55 2016	(r303584)
@@ -357,8 +357,8 @@ __rw_rlock(volatile uintptr_t *c, const 
 	uintptr_t v;
 #ifdef KDTRACE_HOOKS
 	uintptr_t state;
-	uint64_t spin_cnt = 0;
-	uint64_t sleep_cnt = 0;
+	u_int spin_cnt = 0;
+	u_int sleep_cnt = 0;
 	int64_t sleep_time = 0;
 	int64_t all_time = 0;
 #endif
@@ -742,8 +742,8 @@ __rw_wlock_hard(volatile uintptr_t *c, u
 #endif
 #ifdef KDTRACE_HOOKS
 	uintptr_t state;
-	uint64_t spin_cnt = 0;
-	uint64_t sleep_cnt = 0;
+	u_int spin_cnt = 0;
+	u_int sleep_cnt = 0;
 	int64_t sleep_time = 0;
 	int64_t all_time = 0;
 #endif

Modified: head/sys/kern/kern_sx.c
==============================================================================
--- head/sys/kern/kern_sx.c	Sun Jul 31 11:34:08 2016	(r303583)
+++ head/sys/kern/kern_sx.c	Sun Jul 31 12:11:55 2016	(r303584)
@@ -515,8 +515,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
 	int error = 0;
 #ifdef	KDTRACE_HOOKS
 	uintptr_t state;
-	uint64_t spin_cnt = 0;
-	uint64_t sleep_cnt = 0;
+	u_int spin_cnt = 0;
+	u_int sleep_cnt = 0;
 	int64_t sleep_time = 0;
 	int64_t all_time = 0;
 #endif
@@ -820,8 +820,8 @@ _sx_slock_hard(struct sx *sx, int opts, 
 	int error = 0;
 #ifdef KDTRACE_HOOKS
 	uintptr_t state;
-	uint64_t spin_cnt = 0;
-	uint64_t sleep_cnt = 0;
+	u_int spin_cnt = 0;
+	u_int sleep_cnt = 0;
 	int64_t sleep_time = 0;
 	int64_t all_time = 0;
 #endif
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic