]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: configure Seastar's allocator for RocksDB's threads.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 16 Jun 2020 13:09:37 +0000 (15:09 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 23 Jun 2020 08:16:31 +0000 (10:16 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/os/bluestore/BlueRocksEnv.cc
src/os/bluestore/BlueRocksEnv.h

index 54c7d27458cc92b16873f6a6a1eeb6c00ee16d48..8b154335ca6a2c8fb08a33df79e691175652eb7c 100644 (file)
@@ -1,6 +1,10 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
+#ifdef WITH_SEASTAR
+#include "crimson/os/alienstore/alien_store.h"
+#endif
+
 #include "BlueRocksEnv.h"
 #include "BlueFS.h"
 #include "include/stringify.h"
@@ -584,3 +588,11 @@ rocksdb::Status BlueRocksEnv::GetTestDirectory(std::string* path)
   *path = "temp_" + stringify(++foo);
   return rocksdb::Status::OK();
 }
+
+void BlueRocksEnv::StartThread(void(*function)(void* arg), void* arg)
+{
+#ifdef WITH_SEASTAR
+  crimson::os::AlienStore::configure_thread_memory();
+#endif
+  base_t::StartThread(function, arg);
+}
index 82cffcd809bdd27d7313c38b3a6c715cdc576ec4..652e90ab6d5d9a5c99377b2301d6890f3f09f171 100644 (file)
@@ -16,6 +16,8 @@
 class BlueFS;
 
 class BlueRocksEnv : public rocksdb::EnvWrapper {
+  using base_t = EnvWrapper;
+
   void split(const std::string &fn, std::string *dir, std::string *file) {
     size_t slash = fn.rfind('/');
     *file = fn.substr(slash + 1);
@@ -156,6 +158,9 @@ public:
   rocksdb::Status GetAbsolutePath(const std::string& db_path,
       std::string* output_path) override;
 
+  // Start new thread taking care about Seastar's allocator init.
+  void StartThread(void(*function)(void* arg), void* arg) override;
+
   explicit BlueRocksEnv(BlueFS *f);
 private:
   BlueFS *fs;