]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: remove lock for removed_collections.
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 17 Nov 2017 10:14:37 +0000 (18:14 +0800)
committerIgor Fedotov <ifedotov@suse.com>
Tue, 20 Mar 2018 12:51:03 +0000 (15:51 +0300)
Current, queue removed-collections and handle removed-collections
in the same thread. So no need a lock to protect.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit 7646b7407b7cb6fe6f1b4bf3eb9e20d7cdfc5bce)

src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 9aaca0c1d54c54a881eb2eb79ed5690c91ab0d78..e264182931de6626caa7c3288d2664803fd24dd7 100644 (file)
@@ -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<std::mutex> 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<CollectionRef> removed_colls;
   {
-    std::lock_guard<std::mutex> 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<std::mutex> l(reap_lock);
     removed_collections.splice(removed_collections.begin(), removed_colls);
   }
 }
index 580c5aab19834f22706144505235e9b11b32fb16..5b25c92a99081c9d3bacd972bedc810fcf2efdbb 100644 (file)
@@ -1884,7 +1884,6 @@ private:
 
   PerfCounters *logger = nullptr;
 
-  std::mutex reap_lock;
   list<CollectionRef> removed_collections;
 
   RWLock debug_read_error_lock = {"BlueStore::debug_read_error_lock"};