]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: correctly measure deferred writes into new blobs
authorSage Weil <sage@redhat.com>
Thu, 25 Apr 2019 15:49:04 +0000 (10:49 -0500)
committerSage Weil <sage@redhat.com>
Thu, 25 Apr 2019 15:49:04 +0000 (10:49 -0500)
Writes into new blobs were all counted as write_small_new, but those can
still be deferred later in _do_alloc_write if they are <= than the
prefer_deferred setting.

See http://tracker.ceph.com/issues/38816

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

index 0821d3b589598e462599937770fbfe1c2e2d004a..f4b9b26b0307619533967be66934ed6ee2b9ee5d 100644 (file)
@@ -11685,14 +11685,12 @@ void BlueStore::_do_write_small(
   } while (any_change);
 
   // new blob.
-  
   BlobRef b = c->new_blob();
   uint64_t b_off = p2phase<uint64_t>(offset, alloc_len);
   uint64_t b_off0 = b_off;
   _pad_zeros(&bl, &b_off0, block_size);
   o->extent_map.punch_hole(c, offset, length, &wctx->old_extents);
   wctx->write(offset, b, alloc_len, b_off0, bl, b_off, length, true, true);
-  logger->inc(l_bluestore_write_small_new);
 
   return;
 }
@@ -12064,12 +12062,14 @@ int BlueStore::_do_alloc_write(
          });
         ceph_assert(r == 0);
        op->data = *l;
+       logger->inc(l_bluestore_write_small_deferred);
       } else {
        b->get_blob().map_bl(
          b_off, *l,
          [&](uint64_t offset, bufferlist& t) {
            bdev->aio_write(offset, t, &txc->ioc, false);
          });
+       logger->inc(l_bluestore_write_small_new);
       }
     }
   }