Page MenuHomeFreeBSD

critical(9): small updates
ClosedPublic

Authored by mhorne on Mar 16 2023, 7:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 5 2023, 11:23 PM
Unknown Object (File)
Sep 5 2023, 10:40 PM
Unknown Object (File)
Aug 15 2023, 12:50 AM
Unknown Object (File)
Jul 12 2023, 10:08 AM
Unknown Object (File)
Jul 9 2023, 7:16 AM
Unknown Object (File)
Jul 4 2023, 7:42 PM
Unknown Object (File)
Jun 19 2023, 7:42 PM
Unknown Object (File)
Jun 3 2023, 5:07 PM

Details

Summary
  • Document CRITICAL_ASSERT() in this man page.
  • Clarify that a thread may also handle interrupts in a critical section, not only faults/exceptions.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Mar 16 2023, 7:51 PM
share/man/man9/critical_enter.9
40

FWIW kassert.h is included from systm.h

50

... which do not result in a context switch on interrupt exit, instead the context switch is postponed to the critical section exit.

67–68

s/are not required to provide/do not provide/ ?

72–73
76–77

... which might need a context switch to operate.

Might be, it is useful to say that critical section is similar to disabling interrupts, but incurs less overhead and less latency for the filtered interrupt handlers.

Also, it might be useful to note that abusing critical sections affects system latency for interrupt handling, and timers precision.

Handle kib's comments and suggested additions.

This revision now requires review to proceed.Mar 17 2023, 6:23 PM
mhorne added inline comments.
share/man/man9/critical_enter.9
40

I restored it to systm.h in all cases. I could not find a way to cleanly communicate

#include <sys/kassert.h> OR #include <sys/systm.h>

in the synopsis section, or any existing example of this. Maybe someone has a suggestion.

kib added inline comments.
share/man/man9/critical_enter.9
40

I suggest adding a NOTE section saying that sys/kassert.h can be used instead of sys/systm.h

This revision is now accepted and ready to land.Mar 17 2023, 7:55 PM
share/man/man9/critical_enter.9
53
The CPU might also receive and handle interrupts within a critical section.
In that case, the signal handler will not result in a context switch, and will return to the critical section when complete.
69

... guarantees, and thus ...

English LGTM. Can't attest to consistency with source code.

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