From owner-svn-src-projects@FreeBSD.ORG Mon Dec 17 10:23:23 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0611A67F; Mon, 17 Dec 2012 10:23:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF4A68FC15; Mon, 17 Dec 2012 10:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBHANMku067685; Mon, 17 Dec 2012 10:23:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBHANMhq067683; Mon, 17 Dec 2012 10:23:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212171023.qBHANMhq067683@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Dec 2012 10:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244349 - projects/calloutng/sys/kern X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2012 10:23:23 -0000 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;