Subject: Re: SMP re-eetrancy in "bottom half" drivers
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Stephan Uphoff <ups@tree.com>
List: tech-kern
Date: 05/18/2005 18:03:54
On Tue, 2005-05-17 at 17:59, YAMAMOTO Takashi wrote:
> > > Yes; your old patch for i386 SMP effectively collapsed all SPLs to a
> > > single level. That way, no driver should interrupt another.
> > 
> > One level may be a little extreme since you may run into trouble with
> > pmap operations in drivers that need interprocessor interrupts for TLB
> > shootdowns.
> > Serial devices (and others) may also take a dim few on the latency
> > issues this may cause.
> 
> sure.  the following is the hack part of the old patch.
> 
> YAMAMOTO Takashi
> 
> @@ -23,12 +26,22 @@
>  #define        IPL_NONE        0x0     /* nothing */ 
>  #define        IPL_SOFTCLOCK   0x4     /* timeouts */
>  #define        IPL_SOFTNET     0x5     /* protocol stacks */
> +#ifndef MULTIPROCESSOR
>  #define        IPL_BIO         0x6     /* block I/O */
>  #define        IPL_NET         0x7     /* network */ 
>  #define        IPL_SOFTSERIAL  0x8     /* serial */  
>  #define        IPL_TTY         0x9     /* terminal */
>  #define        IPL_VM          0xa     /* memory allocation */
>  #define        IPL_AUDIO       0xb     /* audio */
> +#else /* MULTIPROCESSOR */
> +/* XXX XXX for locking order */
> +#define        IPL_BIO         0x7     /* block I/O */
> +#define        IPL_NET         0x7     /* network */ 
> +#define        IPL_SOFTSERIAL  0x7     /* serial */  
> +#define        IPL_TTY         0x7     /* terminal */
> +#define        IPL_VM          0x7     /* memory allocation */
> +#define        IPL_AUDIO       0x7     /* audio */
> +#endif /* MULTIPROCESSOR */
>  #define        IPL_CLOCK       0xc     /* clock */
>  #define IPL_SCHED      IPL_CLOCK
>  #define        IPL_HIGH        0xd     /* everything */

Thanks - this is definitely more than one level ;-)
More in a few days - when I had some time to think about the issues.

Stephan