summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-11-21 08:57:08 +0000
committerjeff <jeff@FreeBSD.org>2002-11-21 08:57:08 +0000
commit07d36defefe91253b9194a663eeac6867b1c5a0f (patch)
tree76b705237f0cafaf3da58d18306ef13a8482cc40 /sys/kern/kern_synch.c
parent22dd80b8068b411e1b05b4f0e9d8e2de6dccf33e (diff)
downloadFreeBSD-src-07d36defefe91253b9194a663eeac6867b1c5a0f.zip
FreeBSD-src-07d36defefe91253b9194a663eeac6867b1c5a0f.tar.gz
- Move FSCALE back to kern_sync. This is not scheduler specific.
- Create a new callout for lbolt and move it out of schedcpu(). This is not scheduler specific either. Approved by: re
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index ab5427f..66b3411 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -75,6 +75,7 @@ int hogticks;
int lbolt;
static struct callout loadav_callout;
+static struct callout lbolt_callout;
struct loadavg averunnable =
{ {0, 0, 0}, FSCALE }; /* load average, of runnable procs */
@@ -88,8 +89,13 @@ static fixpt_t cexp[3] = {
0.9944598480048967 * FSCALE, /* exp(-1/180) */
};
+/* kernel uses `FSCALE', userland (SHOULD) use kern.fscale */
+static int fscale __unused = FSCALE;
+SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, 0, FSCALE, "");
+
static void endtsleep(void *);
static void loadav(void *arg);
+static void lboltcb(void *arg);
/*
* We're only looking at 7 bits of the address; everything is
@@ -625,15 +631,24 @@ nextproc:
loadav, NULL);
}
+static void
+lboltcb(void *arg)
+{
+ wakeup(&lbolt);
+ callout_reset(&lbolt_callout, hz, lboltcb, NULL);
+}
+
/* ARGSUSED */
static void
sched_setup(dummy)
void *dummy;
{
callout_init(&loadav_callout, 0);
+ callout_init(&lbolt_callout, 1);
/* Kick off timeout driven events by calling first time. */
loadav(NULL);
+ lboltcb(NULL);
}
/*
OpenPOWER on IntegriCloud