Page MenuHomeFreeBSD

vt: avoid grabbing locks for KERNEL_PANICKED() as well
AcceptedPublic

Authored by kevans on Fri, Jan 10, 4:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 22, 10:48 PM
Unknown Object (File)
Thu, Jan 16, 10:09 PM
Unknown Object (File)
Fri, Jan 10, 3:35 PM
Subscribers

Details

Reviewers
emaste
manu
jhb
Summary

This matches the precise conditional we use elsewhere; we can end up
trying to grab the console for a panic that isn't routed through kdb
with, e.g., an explicit call to panic() via a failed assertion or some
such. The scheduler's generally stopped by the time we try to do a
window switch, so we shouldn't try to do any of the normal locking.

Note that this doesn't mean we'll succeed at grabbing the console. If
i915kms is active, for instance, then we won't be able to switch to
ttyv0 to draw the panic message. This does avoid stacking an additional
unrelated panic on top of a panic that we're actually interested in,
though.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61639
Build 58523: arc lint + arc unit

Event Timeline

I'm fine with this. Don't the locking implementations just bail without panicking though if a panic is already active, or is the nested panic not inside a lock but elsewhere?

In D48414#1104253, @jhb wrote:

I'm fine with this. Don't the locking implementations just bail without panicking though if a panic is already active, or is the nested panic not inside a lock but elsewhere?

The panic I saw was deep inside cv_broadcast, iirc, but I purged the dump information already

This revision is now accepted and ready to land.Sat, Jan 11, 10:03 AM

I'm doing a more thorough review of vt_window_switch() after thinking more on jhb's comment in D48413... the lock moved in that one is for a branch that's effectively dead code after this change and should've been removed here anyways. Right now I just get a frozen UI if I panic with xfce in focus on ttyv9 (but no nested panic), and I'm not sure I'm convinced that that would play out any differently even if we could attempt most of the rest of vt_window_switch() while panicking.