]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: mempools for writing and writing_deferred 15402/head
authorSage Weil <sage@redhat.com>
Thu, 1 Jun 2017 02:50:04 +0000 (22:50 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Jun 2017 02:50:04 +0000 (22:50 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/include/mempool.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 43f4ffcd960924b796b6b57b180695c3ce46ffee..0e0badfdc685b9d8b08432c67ccc527f94fa78e5 100644 (file)
@@ -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)                     \
index 1a8cd36cec88c216a78d0d7659a0b21a3c15558d..981c17665b8850faaa608f66bfa6266af02d3739 100644 (file)
@@ -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)
index bf6bdc689ebd78076673ed900ca987686c3b9cb2..f2f3ace5dceafee9a091f52cb25f5a19c5d5e9ff 100644 (file)
@@ -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<uint32_t, std::unique_ptr<Buffer>>::iterator p) {
+    void _rm_buffer(Cache* cache,
+                   map<uint32_t, std::unique_ptr<Buffer>>::iterator p) {
       assert(p != buffer_map.end());
       cache->_audit("_rm_buffer start");
       if (p->second->is_writing()) {