From owner-freebsd-current@FreeBSD.ORG Fri Nov 12 22:10:33 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D097816A4CE; Fri, 12 Nov 2004 22:10:33 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E19043D31; Fri, 12 Nov 2004 22:10:33 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id iACM8uGE033474; Fri, 12 Nov 2004 15:08:56 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 12 Nov 2004 15:09:05 -0700 (MST) Message-Id: <20041112.150905.105578119.imp@bsdimp.com> To: scottl@freebsd.org From: "M. Warner Losh" In-Reply-To: <41952FBD.40602@freebsd.org> References: <20041112.143439.33211003.imp@bsdimp.com> <41952FBD.40602@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: usb with fast interrupts X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2004 22:10:34 -0000 In message: <41952FBD.40602@freebsd.org> Scott Long writes: : M. Warner Losh wrote: : > Our usb system supports soft interrupts, but we currently don't make : > productive use of them. The following makes interrupts fast : > interrupts and uses taskqueues to queue data to a SWI. : > : > Lemme know if it works for you. : > : > Warner : > : : Taskqueues aren't good for timing-sensitive operations. Even though USB : may not be terribly sensitive, I bet you'll actually see performance : drops with things like umass with this. Could you instead just put the : real handler into a kthread and wake it up, or use a swi? I'll have to measure, but I've not seen my umass get any slower with this patch... I can't use a SWI, because there's no way to turn off an SWI once you've created it (and I think you'd said you were opposed to creating a SWI cleanup function). I'm not sure how a kthread would be any faster, however, since both a taskqueue and a thread have to go through a scheduling point. A quick test here seems to point out a bug in da: sudo dd if=/dev/da0 of=/dev/null ^C5275+0 records in 5275+0 records out 2700800 bytes transferred in 26.385502 secs (102359 bytes/sec) 3:06pm hammer:[68]> dmesg | egrep da da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 3MB (7904 512 byte sectors: 64H 32S/T 3C) Hmmm, how can I read more than 3MB from da0? I'll have to check to see how fast it is w/o this change. Warner