From owner-freebsd-usb@FreeBSD.ORG Thu Jan 13 21:24:54 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E806106566B for ; Thu, 13 Jan 2011 21:24:54 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9868FC12 for ; Thu, 13 Jan 2011 21:24:53 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=jVx+AExU5EFhK37+rVAQq6jxd4lXLYohjT2gqEoUpuc= c=1 sm=1 a=x1rYpZKhZ6AA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=L6tdpFjRAAAA:8 a=6I5d2MoRAAAA:8 a=8VP0Rj4qguL7O2_M63MA:9 a=00_Zzu4V4kUwA__9uTkA:7 a=KVZIxizVrvdf97X8XVbmo9HVW6oA:4 a=wPNLvfGTeEIA:10 a=RZHap4myAk8A:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 73387991; Thu, 13 Jan 2011 22:24:51 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Thu, 13 Jan 2011 22:24:54 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <8CD81778A4C13E7-17B0-DFA1@web-mmc-d03.sysops.aol.com> In-Reply-To: <8CD81778A4C13E7-17B0-DFA1@web-mmc-d03.sysops.aol.com> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101132224.54858.hselasky@c2i.net> Cc: freebsd@sopwith.solgatos.com, freebsd-firewire@freebsd.org, freebsd-questions@freebsd.org, dieterbsd@engineer.com Subject: Re: lock contention problem? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 21:24:54 -0000 On Thursday 13 January 2011 21:28:15 dieterbsd@engineer.com wrote: > I suspect that I have a problem with lock/mutex contention. > Reading from a USB disk appears to lock out the firewire driver > for too long, causing data transfer (writing to firewire bus) to fail > with EAGAIN. Once it fails it does not recover. > > kernel: fwohci1: IT DMA underrun (0x40308011) (stat & > OHCI_CNTL_CYCMATCH_S) > last message repeated 63 times > This is from the end of the fwohci_itxbuf_enable() function in > dev/firewire/fwohci.c > > I added LOCK_PROFILING to the kernel and gathered some data. > The data is quite verbose, so I sorted by "max" and am including > the first 40 lines. This is a true real-time task, so I am concerned > with the worst case rather than the average. > Hi, It might be a hardware resource starvation problem. It is possible to nice umass by simply adding a line like: .interval = 2, /* 2 milliseconds */ Inside the following structure in /sys/dev/usb/storage/umass.c : umass_bbb_config[] In states: UMASS_T_BBB_DATA_WRITE UMASS_T_BBB_DATA_READ Another idea: http://svn.freebsd.org/changeset/base/217350 --HPS