From owner-svn-src-projects@FreeBSD.ORG Sun Nov 11 06:30:01 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 CFF9036B; Sun, 11 Nov 2012 06:30:01 +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 B72338FC13; Sun, 11 Nov 2012 06:30:01 +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 qAB6TxDm015523; Sun, 11 Nov 2012 06:29:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAB6Txoq015521; Sun, 11 Nov 2012 06:29:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211110629.qAB6Txoq015521@svn.freebsd.org> From: Alexander Motin Date: Sun, 11 Nov 2012 06:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r242886 - in projects/calloutng: share/man/man9 sys/sys 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: Sun, 11 Nov 2012 06:30:01 -0000 Author: mav Date: Sun Nov 11 06:29:59 2012 New Revision: 242886 URL: http://svnweb.freebsd.org/changeset/base/242886 Log: - Rename macro C_T2PREC() to C_US2PREC() to be more specific. - Add macro C_BT2PREC() to specify precision in form of bintime, that should be useful for relative precisions. - Document both macros. Modified: projects/calloutng/share/man/man9/timeout.9 projects/calloutng/sys/sys/callout.h Modified: projects/calloutng/share/man/man9/timeout.9 ============================================================================== --- projects/calloutng/share/man/man9/timeout.9 Sun Nov 11 04:07:10 2012 (r242885) +++ projects/calloutng/share/man/man9/timeout.9 Sun Nov 11 06:29:59 2012 (r242886) @@ -349,6 +349,18 @@ Run handler directly from hardware inter It is faster, but puts more constraints on handlers. Handlers may use only spin mutexes for locking, and they must be fast because they run with absolute priority. +.It Fn C_US2PREC +Specifies acceptable deviation between requested and factual run time in +microseconds. +Bigger value allows to aggregate more events in one timer interrupt to +reduce processing overhead and power consumption. +.It Fn C_BT2PREC +Alike to +.Fn C_US2PREC , +but allows to specify deviation as 64bit fraction of second same as +.Fa frac +field in +.Ft struct bintime . .El .Pp The function Modified: projects/calloutng/sys/sys/callout.h ============================================================================== --- projects/calloutng/sys/sys/callout.h Sun Nov 11 04:07:10 2012 (r242885) +++ projects/calloutng/sys/sys/callout.h Sun Nov 11 06:29:59 2012 (r242886) @@ -52,17 +52,18 @@ #define C_DIRECT_EXEC 0x0001 /* direct execution of callout */ #define C_PRECISIONBITS 24 -#define C_PRECISIONRANGE ((1 << C_PRECISIONBITS) - 1) +#define C_PRECISIONRANGE ((1 << C_PRECISIONBITS) - 1) #define C_PRECISIONMASK (1 << ((32 - C_PRECISIONBITS) - 1)) -#define C_T2PREC(x) (((x) * 4294) & C_PRECISIONMASK) +#define C_US2PREC(x) (((x) * 4294) & C_PRECISIONMASK) +#define C_BT2PREC(x) (((x) >> 32) & C_PRECISIONMASK) #define C_PREC2BT(x) ((uint64_t)(flags & C_PRECISIONMASK) << 32) /* * Common values specified for precision. */ -#define C_P1MS C_T2PREC(1000) -#define C_P10MS C_T2PREC(10000) -#define C_P100MS C_T2PREC(100000) +#define C_P1MS C_US2PREC(1000) +#define C_P10MS C_US2PREC(10000) +#define C_P100MS C_US2PREC(100000) struct callout_handle { struct callout *callout;