]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix alloc release timing on sync submits
authorSage Weil <sage@redhat.com>
Tue, 15 Nov 2016 17:09:28 +0000 (12:09 -0500)
committerSage Weil <sage@redhat.com>
Fri, 18 Nov 2016 01:33:12 +0000 (19:33 -0600)
If we submit the txc synchronously, we can't immediately release our
freed space to the allocator; that still needs to be done between
commit_start() and commit_finish() from the kv_sync_thread, protected
by the bdev barriers.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index b27e3c51bfc8ee42cc3aae96a063436618d3294d..071bdc6e73c6b1322a3d8009ef104633a8b2e12d 100644 (file)
@@ -6559,6 +6559,11 @@ void BlueStore::_txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t)
     fm->release(p.get_start(), p.get_len(), t);
   }
 
+  _txc_update_store_statfs(txc);
+}
+
+void BlueStore::_txc_release_alloc(TransContext *txc)
+{
   // update allocator with full released set
   if (!g_conf->bluestore_debug_no_reuse_blocks) {
     for (interval_set<uint64_t>::iterator p = txc->released.begin();
@@ -6570,7 +6575,6 @@ void BlueStore::_txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t)
 
   txc->allocated.clear();
   txc->released.clear();
-  _txc_update_store_statfs(txc);
 }
 
 void BlueStore::_kv_sync_thread()
@@ -6642,6 +6646,9 @@ void BlueStore::_kv_sync_thread()
        --txc->osr->kv_committing_serially;
        txc->kv_submitted = true;
       }
+      for (auto txc : kv_committing) {
+       _txc_release_alloc(txc);
+      }
 
       vector<bluestore_pextent_t> bluefs_gift_extents;
       if (bluefs) {
index 5db44e6a39f8c364a53895bb14b12046059aa3b6..80bd466e83b009498b40fb161105dce68b189c02 100644 (file)
@@ -1651,13 +1651,14 @@ private:
   void _txc_write_nodes(TransContext *txc, KeyValueDB::Transaction t);
   void _txc_state_proc(TransContext *txc);
   void _txc_aio_submit(TransContext *txc);
-  void _txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t);
 public:
   void _txc_aio_finish(void *p) {
     _txc_state_proc(static_cast<TransContext*>(p));
   }
 private:
   void _txc_finish_io(TransContext *txc);
+  void _txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t);
+  void _txc_release_alloc(TransContext *txc);
   void _txc_finish_kv(TransContext *txc);
   void _txc_finish(TransContext *txc);