[DragonFlyBSD - Submit #1699] (Closed) callout(9): introduce callout_reset_{,m}s, similarly to timeout_add_{,m}sec on OpenBSD

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Mon Jan 19 03:48:19 PST 2015

Issue #1699 has been updated by tuxillo.

Tracker changed from Bug to Submit
Description updated
Category set to Kernel
Status changed from New to Closed
Assignee deleted (0)
Target version set to 4.2.x


Moving to submit and rejecting as per Matt's comment.

Antonio Huete

Submit #1699: callout(9): introduce callout_reset_{,m}s, similarly to timeout_add_{,m}sec on OpenBSD

* Author: C++
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: Kernel
* Target version: 4.2.x

It has been suggested that one of the steps towards a proper tickless kernel 
would be the conversion of all the users of the various timeout API 
to the use of the more rounded time units whenever possible, e.g. the 
less precise and more rounded seconds instead of the more precise ticks. [0]  
In the kernel, the most obvious and popular examples of such API 
would be callout(9) and tsleep(9).
Since many current users of these API logically require an ms-based timer, 
and the future granularity of a tick may be subject to change, it also 
makes sense to introduce a millisecond (_ms) version of the API together with 
the second (_s) addition.

It may be noted that OpenBSD already has had similar functions introduced 
sometime in 2008 ([1], [2]): timeout_add_{tv,ts,bt,sec,msec,usec,nsec}.  
Apart from _sec and _msec, the rest have no users (only _usec is used once), 
and in the current environment, the us and ns timeouts would appear to serve 
no purpose other than to mislead and confuse the developer.  
On the other hand, timeout_add_sec is referenced in 142 kernel source files 
in OpenBSD 4.7 as of 2010-03, and timeout_add_msec -- in 79.  
Also, the standard SI abbreviation for second and millisecond 
is s and ms, respectively, not sec and msec.

I think it may actually be reasonable to introduce a decisecond (ds) 
version of the functions (in addition to the second and millisecond), 
since that's what many millisecond-to-be users actually need, and _ds 
would be more tickless-friendly compared to _ms anyways.  
The centisecond (cs) may be considered as a more distant option.  :-)

Please let me know what you think of these additions, and whether 
similar _s and _ms sleep(9) functions should be added as well.  
I'm also interested in the feedback regarding the potential _ds 

Best regards,

[0] http://oss.intel.com/pdfs/maximum_tickless.pdf "Getting maximum mileage out of tickless" (2007)
[1] http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/kern_timeout.c#rev1.27 "timeout_add_{tv,ts,bt,sec,usec,nsec}" (2008-07-11)
[2] http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/kern_timeout.c#rev1.29 "timeout_add_msec" (2008-10-22)

0001-callout-9-introduce-callout_reset_-m-s-similarly-to-.patch (1.98 KB)
0002-callout.9-document-callout_reset_-m-s.patch (1.95 KB)

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

More information about the Submit mailing list