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

(cherry picked from commit d2870b8666f2438af400269c0f6a1a48031bb71e)

Details

Provenance
markjAuthored on Feb 14 2025, 3:45 PM
Reviewer
kib
Differential Revision
D48899: ktr: Avoid assertion failures from an unlocked STAILQ_EMPTY check
Parents
rG875ec35c0661: gve: Fix qpl_buf_head being initialized improperly
Branches
Unknown
Tags
Unknown