From f78c54359add3463ba5587d913b4cfb94c594d0d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 6 Oct 2016 12:03:05 -0400 Subject: [PATCH] os/bluestore: clean up compression debug output The previous output was impossible to interpret properly. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index aaefd36c022..c509fec0969 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7549,10 +7549,10 @@ int BlueStore::_do_alloc_write( compressed_bl.claim_append(t); uint64_t rawlen = compressed_bl.length(); uint64_t newlen = P2ROUNDUP(rawlen, min_alloc_size); - uint64_t dstlen = final_length * + uint64_t want_len_raw = final_length * g_conf->bluestore_compression_required_ratio; - dstlen = P2ROUNDUP(dstlen, min_alloc_size); - if (newlen <= dstlen && newlen < final_length) { + uint64_t want_len = P2ROUNDUP(want_len_raw, min_alloc_size); + if (newlen <= want_len && newlen < final_length) { // Cool. We compressed at least as much as we were hoping to. // pad out to min_alloc_size compressed_bl.append_zero(newlen - rawlen); @@ -7572,14 +7572,17 @@ int BlueStore::_do_alloc_write( compressed = true; logger->inc(l_bluestore_compress_success_count); } else { - dout(20) << __func__ << std::hex << " compressed 0x" << l->length() - << " -> 0x" << rawlen << " with " << (int)chdr.type - << ", which is more than required 0x" << dstlen + dout(20) << __func__ << std::hex << " 0x" << l->length() + << " compressed to 0x" << rawlen << " -> 0x" << newlen + << " with " << (int)chdr.type + << ", which is more than required 0x" << want_len_raw + << " -> 0x" << want_len << ", leaving uncompressed" << std::dec << dendl; logger->inc(l_bluestore_compress_rejected_count); } - logger->tinc(l_bluestore_compress_lat, ceph_clock_now(g_ceph_context) - start); + logger->tinc(l_bluestore_compress_lat, + ceph_clock_now(g_ceph_context) - start); } if (!compressed) { b->dirty_blob().set_flag(bluestore_blob_t::FLAG_MUTABLE);