]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add flag to make reads default to buffered
authorSage Weil <sage@redhat.com>
Mon, 11 Jan 2016 22:22:11 +0000 (17:22 -0500)
committerSage Weil <sage@redhat.com>
Wed, 13 Jan 2016 17:56:11 +0000 (12:56 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/os/bluestore/BlueStore.cc

index bda1653533ba9e9a74c3517a9233ed624f89956a..88ebb141fe6f99e320ce4b79a3c125aa1b8e0bc2 100644 (file)
@@ -887,6 +887,7 @@ OPTION(bluestore_overlay_max, OPT_INT, 0)
 OPTION(bluestore_open_by_handle, OPT_BOOL, true)
 OPTION(bluestore_o_direct, OPT_BOOL, true)
 OPTION(bluestore_clone_cow, OPT_BOOL, true)  // do copy-on-write for clones
+OPTION(bluestore_default_buffered_read, 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)
index ac602e513aecdf58df7a7353cebd325988a0f3bc..4cf1500d695ff76a1e06fffceecdace26375d8cd 100644 (file)
@@ -2373,6 +2373,11 @@ int BlueStore::_do_read(
   if (op_flags & CEPH_OSD_OP_FLAG_FADVISE_WILLNEED) {
     dout(20) << __func__ << " will do buffered read" << dendl;
     buffered = true;
+  } else if (g_conf->bluestore_default_buffered_read &&
+            (op_flags & (CEPH_OSD_OP_FLAG_FADVISE_DONTNEED |
+                         CEPH_OSD_OP_FLAG_FADVISE_NOCACHE)) == 0) {
+    dout(20) << __func__ << " defaulting to buffered read" << dendl;
+    buffered = true;
   }
 
   dout(20) << __func__ << " " << offset << "~" << length << " size "