From: Sage Weil Date: Tue, 6 Dec 2016 17:09:49 +0000 (-0500) Subject: os/bluestore: release alloc directly into usable pool X-Git-Tag: v11.1.1~30^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b605a14ec3a2c95c333509cbffc6f7b9ee7da5df;p=ceph.git os/bluestore: release alloc directly into usable pool 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 --- diff --git a/src/os/bluestore/BitMapAllocator.cc b/src/os/bluestore/BitMapAllocator.cc index 3aac6d81a71b..138c5ae4d09d 100644 --- a/src/os/bluestore/BitMapAllocator.cc +++ b/src/os/bluestore/BitMapAllocator.cc @@ -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; } diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 8b7f659e4ec1..312bfe42fae1 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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(); } diff --git a/src/os/bluestore/StupidAllocator.cc b/src/os/bluestore/StupidAllocator.cc index 82aeb2168854..f3cdadfaba29 100644 --- a/src/os/bluestore/StupidAllocator.cc +++ b/src/os/bluestore/StupidAllocator.cc @@ -250,8 +250,8 @@ int StupidAllocator::release( std::lock_guard 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; }