Page MenuHomeFreeBSD

panic(9): some updates
ClosedPublic

Authored by mhorne on Mar 16 2023, 7:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 3:50 PM
Unknown Object (File)
Thu, Apr 25, 9:31 PM
Unknown Object (File)
Sat, Apr 20, 8:26 PM
Unknown Object (File)
Feb 1 2024, 10:14 PM
Unknown Object (File)
Feb 1 2024, 10:11 PM
Unknown Object (File)
Dec 20 2023, 7:57 AM
Unknown Object (File)
Dec 12 2023, 12:21 AM
Unknown Object (File)
Nov 11 2023, 10:35 PM
Subscribers

Details

Summary
  • Correct the include headers
  • Better description of what the panic() function does
  • Document KERNEL_PANICKED()
  • Add a section describing panic execution context
  • Add SEE ALSO

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

share/man/man9/panic.9
73

I would just say that it disables interrupts. spinlock_enter() just happens to be the name of the MI function used for that purpose.

87

It'd be worth mentioning debugger_on_panic IMO.

97–147

Maybe "called recursively" would be more clear?

125
129
rpokala added inline comments.
share/man/man9/panic.9
73

When
.Fn panic
or
.Fn vpanic
is entered, the calling thread takes its spinlock.

80

In the unlikely event of concurrent panics, only one panicking thread will proceed.

85

is called to restart the system, attempting a kernel dump in the process.

mhorne marked 8 inline comments as done.

Handle feedback.

share/man/man9/panic.9
73

@rpokala I added a short paragraph that clarifies vpanic(), but I prefer to keep mentions of it out of the main body of the description.

@markj yes, I thought that name was somewhat suspect.

This revision is now accepted and ready to land.Mar 16 2023, 10:04 PM
share/man/man9/panic.9
48–49

Again, traditionally it was sys/systm.h, and we should offer either of the headers as the correct one.

77

I believe the 'first time' is somewhat confusing. The situation you describe is actually the concurrent calls.

This revision now requires review to proceed.Mar 17 2023, 6:24 PM
This revision is now accepted and ready to land.Mar 17 2023, 8:00 PM
markj added inline comments.
share/man/man9/panic.9
71–80
74

Not related to the patch, just a general question: why do spinlock_enter()/_exit() enter a critical section at all? I would expect disabling interrupts to have the same effect, at least in non-INVARIANTS kernels.

share/man/man9/panic.9
74

To prevent context switches in the code executed under spinlock. As an example, imagine that some code took a spinlock, then does critical_enter()/critical_exit(). If owe_preempt is set, we end up trying to reschedule.

share/man/man9/panic.9
74

Oops, of course. Thanks.

This revision was automatically updated to reflect the committed changes.
mhorne marked an inline comment as done.