summaryrefslogtreecommitdiff
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-04-17 04:18:08 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-04-17 04:18:08 +0000
commitabd9053ee4f1a9738e39de88f4b4455b5e6a6bb4 (patch)
tree124ccb75f51565f956b9e438326ec74f9a5e89c7 /sys/kern/kern_shutdown.c
parent3c41f323c99a630b97fb12208c8723166ad25046 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index ad79fdcbbb79..55c4ba47d973 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -548,6 +548,10 @@ dumpstatus(vm_offset_t addr, long count)
return 0;
}
+#ifdef SMP
+static u_int panic_cpu = NOCPU;
+#endif
+
/*
* Panic is called on unresolvable fatal errors. It prints "panic: mesg",
* and then reboots. If we are called twice, then we avoid trying to sync
@@ -562,7 +566,11 @@ panic(const char *fmt, ...)
#ifdef SMP
/* Only 1 CPU can panic at a time */
- mtx_lock(&panic_mtx);
+ if (panic_cpu != PCPU_GET(cpuid) &&
+ atomic_cmpset_int(&panic_cpu, NOCPU, PCPU_GET(cpuid)) == 0) {
+ for (;;)
+ ; /* nothing */
+ }
#endif
bootopt = RB_AUTOBOOT | RB_DUMP;