From owner-svn-src-all@FreeBSD.ORG Wed Mar 23 14:34:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93A361065672; Wed, 23 Mar 2011 14:34:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD628FC0C; Wed, 23 Mar 2011 14:34:38 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p2NEYYPA007289 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Mar 2011 16:34:34 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p2NEYYmv026328; Wed, 23 Mar 2011 16:34:34 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p2NEYYp8026327; Wed, 23 Mar 2011 16:34:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Mar 2011 16:34:34 +0200 From: Kostik Belousov To: John Baldwin Message-ID: <20110323143434.GZ78089@deviant.kiev.zoral.com.ua> References: <201103180647.p2I6lNCB051745@svn.freebsd.org> <4D831A82.7070308@freebsd.org> <201103230945.37726.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrjEzJmCELwGVYdX" Content-Disposition: inline In-Reply-To: <201103230945.37726.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Edward Tomasz Napierala , svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer Subject: Re: svn commit: r219727 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2011 14:34:39 -0000 --lrjEzJmCELwGVYdX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 23, 2011 at 09:45:37AM -0400, John Baldwin wrote: > On Friday, March 18, 2011 4:40:34 am Julian Elischer wrote: > > On 3/17/11 11:47 PM, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Fri Mar 18 06:47:23 2011 > > > New Revision: 219727 > > > URL: http://svn.freebsd.org/changeset/base/219727 > > > > > > Log: > > > In vm_daemon(), when iterating over all processes in the system, s= kip those > > > which are not yet fully initialized (i.e. ones with p_state =3D=3D= PRS_NEW). > > > Without it, we could panic in _thread_lock_flags(). > > > > > > Note that there may be other instances of FOREACH_PROC_IN_SYSTEM()= that > > > require similar fix. > >=20 > > In the past each process was only put on the process list after it was= =20 > > fully set up. > > Did someone change that recently? that would be "A Bad Thing" (TM). >=20 > Err, no, that has never been true. The reason it has to go on the list > immediately is to reserve the PID against concurrent fork()s. >=20 > Hmm, the locking of prs_state is a bit busted it seems. Both the PROC_LO= CK() > and PROC_SLOCK() are supposed to be held when it is written to, but > PROC_LOCK() is missing in fork1() when moving the state to PRS_NORMAL. >=20 > Also, this commit should check against PRS_NORMAL after acquiring the proc > lock, not before. In the case of this commit, it does not matter much, I think. The reason is that all the check want is to make sure that there is at least one fully initialized thread linked into the process. --lrjEzJmCELwGVYdX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2KBPoACgkQC3+MBN1Mb4iRDwCggjYS4Qc/ppF79O93HpMv9oyW 408AoM/4CuEUI/LCRBoThNNH8Duhyl9R =egLS -----END PGP SIGNATURE----- --lrjEzJmCELwGVYdX--