summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_param.c
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2013-03-04 11:09:56 +0000
committerdavide <davide@FreeBSD.org>2013-03-04 11:09:56 +0000
commit431035cf16837066ffdc5abc7e48a56cc1dfed5d (patch)
tree0c872a90fed688dcf8a42c76624fcacd6e02d513 /sys/kern/subr_param.c
parente52f997818951d22a197789d4aa9c32ab77ab70a (diff)
downloadFreeBSD-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/kern/subr_param.c')
-rw-r--r--sys/kern/subr_param.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index f36c769..0a3580b 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -81,8 +81,10 @@ __FBSDID("$FreeBSD$");
static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS);
-int hz;
-int tick;
+int hz; /* system clock's frequency */
+int tick; /* usec per tick (1000000 / hz) */
+struct bintime tick_bt; /* bintime per tick (1s / hz) */
+sbintime_t tick_sbt;
int maxusers; /* base tunable */
int maxproc; /* maximum # of processes */
int maxprocperuid; /* max # of procs per user */
@@ -221,6 +223,8 @@ init_param1(void)
if (hz == -1)
hz = vm_guest > VM_GUEST_NO ? HZ_VM : HZ;
tick = 1000000 / hz;
+ tick_sbt = SBT_1S / hz;
+ tick_bt = sbttobt(tick_sbt);
#ifdef VM_SWZONE_SIZE_MAX
maxswzone = VM_SWZONE_SIZE_MAX;
OpenPOWER on IntegriCloud