From owner-freebsd-usb@FreeBSD.ORG Fri Feb 18 15:08:29 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 893B01065674; Fri, 18 Feb 2011 15:08:29 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id DFA008FC0C; Fri, 18 Feb 2011 15:08:28 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=118a5bn0tGnRZbUa9ClBty6BTuM1bA5mUZqmf2RHYp4= c=1 sm=1 a=-lJg8f7At1MA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=ASvhghnQg_3jcw4WWmoA:9 a=-0YCYYA-nIRGUpBvckgA:7 a=IdGOttWfNiAEzrsUtbtFc0WId98A:4 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 89888404; Fri, 18 Feb 2011 16:08:27 +0100 From: Hans Petter Selasky To: "Daniel O'Connor" Date: Fri, 18 Feb 2011 16:08:15 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <9CF6C32F-E230-446B-94FC-C57F0F02B0E4@gsoft.com.au> <0F80A010-B97C-4D05-B604-5EF4B07EF248@gsoft.com.au> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102181608.15368.hselasky@c2i.net> Cc: jhb@freebsd.org, freebsd-usb@freebsd.org Subject: Re: libusb performance on 8.1 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: Fri, 18 Feb 2011 15:08:29 -0000 On Friday 18 February 2011 15:40:07 Daniel O'Connor wrote: > On 03/02/2011, at 17:26, Daniel O'Connor wrote: > > BTW do you have a feel for the latency in bulk vs iso? I currently have > > 5-10 msec of buffering in the hardware which I plan on increasing but > > I'm not sure what a reasonable amount would be :) > > I increased this by a factor of 8 but I still get drop outs during disk > activity. > > I timed libusb_handle_events_timeout() with a timeout of 1 millisecond and > it quite often exceeds this (by a significant amount) eg.. > Triggered at 1298039742 > 2011/02/18 14:35:27:ugsio_child: libusb took > 10msec - 32.44 ms > 2011/02/18 14:35:27:ugsio_child: libusb took > 10msec - 27.19 ms > 2011/02/18 14:35:27:ugsio_child: libusb took > 10msec - 25.27 ms > 2011/02/18 14:35:27:ugsio_child: libusb took > 10msec - 21.83 ms > 2011/02/18 14:35:36:ugsio_child: libusb took > 10msec - 48.23 ms > Error during acquisition - ERROR:305 UGSIO aborted transfer: stalled > > (still using bulk transfers for now) Hi, Which harddisk driver are you using? ATA? My guess would be that taskqueues() in the HDD drivers are using swi-queues, instead of ordinary lower-priority queues. For example in sys/dev/ata I found: TASK_INIT(&request->task, 0, ata_completed, request); ATA_DEBUG_RQ(request, "finish taskqueue_swi"); taskqueue_enqueue(taskqueue_swi, &request->task); Which should perhaps just be "taskqueue_thread" instead of "taskqueue_swi". I've noticed during USB debugging that if certain non-DATA-xfer SCSI commands take time to complete, the whole system is waiting apparently, at least X11. This might indicate that synchronous code is being run from interrupt context. --HPS