Page MenuHomeFreeBSD

critical(9): small updates
ClosedPublic

Authored by mhorne on Mar 16 2023, 7:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 9:59 AM
Unknown Object (File)
Wed, May 1, 9:52 PM
Unknown Object (File)
Wed, May 1, 9:50 PM
Unknown Object (File)
Wed, May 1, 9:50 PM
Unknown Object (File)
Wed, May 1, 9:41 PM
Unknown Object (File)
Wed, May 1, 3:53 PM
Unknown Object (File)
Fri, Apr 26, 3:37 PM
Unknown Object (File)
Fri, Apr 26, 10:38 AM

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.