svn commit: r310971 - stable/11/sys/kern
Mateusz Guzik
mjg at FreeBSD.org
Sat Dec 31 13:07:10 UTC 2016
Author: mjg
Date: Sat Dec 31 13:07:09 2016
New Revision: 310971
URL: https://svnweb.freebsd.org/changeset/base/310971
Log:
MFC r309111:
wait: avoid relocking the child if proc_to_reap returns 1
proc_to_reap would always unlock. However, if it returned 1, kern_wait6
would immediately lock it again. Save the dance.
Modified:
stable/11/sys/kern/kern_exit.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/kern/kern_exit.c
==============================================================================
--- stable/11/sys/kern/kern_exit.c Sat Dec 31 13:05:48 2016 (r310970)
+++ stable/11/sys/kern/kern_exit.c Sat Dec 31 13:07:09 2016 (r310971)
@@ -1066,7 +1066,6 @@ proc_to_reap(struct thread *td, struct p
proc_reap(td, p, status, options);
return (-1);
}
- PROC_UNLOCK(p);
return (1);
}
@@ -1199,7 +1198,7 @@ loop:
return (0);
}
- PROC_LOCK(p);
+ PROC_LOCK_ASSERT(p, MA_OWNED);
if ((options & (WTRAPPED | WUNTRACED)) != 0)
PROC_SLOCK(p);
@@ -1259,6 +1258,7 @@ loop:
if (ret != 0) {
KASSERT(ret != -1, ("reaped an orphan (pid %d)",
(int)td->td_retval[0]));
+ PROC_UNLOCK(p);
nfound++;
break;
}
More information about the svn-src-stable
mailing list