]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: remove zoned from crimson 55054/head
authorPere Diaz Bou <pere-altea@hotmail.com>
Thu, 4 Jan 2024 13:30:31 +0000 (14:30 +0100)
committerPere Diaz Bou <pere-altea@hotmail.com>
Tue, 9 Jan 2024 22:08:05 +0000 (23:08 +0100)
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
16 files changed:
CMakeLists.txt
ceph.spec.in
install-deps.sh
src/blk/BlockDevice.cc
src/blk/BlockDevice.h
src/blk/CMakeLists.txt
src/blk/zoned/HMSMRDevice.cc [deleted file]
src/blk/zoned/HMSMRDevice.h [deleted file]
src/crimson/os/alienstore/CMakeLists.txt
src/include/config-h.in.cmake
src/os/bluestore/Allocator.cc
src/os/bluestore/FreelistManager.cc
src/test/objectstore/Allocator_test.cc
src/test/objectstore/allocator_replay_test.cc
src/test/objectstore/test_bluefs.cc
src/vstart.sh

index f2df55a75e12bb042329a2c116c2f72681870a96..582eda5c74dc73ec843d0ac695939e9f16bf578d 100644 (file)
@@ -233,13 +233,6 @@ endif()
 
 include(CMakeDependentOption)
 
-CMAKE_DEPENDENT_OPTION(WITH_ZBD "Enable libzbd bluestore backend" OFF
-  "WITH_BLUESTORE" OFF)
-if(WITH_ZBD)
-  find_package(zbd REQUIRED)
-  set(HAVE_LIBZBD ${ZBD_FOUND})
-endif()
-
 CMAKE_DEPENDENT_OPTION(WITH_LIBURING "Enable io_uring bluestore backend" ON
   "WITH_BLUESTORE;HAVE_LIBAIO" OFF)
 set(HAVE_LIBURING ${WITH_LIBURING})
index 058c79c5e7f829ac667e40adb6040489fc437a10..f813407b76afbbeb643370d77f8667bee71d3ea0 100644 (file)
@@ -21,7 +21,6 @@
 # https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html
 #################################################################################
 %bcond_with make_check
-%bcond_with zbd
 %bcond_with cmake_verbose_logging
 %bcond_without ceph_test_package
 %ifarch s390
@@ -300,9 +299,6 @@ BuildRequires:      socat
 BuildRequires: python%{python3_pkgversion}-asyncssh
 BuildRequires: python%{python3_pkgversion}-natsort
 %endif
-%if 0%{with zbd}
-BuildRequires:  libzbd-devel
-%endif
 %if 0%{?suse_version}
 BuildRequires:  libthrift-devel >= 0.13.0
 %else
@@ -1403,9 +1399,6 @@ cmake .. \
 %if 0%{without lua_packages}
     -DWITH_RADOSGW_LUA_PACKAGES:BOOL=OFF \
 %endif
-%if 0%{with zbd}
-    -DWITH_ZBD:BOOL=ON \
-%endif
 %if 0%{with cmake_verbose_logging}
     -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
 %endif
index d01bc6464e6f99f893923785ce0325b4f99564dc..5956b586e526248058ee20dbae219851d44bbe4c 100755 (executable)
@@ -36,8 +36,6 @@ ARCH=$(uname -m)
 function munge_ceph_spec_in {
     local with_seastar=$1
     shift
-    local with_zbd=$1
-    shift
     local for_make_check=$1
     shift
     local OUTFILE=$1
@@ -46,9 +44,6 @@ function munge_ceph_spec_in {
     if $with_seastar; then
         sed -i -e 's/%bcond_with seastar/%bcond_without seastar/g' $OUTFILE
     fi
-    if $with_zbd; then
-        sed -i -e 's/%bcond_with zbd/%bcond_without zbd/g' $OUTFILE
-    fi
     if $for_make_check; then
         sed -i -e 's/%bcond_with make_check/%bcond_without make_check/g' $OUTFILE
     fi
@@ -221,19 +216,6 @@ function install_boost_on_ubuntu {
 
 }
 
-function install_libzbd_on_ubuntu {
-    ci_debug "Running install_libzbd_on_ubuntu() in install-deps.sh"
-    local codename=$1
-    local project=libzbd
-    local sha1=1fadde94b08fab574b17637c2bebd2b1e7f9127b
-    install_pkg_on_ubuntu \
-        $project \
-        $sha1 \
-        $codename \
-        check \
-        libzbd-dev
-}
-
 motr_pkgs_url='https://github.com/Seagate/cortx-motr/releases/download/2.0.0-rgw'
 
 function install_cortx_motr_on_ubuntu {
@@ -423,7 +405,6 @@ if [ x$(uname)x = xFreeBSDx ]; then
     exit
 else
     [ $WITH_SEASTAR ] && with_seastar=true || with_seastar=false
-    [ $WITH_ZBD ] && with_zbd=true || with_zbd=false
     [ $WITH_PMEM ] && with_pmem=true || with_pmem=false
     [ $WITH_RADOSGW_MOTR ] && with_rgw_motr=true || with_rgw_motr=false
     source /etc/os-release
@@ -452,12 +433,10 @@ else
             *Bionic*)
                 ensure_decent_gcc_on_ubuntu 9 bionic
                 [ ! $NO_BOOST_PKGS ] && install_boost_on_ubuntu bionic
-                $with_zbd && install_libzbd_on_ubuntu bionic
                 ;;
             *Focal*)
                 ensure_decent_gcc_on_ubuntu 11 focal
                 [ ! $NO_BOOST_PKGS ] && install_boost_on_ubuntu focal
-                $with_zbd && install_libzbd_on_ubuntu focal
                 ;;
             *Jammy*)
                 [ ! $NO_BOOST_PKGS ] && install_boost_on_ubuntu jammy
