Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2012 10:23:22 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244349 - projects/calloutng/sys/kern
Message-ID:  <201212171023.qBHANMhq067683@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Dec 17 10:23:22 2012
New Revision: 244349
URL: http://svnweb.freebsd.org/changeset/base/244349

Log:
  Update cc_lastscan to now before processing events, not after. This closes
  chance of scheduling into the past if new callout scheduled while we are
  dropping the lock to execute direct callout.

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

Modified: projects/calloutng/sys/kern/kern_timeout.c
==============================================================================
--- projects/calloutng/sys/kern/kern_timeout.c	Mon Dec 17 10:12:12 2012	(r244348)
+++ projects/calloutng/sys/kern/kern_timeout.c	Mon Dec 17 10:23:22 2012	(r244349)
@@ -399,6 +399,7 @@ callout_process(struct bintime *now)
 
 	/* Compute the buckets of the last scan and present times. */
 	firstb = callout_hash(&cc->cc_lastscan);
+	cc->cc_lastscan = *now;
 	nowb = callout_hash(now);
 
 	/* Compute the last bucket and minimum time of the bucket after it. */
@@ -498,7 +499,6 @@ next:
 	if (callout_new_inserted != NULL)
 		(*callout_new_inserted)(curcpu, last, first);
 	cc->cc_firstevent = last;
-	cc->cc_lastscan = *now;
 #ifdef CALLOUT_PROFILING
 	avg_depth_dir += (depth_dir * 1000 - avg_depth_dir) >> 8;
 	avg_mpcalls_dir += (mpcalls_dir * 1000 - avg_mpcalls_dir) >> 8;



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