From owner-freebsd-current@FreeBSD.ORG Thu Aug 21 14:18:22 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 B67F11065671 for ; Thu, 21 Aug 2008 14:18:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4DB8FC16 for ; Thu, 21 Aug 2008 14:18:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KWAzU-0006JV-L1; Thu, 21 Aug 2008 17:18:20 +0300 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 m7LEIDkq006400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Aug 2008 17:18:13 +0300 (EEST) (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.2/8.14.2) with ESMTP id m7LEICq7039215; Thu, 21 Aug 2008 17:18:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m7LEICbZ039194; Thu, 21 Aug 2008 17:18:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 Aug 2008 17:18:12 +0300 From: Kostik Belousov To: kevin Message-ID: <20080821141812.GK1803@deviant.kiev.zoral.com.ua> 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> <48AD7892.4080802@163.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PBu/a+gn9/ndsyD5" Content-Disposition: inline In-Reply-To: <48AD7892.4080802@163.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KWAzU-0006JV-L1 8e57eaeb0caa6e0cf9db6f24eefe0838 X-Terabit: YES Cc: Ed Schouten , 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:18:22 -0000 --PBu/a+gn9/ndsyD5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 21, 2008 at 10:15:46PM +0800, kevin wrote: > Kostik Belousov wrote: > >On Thu, Aug 21, 2008 at 09:33:55PM +0800, kevin wrote: > > =20 > >>Hi, > >> I update to the newest source tree and rebuild kernel(with zfs=20 > >>patch).kernel panic on system startup.Should I rebuild world? > >>...... > >>Starting gdm. > >>Sleeping thread (tid 100068,pid 1145) owns a non-sleepable lock > >>sched_switch() at sched_switch+0x184 > >>mi_switch() at mi_switch+0x21b > >>sleepq_switch() at sleepq_switch+0xfa > >>sleepq_wait() at sleepq_wait+0x46 > >>_sx_slock_hard() at _sx_slock_hard+0x169 > >>_sx_slock() at _sx_slock+0x6b > >>acct_process() at acct_process+0x24b > >>exit1() at exit1+0x3e8 > >>sys_exit() at sys_exit+0xe > >>syscall() at syscall+0x1dd > >>Xfast_syscall() at Xfast_syscall+0xab > >>--- syscall (1, FreeBSD ELF64, sys_exit), rip =3D 0x80094dd0c, rsp =3D= =20 > >>0x7fffffffcdf8, rbp =3D 0x62d548 --- > >>panic: sleeping thread > >>cpuid =3D 0 > >>KDB: enter: panic > >>[thread pid 1143 tid 100127 ] > >>Stopped at kdb_enter+0x3d: movq $0,0x6cebb4(%rip) > >>db>bt > >>Tracing pid 1143 tid 100127 td 0xfffff000f073700 > >>kdb_enter() at kdb_enter()+0x3d > >>panic() at panic()+0x16c > >>propagate_priority() propagate_priority+0x221 > >>turnstile_wait() at turnstile_wait+0x212 > >>_mtx_lock_sleep() at _mtx_lock_sleep+0xe0 > >>_mtx_lock_flags() at _mtx_lock_flags+0xc0 > >>kern_wait() at kern_wait+0x11b > >>wait4() at wait4+0x33 > >>syscall() at syscall()+0x1dd > >>Xfast_syscall() at Xfast_syscall()+0xab > >>--- syscall (7, FreeBSD ELF64, wait4), rip =3D 0x8009115c, rsp =3D=20 > >>0x7fffffffcf18, rbp =3D 0x26 --- > >>db>show locks > >>exclusive sx proctree (proctree) r =3D 0 (0xffffffff8099fc80) locked=20 > >>@/usr/src/sys/kern/kern_exit.c:702 > >>db>show allpcpu > >>Current CPU:0 > >>cpuid =3D 0 > >>curthread =3D0xffffff000f073700:pid 1143 "sh" > >>curpcb =3D0xfffffffea6084d40 > >>fpcurthread =3D none > >>idlethread =3D 0xffffff0002395380:pid 11 "idle: cpu0" > >>spin locks held: > >> > >>cpuid =3D 1 > >>curthread =3D0xffffff0002395700:pid 1143 "idle: cpu1" > >>curpcb =3D0xfffffffe4001dd40 > >>fpcurthread =3D none > >>idlethread =3D 0xffffff0002395700:pid 11 "idle: cpu1" > >>spin locks held: > >> > >> =20 > > > >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: > > > >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.=20 > > */ > > acct.ac_flagx =3D p->p_acflag; > > PROC_UNLOCK(p); > > =20 > Thanks. After I turned off accounting in /etc/rc.conf. It works. And, could you, please, give us a service and try to turn accounting on the patched kernel ? --PBu/a+gn9/ndsyD5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkiteSMACgkQC3+MBN1Mb4iF7gCghV03KBbG1VcIqZ68vfDAGy27 p0YAnj159XlON2WoNu1x3YUNCrQ2Deu0 =dPBF -----END PGP SIGNATURE----- --PBu/a+gn9/ndsyD5--