From 20cdcc5b73ca7ca1c78ccaba30cf8dd1b2dd7ec0 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 16 Nov 2000 02:16:44 +0000 Subject: 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 --- sys/kern/kern_sig.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/kern/kern_sig.c') diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index af7a32fe52db..dcc0ed3e7af9 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1283,7 +1283,11 @@ issignal(p) psignal(p->p_pptr, SIGCHLD); do { stop(p); + DROP_GIANT_NOSWITCH(); + mtx_enter(&sched_lock, MTX_SPIN); mi_switch(); + mtx_exit(&sched_lock, MTX_SPIN); + PICKUP_GIANT(); } while (!trace_req(p) && p->p_flag & P_TRACED); @@ -1352,7 +1356,11 @@ issignal(p) stop(p); if ((p->p_pptr->p_procsig->ps_flag & PS_NOCLDSTOP) == 0) psignal(p->p_pptr, SIGCHLD); + DROP_GIANT_NOSWITCH(); + mtx_enter(&sched_lock, MTX_SPIN); mi_switch(); + mtx_exit(&sched_lock, MTX_SPIN); + PICKUP_GIANT(); break; } else if (prop & SA_IGNORE) { /* -- cgit v1.2.3