Re: [poll / rfc] kdb_stop_cpus

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Wed, 22 Jun 2011 18:49:27 +0300
on 04/06/2011 11:22 Andriy Gapon said the following:
> commit 458ebd9aca7e91fc6e0825c727c7220ab9f61016
> 
>     generic_stop_cpus: move timeout detection code from under DIAGNOSTIC
> 
>     ... and also increase it a bit.
>     IMO it's better to detect and report the (rather serious) condition and
>     allow a system to proceed somehow rather than be stuck in an endless
>     loop.
> 
> diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
> index ae52f4b..4bd766b 100644
> --- a/sys/kern/subr_smp.c
> +++ b/sys/kern/subr_smp.c
> _at__at_ -232,12 +232,10 _at__at_ generic_stop_cpus(cpumask_t map, u_int type)
>  		/* spin */
>  		cpu_spinwait();
>  		i++;
> -#ifdef DIAGNOSTIC
> -		if (i == 100000) {
> +		if (i == 100000000) {
>  			printf("timeout stopping cpus\n");
>  			break;
>  		}
> -#endif
>  	}
> 
>  	stopping_cpu = NOCPU;
> 
> 

I would like to commit the above, if nobody objects.

A to do item is adding some code to aid debugging of the timeout condition.  I
discussed this with Attilio, he doesn't see this as a show-stopper and he plans to
add the code at a later time.

-- 
Andriy Gapon
Received on Wed Jun 22 2011 - 13:49:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:15 UTC