From owner-freebsd-current@FreeBSD.ORG Thu Aug 21 14:16:11 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 0FC4E106564A for ; Thu, 21 Aug 2008 14:16:11 +0000 (UTC) (envelope-from kevinxlinuz@163.com) Received: from m12-11.163.com (m12-11.163.com [220.181.12.11]) by mx1.freebsd.org (Postfix) with SMTP id 4274B8FC2E for ; Thu, 21 Aug 2008 14:16:10 +0000 (UTC) (envelope-from kevinxlinuz@163.com) Received: from [127.0.0.1] (unknown [60.191.58.178]) by smtp7 (Coremail) with SMTP id C8CowLCrOjmNeK1I2UloNw==.42379S2; Thu, 21 Aug 2008 22:15:41 +0800 (CST) Message-ID: <48AD7892.4080802@163.com> Date: Thu, 21 Aug 2008 22:15:46 +0800 From: kevin User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Kostik Belousov 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> In-Reply-To: <20080821135735.GJ1803@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Coremail-Antispam: 1Uf129KBjvJXoWxZr1fCry7WF4xXrW3WF18uFg_yoWrtw1kp3 y0kw17GFs5Ar4UursrA3ZIvF1j9w1Y93srG3srJr4FkrnY9r1Sq347JFW7Kw1Durn3C3yf Zay8XFsxCrsFvFJanT9S1TB71UUUUUUv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UU UnV7k0a2IF6r1UM7kC6x804xWl14x267AKxVWUJVW8JwAFxVCF77xC6IxKo4kEV4yl1I0E scIYIxCEI4klw4CSwwAFIxvE14AKwVWUJVWUGwAawVAYYI1S6c8GOVWUur45Jryln4vEF7 Iv6F18KVAqrcv_GVWUtr1rJF1ln4vEF7Iv6F18KVAqrcv_XVWUtr1rJF1ln4vEIxA26c8G OVWUur1xXr4lnx0Ec2IEnICE548m6r1DJrWUZwAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26F4j6r4UJwAC62BYpTIE1TZKA3sv LVAKvSnIqfZI6r4lFVCF04k20xvEw2I207IF0wCjxxvEw4Wlc7Ca8VAvwVCFzxkY4VCS07 ylc2IjII80xcxEwVWxJVW3JwCF72vE52k0Y41lx4CE17CEb7AF67AKxVWUXVWUAwCI42IY 6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvj DU0xZFpf9x0zRcBMNUUUUU= 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:16:11 -0000 Kostik Belousov wrote: > On Thu, Aug 21, 2008 at 09:33:55PM +0800, kevin wrote: > >> Hi, >> I update to the newest source tree and rebuild kernel(with zfs >> 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 = 0x80094dd0c, rsp = >> 0x7fffffffcdf8, rbp = 0x62d548 --- >> panic: sleeping thread >> cpuid = 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 = 0x8009115c, rsp = >> 0x7fffffffcf18, rbp = 0x26 --- >> db>show locks >> exclusive sx proctree (proctree) r = 0 (0xffffffff8099fc80) locked >> @/usr/src/sys/kern/kern_exit.c:702 >> db>show allpcpu >> Current CPU:0 >> cpuid = 0 >> curthread =0xffffff000f073700:pid 1143 "sh" >> curpcb =0xfffffffea6084d40 >> fpcurthread = none >> idlethread = 0xffffff0002395380:pid 11 "idle: cpu0" >> spin locks held: >> >> cpuid = 1 >> curthread =0xffffff0002395700:pid 1143 "idle: cpu1" >> curpcb =0xfffffffe4001dd40 >> fpcurthread = none >> idlethread = 0xffffff0002395700:pid 11 "idle: cpu1" >> spin locks held: >> >> > > 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. > */ > > + 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 = tty_udev(p->p_pgrp->pg_session->s_ttyp); > + else > + acct.ac_tty = NODEV; > + sx_sunlock(&proctree_lock); > + > + /* (2) The name of the command that ran */ > bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm); > > - /* (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 = encode_timeval(ut); > acct.ac_stime = encode_timeval(st); > > - /* (3) The elapsed time the command ran (and its starting time) */ > + /* (4) The elapsed time the command ran (and its starting time) */ > tmp = boottime; > timevaladd(&tmp, &p->p_stats->p_start); > acct.ac_btime = tmp.tv_sec; > @@ -383,7 +392,7 @@ acct_process(struct thread *td) > timevalsub(&tmp, &p->p_stats->p_start); > acct.ac_etime = encode_timeval(tmp); > > - /* (4) The average amount of memory used */ > + /* (5) The average amount of memory used */ > tmp = 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 = 0; > > - /* (5) The number of disk I/O operations done */ > + /* (6) The number of disk I/O operations done */ > acct.ac_io = encode_long(ru.ru_inblock + ru.ru_oublock); > > - /* (6) The UID and GID of the process */ > + /* (7) The UID and GID of the process */ > acct.ac_uid = p->p_ucred->cr_ruid; > acct.ac_gid = p->p_ucred->cr_rgid; > > - /* (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 = tty_udev(p->p_pgrp->pg_session->s_ttyp); > - else > - acct.ac_tty = NODEV; > - sx_sunlock(&proctree_lock); > - > /* (8) The boolean flags that tell how the process terminated, etc. */ > acct.ac_flagx = p->p_acflag; > PROC_UNLOCK(p); > Thanks. After I turned off accounting in /etc/rc.conf. It works.