]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: release alloc directly into usable pool
authorSage Weil <sage@redhat.com>
Tue, 6 Dec 2016 17:09:49 +0000 (12:09 -0500)
committerSage Weil <sage@redhat.com>
Thu, 15 Dec 2016 19:20:27 +0000 (14:20 -0500)
Wait until after the kv transaction commits, and then
release extents directly into the usable pool.

This will let us remove the commit_{start,end} business.

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

index 3aac6d81a71b93cf96bfc76868526c71a2164be4..138c5ae4d09de1607fcf3395e62c4428ccb40494 100644 (file)
@@ -239,8 +239,7 @@ int BitMapAllocator::release(
   dout(10) << __func__ << " 0x"
            << std::hex << offset << "~" << length << std::dec
            << dendl;
-  m_uncommitted.insert(offset, length);
-  m_num_uncommitted += length;
+  insert_free(offset, length);
   return 0;
 }
 
index 8b7f659e4ec1fcb675a7638046808e6c0c5819c1..312bfe42fae156fd1bce483f483b97bca2dad346 100644 (file)
@@ -6666,7 +6666,6 @@ void BlueStore::_kv_sync_thread()
        txc->state = TransContext::STATE_KV_SUBMITTED;
       }
       for (auto txc : kv_committing) {
-       _txc_release_alloc(txc);
        if (txc->had_ios) {
          --txc->osr->txc_with_unstable_io;
        }
@@ -6722,6 +6721,7 @@ void BlueStore::_kv_sync_thread()
       while (!kv_committing.empty()) {
        TransContext *txc = kv_committing.front();
        assert(txc->state == TransContext::STATE_KV_SUBMITTED);
+       _txc_release_alloc(txc);
        _txc_state_proc(txc);
        kv_committing.pop_front();
       }
index 82aeb21688541fff3f9aa24f7650c1dad17235d1..f3cdadfaba29a65980dc2dccfd31d2cf3bafb85b 100644 (file)
@@ -250,8 +250,8 @@ int StupidAllocator::release(
   std::lock_guard<std::mutex> l(lock);
   dout(10) << __func__ << " 0x" << std::hex << offset << "~" << length
           << std::dec << dendl;
-  uncommitted.insert(offset, length);
-  num_uncommitted += length;
+  _insert_free(offset, length);
+  num_free += length;
   return 0;
 }