Skip to content

Commit

Permalink
Merge pull request ceph#22556 from majianpeng/bluestore-misc-cleanup2
Browse files Browse the repository at this point in the history
os/bluestore: cleanups

Reviewed-by: Igor Fedotov <[email protected]>
  • Loading branch information
tchaikov authored Jun 27, 2018
2 parents 289f7ab + 7109c84 commit a2d2711
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9008,6 +9008,7 @@ void BlueStore::_kv_stop()
void BlueStore::_kv_sync_thread()
{
dout(10) << __func__ << " start" << dendl;
deque<DeferredBatch*> deferred_stable_queue; ///< deferred ios done + stable
std::unique_lock<std::mutex> l(kv_lock);
assert(!kv_sync_started);
kv_sync_started = true;
Expand Down Expand Up @@ -9462,14 +9463,15 @@ void BlueStore::_deferred_aio_finish(OpSequencer *osr)

{
uint64_t costs = 0;
std::lock_guard<std::mutex> l2(osr->qlock);
for (auto& i : b->txcs) {
TransContext *txc = &i;
txc->log_state_latency(logger, l_bluestore_state_deferred_aio_wait_lat);
txc->state = TransContext::STATE_DEFERRED_CLEANUP;
costs += txc->cost;
{
std::lock_guard<std::mutex> l2(osr->qlock);
for (auto& i : b->txcs) {
TransContext *txc = &i;
txc->log_state_latency(logger, l_bluestore_state_deferred_aio_wait_lat);
txc->state = TransContext::STATE_DEFERRED_CLEANUP;
costs += txc->cost;
}
}
osr->qcond.notify_all();
throttle_deferred_bytes.put(costs);
std::lock_guard<std::mutex> l(kv_lock);
deferred_done_queue.emplace_back(b);
Expand Down
1 change: 0 additions & 1 deletion src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,6 @@ class BlueStore : public ObjectStore,
deque<TransContext*> kv_queue_unsubmitted; ///< ready, need submit by kv thread
deque<TransContext*> kv_committing; ///< currently syncing
deque<DeferredBatch*> deferred_done_queue; ///< deferred ios done
deque<DeferredBatch*> deferred_stable_queue; ///< deferred ios done + stable

KVFinalizeThread kv_finalize_thread;
std::mutex kv_finalize_lock;
Expand Down

0 comments on commit a2d2711

Please sign in to comment.