Page MenuHomeFreeBSD

panic(9): some updates
ClosedPublic

Authored by mhorne on Mar 16 2023, 7:36 PM.
Tags
None
Referenced Files
F102641140: D39132.id118947.diff
Fri, Nov 15, 5:32 AM
Unknown Object (File)
Oct 16 2024, 5:39 AM
Unknown Object (File)
Oct 15 2024, 11:22 AM
Unknown Object (File)
Oct 15 2024, 11:22 AM
Unknown Object (File)
Oct 14 2024, 4:08 AM
Unknown Object (File)
Oct 12 2024, 8:54 PM
Unknown Object (File)
Oct 11 2024, 7:05 PM
Unknown Object (File)
Oct 9 2024, 2:11 AM
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.