From owner-svn-src-projects@FreeBSD.ORG Thu May 28 20:36:38 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4CC296A; Thu, 28 May 2015 20:36:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 937CCC59; Thu, 28 May 2015 20:36:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4SKac4F045508; Thu, 28 May 2015 20:36:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4SKace2045507; Thu, 28 May 2015 20:36:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505282036.t4SKace2045507@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 28 May 2015 20:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r283667 - projects/hps_head/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.20 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: Thu, 28 May 2015 20:36:38 -0000 Author: hselasky Date: Thu May 28 20:36:37 2015 New Revision: 283667 URL: https://svnweb.freebsd.org/changeset/base/283667 Log: Direct callouts must be executed after cpu_new_callout() is called in the callout_process() function. Direct callouts can restart themselves or another callout which also can call cpu_new_callout(). If this happens from the completion callback the computed "cc_firstevent" will be wrong. Modified: projects/hps_head/sys/kern/kern_timeout.c Modified: projects/hps_head/sys/kern/kern_timeout.c ============================================================================== --- projects/hps_head/sys/kern/kern_timeout.c Thu May 28 20:33:28 2015 (r283666) +++ projects/hps_head/sys/kern/kern_timeout.c Thu May 28 20:36:37 2015 (r283667) @@ -632,6 +632,10 @@ callout_process(sbintime_t now) */ } while (((int)(firstb - lastb)) <= 0); + cc->cc_firstevent = last; +#ifndef NO_EVENTTIMERS + cpu_new_callout(curcpu, last, first); +#endif /* * Check for expired direct callouts, if any: */ @@ -639,11 +643,6 @@ callout_process(sbintime_t now) LIST_REMOVE(tmp, c_links.le); softclock_call_cc(tmp, cc, 1); } - - cc->cc_firstevent = last; -#ifndef NO_EVENTTIMERS - cpu_new_callout(curcpu, last, first); -#endif #ifdef CALLOUT_PROFILING callout_update_stats(cc, 1); #endif