From owner-freebsd-scsi@FreeBSD.ORG Wed Dec 12 20:54:49 2007 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA9816A418; Wed, 12 Dec 2007 20:54:49 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 1726013C45B; Wed, 12 Dec 2007 20:54:48 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 1C23261B04A; Wed, 12 Dec 2007 12:54:48 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18731-10; Wed, 12 Dec 2007 12:54:46 -0800 (PST) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id D76CD61AD83; Wed, 12 Dec 2007 12:54:46 -0800 (PST) Message-ID: <47604A96.6020401@miralink.com> Date: Wed, 12 Dec 2007 12:54:46 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Nate Lawson References: <1197420795.2738.6.camel@iago.office.miralink.com> <86sl28snpe.wl%simokawa@FreeBSD.ORG> <1197425759.14437.0.camel@home-desk> <626eb4530712111837y4608e919w845461d36a18118f@mail.gmail.com> <475F5669.1010800@miralink.com> <476034FE.7080003@miralink.com> <4760446D.2060102@root.org> In-Reply-To: <4760446D.2060102@root.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Wed Dec 12 12:54:47 2007 X-DSPAM-Confidence: 0.7829 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 47604a97113741592213743 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, AWL=-0.000, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: Hidetoshi Shimokawa , freebsd-firewire@freebsd.org, freebsd-scsi@freebsd.org Subject: Re: scsi_target witness lock error X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2007 20:54:49 -0000 Nate Lawson wrote: > Sean Bruno wrote: > >> Alrighty, a little cleaner patch to allow sbp_targ.c to acutally work >> under RELENG_6. http://www.consultcsg.com/RELENG_6.diff >> >> Also and update with the witness error. And the kernel config I am using: >> http://www.consultcsg.com/scsitarget_witness.txt >> http://www.consultcsg.com/FIREWIRE_TGT >> >> Is scsi_target the only application that is making this kern env witness >> error appear? I find it hard to believe that nothing else in the code >> base hits this type of problem? >> > > Apparently scsi_target wasn't fully tested when the CAM locking went in. > It was written before there was a design for CAM locking so it may need > some reworking. For example, it assumes that it should acquire/drop > locks multiple times in its start method if there are multiple CCBs > queued. That may not be the fastest way, depending on contention for > the SIM lock. > > Hmmm...I just applied(ripped off!) a RELENG_7 modifed version of kern_environment.c that uses non-sleepable mutex's and the witness went away. http://www.consultcsg.com/kern_env.diff It appears that you are on to something Nate with regard to the CAM locking. scsi_target appears to be blocking on a call to cam_periph_lock(): http://www.consultcsg.com/cam_periph_lock.txt Hidetoshi suggested a patch that I will now apply and retest: http://consultcsg.com/scsi_target.c.diff I do however, get a kernel panic when trying to exit from scsi_target via ctrl-c http://www.consultcsg.com/knlist_lock.txt Sean P.S. Is the URL based logging working better than a cut/paste into the email for everyone?