From: Jianpeng Ma Date: Fri, 17 Nov 2017 10:14:37 +0000 (+0800) Subject: os/bluestore: remove lock for removed_collections. X-Git-Tag: v13.0.1~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7646b7407b7cb6fe6f1b4bf3eb9e20d7cdfc5bce;p=ceph.git os/bluestore: remove lock for removed_collections. Current, queue removed-collections and handle removed-collections in the same thread. So no need a lock to protect. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index cd4513be7c4c..fc75f36e1f9b 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6294,7 +6294,8 @@ BlueStore::CollectionRef BlueStore::_get_collection(const coll_t& cid) void BlueStore::_queue_reap_collection(CollectionRef& c) { dout(10) << __func__ << " " << c << " " << c->cid << dendl; - std::lock_guard l(reap_lock); + // _reap_collections and this in the same thread, + // so no need a lock. removed_collections.push_back(c); } @@ -6303,7 +6304,8 @@ void BlueStore::_reap_collections() list removed_colls; { - std::lock_guard l(reap_lock); + // _queue_reap_collection and this in the same thread. + // So no need a lock. if (!removed_collections.empty()) removed_colls.swap(removed_collections); else @@ -6333,7 +6335,6 @@ void BlueStore::_reap_collections() if (removed_colls.empty()) { dout(10) << __func__ << " all reaped" << dendl; } else { - std::lock_guard l(reap_lock); removed_collections.splice(removed_collections.begin(), removed_colls); } } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 39a9607743a8..f76308d8c422 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1883,7 +1883,6 @@ private: PerfCounters *logger = nullptr; - std::mutex reap_lock; list removed_collections; RWLock debug_read_error_lock = {"BlueStore::debug_read_error_lock"};