Don't call sleepinit() from proc0_init(), make it a SYSINIT instead.

vmem needs the sleepq locks to be initialized when free'ing kva, so we want it
called as early as possible.
This commit is contained in:
Olivier Houchard 2013-08-09 23:13:52 +00:00
parent e137643ef3
commit 662423aeaf
3 changed files with 8 additions and 7 deletions

View File

@ -455,10 +455,6 @@ proc0_init(void *dummy __unused)
* Add scheduler specific parts to proc, thread as needed.
*/
schedinit(); /* scheduler gets its house in order */
/*
* Initialize sleep queue hash table
*/
sleepinit();
/*
* Create process 0 (the swapper).

View File

@ -121,14 +121,20 @@ SDT_PROBE_DEFINE(sched, , , schedctl_nopreempt, schedctl-nopreempt);
SDT_PROBE_DEFINE(sched, , , schedctl_preempt, schedctl-preempt);
SDT_PROBE_DEFINE(sched, , , schedctl_yield, schedctl-yield);
void
sleepinit(void)
static void
sleepinit(void *unused)
{
hogticks = (hz / 10) * 2; /* Default only. */
init_sleepqueues();
}
/*
* vmem tries to lock the sleepq mutexes when free'ing kva, so make sure
* it is available.
*/
SYSINIT(sleepinit, SI_SUB_KMEM, SI_ORDER_ANY, sleepinit, 0);
/*
* General sleep call. Suspends the current thread until a wakeup is
* performed on the specified identifier. The thread will then be made

View File

@ -892,7 +892,6 @@ int setrunnable(struct thread *);
void setsugid(struct proc *p);
int should_yield(void);
int sigonstack(size_t sp);
void sleepinit(void);
void stopevent(struct proc *, u_int, u_int);
struct thread *tdfind(lwpid_t, pid_t);
void threadinit(void);