PERFORCE change 112980 for review

John Baldwin jhb at freebsd.org
Tue Jan 16 21:10:24 UTC 2007


On Tuesday 16 January 2007 05:11, Paolo Pisati wrote:
> http://perforce.freebsd.org/chv.cgi?CH=112980
> 
> Change 112980 by piso at piso_newluxor on 2007/01/16 10:10:55
> 
> 	Move spin lock acquisition inside the interrupt scanning
> 	function.
> 	While here, fix spacing and indentation.

FYI, callout_init_mtx() doesn't work with spin mutexes.

> Affected files ...
> 
> .. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#20 edit
> 
> Differences ...
> 
> ==== //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#20 (text+ko) 
====
> 
> @@ -273,7 +273,7 @@
>  {
>  
>  	mtx_init(&ia64_intrs_lock, "intr table", NULL, MTX_SPIN);
> -	callout_init_mtx(&stray_callout_handle, &ia64_intrs_lock, 0);
> +	callout_init(&stray_callout_handle, 1);
>  }
>  SYSINIT(ithds_init, SI_SUB_INTR, SI_ORDER_SECOND, ithds_init, NULL);
>  
> @@ -361,10 +361,13 @@
>  walk_intr_ia64(void) {
>  	struct ia64_intr *ia64_i;
>  	static int i = 0;
> +	int j;
>  
> -	for (; i < IA64_NUMI; ) {
> -		int j = i++;
> +	for (; i < IA64_NUMI;) {
> +		j = i++;
> +		mtx_lock_spin(&ia64_intrs_lock);
>  		ia64_i = ia64_intrs[j];
> +		mtx_unlock_spin(&ia64_intrs_lock);
>  		if (ia64_i != NULL && ia64_i->event != NULL)
>  			return (ia64_i->event);
>  	}
> @@ -374,12 +377,10 @@
>  
>  void
>  intr_callout_reset(void) 
> -{
> -	
> -	mtx_lock_spin(&ia64_intrs_lock);
> +{	
> +
>  	callout_reset(&stray_callout_handle, hz, 
> -		      &stray_detection, &walk_intr_ia64);
> -	mtx_unlock_spin(&ia64_intrs_lock);	
> +	    &stray_detection, &walk_intr_ia64);
>  }
>  
>  static void
> 

-- 
John Baldwin


More information about the p4-projects mailing list