From: Jianpeng Ma Date: Fri, 17 Nov 2017 10:14:37 +0000 (+0800) Subject: os/bluestore: remove lock for removed_collections. X-Git-Tag: v12.2.5~97^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0277bba5903c1ea6f0d5be89fc694b9efb331b34;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 (cherry picked from commit 7646b7407b7cb6fe6f1b4bf3eb9e20d7cdfc5bce) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 9aaca0c1d54c..e264182931de 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6256,7 +6256,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); } @@ -6265,7 +6266,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 @@ -6295,7 +6297,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 580c5aab1983..5b25c92a9908 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1884,7 +1884,6 @@ private: PerfCounters *logger = nullptr; - std::mutex reap_lock; list removed_collections; RWLock debug_read_error_lock = {"BlueStore::debug_read_error_lock"};