From owner-svn-src-stable@freebsd.org Wed Oct 21 01:45:20 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FCAA19B5B; Wed, 21 Oct 2015 01:45:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF24E4B; Wed, 21 Oct 2015 01:45:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9L1jIQA069738; Wed, 21 Oct 2015 01:45:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9L1jILm069737; Wed, 21 Oct 2015 01:45:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510210145.t9L1jILm069737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 21 Oct 2015 01:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289673 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 01:45:20 -0000 Author: bdrewery Date: Wed Oct 21 01:45:18 2015 New Revision: 289673 URL: https://svnweb.freebsd.org/changeset/base/289673 Log: MFC r288994: Remove redundant RFFPWAIT/vfork(2) handling in Linux fork(2) and clone(2) wrappers. Modified: stable/9/sys/compat/linux/linux_fork.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_fork.c ============================================================================== --- stable/9/sys/compat/linux/linux_fork.c Wed Oct 21 01:41:22 2015 (r289672) +++ stable/9/sys/compat/linux/linux_fork.c Wed Oct 21 01:45:18 2015 (r289673) @@ -110,9 +110,8 @@ linux_vfork(struct thread *td, struct li printf(ARGS(vfork, "")); #endif - /* Exclude RFPPWAIT */ - if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2, - NULL, 0)) != 0) + if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFPPWAIT | RFSTOPPED, + 0, &p2, NULL, 0)) != 0) return (error); td->td_retval[0] = p2->p_pid; @@ -121,10 +120,6 @@ linux_vfork(struct thread *td, struct li if (error) return (error); - PROC_LOCK(p2); - p2->p_flag |= P_PPWAIT; - PROC_UNLOCK(p2); - td2 = FIRST_THREAD_IN_PROC(p2); /* @@ -135,12 +130,6 @@ linux_vfork(struct thread *td, struct li sched_add(td2, SRQ_BORING); thread_unlock(td2); - /* wait for the children to exit, ie. emulate vfork */ - PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); - PROC_UNLOCK(p2); - return (0); } @@ -202,6 +191,9 @@ linux_clone(struct thread *td, struct li if (args->parent_tidptr == NULL) return (EINVAL); + if (args->flags & LINUX_CLONE_VFORK) + ff |= RFPPWAIT; + error = fork1(td, ff, 0, &p2, NULL, 0); if (error) return (error); @@ -270,12 +262,6 @@ linux_clone(struct thread *td, struct li "stack %p sig = %d"), (int)p2->p_pid, args->stack, exit_signal); #endif - if (args->flags & LINUX_CLONE_VFORK) { - PROC_LOCK(p2); - p2->p_flag |= P_PPWAIT; - PROC_UNLOCK(p2); - } - /* * Make this runnable after we are finished with it. */ @@ -287,13 +273,5 @@ linux_clone(struct thread *td, struct li td->td_retval[0] = p2->p_pid; td->td_retval[1] = 0; - if (args->flags & LINUX_CLONE_VFORK) { - /* wait for the children to exit, ie. emulate vfork */ - PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); - PROC_UNLOCK(p2); - } - return (0); }