From owner-freebsd-current@FreeBSD.ORG Thu Aug 21 14:07:55 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64A2A1065672 for ; Thu, 21 Aug 2008 14:07:55 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id E51318FC38 for ; Thu, 21 Aug 2008 14:07:54 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 3C7E21CE1E; Thu, 21 Aug 2008 16:07:54 +0200 (CEST) Date: Thu, 21 Aug 2008 16:07:54 +0200 From: Ed Schouten To: Kostik Belousov Message-ID: <20080821140754.GL99951@hoeg.nl> References: <747dc8f30808201223i46ba04daw34c267574ba7cc99@mail.gmail.com> <20080820201226.GI99951@hoeg.nl> <20080820203238.GF1803@deviant.kiev.zoral.com.ua> <3c1674c90808201438p2751d7f7x3f5ee892310201c8@mail.gmail.com> <747dc8f30808210529s329bed21iea29ae5c0c28b793@mail.gmail.com> <48AD6EC3.5000507@163.com> <20080821135735.GJ1803@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MekdDWo5JqZA69XK" Content-Disposition: inline In-Reply-To: <20080821135735.GJ1803@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: kevin , FreeBSD Current Subject: Re: 8.0-CURRENT kernel panic on system boot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 14:07:55 -0000 --MekdDWo5JqZA69XK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Kostik, others, * Kostik Belousov wrote: > No, this is a consequence of taking sx after proc lock in kern_acct.c, > acct_process(). You may turn off accounting, or try this patch: >=20 > diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c > index e505f62..d45e3b7 100644 > --- a/sys/kern/kern_acct.c > +++ b/sys/kern/kern_acct.c > @@ -366,16 +366,25 @@ acct_process(struct thread *td) > * Get process accounting information. > */ > =20 > + sx_slock(&proctree_lock); > PROC_LOCK(p); > - /* (1) The name of the command that ran */ > + > + /* (1) The terminal from which the process was started */ > + if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp) > + acct.ac_tty =3D tty_udev(p->p_pgrp->pg_session->s_ttyp); > + else > + acct.ac_tty =3D NODEV; > + sx_sunlock(&proctree_lock); > + > + /* (2) The name of the command that ran */ > bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm); > =20 > - /* (2) The amount of user and system time that was used */ > + /* (3) The amount of user and system time that was used */ > rufetchcalc(p, &ru, &ut, &st); > acct.ac_utime =3D encode_timeval(ut); > acct.ac_stime =3D encode_timeval(st); > =20 > - /* (3) The elapsed time the command ran (and its starting time) */ > + /* (4) The elapsed time the command ran (and its starting time) */ > tmp =3D boottime; > timevaladd(&tmp, &p->p_stats->p_start); > acct.ac_btime =3D tmp.tv_sec; > @@ -383,7 +392,7 @@ acct_process(struct thread *td) > timevalsub(&tmp, &p->p_stats->p_start); > acct.ac_etime =3D encode_timeval(tmp); > =20 > - /* (4) The average amount of memory used */ > + /* (5) The average amount of memory used */ > tmp =3D ut; > timevaladd(&tmp, &st); > /* Convert tmp (i.e. u + s) into hz units to match ru_i*. */ > @@ -394,21 +403,13 @@ acct_process(struct thread *td) > else > acct.ac_mem =3D 0; > =20 > - /* (5) The number of disk I/O operations done */ > + /* (6) The number of disk I/O operations done */ > acct.ac_io =3D encode_long(ru.ru_inblock + ru.ru_oublock); > =20 > - /* (6) The UID and GID of the process */ > + /* (7) The UID and GID of the process */ > acct.ac_uid =3D p->p_ucred->cr_ruid; > acct.ac_gid =3D p->p_ucred->cr_rgid; > =20 > - /* (7) The terminal from which the process was started */ > - sx_slock(&proctree_lock); > - if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp) > - acct.ac_tty =3D tty_udev(p->p_pgrp->pg_session->s_ttyp); > - else > - acct.ac_tty =3D NODEV; > - sx_sunlock(&proctree_lock); > - > /* (8) The boolean flags that tell how the process terminated, etc. */ > acct.ac_flagx =3D p->p_acflag; > PROC_UNLOCK(p); Indeed. It seems I introduced this problem when importing the MPSAFE TTY layer: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/kern_acct.c.diff?r1=3D1= =2E98;r2=3D1.99 Kevin, let me know if this fixes the problem for you. If it does, I'll commit it to SVN. Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --MekdDWo5JqZA69XK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkitdroACgkQ52SDGA2eCwUoSwCeOdFow6Mw5BzATHk2qdnhmQFF UZcAn0knRhCTGmfSJK/T0F+J+HVsNi7o =ellz -----END PGP SIGNATURE----- --MekdDWo5JqZA69XK--