@@ -549,7 +528,7 @@ else
         if [ "$INSTALL_EXTRA_PACKAGES" ]; then
             $SUDO dnf install -y $INSTALL_EXTRA_PACKAGES
         fi
-        munge_ceph_spec_in $with_seastar $with_zbd $for_make_check $DIR/ceph.spec
+        munge_ceph_spec_in $with_seastar $for_make_check $DIR/ceph.spec
         # for python3_pkgversion macro defined by python-srpm-macros, which is required by python3-devel
         $SUDO dnf install -y python3-devel
         $SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
index fd07e443c1365f470861edef5be391ebafb0936b..33ceacc8909eb2fe13fe91a2166f40834363317a 100644 (file)
 #include "pmem/PMEMDevice.h"
 #endif
 
-#if defined(HAVE_LIBZBD)
-#include "zoned/HMSMRDevice.h"
-#endif
-
 #include "common/debug.h"
 #include "common/EventTrace.h"
 #include "common/errno.h"
@@ -113,11 +109,6 @@ BlockDevice::detect_device_type(const std::string& path)
     return block_device_t::pmem;
   }
 #endif
-#if (defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO)) && defined(HAVE_LIBZBD)
-  if (HMSMRDevice::support(path)) {
-    return block_device_t::hm_smr;
-  }
-#endif
 #if defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO)
   return block_device_t::aio;
 #else
@@ -142,11 +133,6 @@ BlockDevice::device_type_from_name(const std::string& blk_dev_name)
   if (blk_dev_name == "pmem") {
     return block_device_t::pmem;
   }
-#endif
-#if (defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO)) && defined(HAVE_LIBZBD)
-  if (blk_dev_name == "hm_smr") {
-    return block_device_t::hm_smr;
-  }
 #endif
   return block_device_t::unknown;
 }
@@ -168,10 +154,6 @@ BlockDevice* BlockDevice::create_with_type(block_device_t device_type,
 #if defined(HAVE_BLUESTORE_PMEM)
   case block_device_t::pmem:
     return new PMEMDevice(cct, cb, cbpriv);
-#endif
-#if (defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO)) && defined(HAVE_LIBZBD)
-  case block_device_t::hm_smr:
-    return new HMSMRDevice(cct, cb, cbpriv, d_cb, d_cbpriv);
 #endif
   default:
     ceph_abort_msg("unsupported device");
index 440faf3d4b4c0c5602ab5d45aa39a9984e216684..6c55646fc76df8d5594bbb66d1a7729e9a0966c5 100644 (file)
@@ -156,9 +156,6 @@ private:
     unknown,
 #if defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO)
     aio,
-#if defined(HAVE_LIBZBD)
-    hm_smr,
-#endif
 #endif
 #if defined(HAVE_SPDK)
     spdk,
index 5d9fd6a52953d6d7e73a044d38a5f27b469e533f..62c2a5c29f4bc8630b8828feb192d8cb080ee076 100644 (file)
@@ -20,11 +20,6 @@ if(WITH_SPDK)
     spdk/NVMEDevice.cc)
 endif()
 
