From owner-svn-src-projects@FreeBSD.ORG Sun Jul 1 11:52:53 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 797E4106564A; Sun, 1 Jul 2012 11:52:53 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6BE8FC0A; Sun, 1 Jul 2012 11:52:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q61BqrGk000171; Sun, 1 Jul 2012 11:52:53 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61BqrEq000167; Sun, 1 Jul 2012 11:52:53 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201207011152.q61BqrEq000167@svn.freebsd.org> From: Davide Italiano Date: Sun, 1 Jul 2012 11:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237919 - in projects/calloutng/sys: conf kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 01 Jul 2012 11:52:53 -0000 Author: davide Date: Sun Jul 1 11:52:52 2012 New Revision: 237919 URL: http://svn.freebsd.org/changeset/base/237919 Log: - Take in account aggregation when comparing event times in callout_process() and when we submit events to eventtimers(4). - Fix a bug in the 'steps' variable logic in softclock(). It shouldn't be zeroed every time we extract a new event for processing it from cc_expireq. - Indent string should be there, I wrongly removed it. Reported by: mav [1,2], pluknet [3] Modified: projects/calloutng/sys/conf/NOTES projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/conf/NOTES ============================================================================== --- projects/calloutng/sys/conf/NOTES Sun Jul 1 09:35:15 2012 (r237918) +++ projects/calloutng/sys/conf/NOTES Sun Jul 1 11:52:52 2012 (r237919) @@ -1,4 +1,4 @@ - +# $FreeBSD$ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Sun Jul 1 09:35:15 2012 (r237918) +++ projects/calloutng/sys/kern/kern_timeout.c Sun Jul 1 11:52:52 2012 (r237919) @@ -378,7 +378,9 @@ callout_process(void) for (;;) { sc = &cc->cc_callwheel[first]; TAILQ_FOREACH(tmp, sc, c_links.tqe) { - if (bintime_cmp(&tmp->c_time, &now, <=)) { + next = tmp->c_time; + bintime_sub(&next, &tmp->c_precision); + if (bintime_cmp(&next, &now, <=)) { /* * Consumer told us the callout may be run * directly from hardware interrupt context. @@ -499,6 +501,7 @@ callout_cc_add(struct callout *c, struct struct bintime to_bintime, void (*func)(void *), void *arg, int cpu, int flags) { + struct bintime bt; int bucket, r_shift, r_val; CC_LOCK_ASSERT(cc); @@ -546,10 +549,12 @@ callout_cc_add(struct callout *c, struct c, c_links.tqe); /* * Inform the eventtimers(4) subsystem there's a new callout - * that has been inserted. + * that has been inserted, but only if really required. */ + bt = c->c_time; + bintime_add(&bt, &c->c_precision); if (callout_new_inserted != NULL && - (bintime_cmp(&c->c_time, &cc->cc_firstevent, <) || + (bintime_cmp(&bt, &cc->cc_firstevent, <) || (cc->cc_firstevent.sec == 0 && cc->cc_firstevent.frac == 0))) { cc->cc_firstevent = c->c_time; (*callout_new_inserted)(cpu, c->c_time); @@ -784,7 +789,6 @@ softclock(void *arg) TAILQ_REMOVE(&cc->cc_expireq, c, c_staiter); c = softclock_call_cc(c, cc, &mpcalls, &lockcalls, &gcalls); - steps = 0; } } #ifdef CALLOUT_PROFILING