Date: Wed, 23 Mar 2011 16:34:34 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: svn-src-head@freebsd.org, Edward Tomasz Napierala <trasz@freebsd.org>, svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer <julian@freebsd.org> Subject: Re: svn commit: r219727 - head/sys/vm Message-ID: <20110323143434.GZ78089@deviant.kiev.zoral.com.ua> In-Reply-To: <201103230945.37726.jhb@freebsd.org> References: <201103180647.p2I6lNCB051745@svn.freebsd.org> <4D831A82.7070308@freebsd.org> <201103230945.37726.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110323143434.GZ78089>