-if(WITH_ZBD)
-  list(APPEND libblk_srcs
-    zoned/HMSMRDevice.cc)
-endif()
-
 if(libblk_srcs)
   add_library(blk STATIC ${libblk_srcs})
   target_include_directories(blk PRIVATE "./")
@@ -39,10 +34,6 @@ if(WITH_SPDK)
     PRIVATE spdk::spdk)
 endif()
 
-if(WITH_ZBD)
-  target_link_libraries(blk PRIVATE ${ZBD_LIBRARIES})
-endif()
-
 if(WITH_BLUESTORE_PMEM)
   if(HAVE_LIBDML)
     target_link_libraries(blk PRIVATE dml::dml dml::dmlhl)
diff --git a/src/blk/zoned/HMSMRDevice.cc b/src/blk/zoned/HMSMRDevice.cc
deleted file mode 100644 (file)
index 416eae4..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2014 Red Hat
- * Copyright (C) 2020 Abutalib Aghayev
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation.  See file COPYING.
- *
- */
-
-#include "HMSMRDevice.h"
-extern "C" {
-#include <libzbd/zbd.h>
-}
-#include "common/debug.h"
-#include "common/errno.h"
-
-#define dout_context cct
-#define dout_subsys ceph_subsys_bdev
-#undef dout_prefix
-#define dout_prefix *_dout << "smrbdev(" << this << " " << path << ") "
-
-using namespace std;
-
-HMSMRDevice::HMSMRDevice(CephContext* cct,
-                        aio_callback_t cb,
-                        void *cbpriv,
-                        aio_callback_t d_cb,
-                        void *d_cbpriv)
-  : KernelDevice(cct, cb, cbpriv, d_cb, d_cbpriv)
-{
-}
-
-bool HMSMRDevice::support(const std::string& path)
-{
-  return zbd_device_is_zoned(path.c_str()) == 1;
-}
-
-int HMSMRDevice::_post_open()
-{
-  dout(10) << __func__ << dendl;
-
-  zbd_fd = zbd_open(path.c_str(), O_RDWR | O_DIRECT | O_LARGEFILE, nullptr);
-  int r;
-  if (zbd_fd < 0) {
-    r = errno;
-    derr << __func__ << " zbd_open failed on " << path << ": "
-        << cpp_strerror(r) << dendl;
-    return -r;
-  }
-
-  unsigned int nr_zones = 0;
-  std::vector<zbd_zone> zones;
-  if (zbd_report_nr_zones(zbd_fd, 0, 0, ZBD_RO_NOT_WP, &nr_zones) != 0) {
-    r = -errno;
-    derr << __func__ << " zbd_report_nr_zones failed on " << path << ": "
-        << cpp_strerror(r) << dendl;
-    goto fail;
-  }
-
-  zones.resize(nr_zones);
-  if (zbd_report_zones(zbd_fd, 0, 0, ZBD_RO_NOT_WP, zones.data(), &nr_zones) != 0) {
-    r = -errno;
-    derr << __func__ << " zbd_report_zones failed on " << path << dendl;
-    goto fail;
-  }
-
-  zone_size = zbd_zone_len(&zones[0]);
-  conventional_region_size = nr_zones * zone_size;
-
-  dout(10) << __func__ << " setting zone size to " << zone_size
-          << " and conventional region size to " << conventional_region_size
-           << dendl;
-
-  return 0;
-
-fail:
-  zbd_close(zbd_fd);
-  zbd_fd = -1;
-  return r;
-}
-
-
-void HMSMRDevice::_pre_close()
-{
-  if (zbd_fd >= 0) {
-    zbd_close(zbd_fd);
-    zbd_fd = -1;
-  }
-}
-
-void HMSMRDevice::reset_all_zones()
-{
-  dout(10) << __func__ << dendl;
-  zbd_reset_zones(zbd_fd, conventional_region_size, 0);
-}
-
-void HMSMRDevice::reset_zone(uint64_t zone)
-{
-  dout(10) << __func__ << " zone 0x" << std::hex << zone << std::dec << dendl;
-  if (zbd_reset_zones(zbd_fd, zone * zone_size, zone_size) != 0) {
-    derr << __func__ << " resetting zone failed for zone 0x" << std::hex
-        << zone << std::dec << dendl;
-    ceph_abort("zbd_reset_zones failed");
-  }
-}
-
-std::vector<uint64_t> HMSMRDevice::get_zones()
-{
-  std::vector<zbd_zone> zones;
-  unsigned int num_zones = size / zone_size;
-  zones.resize(num_zones);
-
-  int r = zbd_report_zones(zbd_fd, 0, 0, ZBD_RO_ALL, zones.data(), &num_zones);
-  if (r != 0) {
-    derr << __func__ << " zbd_report_zones failed on " << path << ": "
-        << cpp_strerror(errno) << dendl;
-    ceph_abort("zbd_report_zones failed");
-  }
-
-  std::vector<uint64_t> wp(num_zones);
-  for (unsigned i = 0; i < num_zones; ++i) {
-    wp[i] = zones[i].wp;
-  }
-  return wp;
-}
diff --git a/src/blk/zoned/HMSMRDevice.h b/src/blk/zoned/HMSMRDevice.h
deleted file mode 100644 (file)
index edf18b5..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2014 Red Hat
- * Copyright (C) 2020 Abutalib Aghayev
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation.  See file COPYING.
- *
- */
-
-#ifndef CEPH_BLK_HMSMRDEVICE_H
-#define CEPH_BLK_HMSMRDEVICE_H
-
-#include <atomic>
-
-#include "include/types.h"
-#include "include/interval_set.h"
-#include "common/Thread.h"
-#include "include/utime.h"
-
-#include "aio/aio.h"
-#include "BlockDevice.h"
-#include "../kernel/KernelDevice.h"
-
-
-class HMSMRDevice final : public KernelDevice {
-  int zbd_fd = -1;     ///< fd for the zoned block device
-
-public:
-  HMSMRDevice(CephContext* cct, aio_callback_t cb, void *cbpriv,
-              aio_callback_t d_cb, void *d_cbpriv);
-
-  static bool support(const std::string& path);
-
-  // open/close hooks for libzbd
-  int _post_open() override;
-  void _pre_close() override;
-
-  // smr-specific methods
-  bool is_smr() const final { return true; }
-  void reset_all_zones() override;
-  void reset_zone(uint64_t zone) override;
-  std::vector<uint64_t> get_zones() override;
-
-};
-
-#endif //CEPH_BLK_HMSMRDEVICE_H
index 20e03d3305ff614855e42948ddcd9aae4d8b1b00..e446d4099f7bf7c275e0a7029e863f83b7413afa 100644 (file)
@@ -63,11 +63,6 @@ set(alien_store_srcs
   ${PROJECT_SOURCE_DIR}/src/os/bluestore/StupidAllocator.cc
   ${PROJECT_SOURCE_DIR}/src/os/bluestore/BitmapAllocator.cc
   ${PROJECT_SOURCE_DIR}/src/os/memstore/MemStore.cc)
