]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Add bluestore_write_v2 conf variable
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 16 Jan 2024 10:16:09 +0000 (10:16 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 7 Aug 2024 10:55:46 +0000 (10:55 +0000)
Add new conf variable.
bluestore_write_v2 = true : use new _do_write_v2() function
bluestore_write_v2 = false : use legacy _do_write() function
This variable is read only at start time.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/common/options/global.yaml.in
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index b170a3e9849c46311e6fefd3e5a14666a1f87256..19aea6408653aa56760191181e7f6278f9dfe473 100644 (file)
@@ -5041,6 +5041,18 @@ options:
   flags:
   - create
   with_legacy: false
+- name: bluestore_write_v2
+  type: bool
+  level: advanced
+  desc: Use faster write path
+  long_desc: Original write path was developed over long time by constantly adding features.
+    The price was layered inefficiencies gained along the way.
+    Rework of write path done from scratch clears it and optimizes for typical cases.
+    Write_v2 is necessary for recompression feature.
+  default: false
+  flags:
+  - startup
+  with_legacy: false
 - name: bluestore_allocator
   type: str
   level: advanced
index d01ce24fa15042477c3eb2e3d0286e2e41c0f604..fe14a13f649112654d1d6ead28d9d1b4c30bc527 100644 (file)
@@ -9149,7 +9149,7 @@ int BlueStore::_mount()
       return r;
     }
   }
-
+  use_write_v2 =   cct->_conf.get_val<bool>("bluestore_write_v2");
   _kv_only = false;
   if (cct->_conf->bluestore_fsck_on_mount) {
     int rc = fsck(cct->_conf->bluestore_fsck_on_mount_deep);
@@ -17400,7 +17400,11 @@ int BlueStore::_write(TransContext *txc,
     r = -E2BIG;
   } else {
     _assign_nid(txc, o);
-    r = _do_write(txc, c, o, offset, length, bl, fadvise_flags);
+    if (use_write_v2) {
+      r = _do_write_v2(txc, c, o, offset, length, bl, fadvise_flags);
+    } else {
+      r = _do_write(txc, c, o, offset, length, bl, fadvise_flags);
+    }
     txc->write_onode(o);
   }
   auto finish = mono_clock::now();
index 4aac566c61cab0a30283c0e19e4724c4df265118..4fd40eee38ecdfd9773fcaf1cf1f8c1ddb71a979 100644 (file)
@@ -2454,6 +2454,7 @@ private:
                std::numeric_limits<decltype(min_alloc_size)>::digits,
                "not enough bits for min_alloc_size");
   bool elastic_shared_blobs = false; ///< use smart ExtentMap::dup to reduce shared blob count
+  bool use_write_v2 = false; ///< use new write path
 
   enum {
     // Please preserve the order since it's DB persistent