mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
smp: remove gratuitous cache miss when no responses are pending
boost::lockfree::spsc_queue::push() writes the producer index even when no data is pushed, so check whether we need to do any work beforehand.
This commit is contained in:
@@ -962,8 +962,10 @@ void smp_message_queue::respond(work_item* item) {
|
||||
}
|
||||
|
||||
void smp_message_queue::flush_response_batch() {
|
||||
_completed.push(_completed_fifo.begin(), _completed_fifo.end());
|
||||
_completed_fifo.clear();
|
||||
if (!_completed_fifo.empty()) {
|
||||
_completed.push(_completed_fifo.begin(), _completed_fifo.end());
|
||||
_completed_fifo.clear();
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t PrefetchCnt, typename Func>
|
||||
|
||||
Reference in New Issue
Block a user