From owner-freebsd-current@FreeBSD.ORG Mon Nov 15 08:04:50 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 8E37C16A4CE for ; Mon, 15 Nov 2004 08:04:50 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A64B43D48 for ; Mon, 15 Nov 2004 08:04:50 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id iAF86mEI017365; Mon, 15 Nov 2004 01:06:48 -0700 (MST) (envelope-from scottl@freebsd.org) Message-ID: <41986351.2070806@freebsd.org> Date: Mon, 15 Nov 2004 01:05:37 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040929 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John-Mark Gurney References: <20041112.143439.33211003.imp@bsdimp.com> <41952FBD.40602@freebsd.org> <20041115080155.GH57546@funkthat.com> In-Reply-To: <20041115080155.GH57546@funkthat.com> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: current@freebsd.org cc: "M. Warner Losh" 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: Mon, 15 Nov 2004 08:04:50 -0000 John-Mark Gurney wrote: > Scott Long wrote this message on Fri, Nov 12, 2004 at 14:48 -0700: > >>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. >> >>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? > > > If you need low latency, I made taskqueue's easier to create: > TASKQUEUE_DEFINE_THREAD(kqueue); > > and then use: > taskqueue_enqueue(taskqueue_kqueue, &kq->kq_task); > > of course replace kqueue w/ your own string... Check the taskqueue(9) > man page for more details. > So the only problem with TASKQUEUE_DEFINE_THREAD() is that it appears impossible at the moment to clean up the thread that this creates when the driver wants to unload. Scott