Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Cleanup dead code after revert of racy vfork(2) commit



details:   https://anonhg.NetBSD.org/src/rev/2c214e84aabd
branches:  trunk
changeset: 350265:2c214e84aabd
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon Jan 09 00:31:30 2017 +0000

description:
Cleanup dead code after revert of racy vfork(2) commit

This removes dead code introduced with the following commit:

date: 2012-07-27 22:52:49 +0200;  author: christos;  state: Exp;  lines: +8 -2;
revert racy vfork() parent-blocking-before-child-execs-or-exits code.
ok rmind

diffstat:

 sys/kern/kern_exec.c |  19 ++-----------------
 sys/kern/kern_exit.c |  16 ++--------------
 sys/kern/kern_fork.c |  10 ++--------
 3 files changed, 6 insertions(+), 39 deletions(-)

diffs (118 lines):

diff -r 1edd377e8d9f -r 2c214e84aabd sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Sun Jan 08 21:36:24 2017 +0000
+++ b/sys/kern/kern_exec.c      Mon Jan 09 00:31:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.439 2017/01/06 22:42:58 kamil Exp $    */
+/*     $NetBSD: kern_exec.c,v 1.440 2017/01/09 00:31:30 kamil Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.439 2017/01/06 22:42:58 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.440 2017/01/09 00:31:30 kamil Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1235,26 +1235,11 @@
         * exited and exec()/exit() are the only places it will be cleared.
         */
        if ((p->p_lflag & PL_PPWAIT) != 0) {
-#if 0
-               lwp_t *lp;
-
-               mutex_enter(proc_lock);
-               lp = p->p_vforklwp;
-               p->p_vforklwp = NULL;
-
-               l->l_lwpctl = NULL; /* was on loan from blocked parent */
-               p->p_lflag &= ~PL_PPWAIT;
-
-               lp->l_pflag &= ~LP_VFORKWAIT; /* XXX */
-               cv_broadcast(&lp->l_waitcv);
-               mutex_exit(proc_lock);
-#else
                mutex_enter(proc_lock);
                l->l_lwpctl = NULL; /* was on loan from blocked parent */
                p->p_lflag &= ~PL_PPWAIT;
                cv_broadcast(&p->p_pptr->p_waitcv);
                mutex_exit(proc_lock);
-#endif
        }
 
        error = credexec(l, &data->ed_attr);
diff -r 1edd377e8d9f -r 2c214e84aabd sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Sun Jan 08 21:36:24 2017 +0000
+++ b/sys/kern/kern_exit.c      Mon Jan 09 00:31:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.267 2016/11/13 15:25:01 christos Exp $ */
+/*     $NetBSD: kern_exit.c,v 1.268 2017/01/09 00:31:30 kamil Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.267 2016/11/13 15:25:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.268 2017/01/09 00:31:30 kamil Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -343,21 +343,9 @@
         */
        mutex_enter(proc_lock);
        if (p->p_lflag & PL_PPWAIT) {
-#if 0
-               lwp_t *lp;
-
-               l->l_lwpctl = NULL; /* was on loan from blocked parent */
-               p->p_lflag &= ~PL_PPWAIT;
-
-               lp = p->p_vforklwp;
-               p->p_vforklwp = NULL;
-               lp->l_pflag &= ~LP_VFORKWAIT; /* XXX */
-               cv_broadcast(&lp->l_waitcv);
-#else
                l->l_lwpctl = NULL; /* was on loan from blocked parent */
                p->p_lflag &= ~PL_PPWAIT;
                cv_broadcast(&p->p_pptr->p_waitcv);
-#endif
        }
 
        if (SESS_LEADER(p)) {
diff -r 1edd377e8d9f -r 2c214e84aabd sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c      Sun Jan 08 21:36:24 2017 +0000
+++ b/sys/kern/kern_fork.c      Mon Jan 09 00:31:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_fork.c,v 1.196 2016/11/04 18:14:04 christos Exp $ */
+/*     $NetBSD: kern_fork.c,v 1.197 2017/01/09 00:31:30 kamil Exp $    */
 
 /*-
  * Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.196 2016/11/04 18:14:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.197 2017/01/09 00:31:30 kamil Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -570,14 +570,8 @@
         * Preserve synchronization semantics of vfork.  If waiting for
         * child to exec or exit, sleep until it clears LP_VFORKWAIT.
         */
-#if 0
-       while (l1->l_pflag & LP_VFORKWAIT) {
-               cv_wait(&l1->l_waitcv, proc_lock);
-       }
-#else
        while (p2->p_lflag & PL_PPWAIT)
                cv_wait(&p1->p_waitcv, proc_lock);
-#endif
 
        /*
         * Let the parent know that we are tracing its child.



Home | Main Index | Thread Index | Old Index