]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: Remove bluestore_debug_prefill
authorAdam Kupczyk <akupczyk@ibm.com>
Wed, 24 Jan 2024 16:31:32 +0000 (16:31 +0000)
committerPere Diaz Bou <pere-altea@hotmail.com>
Fri, 23 Aug 2024 09:49:23 +0000 (11:49 +0200)
Remove outdated and useless debug setting.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 3b904283f33ebb9ed83b82eeb6f97846781401ac)

src/common/options/global.yaml.in
src/os/bluestore/BlueStore.cc

index 51c8c0acfd77a14036cefc6363fc92d448740259..a66f544a579350c9b5a2eb0646a588c8512574c3 100644 (file)
@@ -5229,12 +5229,6 @@ options:
   level: dev
   default: false
   with_legacy: true
-- name: bluestore_debug_prefill
-  type: float
-  level: dev
-  desc: simulate fragmentation
-  default: 0
-  with_legacy: true
 - name: bluestore_debug_prefragment_max
   type: size
   level: dev
index 72681123381e05a8338d1048197aed571f32ba50..ad2d2bad3930a31bc51f111a4fd9e3287933872e 100644 (file)
@@ -6737,48 +6737,6 @@ int BlueStore::_open_fm(KeyValueDB::Transaction t,
       // bluefs doing that itself.
       fm->allocate(0, reserved, t);
     }
-    // debug code - not needed for NULL FM
-    if (cct->_conf->bluestore_debug_prefill > 0) {
-      uint64_t end = bdev->get_size() - reserved;
-      dout(1) << __func__ << " pre-fragmenting freespace, using "
-             << cct->_conf->bluestore_debug_prefill << " with max free extent "
-             << cct->_conf->bluestore_debug_prefragment_max << dendl;
-      uint64_t start = p2roundup(reserved, min_alloc_size);
-      uint64_t max_b = cct->_conf->bluestore_debug_prefragment_max / min_alloc_size;
-      float r = cct->_conf->bluestore_debug_prefill;
-      r /= 1.0 - r;
-      bool stop = false;
-
-      while (!stop && start < end) {
-       uint64_t l = (rand() % max_b + 1) * min_alloc_size;
-       if (start + l > end) {
-         l = end - start;
-          l = p2align(l, min_alloc_size);
-        }
-        ceph_assert(start + l <= end);
-
-       uint64_t u = 1 + (uint64_t)(r * (double)l);
-       u = p2roundup(u, min_alloc_size);
-        if (start + l + u > end) {
-          u = end - (start + l);
-          // trim to align so we don't overflow again
-          u = p2align(u, min_alloc_size);
-          stop = true;
-        }
-        ceph_assert(start + l + u <= end);
-
-       dout(20) << __func__ << " free 0x" << std::hex << start << "~" << l
-                << " use 0x" << u << std::dec << dendl;
-
-        if (u == 0) {
-          // break if u has been trimmed to nothing
-          break;
-        }
-
-       fm->allocate(start + l, u, t);
-       start += l + u;
-      }
-    }
     r = _write_out_fm_meta(0);
     ceph_assert(r == 0);
   } else {