Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Apr 2002 11:57:32 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 9930 for review
Message-ID:  <200204171857.g3HIvWb51262@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=9930

Change 9930 by jhb@jhb_laptop on 2002/04/17 11:56:44

	Don't need sched_lock to test p_stat against SZOMB and SSTOP.

Affected files ...

... //depot/projects/smpng/sys/kern/kern_exit.c#35 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_exit.c#35 (text+ko) ====

@@ -539,7 +539,6 @@
 		}
 
 		nfound++;
-		mtx_lock_spin(&sched_lock);
 		if (p->p_stat == SZOMB) {
 			/*
 			 * charge childs scheduling cpu usage to parent
@@ -553,11 +552,12 @@
 			 * XXXKSE
 			 */
 			if (curthread->td_proc->p_pid != 1) {
+				mtx_lock_spin(&sched_lock);
 				curthread->td_ksegrp->kg_estcpu =
 				    ESTCPULIM(curthread->td_ksegrp->kg_estcpu +
 				    p->p_ksegrp.kg_estcpu);
+				mtx_unlock_spin(&sched_lock);
 			}
-			mtx_unlock_spin(&sched_lock);
 
 			td->td_retval[0] = p->p_pid;
 #ifdef COMPAT_43
@@ -673,7 +673,6 @@
 		}
 		if (p->p_stat == SSTOP && (p->p_flag & P_WAITED) == 0 &&
 		    (p->p_flag & P_TRACED || uap->options & WUNTRACED)) {
-			mtx_unlock_spin(&sched_lock);
 			p->p_flag |= P_WAITED;
 			sx_xunlock(&proctree_lock);
 			td->td_retval[0] = p->p_pid;
@@ -696,7 +695,6 @@
 			mtx_unlock(&Giant);
 			return (error);
 		}
-		mtx_unlock_spin(&sched_lock);
 		PROC_UNLOCK(p);
 	}
 	sx_xunlock(&proctree_lock);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204171857.g3HIvWb51262>