if (empty) {
mutex.Lock();
cond.Signal();
mutex.Unlock();
}
}
sdata->sdata_wait_lock.Lock();
if (!sdata->stop_waiting) {
Fix by simply rechecking that context_queue is empty after taking the
wait lock. We still check it without taking that lock to keep the hot/busy
path fast (we avoid the wait lock in general) at the expense of taking
the context_queue qlock twice in the idle/wait path (where we don't care
so much about additional latency/cycles).
Fixes: http://tracker.ceph.com/issues/36473 Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com> Signed-off-by: Sage Weil <sage@redhat.com>