From owner-freebsd-firewire@FreeBSD.ORG Wed Dec 12 22:17:41 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DDFB16A469; Wed, 12 Dec 2007 22:17:41 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id A797713C467; Wed, 12 Dec 2007 22:17:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id lBCLgkWO016721; Wed, 12 Dec 2007 14:42:47 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <476055BF.90808@samsco.org> Date: Wed, 12 Dec 2007 14:42:23 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 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-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Wed, 12 Dec 2007 14:42:47 -0700 (MST) X-Spam-Status: No, score=-1.4 required=5.4 tests=ALL_TRUSTED autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: freebsd-firewire@freebsd.org, freebsd-scsi@freebsd.org Subject: Re: scsi_target witness lock error X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2007 22:17:41 -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. Yep, hate to say it, it dropped off my radar. Sorry. > 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. > I've found that grabbing+dropping a lock in a loop is really, really bad for performance critical paths. The cost of the atomic ops is trivial, but the cost of contention is huge. The same is true of grabbing and dropping locks in a long linear path. Imagine driving down a street with a lot of stoplights, and each stoplight is sensor-triggered by cross traffic. Even if cross-traffic is light and you only have to stop for one light, and that one light is really short, you still loose a lot of time from slowing down and then speeding back up. You could imagine that it would be a lot faster to have all lights stay green for you. Scott