Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2011 09:55:15 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        John Baldwin <jhb@freebsd.org>
Subject:   Re: Adjust USB kthread priorities
Message-ID:  <201101130955.15676.hselasky@c2i.net>
In-Reply-To: <201101121703.37226.jhb@freebsd.org>
References:  <201101121703.37226.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 12 January 2011 23:03:37 John Baldwin wrote:
> Currently the USB kthreads created for each USB bus use hardware interrupt
> priorities.  I think this is wrong and that they should use software
> interrupt priorities instead.  This patch would do that:
> 
> --- //depot/projects/smpng/sys/dev/usb/usb_process.h	2009-08-25
> 21:12:15.000000000 0000 +++
> //depot/user/jhb/socket/dev/usb/usb_process.h	2010-12-21
> 20:30:04.000000000 0000 @@ -27,11 +27,13 @@
>  #ifndef _USB_PROCESS_H_
>  #define	_USB_PROCESS_H_
> 
> +#include <sys/interrupt.h>
>  #include <sys/priority.h>
> +#include <sys/runq.h>
> 
>  /* defines */
> -#define	USB_PRI_HIGH PI_NET
> -#define	USB_PRI_MED PI_DISK
> +#define	USB_PRI_HIGH	PI_SWI(SWI_NET)
> +#define	USB_PRI_MED	PI_SWI(SWI_CAMBIO)
> 
>  #define	USB_PROC_WAIT_TIMEOUT 2
>  #define	USB_PROC_WAIT_DRAIN   1

Your suggestion is OK. The priority assignments were made to avoid USB threads 
competing with other userland threads.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101130955.15676.hselasky>