svn commit: r296529 - vendor-sys/illumos/dist/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Tue Mar 8 18:16:51 UTC 2016


Author: mav
Date: Tue Mar  8 18:16:50 2016
New Revision: 296529
URL: https://svnweb.freebsd.org/changeset/base/296529

Log:
  6672 arc_reclaim_thread() should use gethrtime() instead of ddi_get_lbolt()
  6673 want a macro to convert seconds to nanoseconds and vice-versa
  
  Reviewed by: Matthew Ahrens <mahrens at delphix.com>
  Reviewed by: Prakash Surya <prakash.surya at delphix.com>
  Reviewed by: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
  Reviewed by: Robert Mustacchi <rm at joyent.com>
  Approved by: Dan McDonald <danmcd at omniti.com>
  Author: Eli Rosenthal <eli.rosenthal at delphix.com>
  
  illumos/illumos-gate at a8f6344fa0921599e1f4511e41b5f9a25c38c0f9

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c	Tue Mar  8 18:11:38 2016	(r296528)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c	Tue Mar  8 18:16:50 2016	(r296529)
@@ -3352,7 +3352,7 @@ arc_kmem_reap_now(void)
 static void
 arc_reclaim_thread(void)
 {
-	clock_t			growtime = 0;
+	hrtime_t		growtime = 0;
 	callb_cpr_t		cpr;
 
 	CALLB_CPR_INIT(&cpr, &arc_reclaim_lock, callb_generic_cpr, FTAG);
@@ -3373,7 +3373,7 @@ arc_reclaim_thread(void)
 			 * Wait at least zfs_grow_retry (default 60) seconds
 			 * before considering growing.
 			 */
-			growtime = ddi_get_lbolt() + (arc_grow_retry * hz);
+			growtime = gethrtime() + SEC2NSEC(arc_grow_retry);
 
 			arc_kmem_reap_now();
 
@@ -3393,7 +3393,7 @@ arc_reclaim_thread(void)
 			}
 		} else if (free_memory < arc_c >> arc_no_grow_shift) {
 			arc_no_grow = B_TRUE;
-		} else if (ddi_get_lbolt() >= growtime) {
+		} else if (gethrtime() >= growtime) {
 			arc_no_grow = B_FALSE;
 		}
 
@@ -3424,8 +3424,8 @@ arc_reclaim_thread(void)
 			 * even if we aren't being signalled)
 			 */
 			CALLB_CPR_SAFE_BEGIN(&cpr);
-			(void) cv_timedwait(&arc_reclaim_thread_cv,
-			    &arc_reclaim_lock, ddi_get_lbolt() + hz);
+			(void) cv_timedwait_hires(&arc_reclaim_thread_cv,
+			    &arc_reclaim_lock, SEC2NSEC(1), MSEC2NSEC(1), 0);
 			CALLB_CPR_SAFE_END(&cpr, &arc_reclaim_lock);
 		}
 	}


More information about the svn-src-all mailing list