Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jun 2012 13:04:51 +0000 (UTC)
From:      Davide Italiano <davide@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r236449 - projects/calloutng/sys/kern
Message-ID:  <201206021304.q52D4p2X090537@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davide
Date: Sat Jun  2 13:04:50 2012
New Revision: 236449
URL: http://svn.freebsd.org/changeset/base/236449

Log:
  Replace binuptime() with getbinuptime() because it's suitable for the
  purpose and it's cheaper. Update the relative comment on precision error
  during callwheel scan as well.
  
  Move the exit condition for the wheel scan before the increment of the
  bucket. Before this change, it may happen that the last slot of the wheel
  is not examined.
  
  Pointed out by:		mav

Modified:
  projects/calloutng/sys/kern/kern_timeout.c

Modified: projects/calloutng/sys/kern/kern_timeout.c
==============================================================================
--- projects/calloutng/sys/kern/kern_timeout.c	Sat Jun  2 12:26:14 2012	(r236448)
+++ projects/calloutng/sys/kern/kern_timeout.c	Sat Jun  2 13:04:50 2012	(r236449)
@@ -373,9 +373,9 @@ callout_tick(void)
 	need_softclock = 0;
 	cc = CC_SELF();
 	mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET);
-	binuptime(&now);
+	getbinuptime(&now);
 	/* 
-	 * Get binuptime() may be inaccurate and return time up to 1/HZ in the past. 
+	 * getbinuptime() may be inaccurate and return time up to 1/HZ in the past. 
 	 * In order to avoid the possible loss of one or more events look back 1/HZ
 	 * in the past from the time we last checked.
 	 */	
@@ -405,9 +405,9 @@ callout_tick(void)
 				need_softclock = 1;
 			}	
 		}
-		first = (first + 1) & callwheelmask;
 		if (first == last)
 			break;
+		first = (first + 1) & callwheelmask;
 	}
 	cc->cc_softticks = now;
 	mtx_unlock_spin_flags(&cc->cc_lock, MTX_QUIET);



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