Page MenuHomeFreeBSD

D20019.id56519.diff
No OneTemporary

D20019.id56519.diff

Index: sys/x86/x86/mp_x86.c
===================================================================
--- sys/x86/x86/mp_x86.c
+++ sys/x86/x86/mp_x86.c
@@ -1397,8 +1397,10 @@
cpustop_handler(void)
{
u_int cpu;
+ int apic;
cpu = PCPU_GET(cpuid);
+ apic = PCPU_GET(apic_id);
savectx(&stoppcbs[cpu]);
@@ -1406,8 +1408,18 @@
CPU_SET_ATOMIC(cpu, &stopped_cpus);
/* Wait for restart */
- while (!CPU_ISSET(cpu, &started_cpus))
- ia32_pause();
+ while (!CPU_ISSET(cpu, &started_cpus)) {
+ ia32_pause();
+
+ /*
+ * Halt non-BSP CPUs on panic -- we're never going to need them
+ * again, and might as well save power / release resources
+ * (e.g., overprovisioned VM infrastructure).
+ */
+ while (__predict_false(boot_cpu_id != -1 && apic != boot_cpu_id
+ && panicstr != NULL))
+ halt();
+ }
cpustop_handler_post(cpu);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 26, 1:28 AM (4 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24204113
Default Alt Text
D20019.id56519.diff (854 B)

Event Timeline