HomeFreeBSD

x86: Halt non-BSP CPUs on panic IPI_STOP

Description

x86: Halt non-BSP CPUs on panic IPI_STOP

We may need the BSP to reboot, but we don't need any AP CPU that isn't the
panic thread. Any CPU landing in this routine during panic isn't the panic
thread, so we can just detect !BSP && panic and shut down the logical core.

The savings can be demonstrated in a bhyve guest with multiple cores; before
this change, N guest threads would spin at 100% CPU. After this change,
only one or two threads spin (depending on if the panicing CPU was the BSP
or not).

Konstantin points out that this may break any future patches which allow
switching ddb(4) CPUs after panic and examining CPU-local state that cannot
be inspected remotely. In the event that such a mechanism is incorporated,
this behavior could be made configurable by tunable/sysctl.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20019

Details

Provenance
cemAuthored on
Reviewer
kib
Differential Revision
D20019: x86: Halt non-BSP CPUs on panic IPI_STOP
Parents
rS346642: fusefs: handle ENOSYS for FUSE_INTERRUPT
Branches
Unknown
Tags
Unknown