From owner-freebsd-stable@FreeBSD.ORG Thu Jun 3 06:29:26 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D557A1065677; Thu, 3 Jun 2010 06:29:26 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 350A38FC1C; Thu, 3 Jun 2010 06:29:25 +0000 (UTC) Received: by fxm5 with SMTP id 5so5533847fxm.13 for ; Wed, 02 Jun 2010 23:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=9Q1LvrtyZXQdkofIFWhud3dCVhh+d/p6POceAH+KzDg=; b=LUG/dTximnmr7r3dGVngqbyVq0V262LN5hzRnTTBLfVUe7PMElU9idn+9yBcBHB2O1 kZ71KSc9eHjDTZkoK+Ds+sHft4jIf+NkAy1niec6HA3YcjG8zdpd/8HfREB8uR50JdvH nj8ev7MKb6uqKNHBoIRpy4/p/xydWEOtB8LTI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=vGPwLwqqX37zpyRyIowDfqpd4/ko1ZjCOTUPDgq/dFpbGHqlG/cCCgasIUoCpWZgrP GnTGUn/bYLJb3HSSLgcUVQlw/C2O35QginAk6CupRML43662uqAD5YSq15BUBdHXSgKn geGD4HHvZ4n8oKJCB7ZWSw17fCPbfrzv6rMU0= Received: by 10.87.64.25 with SMTP id r25mr15066802fgk.20.1275546565132; Wed, 02 Jun 2010 23:29:25 -0700 (PDT) Received: from ndenev.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id 4sm514954fgg.7.2010.06.02.23.29.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jun 2010 23:29:22 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <20100524171210.GA1418@michelle.cdnetworks.com> Date: Thu, 3 Jun 2010 09:29:20 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <87BA8EDC-BE95-4C84-94CD-5CA12961708A@gmail.com> References: <77DFF2E5-7A1E-4063-A852-2C7AD9BC3DD4@gmail.com> <201005240948.33555.jhb@freebsd.org> <20100524171210.GA1418@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1078) Cc: freebsd-stable@freebsd.org, John Baldwin Subject: Re: if_sge related panics X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 06:29:26 -0000 On May 24, 2010, at 8:12 PM, Pyun YongHyeon wrote: > On Mon, May 24, 2010 at 09:48:33AM -0400, John Baldwin wrote: >> On Monday 24 May 2010 6:35:01 am Nikolay Denev wrote: >>> On May 24, 2010, at 8:57 AM, Nikolay Denev wrote: >>>=20 >>>> Hi, >>>>=20 >>>> Recently I started to experience a if_sge(4) related panic. >>>> It happens almost every time I try to download a torrent file for = example. >>>> Copying of large files over NFS seem not to trigger it, but I = haven't tested extensively. >>>>=20 >>>> Here is the panic message : >>>>=20 >>>> Fatal trap 12: page fault while in kernel mode >>>> cpuid =3D 0; apic id =3D 00 >>>> fault virtual address =3D 0x8 >>>> fault code =3D supervisor write data, page = not present >>>> instruction pointer =3D 0x20:0xffffffff80230413 >>>> stack pointer =3D = 0x28:0xffffff80001e9280 >>>> frame pointer =3D 0x28:0xffffff80001e9510 >>>> code segment =3D base 0x0, limit 0xfffff, = type 0x1b >>>> =3D DPL 0, pres 1, long = 1, def32 0, gran 1 >>>> processor eflags =3D interrupt enabled, resume, = IOPL =3D 0 >>>> current process =3D 12 (irq19: sge0) >>>> trap number =3D 12 >>>> panic: page fault >>>> cpuid =3D 0 >>>> Uptime: 1d20h56m20s >>>> Cannot dump. Device not defined or unavailable >>>> Automatic reboot in 15 seconds - press a key on the console to = abort >>>> Sleeping thread (tid 100039, pid 12) owns a non-sleepable lock >>>>=20 >>>> My swap is on a zvol, so I don't have dump. I'll try to attach a = disk on the eSATA port and dump there if needed. >>>=20 >>> Here is some info from the crashdump : >>>=20 >>> (kgdb) #0 doadump () at pcpu.h:223 >>> #1 0xffffffff802fb149 in boot (howto=3D260) >>> at /usr/src/sys/kern/kern_shutdown.c:416 >>> #2 0xffffffff802fb57c in panic (fmt=3D0xffffffff8055d564 "%s") >>> at /usr/src/sys/kern/kern_shutdown.c:590 >>> #3 0xffffffff805055b8 in trap_fatal (frame=3D0xffffff000288a3e0, = eva=3DVariable "eva" is not available. >>> ) >>> at /usr/src/sys/amd64/amd64/trap.c:777 >>> #4 0xffffffff805059dc in trap_pfault (frame=3D0xffffff80001e91d0, = usermode=3D0) >>> at /usr/src/sys/amd64/amd64/trap.c:693 >>> #5 0xffffffff805061c5 in trap (frame=3D0xffffff80001e91d0) >>> at /usr/src/sys/amd64/amd64/trap.c:451 >>> #6 0xffffffff804eb977 in calltrap () >>> at /usr/src/sys/amd64/amd64/exception.S:223 >>> #7 0xffffffff80230413 in sge_start_locked (ifp=3D0xffffff000270d800) >>> at /usr/src/sys/dev/sge/if_sge.c:1591 >>=20 >> Try this. sge_encap() can sometimes return an error with m_head set = to NULL: >>=20 >=20 > Thanks John. Committed in r208512. >=20 >> Index: if_sge.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- if_sge.c (revision 208375) >> +++ if_sge.c (working copy) >> @@ -1588,7 +1588,8 @@ >> if (m_head =3D=3D NULL) >> break; >> if (sge_encap(sc, &m_head)) { >> - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); >> + if (m_head !=3D NULL) >> + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); >> ifp->if_drv_flags |=3D IFF_DRV_OACTIVE; >> break; >> } >>=20 >> --=20 >> John Baldwin After the patch I experienced several network outages (ping reporting = "no buffer space available") that were resolved by ifconfig down/up of the sge(4) interface. I can see that most of the other drivers that handle XXX_encap() = returning m_head pointing NULL, break when this condition is hit: i.e. : Index: if_sge.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- if_sge.c (revision 208375) +++ if_sge.c (working copy) @@ -1588,7 +1588,8 @@ if (m_head =3D=3D NULL) break; if (sge_encap(sc, &m_head)) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head =3D=3D NULL) + break; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |=3D IFF_DRV_OACTIVE; break; } But here in sge(4) we always set IFF_DRV_OACTIVE. Do you think this can be the source of the problem ? Regards, Niki=