-if(WITH_ZBD)
-  list(APPEND alien_store_srcs
-    ${PROJECT_SOURCE_DIR}/src/os/bluestore/ZonedFreelistManager.cc
-    ${PROJECT_SOURCE_DIR}/src/os/bluestore/ZonedAllocator.cc)
-endif()
 add_library(crimson-alienstore STATIC
   ${alien_store_srcs})
 if(WITH_LTTNG)
index f14a1f43a6005f7cbe6089ff03aaf0539064ca95..c983eff3963709b55747b296e0d6bc7aa4c7677f 100644 (file)
@@ -87,9 +87,6 @@
 /* Defined if you have libdml */
 #cmakedefine HAVE_LIBDML
 
-/* Defined if you have libzbd */
-#cmakedefine HAVE_LIBZBD
-
 /* Defined if you have liburing */
 #cmakedefine HAVE_LIBURING
 
index 7029420b53d0dc3743607329b6f25bb5d1ad8e96..60265939988e0477a658b44db22551b36ef2cf92 100644 (file)
@@ -8,9 +8,6 @@
 #include "AvlAllocator.h"
 #include "BtreeAllocator.h"
 #include "HybridAllocator.h"
-#ifdef HAVE_LIBZBD
-#include "ZonedAllocator.h"
-#endif
 #include "common/debug.h"
 #include "common/admin_socket.h"
 #define dout_subsys ceph_subsys_bluestore
index 37347ced66bdd96d9258e614d60ebada7576f2cf..1ea07bf6e4c9a62c0d75e5a6f97de33e132a1801 100644 (file)
@@ -3,9 +3,6 @@
 
 #include "FreelistManager.h"
 #include "BitmapFreelistManager.h"
