Index: sys/kern/kern_rmlock.c =================================================================== --- sys/kern/kern_rmlock.c +++ sys/kern/kern_rmlock.c @@ -407,9 +407,11 @@ return (0); } } else { - if (rm->lock_object.lo_flags & LO_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { + THREAD_SLEEPING_OK(); sx_xlock(&rm->rm_lock_sx); - else + THREAD_NO_SLEEPING(); + } else mtx_lock(&rm->rm_lock_mtx); }