From: Sage Weil Date: Thu, 1 Jun 2017 02:50:04 +0000 (-0400) Subject: os/bluestore: mempools for writing and writing_deferred X-Git-Tag: ses5-milestone6~9^2~11^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e84a9485144b1c87cc8152b0de5f521df2afedde;p=ceph.git os/bluestore: mempools for writing and writing_deferred Signed-off-by: Sage Weil --- diff --git a/src/include/mempool.h b/src/include/mempool.h index 43f4ffcd96092..0e0badfdc685b 100644 --- a/src/include/mempool.h +++ b/src/include/mempool.h @@ -143,6 +143,8 @@ namespace mempool { f(bluestore_cache_other) \ f(bluestore_fsck) \ f(bluestore_txc) \ + f(bluestore_writing_deferred) \ + f(bluestore_writing) \ f(bluefs) \ f(buffer_anon) \ f(buffer_meta) \ diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1a8cd36cec88c..981c17665b885 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1412,6 +1412,7 @@ void BlueStore::BufferSpace::finish_write(Cache* cache, uint64_t seq) b->state = Buffer::STATE_CLEAN; writing.erase(i++); b->maybe_rebuild(); + b->data.reassign_to_mempool(mempool::mempool_bluestore_cache_data); cache->_add_buffer(b, 1, nullptr); ldout(cache->cct, 20) << __func__ << " added " << *b << dendl; } @@ -2920,6 +2921,8 @@ void BlueStore::DeferredBatch::prepare_write( assert(i.second); // this should be a new insertion i.first->second.seq = seq; blp.copy(length, i.first->second.bl); + i.first->second.bl.reassign_to_mempool( + mempool::mempool_bluestore_writing_deferred); dout(20) << __func__ << " seq " << seq << " 0x" << std::hex << offset << "~" << length << " crc " << i.first->second.bl.crc32c(-1) diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index bf6bdc689ebd7..f2f3ace5dceaf 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -261,17 +261,19 @@ public: cache->_audit("_add_buffer start"); buffer_map[b->offset].reset(b); if (b->is_writing()) { + b->data.reassign_to_mempool(mempool::mempool_bluestore_writing); writing.push_back(*b); } else { + b->data.reassign_to_mempool(mempool::mempool_bluestore_cache_data); cache->_add_buffer(b, level, near); } - b->data.reassign_to_mempool(mempool::mempool_bluestore_cache_data); cache->_audit("_add_buffer end"); } void _rm_buffer(Cache* cache, Buffer *b) { _rm_buffer(cache, buffer_map.find(b->offset)); } - void _rm_buffer(Cache* cache, map>::iterator p) { + void _rm_buffer(Cache* cache, + map>::iterator p) { assert(p != buffer_map.end()); cache->_audit("_rm_buffer start"); if (p->second->is_writing()) {