From nobody@FreeBSD.org  Wed Sep 15 16:14:51 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id F280A16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Sep 2004 16:14:50 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E2B3C43D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Sep 2004 16:14:50 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i8FGEon6076984
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Sep 2004 16:14:50 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i8FGEoCE076983;
	Wed, 15 Sep 2004 16:14:50 GMT
	(envelope-from nobody)
Message-Id: <200409151614.i8FGEoCE076983@www.freebsd.org>
Date: Wed, 15 Sep 2004 16:14:50 GMT
From: Michel Gravey <michel.gravey@7ici.biz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Hang during heavy load with amr raid controller (466 series / dell perc 2 SC) 
X-Send-Pr-Version: www-2.3

>Number:         71771
>Category:       kern
>Synopsis:       [amr] Hang during heavy load with amr raid controller (466 series / dell perc 2 SC)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 15 16:20:17 GMT 2004
>Closed-Date:    Thu Dec 30 16:54:28 UTC 2010
>Last-Modified:  Thu Dec 30 16:54:28 UTC 2010
>Originator:     Michel Gravey
>Release:        4.10-RELEASE--p2
>Organization:
7ici
>Environment:
FreeBSD proliant 4.10-RELEASE-p2 FreeBSD 4.10-RELEASE-p2 #19: Thu Aug 5 21:55:46 CEST 2004     root@proliant:/usr/src/sys/compile/PROLIANT  i386
>Description:
The hang (no panic) comes under heavy load after 1-5 hours of make world running at -j4(or -j6 or -j12). The system is a proliant 1850R(P3SMP) with 4 drives on a hardware raid 5 controller, a amr 466 (dell perc2sc).
make.conf: COPTFLAGS= -O2 -pipe -march=pentiumpro or GENERIC kernel from fresh install
>How-To-Repeat:
Probably very hardware specific but running several make buildworld/installworld during several hours (1-5, maybe less, it depends) with SMP turned on, with a amr controller 466 series should repeat the problem. A big dbench doesn't reproduce the problem (maybe not tried enought time).
>Fix:
Here is a patch from cognet@freebsd.org whitch correct the problem
Index: amr.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/amr/amr.c,v
retrieving revision 1.7.2.15
diff -u -p -r1.7.2.15 amr.c
--- amr.c       22 Jul 2004 16:35:18 -0000      1.7.2.15
+++ amr.c       5 Aug 2004 11:41:30 -0000
@@ -326,7 +326,7 @@ amr_startup(void *arg)
     /*
      * Start the timeout routine.
      */
-/*    sc->amr_timeout = timeout(amr_periodic, sc, hz);*/
+    sc->amr_timeout = timeout(amr_periodic, sc, hz);
 
     return;
 }
@@ -542,14 +542,16 @@ static void
 amr_periodic(void *data)
 {
     struct amr_softc   *sc = (struct amr_softc *)data;
-
+    int s;
+                            
     debug_called(2);
 
     /* XXX perform periodic status checks here */
 
     /* compensate for missed interrupts */
+    s = splbio();
     amr_done(sc);
-
+    splx(s);
     /* reschedule */
     sc->amr_timeout = timeout(amr_periodic, sc, hz);
 }
      
>Release-Note:
>Audit-Trail:

From: "Simon L. Nielsen" <simon@FreeBSD.org>
To: Michel Gravey <michel.gravey@7ici.biz>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/71771: Hang during heavy load with amr raid controller (466 series / dell perc 2 SC)
Date: Wed, 15 Sep 2004 21:28:47 +0200

 --+HP7ph2BbKc20aGI
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On 2004.09.15 16:14:50 +0000, Michel Gravey wrote:
 >=20
 
 > The hang (no panic) comes under heavy load after 1-5 hours of make world =
 running at -j4(or -j6 or -j12). The system is a proliant 1850R(P3SMP) with =
 4 drives on a hardware raid 5 controller, a amr 466 (dell perc2sc).
 > make.conf: COPTFLAGS=3D -O2 -pipe -march=3Dpentiumpro or GENERIC kernel f=
 rom fresh install
 
 I don't know if it is the problem (might not be), but using -O2 (or
 higher) is unsupported on 4.X and will (AFAIR) break at least part of
 the kernel.
 
 --=20
 Simon L. Nielsen
 FreeBSD Documentation Team
 
 --+HP7ph2BbKc20aGI
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (FreeBSD)
 
 iD8DBQFBSJfuh9pcDSc1mlERAsk+AKCU+6sUVklDwQBQA0d+NWJsedcyxgCfW2Zb
 jCIq+U44fz61FTX7MCi1ooQ=
 =kWnB
 -----END PGP SIGNATURE-----
 
 --+HP7ph2BbKc20aGI--

From: "Michel Gravey" <michel.gravey@7ici.biz>
To: "Michel Gravey" <michel.gravey@7ici.biz>
Cc: <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: kern/71771: Hang during heavy load with amr raid controller (466 series / dell perc 2 SC)
Date: Thu, 16 Sep 2004 11:31:18 +0200

 The hang still occurs with a kernel just compiled with -O.
 So I really need the patch I submitted.
 Maybe not the good way but it works fine for me.
 I can test other patches if you have any.
 
 Have a nice day,
 
 Michel Gravey
 
 ----- Original Message ----- 
 From: "Michel Gravey" <michel.gravey@7ici.biz>
 To: "Simon L. Nielsen" <simon@FreeBSD.org>
 Sent: Wednesday, September 15, 2004 10:35 PM
 Subject: Re: kern/71771: Hang during heavy load with amr raid controller 
 (466 series / dell perc 2 SC)
 
 > Will try now to crash this box (nice program) with a driver not patched 
 > and a -O only.
 > If it doesn't crash, I'm lucky, and no problem with the driver. (I will 
 > report it)
 >
 > Thanks for the tip,
 >
 > Michel Gravey
 > ----- Original Message ----- 
 > From: "Simon L. Nielsen" <simon@FreeBSD.org>
 > To: "Michel Gravey" <michel.gravey@7ici.biz>
 > Cc: <freebsd-gnats-submit@FreeBSD.org>
 > Sent: Wednesday, September 15, 2004 9:28 PM
 > Subject: Re: kern/71771: Hang during heavy load with amr raid controller 
 > (466 series / dell perc 2 SC)
 >
 >On 2004.09.15 16:14:50 +0000, Michel Gravey wrote:
 >
 
 >> The hang (no panic) comes under heavy load after 1-5 hours of make world 
 >> running at -j4(or -j6 or -j12). The system is a proliant 1850R(P3SMP) 
 >> with 4 drives on a hardware raid 5 controller, a amr 466 (dell perc2sc).
 >> make.conf: COPTFLAGS= -O2 -pipe -march=pentiumpro or GENERIC kernel from 
 >> fresh install
 
 >I don't know if it is the problem (might not be), but using -O2 (or
 >higher) is unsupported on 4.X and will (AFAIR) break at least part of
 >the kernel.
 
 >-- 
 >Simon L. Nielsen
 >FreeBSD Documentation Team 
 
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Fri Nov 26 07:51:15 UTC 2010 
State-Changed-Why:  
Can you still reproduce this on a supported release? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71771 
State-Changed-From-To: feedback->closed 
State-Changed-By: jh 
State-Changed-When: Thu Dec 30 16:54:27 UTC 2010 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71771 
>Unformatted:
