Page MenuHomeFreeBSD

critical(9): small updates
ClosedPublic

Authored by mhorne on Mar 16 2023, 7:35 PM.
Tags
None
Referenced Files
F102653121: D39130.diff
Fri, Nov 15, 9:30 AM
Unknown Object (File)
Sep 20 2024, 2:35 PM
Unknown Object (File)
Sep 15 2024, 5:44 PM
Unknown Object (File)
Sep 9 2024, 12:54 AM
Unknown Object (File)
Sep 4 2024, 10:32 PM
Unknown Object (File)
Sep 4 2024, 10:32 PM
Unknown Object (File)
Sep 4 2024, 10:32 PM
Unknown Object (File)
Sep 4 2024, 10:32 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 50423
Build 47314: 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

51

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

63

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

69
72

... 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
55
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.
66

... 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.