Skip to content

Commit

Permalink
os/bluestore: set min compressed blob size floor at 2x min_alloc_size
Browse files Browse the repository at this point in the history
Otherwise there's not point in compressing--we won't be able to
allocation a smaller space to store it.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Sep 30, 2016
1 parent 87f6d23 commit beed433
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7687,6 +7687,13 @@ int BlueStore::_do_write(
wctx.target_blob_size > g_conf->bluestore_max_blob_size) {
wctx.target_blob_size = g_conf->bluestore_max_blob_size;
}
// set the min blob size floor at 2x the min_alloc_size, or else we
// won't be able to allocate a smaller extent for the compressed
// data.
if (wctx.compress &&
wctx.target_blob_size < min_alloc_size * 2) {
wctx.target_blob_size = min_alloc_size * 2;
}

dout(20) << __func__ << " prefer csum_order " << wctx.csum_order
<< " target_blob_size 0x" << std::hex << wctx.target_blob_size
Expand Down

0 comments on commit beed433

Please sign in to comment.