Queued Spinlock (MCS-based 4-byte qspinlock)
include/sync/qspinlock.h View source View on GitHub TODO
I would really like to use a CNA lock/cohorting as an extension to qspinlock, possibly also with a boot-time flag to enable/disable it for testing. Could be super interesting!
Structs
Section titled “Structs”qspinlock_acq_scope
Section titled “qspinlock_acq_scope” struct qspinlock_acq_scope (3 fields) source
qspinlock_rel_scope
Section titled “qspinlock_rel_scope” struct qspinlock_rel_scope (3 fields) source
qspinlock_acq_scope
Section titled “qspinlock_acq_scope”qspinlock_rel_scope
Section titled “qspinlock_rel_scope”qspinlock_guard
Section titled “qspinlock_guard”qspinlock_level
Section titled “qspinlock_level” enum qspinlock_level (4 variants) source
Functions
Section titled “Functions”qspinlock_init_chk_full
Section titled “qspinlock_init_chk_full”void qspinlock_init_chk_full(
struct qspinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source qspin_is_locked
Section titled “qspin_is_locked”qspinlock_policy_init_internal
Section titled “qspinlock_policy_init_internal”void qspinlock_policy_init_internal(
struct qspinlock *lock,
enum lock_chk_flags flags
) source qspinlock_map_init_internal
Section titled “qspinlock_map_init_internal”void qspinlock_map_init_internal(
struct qspinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source qspinlock_shallow_init_internal
Section titled “qspinlock_shallow_init_internal”qspinlock_set_chk_flags
Section titled “qspinlock_set_chk_flags”void qspinlock_set_chk_flags(
struct qspinlock *lock,
enum lock_chk_flags flags
) source qspinlock_reinit_chk
Section titled “qspinlock_reinit_chk”void qspinlock_reinit_chk(
struct qspinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source qspinlock_note_use
Section titled “qspinlock_note_use”void qspinlock_note_use(
struct qspinlock *lock,
enum lock_op_flags flags
) source qspinlock_order_checked
Section titled “qspinlock_order_checked”qspinlock_stamp
Section titled “qspinlock_stamp” TODO
move stamping to initialization, but we are using this HACK: because it’s fine anyways
qspinlock_classify
Section titled “qspinlock_classify”void qspinlock_classify(
struct qspinlock *lock,
enum lock_op_flags usage,
const struct lock_chk_site *site
) source qspinlock_deep_checked
Section titled “qspinlock_deep_checked”qspinlock_chk_acq_req
Section titled “qspinlock_chk_acq_req”struct lock_chk_acq_req qspinlock_chk_acq_req(
struct qspinlock *lock,
const struct lock_chk_site *site,
enum lock_subclass subclass,
enum lock_op_flags flags
) source qspinlock_chk_rel_req
Section titled “qspinlock_chk_rel_req”struct lock_chk_rel_req qspinlock_chk_rel_req(
struct qspinlock *lock,
const struct lock_chk_site *site
) source qspinlock_acq_begin
Section titled “qspinlock_acq_begin”void qspinlock_acq_begin(
struct qspinlock_acq_scope *scope,
struct qspinlock *lock,
const struct lock_chk_site *site,
enum lock_subclass subclass,
enum lock_op_flags flags
) source qspinlock_acq_commit
Section titled “qspinlock_acq_commit”void qspinlock_acq_commit(struct qspinlock_acq_scope *scope) source qspinlock_acq_abort
Section titled “qspinlock_acq_abort”void qspinlock_acq_abort(struct qspinlock_acq_scope *scope) source qspinlock_rel_begin
Section titled “qspinlock_rel_begin”void qspinlock_rel_begin(
struct qspinlock_rel_scope *scope,
struct qspinlock *lock,
const struct lock_chk_site *site
) source qspinlock_rel_commit
Section titled “qspinlock_rel_commit”void qspinlock_rel_commit(struct qspinlock_rel_scope *scope) source qspinlock_shallow_push
Section titled “qspinlock_shallow_push”void qspinlock_shallow_push(
struct qspinlock *lock,
enum irql irql,
const struct lock_chk_site *site
) source qspinlock_shallow_validate_top
Section titled “qspinlock_shallow_validate_top”void qspinlock_shallow_validate_top(
struct qspinlock *lock,
enum irql old,
const struct lock_chk_site *site
) source qspinlock_shallow_pop
Section titled “qspinlock_shallow_pop”qspinlock_assert_held_deep
Section titled “qspinlock_assert_held_deep”bool qspinlock_assert_held_deep(
struct qspinlock *lock,
bool want_held,
const struct lock_chk_site *site
) source qspinlock_policy_init_internal
Section titled “qspinlock_policy_init_internal”void qspinlock_policy_init_internal(
struct qspinlock *lock,
enum lock_chk_flags flags
) source qspinlock_map_init_internal
Section titled “qspinlock_map_init_internal”void qspinlock_map_init_internal(
struct qspinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source qspinlock_shallow_init_internal
Section titled “qspinlock_shallow_init_internal”qspinlock_set_chk_flags
Section titled “qspinlock_set_chk_flags”void qspinlock_set_chk_flags(
struct qspinlock *lock,
enum lock_chk_flags flags
) source qspinlock_reinit_chk
Section titled “qspinlock_reinit_chk”void qspinlock_reinit_chk(
struct qspinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source qspinlock_note_use
Section titled “qspinlock_note_use”void qspinlock_note_use(
struct qspinlock *lock,
enum lock_op_flags flags
) source qspinlock_order_checked
Section titled “qspinlock_order_checked”qspinlock_classify
Section titled “qspinlock_classify”void qspinlock_classify(
struct qspinlock *lock,
enum lock_op_flags usage,
const struct lock_chk_site *site
) source qspinlock_deep_checked
Section titled “qspinlock_deep_checked”qspinlock_acq_begin
Section titled “qspinlock_acq_begin”void qspinlock_acq_begin(
struct qspinlock_acq_scope *scope,
struct qspinlock *lock,
const struct lock_chk_site *site,
enum lock_subclass subclass,
enum lock_op_flags flags
) source qspinlock_acq_commit
Section titled “qspinlock_acq_commit”void qspinlock_acq_commit(struct qspinlock_acq_scope *scope) source qspinlock_acq_abort
Section titled “qspinlock_acq_abort”void qspinlock_acq_abort(struct qspinlock_acq_scope *scope) source qspinlock_rel_begin
Section titled “qspinlock_rel_begin”void qspinlock_rel_begin(
struct qspinlock_rel_scope *scope,
struct qspinlock *lock,
const struct lock_chk_site *site
) source qspinlock_rel_commit
Section titled “qspinlock_rel_commit”void qspinlock_rel_commit(struct qspinlock_rel_scope *scope) source qspinlock_shallow_push
Section titled “qspinlock_shallow_push”void qspinlock_shallow_push(
struct qspinlock *lock,
enum irql irql,
const struct lock_chk_site *site
) source qspinlock_shallow_validate_top
Section titled “qspinlock_shallow_validate_top”void qspinlock_shallow_validate_top(
struct qspinlock *lock,
enum irql old,
const struct lock_chk_site *site
) source qspinlock_shallow_pop
Section titled “qspinlock_shallow_pop”qspinlock_assert_held_deep
Section titled “qspinlock_assert_held_deep”bool qspinlock_assert_held_deep(
struct qspinlock *lock,
bool want_held,
const struct lock_chk_site *site
) source qspinlock_init_chk_full
Section titled “qspinlock_init_chk_full”void qspinlock_init_chk_full(
struct qspinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source qspin_trylock_physical
Section titled “qspin_trylock_physical”cc_warn_unused_result bool qspin_trylock_physical(struct qspinlock *lock) source qspin_lock_slowpath
Section titled “qspin_lock_slowpath”qspin_lock_physical
Section titled “qspin_lock_physical”qspin_unlock_physical
Section titled “qspin_unlock_physical”qspin_is_locked
Section titled “qspin_is_locked”qspin_trylock_raw_full
Section titled “qspin_trylock_raw_full”cc_warn_unused_result bool qspin_trylock_raw_full(
struct qspinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source qspin_lock_raw_full
Section titled “qspin_lock_raw_full”void qspin_lock_raw_full(
struct qspinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source qspin_unlock_raw_full
Section titled “qspin_unlock_raw_full”void qspin_unlock_raw_full(
struct qspinlock *lock,
const struct lock_chk_site *site
) source qspin_unlock_full
Section titled “qspin_unlock_full”void qspin_unlock_full(
struct qspinlock *lock,
enum irql old_irql,
const struct lock_chk_site *site
) source qspin_lock_full
Section titled “qspin_lock_full”irql qspin_lock_full(
struct qspinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source qspin_lock_high_full
Section titled “qspin_lock_high_full”irql qspin_lock_high_full(
struct qspinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source qspin_trylock_full
Section titled “qspin_trylock_full”cc_warn_unused_result bool qspin_trylock_full(
struct qspinlock *lock,
enum irql *out,
enum lock_subclass sc,
const struct lock_chk_site *site
) source qspin_trylock_high_full
Section titled “qspin_trylock_high_full”cc_warn_unused_result bool qspin_trylock_high_full(
struct qspinlock *lock,
enum irql *out,
enum lock_subclass sc,
const struct lock_chk_site *site
) source qspin_assert_held_full
Section titled “qspin_assert_held_full”void qspin_assert_held_full(
struct qspinlock *lock,
const struct lock_chk_site *site
) source qspin_assert_not_held_full
Section titled “qspin_assert_not_held_full”void qspin_assert_not_held_full(
struct qspinlock *lock,
const struct lock_chk_site *site
) source qspinlock_guard_assume
Section titled “qspinlock_guard_assume”qspinlock_guard_exit
Section titled “qspinlock_guard_exit”void qspinlock_guard_exit(struct qspinlock_guard *g) source qspin_guard_enter
Section titled “qspin_guard_enter”struct qspinlock_guard qspin_guard_enter(struct qspinlock *lock) source qspin_guard_high_enter
Section titled “qspin_guard_high_enter”struct qspinlock_guard qspin_guard_high_enter(struct qspinlock *lock) source qspin_guard_high_subclass_enter
Section titled “qspin_guard_high_subclass_enter”struct qspinlock_guard qspin_guard_high_subclass_enter(
struct qspinlock *lock,
enum lock_subclass sc
) source qspin_guard_subclass_enter
Section titled “qspin_guard_subclass_enter”struct qspinlock_guard qspin_guard_subclass_enter(
struct qspinlock *lock,
enum lock_subclass sc
) source Variables
Section titled “Variables”struct lock_chk_lock chk source irq_usage
Section titled “irq_usage”atomic(enum lock_op_flags) irq_usage source Macros
Section titled “Macros”Q_SPIN_LOCKED_OFFSET
Section titled “Q_SPIN_LOCKED_OFFSET”#define Q_SPIN_LOCKED_OFFSET 0 source Bit layout of the lock word:
0 - 7: locked byte (Q_SPIN_LOCKED_VAL = 0x01) 8 : pending bit (Q_SPIN_PENDING_VAL = 0x100) 9 - 10: tail context index 16 - 31: tail CPU ID + 1 (16 bits)
Q_SPIN_LOCKED_BITS
Section titled “Q_SPIN_LOCKED_BITS”#define Q_SPIN_LOCKED_BITS 8 source Q_SPIN_LOCKED_MASK
Section titled “Q_SPIN_LOCKED_MASK”#define Q_SPIN_LOCKED_MASK 0x000000FFU source Q_SPIN_LOCKED_VAL
Section titled “Q_SPIN_LOCKED_VAL”#define Q_SPIN_LOCKED_VAL 0x00000001U source Q_SPIN_PENDING_OFFSET
Section titled “Q_SPIN_PENDING_OFFSET”#define Q_SPIN_PENDING_OFFSET 8 source Q_SPIN_PENDING_BITS
Section titled “Q_SPIN_PENDING_BITS”#define Q_SPIN_PENDING_BITS 1 source Q_SPIN_PENDING_MASK
Section titled “Q_SPIN_PENDING_MASK”#define Q_SPIN_PENDING_MASK 0x00000100U source Q_SPIN_PENDING_VAL
Section titled “Q_SPIN_PENDING_VAL”#define Q_SPIN_PENDING_VAL 0x00000100U source Q_SPIN_LOCKED_PENDING_MASK
Section titled “Q_SPIN_LOCKED_PENDING_MASK”#define Q_SPIN_LOCKED_PENDING_MASK (Q_SPIN_LOCKED_MASK | Q_SPIN_PENDING_MASK) source Q_SPIN_TAIL_LVL_OFFSET
Section titled “Q_SPIN_TAIL_LVL_OFFSET”#define Q_SPIN_TAIL_LVL_OFFSET 9 source Q_SPIN_TAIL_LVL_BITS
Section titled “Q_SPIN_TAIL_LVL_BITS”#define Q_SPIN_TAIL_LVL_BITS 2 source Q_SPIN_TAIL_LVL_MASK
Section titled “Q_SPIN_TAIL_LVL_MASK”#define Q_SPIN_TAIL_LVL_MASK 0x00000600U source Q_SPIN_TAIL_CPU_OFFSET
Section titled “Q_SPIN_TAIL_CPU_OFFSET”#define Q_SPIN_TAIL_CPU_OFFSET 16 source Q_SPIN_TAIL_CPU_BITS
Section titled “Q_SPIN_TAIL_CPU_BITS”#define Q_SPIN_TAIL_CPU_BITS 16 source Q_SPIN_TAIL_CPU_MASK
Section titled “Q_SPIN_TAIL_CPU_MASK”#define Q_SPIN_TAIL_CPU_MASK 0xFFFF0000U source Q_SPIN_TAIL_MASK
Section titled “Q_SPIN_TAIL_MASK”#define Q_SPIN_TAIL_MASK (Q_SPIN_TAIL_LVL_MASK | Q_SPIN_TAIL_CPU_MASK) source QSPINLOCK_INIT
Section titled “QSPINLOCK_INIT”#define QSPINLOCK_INIT QSPINLOCK_INIT_CHK(NULL, LOCK_CHKD_FULL) source QSPINLOCK_DEFINE
Section titled “QSPINLOCK_DEFINE”#define QSPINLOCK_DEFINE(id) source Expansion
#define QSPINLOCK_DEFINE(id) struct qspinlock id = QSPINLOCK_INIT QSPINLOCK_DEFINE_CHK
Section titled “QSPINLOCK_DEFINE_CHK”#define QSPINLOCK_DEFINE_CHK(id, class_, flags_) source Expansion
#define QSPINLOCK_DEFINE_CHK(id, class_, flags_) \
struct qspinlock id = QSPINLOCK_INIT_CHK((class_), (flags_)) __QSPINLOCK_SHALLOW_VALUE_INIT
Section titled “__QSPINLOCK_SHALLOW_VALUE_INIT”#define __QSPINLOCK_SHALLOW_VALUE_INIT source Expansion
#define __QSPINLOCK_SHALLOW_VALUE_INIT \
, .irq_usage = ATOMIC_VAR_INIT(LOCK_OP_IRQ_NONE) __QSPINLOCK_LOCK_CHK_VALUE_INIT
Section titled “__QSPINLOCK_LOCK_CHK_VALUE_INIT”#define __QSPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) source Expansion
#define __QSPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) \
, .chk = LOCK_CHK_LOCK_VALUE_INIT((class_), (flags_)) QSPINLOCK_INIT_CHK
Section titled “QSPINLOCK_INIT_CHK”#define QSPINLOCK_INIT_CHK(class_, flags_) source Expansion
#define QSPINLOCK_INIT_CHK(class_, flags_) \
((struct qspinlock) { \
.val = ATOMIC_VAR_INIT(0) __QSPINLOCK_LOCK_CHK_VALUE_INIT( \
(class_), (flags_)) __QSPINLOCK_SHALLOW_VALUE_INIT}) qspinlock_init_chk
Section titled “qspinlock_init_chk”#define qspinlock_init_chk(lock_, class_, flags_) source Expansion
#define qspinlock_init_chk(lock_, class_, flags_) \
qspinlock_init_chk_full((lock_), (class_), (flags_)) qspinlock_init_auto_internal
Section titled “qspinlock_init_auto_internal”#define qspinlock_init_auto_internal(lock_, flags_) source Expansion
#define qspinlock_init_auto_internal(lock_, flags_) \
do { \
static const struct lock_chk_class __auto_class = { \
.name = #lock_, \
.file = __RELFILE__, \
.line = __LINE__, \
}; \
qspinlock_init_chk_full((lock_), &__auto_class, (flags_)); \
} while (0) __QSPINLOCK_SHALLOW_VALUE_INIT
Section titled “__QSPINLOCK_SHALLOW_VALUE_INIT”#define __QSPINLOCK_SHALLOW_VALUE_INIT source __QSPINLOCK_LOCK_CHK_VALUE_INIT
Section titled “__QSPINLOCK_LOCK_CHK_VALUE_INIT”#define __QSPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) source Expansion
#define __QSPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) QSPINLOCK_INIT_CHK
Section titled “QSPINLOCK_INIT_CHK”#define QSPINLOCK_INIT_CHK(class_, flags_) source Expansion
#define QSPINLOCK_INIT_CHK(class_, flags_) \
((struct qspinlock) {.val = ATOMIC_VAR_INIT(0)}) qspinlock_init_chk
Section titled “qspinlock_init_chk”#define qspinlock_init_chk(lock_, class_, flags_) source Expansion
#define qspinlock_init_chk(lock_, class_, flags_) \
qspinlock_init_chk_full((lock_), NULL, LOCK_UNCHKD) qspinlock_init_auto_internal
Section titled “qspinlock_init_auto_internal”#define qspinlock_init_auto_internal(lock_, flags_) source Expansion
#define qspinlock_init_auto_internal(lock_, flags_) \
qspinlock_init_chk_full((lock_), NULL, LOCK_UNCHKD) qspinlock_init_1
Section titled “qspinlock_init_1”#define qspinlock_init_1(lock_) source Expansion
#define qspinlock_init_1(lock_) qspinlock_init_2(lock_, LOCK_CHKD_FULL) qspinlock_init_2
Section titled “qspinlock_init_2”#define qspinlock_init_2(lock_, flags_) source Expansion
#define qspinlock_init_2(lock_, flags_) \
qspinlock_init_auto_internal((lock_), (flags_)) qspinlock_init
Section titled “qspinlock_init”#define qspinlock_init(...) source Expansion
#define qspinlock_init(...) PP_CALL(qspinlock_init, __VA_ARGS__) qspin_init
Section titled “qspin_init”#define qspin_init(...) source Expansion
#define qspin_init(...) qspinlock_init(__VA_ARGS__) qspin_init_chk
Section titled “qspin_init_chk”#define qspin_init_chk(...) source Expansion
#define qspin_init_chk(...) qspinlock_init_chk(__VA_ARGS__) QSPINLOCK_ASSERT_HELD_RAW
Section titled “QSPINLOCK_ASSERT_HELD_RAW”#define QSPINLOCK_ASSERT_HELD_RAW(l) source Same deal as SPINLOCK_ASSERT_HELD_RAW, just checks the bit, but that doesn’t say anything about thread ownership
Expansion
#define QSPINLOCK_ASSERT_HELD_RAW(l) \
enforce(qspin_is_locked(l), "qspinlock not locked") qspin_lock
Section titled “qspin_lock”#define qspin_lock(lock_) source Expansion
#define qspin_lock(lock_) \
qspin_lock_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) qspin_lock_subclass
Section titled “qspin_lock_subclass”#define qspin_lock_subclass(lock_, subclass_) source Expansion
#define qspin_lock_subclass(lock_, subclass_) \
qspin_lock_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) qspin_lock_high
Section titled “qspin_lock_high”#define qspin_lock_high(lock_) source Expansion
#define qspin_lock_high(lock_) \
qspin_lock_high_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) qspin_lock_high_subclass
Section titled “qspin_lock_high_subclass”#define qspin_lock_high_subclass(lock_, subclass_) source Expansion
#define qspin_lock_high_subclass(lock_, subclass_) \
qspin_lock_high_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) qspin_trylock
Section titled “qspin_trylock”#define qspin_trylock(lock_, out_) source Expansion
#define qspin_trylock(lock_, out_) \
qspin_trylock_full((lock_), (out_), LOCK_SUBCLASS_PRIMARY, \
LOCK_CHK_SITE_HERE()) qspin_trylock_subclass
Section titled “qspin_trylock_subclass”#define qspin_trylock_subclass(lock_, out_, subclass_) source Expansion
#define qspin_trylock_subclass(lock_, out_, subclass_) \
qspin_trylock_full((lock_), (out_), (subclass_), LOCK_CHK_SITE_HERE()) qspin_trylock_high
Section titled “qspin_trylock_high”#define qspin_trylock_high(lock_, out_) source Expansion
#define qspin_trylock_high(lock_, out_) \
qspin_trylock_high_full((lock_), (out_), LOCK_SUBCLASS_PRIMARY, \
LOCK_CHK_SITE_HERE()) qspin_trylock_high_subclass
Section titled “qspin_trylock_high_subclass”#define qspin_trylock_high_subclass(lock_, out_, subclass_) source Expansion
#define qspin_trylock_high_subclass(lock_, out_, subclass_) \
qspin_trylock_high_full((lock_), (out_), (subclass_), LOCK_CHK_SITE_HERE()) qspin_unlock
Section titled “qspin_unlock”#define qspin_unlock(lock_, old_) source Expansion
#define qspin_unlock(lock_, old_) \
qspin_unlock_full((lock_), (old_), LOCK_CHK_SITE_HERE()) qspin_unlock_irq_restore
Section titled “qspin_unlock_irq_restore”#define qspin_unlock_irq_restore(lock_, old_) source Expansion
#define qspin_unlock_irq_restore(lock_, old_) \
qspin_unlock_full((lock_), (old_), LOCK_CHK_SITE_HERE()) qspin_lock_raw
Section titled “qspin_lock_raw”#define qspin_lock_raw(lock_) source Expansion
#define qspin_lock_raw(lock_) \
qspin_lock_raw_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) qspin_lock_raw_subclass
Section titled “qspin_lock_raw_subclass”#define qspin_lock_raw_subclass(lock_, subclass_) source Expansion
#define qspin_lock_raw_subclass(lock_, subclass_) \
qspin_lock_raw_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) qspin_trylock_raw
Section titled “qspin_trylock_raw”#define qspin_trylock_raw(lock_) source Expansion
#define qspin_trylock_raw(lock_) \
qspin_trylock_raw_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) qspin_trylock_raw_subclass
Section titled “qspin_trylock_raw_subclass”#define qspin_trylock_raw_subclass(lock_, subclass_) source Expansion
#define qspin_trylock_raw_subclass(lock_, subclass_) \
qspin_trylock_raw_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) qspin_unlock_raw
Section titled “qspin_unlock_raw”#define qspin_unlock_raw(lock_) source Expansion
#define qspin_unlock_raw(lock_) \
qspin_unlock_raw_full((lock_), LOCK_CHK_SITE_HERE()) QSPINLOCK_ASSERT_HELD
Section titled “QSPINLOCK_ASSERT_HELD”#define QSPINLOCK_ASSERT_HELD(l) source Expansion
#define QSPINLOCK_ASSERT_HELD(l) \
qspin_assert_held_full((l), LOCK_CHK_SITE_HERE()) QSPINLOCK_ASSERT_NOT_HELD
Section titled “QSPINLOCK_ASSERT_NOT_HELD”#define QSPINLOCK_ASSERT_NOT_HELD(l) source Expansion
#define QSPINLOCK_ASSERT_NOT_HELD(l) \
qspin_assert_not_held_full((l), LOCK_CHK_SITE_HERE()) qspin_guard
Section titled “qspin_guard”#define qspin_guard(lock_) source Expansion
#define qspin_guard(lock_) \
cc_cleanup(qspinlock_guard_exit) struct qspinlock_guard PP_CONCAT( \
qspin_guard_, __COUNTER__) = \
(qspinlock_guard_assume(lock_), qspin_guard_enter(lock_)) qspin_guard_high
Section titled “qspin_guard_high”#define qspin_guard_high(lock_) source Expansion
#define qspin_guard_high(lock_) \
cc_cleanup(qspinlock_guard_exit) struct qspinlock_guard PP_CONCAT( \
qspin_guard_high_, __COUNTER__) = \
(qspinlock_guard_assume(lock_), qspin_guard_high_enter(lock_)) qspin_guard_subclass
Section titled “qspin_guard_subclass”#define qspin_guard_subclass(lock_, subclass_) source Expansion
#define qspin_guard_subclass(lock_, subclass_) \
cc_cleanup(qspinlock_guard_exit) struct qspinlock_guard PP_CONCAT( \
qspin_guard_, __COUNTER__) = \
(qspinlock_guard_assume(lock_), \
qspin_guard_subclass_enter((lock_), (subclass_))) qspin_guard_high_subclass
Section titled “qspin_guard_high_subclass”#define qspin_guard_high_subclass(lock_, subclass_) source Expansion
#define qspin_guard_high_subclass(lock_, subclass_) \
cc_cleanup(qspinlock_guard_exit) struct qspinlock_guard PP_CONCAT( \
qspin_guard_high_, __COUNTER__) = \
(qspinlock_guard_assume(lock_), \
qspin_guard_high_subclass_enter((lock_), (subclass_)))