1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Remove the now unused `lbolt' variable from the kernel.

We used to have a single wait channel inside the kernel which could be
used by threads that just wanted to sleep for some time (the next
second). The old TTY layer was the only piece of code that still used
lbolt, because I already removed the use of lbolt from the NFS clients
and the VFS syncer.

Approved by:	philip
This commit is contained in:
Ed Schouten 2008-08-20 12:20:22 +00:00
parent c59abcf330
commit 040b1db930
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181921
2 changed files with 3 additions and 16 deletions

View File

@ -70,11 +70,9 @@ SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup,
NULL);
int hogticks;
int lbolt;
static int pause_wchan;
static struct callout loadav_callout;
static struct callout lbolt_callout;
struct loadavg averunnable =
{ {0, 0, 0}, FSCALE }; /* load average, of runnable procs */
@ -93,7 +91,6 @@ static int fscale __unused = FSCALE;
SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, 0, FSCALE, "");
static void loadav(void *arg);
static void lboltcb(void *arg);
void
sleepinit(void)
@ -136,8 +133,8 @@ _sleep(void *ident, struct lock_object *lock, int priority,
#endif
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
"Sleeping on \"%s\"", wmesg);
KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL ||
ident == &lbolt, ("sleeping without a lock"));
KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL,
("sleeping without a lock"));
KASSERT(p != NULL, ("msleep1"));
KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
if (priority & PDROP)
@ -202,7 +199,7 @@ _sleep(void *ident, struct lock_object *lock, int priority,
* stopped, then td will no longer be on a sleep queue upon
* return from cursig().
*/
sleepq_add(ident, ident == &lbolt ? NULL : lock, wmesg, flags, 0);
sleepq_add(ident, lock, wmesg, flags, 0);
if (timo)
sleepq_set_timeout(ident, timo);
if (lock != NULL && class->lc_flags & LC_SLEEPABLE) {
@ -515,23 +512,14 @@ loadav(void *arg)
loadav, NULL);
}
static void
lboltcb(void *arg)
{
wakeup(&lbolt);
callout_reset(&lbolt_callout, hz, lboltcb, NULL);
}
/* ARGSUSED */
static void
synch_setup(void *dummy)
{
callout_init(&loadav_callout, CALLOUT_MPSAFE);
callout_init(&lbolt_callout, CALLOUT_MPSAFE);
/* Kick off timeout driven events by calling first time. */
loadav(NULL);
lboltcb(NULL);
}
/*

View File

@ -69,7 +69,6 @@ extern int stathz; /* statistics clock's frequency */
extern int profhz; /* profiling clock's frequency */
extern int profprocs; /* number of process's profiling */
extern int ticks;
extern int lbolt; /* once a second sleep address */
#endif /* _KERNEL */