Prevent vm_page_zero_idle_wakeup() from attempting to wake up the

page zeroing thread before it has been created. It was possible for
calls to free() very early in the boot process to panic here because
the sleep queues were not yet initialised. Specifically, sysinit_add()
running at SI_SUB_KLD would trigger this if the array of pointers
became big enough to require uma_large_alloc() allocations.

Submitted by:	peter
This commit is contained in:
Ian Dowse 2004-08-29 01:02:33 +00:00
parent 941fdb393b
commit 632ca524c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134461

View File

@ -57,9 +57,11 @@ static int cnt_prezero;
SYSCTL_INT(_vm_stats_misc, OID_AUTO, cnt_prezero, CTLFLAG_RD,
&cnt_prezero, 0, "");
static int idlezero_enable = 1;
static int idlezero_enable_default = 1;
TUNABLE_INT("vm.idlezero_enable", &idlezero_enable_default);
/* Defer setting the enable flag until the kthread is running. */
static int idlezero_enable = 0;
SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RW, &idlezero_enable, 0, "");
TUNABLE_INT("vm.idlezero_enable", &idlezero_enable);
static int idlezero_maxrun = 16;
SYSCTL_INT(_vm, OID_AUTO, idlezero_maxrun, CTLFLAG_RW, &idlezero_maxrun, 0, "");
@ -147,6 +149,7 @@ vm_pagezero(void __unused *arg)
rtp_to_pri(&rtp, td->td_ksegrp);
pri = td->td_priority;
mtx_unlock_spin(&sched_lock);
idlezero_enable = idlezero_enable_default;
for (;;) {
if (vm_page_zero_check()) {