From owner-p4-projects@FreeBSD.ORG Thu Dec 20 23:13:01 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8CF5016A469; Thu, 20 Dec 2007 23:13:01 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4366216A418 for ; Thu, 20 Dec 2007 23:13:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 35F8613C4F7 for ; Thu, 20 Dec 2007 23:13:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBKND1gm098687 for ; Thu, 20 Dec 2007 23:13:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBKND126098677 for perforce@freebsd.org; Thu, 20 Dec 2007 23:13:01 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 20 Dec 2007 23:13:01 GMT Message-Id: <200712202313.lBKND126098677@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 131337 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2007 23:13:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=131337 Change 131337 by hselasky@hselasky_laptop001 on 2007/12/20 23:12:18 We need to set higher priority on the interrupt threads. TIP for testing: Buy an USB Sound card and lower the priority of the interrupt thread. When the system is busy you will hear glitches in the sound stream. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#75 edit .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#82 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#75 (text+ko) ==== @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include #include @@ -2687,8 +2689,15 @@ struct usbd_config_td *ctd = arg; struct usbd_config_td_item *item; struct usbd_mbuf *m; + struct thread *td; register int error; + /* adjust priority */ + td = curthread; + thread_lock(td); + sched_prio(td, PI_DISK); + thread_unlock(td); + mtx_lock(ctd->p_mtx); while (1) { @@ -2813,7 +2822,7 @@ } if (usb_thread_create (&usbd_config_td_thread, ctd, &(ctd->config_thread), - "usbd config thread")) { + "USB config thread")) { PRINTFN(0, ("unable to create config thread!\n")); ctd->config_thread = NULL; goto error; ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#82 (text+ko) ==== @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -2121,8 +2123,15 @@ { struct usbd_memory_info *info = arg; struct usbd_xfer *xfer[4]; + struct thread *td; uint8_t dropcount; + /* adjust priority */ + td = curthread; + thread_lock(td); + sched_prio(td, PI_NET); + thread_unlock(td); + mtx_lock(info->usb_mtx); /*