-#ifdef HAVE_LIBZBD
-#include "ZonedFreelistManager.h"
-#endif
 
 FreelistManager *FreelistManager::create(
   CephContext* cct,
@@ -33,10 +30,5 @@ FreelistManager *FreelistManager::create(
 void FreelistManager::setup_merge_operators(KeyValueDB *db,
                                            const std::string& type)
 {
-#ifdef HAVE_LIBZBD
-  if (type == "zoned")
-    ZonedFreelistManager::setup_merge_operator(db, "z");
-  else
-#endif
-    BitmapFreelistManager::setup_merge_operator(db, "b");
+  BitmapFreelistManager::setup_merge_operator(db, "b");
 }
index 0e76c479002add06a4192377651a9ccc3196b7d1..1325e89b0da8f80ad73ac39720de268da7a06db6 100644 (file)
@@ -26,8 +26,7 @@ public:
   void init_alloc(int64_t size, uint64_t min_alloc_size) {
     std::cout << "Creating alloc type " << string(GetParam()) << " \n";
     alloc.reset(Allocator::create(g_ceph_context, GetParam(), size,
-                                 min_alloc_size,
-                                 256*1048576, 100*256*1048576ull));
+                                 min_alloc_size));
   }
 
   void init_close() {
index 7d0d9420f6bea5b53c8a81b5a5fe16e848e1c9e5..4405c30611efe6025e0fd3ab58b213b1daed40fb 100644 (file)
@@ -391,7 +391,7 @@ int replay_free_dump_and_apply(char* fname,
                        std::string_view alloc_name) {
     alloc.reset(
       Allocator::create(
-        g_ceph_context, alloc_type, capacity, alloc_unit, 0, 0, alloc_name));
+        g_ceph_context, alloc_type, capacity, alloc_unit, alloc_name));
   };
   auto add_fn = [&](uint64_t offset,
                    uint64_t len) {
index 007f47837cef4dde3d790d8d961684626b82f5b5..795b8b054c9047a49ed2bdc7306e14c664e81bbe 100644 (file)
@@ -1125,7 +1125,7 @@ TEST(BlueFS, test_shared_alloc) {
   uint64_t shared_alloc_unit = 4096;
   shared_alloc.set(
     Allocator::create(g_ceph_context, g_ceph_context->_conf->bluefs_allocator,
-                      size, shared_alloc_unit, 0, 0, "test shared allocator"),
+                      size, shared_alloc_unit, "test shared allocator"),
     shared_alloc_unit);
   shared_alloc.a->init_add_free(0, size);
 
@@ -1196,7 +1196,7 @@ TEST(BlueFS, test_shared_alloc_sparse) {
   bluefs_shared_alloc_context_t shared_alloc;
   shared_alloc.set(
     Allocator::create(g_ceph_context, g_ceph_context->_conf->bluefs_allocator,
-                      size, main_unit, 0, 0, "test shared allocator"),
+                      size, main_unit, "test shared allocator"),
     main_unit);
   // prepare sparse free space but let's have a continuous chunk at
   // the beginning to fit initial log's fnode into superblock,
@@ -1273,7 +1273,7 @@ TEST(BlueFS, test_4k_shared_alloc) {
   bluefs_shared_alloc_context_t shared_alloc;
   shared_alloc.set(
     Allocator::create(g_ceph_context, g_ceph_context->_conf->bluefs_allocator,
-                      size, main_unit, 0, 0, "test shared allocator"),
+                      size, main_unit, "test shared allocator"),
     main_unit);
   shared_alloc.a->init_add_free(bluefs_alloc_unit, size - bluefs_alloc_unit);
 
index a76eadfb54ec0699988ea65b706533a5b035290f..d860a6e104e0141b2f248602fec20b921764a0b4 100755 (executable)
@@ -172,7 +172,6 @@ rgw_store="rados"
 lockdep=${LOCKDEP:-1}
 spdk_enabled=0 # disable SPDK by default
 pmem_enabled=0
-zoned_enabled=0
 io_uring_enabled=0
 with_jaeger=0
 
@@ -842,13 +841,6 @@ EOF
                 BLUESTORE_OPTS=""
             fi
         fi
-        if [ "$zoned_enabled" -eq 1 ]; then
-            BLUESTORE_OPTS+="
-        bluestore min alloc size = 65536
-        bluestore prefer deferred size = 0
-        bluestore prefer deferred size hdd = 0
-        bluestore prefer deferred size ssd = 0
-        fi
         if [ "$io_uring_enabled" -eq 1 ]; then
             BLUESTORE_OPTS+="
         bdev ioring = true"