OFED spinlocks

Vijay Singh vijju.singh at gmail.com
Fri Mar 3 16:34:29 UTC 2017


I am looking at sys/ofed/include/linux/spinlock.h in 10.3:

static inline void
spin_lock_init(spinlock_t *lock)
{

        memset(&lock->m, 0, sizeof(lock->m));
        mtx_init(&lock->m, "lnxspin", NULL, MTX_DEF | MTX_NOWITNESS);
}

#define DEFINE_SPINLOCK(lock)                                           \
        spinlock_t lock;                                                \
        MTX_SYSINIT(lock, &(lock).m, "lnxspin", MTX_DEF)

If this a spin lock, why do we use MTX_DEF? What am I missing.

-vijay


More information about the freebsd-infiniband mailing list