HomeFreeBSD

queue: Add atomic variants for *_EMPTY

Description

queue: Add atomic variants for *_EMPTY

In some places, these macros are used without a lock, under the
assumption that they are naturally atomic. After commit
34740937f7a4 ("queue: New debug macros for STAILQ"), this assumption is
false.

Provide *_EMPTY_ATOMIC for such cases. This lets us include extra debug
checks for the non-atomic case, and gives us a way to explicitly
annotate unlocked checks, which generally deserve extra scrutiny and
might otherwise raise reports from KCSAN.

Reviewed by: kib, olce (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D48899

Details

Provenance
markjAuthored on Fri, Feb 14, 3:45 PM
Reviewer
kib
Differential Revision
D48899: ktr: Avoid assertion failures from an unlocked STAILQ_EMPTY check
Parents
rGfbacadf103dc: vmm: Add vmm_fence.c to SRCS for vmm.ko on riscv
Branches
Unknown
Tags
Unknown