From: Matthew Dillon Date: Mon, 31 Jan 2011 21:08:26 +0000 (-0800) Subject: kernel - Fix stall after mountroot w/ SMP & ncpus == 1 X-Git-Tag: v2.11.0~268^2~6 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/58bb3381c4471bee358b69dec424840490348f65 kernel - Fix stall after mountroot w/ SMP & ncpus == 1 * Fix a degenerate case for SMP builds when ncpus == 1. This effects both the vkernel and the normal kernel (when a SMP kernel is booted on a non-SMP box which has a LAPIC). The init process was not bring scheduled properly. --- diff --git a/sys/kern/usched_bsd4.c b/sys/kern/usched_bsd4.c index 29dd464152..1f9fe999fc 100644 --- a/sys/kern/usched_bsd4.c +++ b/sys/kern/usched_bsd4.c @@ -553,8 +553,13 @@ bsd4_setrunqueue(struct lwp *lp) found: if (gd == mycpu) { spin_unlock(&bsd4_spin); - if ((dd->upri & ~PPQMASK) > (lp->lwp_priority & ~PPQMASK)) - need_user_resched(); + if ((dd->upri & ~PPQMASK) > (lp->lwp_priority & ~PPQMASK)) { + if (dd->uschedcp == NULL) { + lwkt_schedule(&dd->helper_thread); + } else { + need_user_resched(); + } + } } else { atomic_clear_cpumask(&bsd4_rdyprocmask, CPUMASK(cpuid)); spin_unlock(&bsd4_spin);