Page MenuHomeFreeBSD

critical(9): small updates
ClosedPublic

Authored by mhorne on Mar 16 2023, 7:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 5:08 PM
Unknown Object (File)
Thu, Dec 12, 12:15 PM
Unknown Object (File)
Wed, Dec 11, 9:50 PM
Unknown Object (File)
Tue, Dec 10, 6:14 AM
Unknown Object (File)
Nov 15 2024, 11:41 AM
Unknown Object (File)
Nov 15 2024, 11:25 AM
Unknown Object (File)
Nov 15 2024, 9:30 AM
Unknown Object (File)
Sep 20 2024, 2:35 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 Passed
Unit
No Test Coverage
Build Status
Buildable 50447
Build 47338: arc lint + arc unit

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.