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:
parent
e137643ef3
commit
662423aeaf
@ -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).
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user