diff options
author | davide <davide@FreeBSD.org> | 2013-03-04 11:09:56 +0000 |
---|---|---|
committer | davide <davide@FreeBSD.org> | 2013-03-04 11:09:56 +0000 |
commit | 431035cf16837066ffdc5abc7e48a56cc1dfed5d (patch) | |
tree | 0c872a90fed688dcf8a42c76624fcacd6e02d513 /sys/sys/_callout.h | |
parent | e52f997818951d22a197789d4aa9c32ab77ab70a (diff) | |
download | FreeBSD-src-431035cf16837066ffdc5abc7e48a56cc1dfed5d.zip FreeBSD-src-431035cf16837066ffdc5abc7e48a56cc1dfed5d.tar.gz |
- Make callout(9) tickless, relying on eventtimers(4) as backend for
precise time event generation. This greatly improves granularity of
callouts which are not anymore constrained to wait next tick to be
scheduled.
- Extend the callout KPI introducing a set of callout_reset_sbt* functions,
which take a sbintime_t as timeout argument. The new KPI also offers a
way for consumers to specify precision tolerance they allow, so that
callout can coalesce events and reduce number of interrupts as well as
potentially avoid scheduling a SWI thread.
- Introduce support for dispatching callouts directly from hardware
interrupt context, specifying an additional flag. This feature should be
used carefully, as long as interrupt context has some limitations
(e.g. no sleeping locks can be held).
- Enhance mechanisms to gather informations about callwheel, introducing
a new sysctl to obtain stats.
This change breaks the KBI. struct callout fields has been changed, in
particular 'int ticks' (4 bytes) has been replaced with 'sbintime_t'
(8 bytes) and another 'sbintime_t' field was added for precision.
Together with: mav
Reviewed by: attilio, bde, luigi, phk
Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo (amd64, sparc64), marius (sparc64), ian (arm),
markj (amd64), mav, Fabian Keil
Diffstat (limited to 'sys/sys/_callout.h')
-rw-r--r-- | sys/sys/_callout.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/_callout.h b/sys/sys/_callout.h index b8c3ce9..e186aec 100644 --- a/sys/sys/_callout.h +++ b/sys/sys/_callout.h @@ -42,15 +42,18 @@ struct lock_object; -SLIST_HEAD(callout_list, callout); +LIST_HEAD(callout_list, callout); +SLIST_HEAD(callout_slist, callout); TAILQ_HEAD(callout_tailq, callout); struct callout { union { + LIST_ENTRY(callout) le; SLIST_ENTRY(callout) sle; TAILQ_ENTRY(callout) tqe; } c_links; - int c_time; /* ticks to the event */ + sbintime_t c_time; /* ticks to the event */ + sbintime_t c_precision; /* delta allowed wrt opt */ void *c_arg; /* function argument */ void (*c_func)(void *); /* function to call */ struct lock_object *c_lock; /* lock to handle */ |