From owner-p4-projects Tue Apr 9 19:44:33 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9287C37B404; Tue, 9 Apr 2002 19:44:25 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D0D8A37B416 for ; Tue, 9 Apr 2002 19:44:24 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3A2iOv25021 for perforce@freebsd.org; Tue, 9 Apr 2002 19:44:24 -0700 (PDT) (envelope-from jhb@freebsd.org) Date: Tue, 9 Apr 2002 19:44:24 -0700 (PDT) Message-Id: <200204100244.g3A2iOv25021@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 9484 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=9484 Change 9484 by jhb@jhb_laptop on 2002/04/09 19:43:53 Tidy up sched locking. Affected files ... ... //depot/projects/smpng/sys/kern/kern_sig.c#28 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_sig.c#28 (text+ko) ==== @@ -1040,13 +1040,10 @@ PROC_UNLOCK(p); continue; } - mtx_lock_spin(&sched_lock); if (p->p_stat == SZOMB) { - mtx_unlock_spin(&sched_lock); PROC_UNLOCK(p); continue; } - mtx_unlock_spin(&sched_lock); if (p_cansignal(cp, p, sig) == 0) { nfound++; if (sig) @@ -1333,6 +1330,10 @@ * Defer further processing for signals which are held, * except that stopped processes must be continued by SIGCONT. */ + /* + * XXX: we shouldn't drop sched_lock from signotify() and then lock it + * again here. + */ mtx_lock_spin(&sched_lock); if (action == SIG_HOLD && (!(prop & SA_CONT) || p->p_stat != SSTOP)) { mtx_unlock_spin(&sched_lock); @@ -1352,6 +1353,7 @@ mtx_unlock_spin(&sched_lock); goto out; } + mtx_unlock_spin(&sched_lock); /* * Process is sleeping and traced... make it runnable * so it can discover the signal in issignal() and stop @@ -1359,7 +1361,6 @@ */ if (p->p_flag & P_TRACED) goto run; - mtx_unlock_spin(&sched_lock); /* * If SIGCONT is default (or ignored) and process is * asleep, we are finished; the process should not @@ -1443,13 +1444,12 @@ /* mark it as sleeping */ } } - mtx_unlock_spin(&sched_lock); } else { if (td->td_wchan == NULL) goto run; p->p_stat = SSLEEP; - mtx_unlock_spin(&sched_lock); } + mtx_unlock_spin(&sched_lock); goto out; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message