From 1aac6ac94a070ab24ceaf96086475a4d92df8df5 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Sat, 25 Jun 2011 10:01:43 +0000 Subject: [PATCH] generic_stop_cpus: pull timeout logic from under DIAGNOSTIC ... and also increase the timeout. It's better to try to proceed somehow despite stuck CPUs than to hang indefinitely. Especially so during shutdown and when entering kdb or panic. Timeout value is still an aribitrary value. Timeout diagnostic is just a printf; the work on something more debuggable is planned by attilio. Need to be careful here as stop_cpus_hard is called very early while enetering kdb and soon(-ish) it may become called very early when entering panic. Reviewed by: attilio MFC after: 2 months --- sys/kern/subr_smp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index c38177b4e71f..0929ab907589 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -236,12 +236,10 @@ generic_stop_cpus(cpuset_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;