mirror of
https://github.com/ceph/ceph
synced 2025-03-20 09:16:59 +00:00
osd/OSD: Using Wait rather than WaitInterval to wait queue.is_empty().
Why use WaitInterval, there is a comment:"optimistically sleep a moment; maybe another work item will come along." But in fact,we don't see any benefit for this optimization. Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
This commit is contained in:
parent
f265ed6b1c
commit
fb6eca1fb2
@ -9755,19 +9755,18 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
|
||||
sdata->sdata_op_ordering_lock.Lock();
|
||||
if (sdata->pqueue->empty()) {
|
||||
dout(20) << __func__ << " empty q, waiting" << dendl;
|
||||
// optimistically sleep a moment; maybe another work item will come along.
|
||||
osd->cct->get_heartbeat_map()->reset_timeout(hb,
|
||||
osd->cct->_conf->threadpool_default_timeout, 0);
|
||||
osd->cct->get_heartbeat_map()->clear_timeout(hb);
|
||||
sdata->sdata_lock.Lock();
|
||||
sdata->sdata_op_ordering_lock.Unlock();
|
||||
sdata->sdata_cond.WaitInterval(sdata->sdata_lock,
|
||||
utime_t(osd->cct->_conf->threadpool_empty_queue_max_wait, 0));
|
||||
sdata->sdata_cond.Wait(sdata->sdata_lock);
|
||||
sdata->sdata_lock.Unlock();
|
||||
sdata->sdata_op_ordering_lock.Lock();
|
||||
if (sdata->pqueue->empty()) {
|
||||
sdata->sdata_op_ordering_lock.Unlock();
|
||||
return;
|
||||
}
|
||||
osd->cct->get_heartbeat_map()->reset_timeout(hb,
|
||||
osd->cct->_conf->threadpool_default_timeout, 0);
|
||||
}
|
||||
OpQueueItem item = sdata->pqueue->dequeue();
|
||||
if (osd->is_stopping()) {
|
||||
|
Loading…
Reference in New Issue
Block a user