From owner-freebsd-usb@FreeBSD.ORG Tue Mar 3 22:15:44 2009 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 5AC3D1065672 for ; Tue, 3 Mar 2009 22:15:44 +0000 (UTC) (envelope-from stevecalfee@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.229]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9E98FC19 for ; Tue, 3 Mar 2009 22:15:44 +0000 (UTC) (envelope-from stevecalfee@gmail.com) Received: by rv-out-0506.google.com with SMTP id f6so3405772rvb.43 for ; Tue, 03 Mar 2009 14:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LBbK/+4N0A8qpAib+YIHfyIEVgD+d/uPMV6cheX6bKA=; b=e8i3O+1FRmuuOivZbh/v/CQ18o+2Fwr5VCWXkdDF6RS/Yu9GPPoVOv88a4cA/hz50s vkQqtvUWBJDib1wT8N7HGgPd5NunFPONvG5/mG15pZ2u7K5qQHtKBAS+xEDqjwrceTYF 1Ga/TfdsZmBDgOPUlUOFtbcUj6NcHp00p+xpY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=mBLm1Sqrs2KtZysTZqgP2B4WHb+MsyY27GEYt8LH0d/sccelMDYfK2yZmt2VR0cLid m65uZMoavKAiU5mohVgUIasYNHlI3RbVl9mjl2JTE6We5gZuICBBwOMvL5QxhKe8OxIV acZPE1Q15WvRNR08NF9S4znfRS7KPWwiap32o= MIME-Version: 1.0 Received: by 10.115.22.1 with SMTP id z1mr3633693wai.202.1236118543858; Tue, 03 Mar 2009 14:15:43 -0800 (PST) In-Reply-To: <200903032243.31914.hselasky@c2i.net> References: <200903010045.44904.man@email.com.ua> <200903031516.02744.hselasky@c2i.net> <200903032006.54451.man@email.com.ua> <200903032243.31914.hselasky@c2i.net> Date: Tue, 3 Mar 2009 14:15:43 -0800 Message-ID: <4a5ff6bc0903031415s16158407m386b8321a5082996@mail.gmail.com> From: Steve Calfee To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: Low perfomance when read from usb flash drive 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: Tue, 03 Mar 2009 22:15:44 -0000 > I think the reduced performance can be explained by a clamp on the interrupt > rate around 1000 interrupts per second instead of 8000. Maybe someone has an > explanation for this? > > The EHCI is being programmed to interrupt at 125us intervals, but there seems > to be limits other places. > > It is possible to workaround this in the umass driver by doing the cmd + read > in one operation. Hi Hans, I am looking at using FreeBSD in an embedded product. I have not examined your ehci software, but I am aware of how Linux and other OSes run the controller. Why are you taking an interrupt every uFrame SOF? What can you possibly do then? You are not in a RTOS, you are not guaranteed to even get that fast an interrupt. The whole point of the magic ehci DMA engine is that many transactions can be programmed and then they can interrupt when they are done. The Periodic list is set up with (hopefully) enough transactions that the OS can keep up, and async doesn't care at all - the only impact is possible xfer speed. Taking really fast periodic (uFrame) interrupts guarantees no faster transfers than just having the end of transfer interrupt. Just wondering. Regards, Steve