diff options
author | jhb <jhb@FreeBSD.org> | 2000-11-16 02:16:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-11-16 02:16:44 +0000 |
commit | c0bba69cbe7c4beee5213a4f1494387ee365db4c (patch) | |
tree | bc01d9302c1c47d1c7ec3254c6bfc60515318af1 /sys/kern/kern_shutdown.c | |
parent | 4b0f06d83c650d18d7bc905ae27eb7412fcfc038 (diff) | |
download | FreeBSD-src-c0bba69cbe7c4beee5213a4f1494387ee365db4c.zip FreeBSD-src-c0bba69cbe7c4beee5213a4f1494387ee365db4c.tar.gz |
Don't release and acquire Giant in mi_switch(). Instead, release and
acquire Giant as needed in functions that call mi_switch(). The releases
need to be done outside of the sched_lock to avoid potential deadlocks
from trying to acquire Giant while interrupts are disabled.
Submitted by: witness
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r-- | sys/kern/kern_shutdown.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 431f966..025ed04 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -254,6 +254,7 @@ boot(int howto) pbusy = nbusy; sync(&proc0, NULL); if (curproc != NULL) { + DROP_GIANT_NOSWITCH(); for (subiter = 0; subiter < 50 * iter; subiter++) { mtx_enter(&sched_lock, MTX_SPIN); setrunqueue(curproc); @@ -261,6 +262,7 @@ boot(int howto) mtx_exit(&sched_lock, MTX_SPIN); DELAY(1000); } + PICKUP_GIANT(); } else DELAY(50000 * iter); } |