Skip to content

Commit

Permalink
Merge pull request #11301 from liewegas/wip-bluestore-buffered-write
Browse files Browse the repository at this point in the history
os/bluestore: allow default to buffered write

Reviewed-by: Mark Nelson <mnelson@redhat.com>
  • Loading branch information
liewegas committed Oct 10, 2016
2 parents 99cd309 + 7ae800b commit 5f0a360
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -1022,6 +1022,7 @@ OPTION(bluestore_overlay_max_length, OPT_INT, 65536)
OPTION(bluestore_overlay_max, OPT_INT, 0)
OPTION(bluestore_clone_cow, OPT_BOOL, false) // do copy-on-write for clones
OPTION(bluestore_default_buffered_read, OPT_BOOL, true)
OPTION(bluestore_default_buffered_write, OPT_BOOL, false)
OPTION(bluestore_debug_misc, OPT_BOOL, false)
OPTION(bluestore_debug_no_reuse_blocks, OPT_BOOL, false)
OPTION(bluestore_debug_small_allocations, OPT_INT, 0)
Expand Down
5 changes: 5 additions & 0 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -7815,6 +7815,11 @@ int BlueStore::_do_write(
if (fadvise_flags & CEPH_OSD_OP_FLAG_FADVISE_WILLNEED) {
dout(20) << __func__ << " will do buffered write" << dendl;
wctx.buffered = true;
} else if (g_conf->bluestore_default_buffered_write &&
(fadvise_flags & (CEPH_OSD_OP_FLAG_FADVISE_DONTNEED |
CEPH_OSD_OP_FLAG_FADVISE_NOCACHE)) == 0) {
dout(20) << __func__ << " defaulting to buffered write" << dendl;
wctx.buffered = true;
}

// FIXME: Using the MAX of the block_size_order and preferred_csum_order
Expand Down
7 changes: 7 additions & 0 deletions src/test/objectstore/store_test.cc
Expand Up @@ -4207,6 +4207,8 @@ TEST_P(StoreTest, SyntheticMatrixSharding) {
{ "bluestore_extent_map_shard_min_size", "60", 0 },
{ "bluestore_extent_map_shard_max_size", "300", 0 },
{ "bluestore_extent_map_shard_target_size", "150", 0 },
{ "bluestore_default_buffered_read", "true", 0 },
{ "bluestore_default_buffered_write", "true", 0 },
{ 0 },
};
do_matrix(m, store);
Expand Down Expand Up @@ -4272,6 +4274,7 @@ TEST_P(StoreTest, SyntheticMatrixCsumAlgorithm) {
{ "bluestore_min_alloc_size", "65536", 0 },
{ "bluestore_csum_type", "crc32c", "crc32c_16", "crc32c_8", "xxhash32",
"xxhash64", "none", 0 },
{ "bluestore_default_buffered_write", "false", 0 },
{ 0 },
};
do_matrix(m, store);
Expand All @@ -4290,6 +4293,7 @@ TEST_P(StoreTest, SyntheticMatrixCsumVsCompression) {
{ "bluestore_compression_algorithm", "snappy", "zlib", 0 },
{ "bluestore_csum_type", "crc32c", 0 },
{ "bluestore_default_buffered_read", "true", "false", 0 },
{ "bluestore_default_buffered_write", "true", "false", 0 },
{ 0 },
};
do_matrix(m, store);
Expand All @@ -4305,6 +4309,7 @@ TEST_P(StoreTest, SyntheticMatrixCompression) {
{ "alignment", "65536", 0 },
{ "bluestore_min_alloc_size", "4096", "65536", 0 },
{ "bluestore_compression", "force", "aggressive", "passive", "none", 0},
{ "bluestore_default_buffered_write", "false", 0 },
{ 0 },
};
do_matrix(m, store);
Expand All @@ -4320,6 +4325,7 @@ TEST_P(StoreTest, SyntheticMatrixCompressionAlgorithm) {
{ "alignment", "65536", 0 },
{ "bluestore_compression_algorithm", "zlib", "snappy", 0 },
{ "bluestore_compression", "force", 0 },
{ "bluestore_default_buffered_write", "false", 0 },
{ 0 },
};
do_matrix(m, store);
Expand All @@ -4338,6 +4344,7 @@ TEST_P(StoreTest, SyntheticMatrixNoCsum) {
{ "bluestore_compression", "force", "none", 0},
{ "bluestore_csum_type", "none", 0},
{ "bluestore_default_buffered_read", "true", "false", 0 },
{ "bluestore_default_buffered_write", "true", 0 },
{ 0 },
};
do_matrix(m, store);
Expand Down

0 comments on commit 5f0a360

Please sign in to comment.