[openib-general] Re: Re[PATCH] Opensm - clean exit on ^C

Hal Rosenstock halr at voltaire.com
Mon Jan 9 06:55:34 PST 2006


Hi Yael,

On Thu, 2006-01-05 at 07:16, Yael Kalka wrote:
> Hi Hal,
> 
> I've noticed that sometimes when killing OpenSM using ^C not all
> threads are killed.
> The reason for that is that there are threads that mask the
> signalling, and when removing the ^C handling from OpenSM, these
> threads still mask the signalling and stay alive as a result.
> The following patch fixes this.

Is there one other piece to this ? Doesn't osm_opensm.c need to be
modified to handle SIGINT for OSM_VENDOR_INTF_OPENIB ? Thanks.

void
osm_reg_sig_handler(
   IN osm_opensm_t * const p_osm )
{
   __p_osm_to_signal = p_osm;
#ifndef OSM_VENDOR_INTF_OPENIB 
   cl_reg_sig_hdl( SIGINT, __sig_handler );
#endif

-- Hal


> Thanks,
> Yael
> 
> Signed-off-by:  Yael Kalka <yael at mellanox.co.il>
> 
> Index: include/complib/cl_signal_osd.h
> ===================================================================
> --- include/complib/cl_signal_osd.h	(revision 4760)
> +++ include/complib/cl_signal_osd.h	(working copy)
> @@ -148,12 +148,14 @@ cl_sig_mask_sigint(void)
>   #ifdef __WIN__
>    /* we do not mask kill */
>   #else	
> +#ifndef OSM_VENDOR_INTF_OPENIB 
>     sigset_t sigs;
>        
>     sigemptyset(&sigs);
>     sigaddset(&sigs, SIGINT);
>     pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> - #endif
> +#endif /* OSM_VENDOR_INTF_OPENIB */
> +#endif /* __WIN__ */
>  }
>  /*
>  *********/
> Index: libvendor/osm_vendor_ibumad.c
> ===================================================================
> --- libvendor/osm_vendor_ibumad.c	(revision 4760)
> +++ libvendor/osm_vendor_ibumad.c	(working copy)
> @@ -244,10 +244,6 @@ umad_receiver(void *p_ptr)
>  
>  	OSM_LOG_ENTER( p_ur->p_log, umad_receiver );
>  
> -	sigemptyset(&sigs);
> -	sigaddset(&sigs, SIGINT);
> -	pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> -
>  	for (;;) {
>  		if (!umad &&
>  		    !(umad = umad_alloc(1, umad_size() + MAD_BLOCK_SIZE))) {
> 




More information about the general mailing list