From cafc6f35758bb2cf04664fd6a7b66742ad50669b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 9 Nov 2020 14:34:00 +0800 Subject: [PATCH] crimson/os: do not configure seastar allocator for alien threads 4cd2b00d2a703510777bd761609be221859bd790 allows us to colocate seastar allocator used by seastar reactors and libc allocator used by alien threads, there is no need to configure seastar allocator for alien thread anymore. this change partially reverts - f7715b86ef09a820adb2d43d4e82cabc9a04199f - b55919071fc872d880bebe70bc270b9d66d02ab0 Signed-off-by: Kefu Chai --- src/common/Thread.cc | 3 --- src/crimson/os/alienstore/alien_store.cc | 12 ------------ src/crimson/os/alienstore/alien_store.h | 1 - src/crimson/os/alienstore/thread_pool.cc | 2 -- src/os/bluestore/BlueRocksEnv.cc | 12 ------------ src/os/bluestore/BlueRocksEnv.h | 5 ----- src/test/crimson/CMakeLists.txt | 1 - 7 files changed, 36 deletions(-) diff --git a/src/common/Thread.cc b/src/common/Thread.cc index ca8d7a18272de..aaee01aeff31b 100644 --- a/src/common/Thread.cc +++ b/src/common/Thread.cc @@ -84,9 +84,6 @@ void *Thread::entry_wrapper() _set_affinity(cpuid); ceph_pthread_setname(pthread_self(), thread_name.c_str()); -#ifdef WITH_SEASTAR - crimson::os::AlienStore::configure_thread_memory(); -#endif return entry(); } diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index 56bf63fb8f5c7..51548d874f5bf 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -5,7 +5,6 @@ #include "alien_store.h" #include -#include #include #include #include @@ -13,9 +12,7 @@ #include #include -#include #include -#include #include "common/ceph_context.h" #include "global/global_context.h" @@ -570,13 +567,4 @@ int AlienStore::AlienOmapIterator::status() const return iter->status(); } -void AlienStore::configure_thread_memory() -{ - std::vector layout; - // 1 GiB for experimenting. Perhaps we'll introduce a config option later. - // TODO: consider above. - layout.emplace_back(seastar::resource::memory{1024 * 1024 * 1024, 0}); - seastar::memory::configure(layout, false, std::nullopt); -} - } diff --git a/src/crimson/os/alienstore/alien_store.h b/src/crimson/os/alienstore/alien_store.h index 9238c4df548bd..fde0c1757bca4 100644 --- a/src/crimson/os/alienstore/alien_store.h +++ b/src/crimson/os/alienstore/alien_store.h @@ -111,7 +111,6 @@ public: CollectionRef ch, const ghobject_t& oid) final; - static void configure_thread_memory(); private: constexpr static unsigned MAX_KEYS_PER_OMAP_GET_CALL = 32; mutable std::unique_ptr tp; diff --git a/src/crimson/os/alienstore/thread_pool.cc b/src/crimson/os/alienstore/thread_pool.cc index 488599e274880..e127d87d524fc 100644 --- a/src/crimson/os/alienstore/thread_pool.cc +++ b/src/crimson/os/alienstore/thread_pool.cc @@ -5,7 +5,6 @@ #include "include/ceph_assert.h" #include "crimson/common/config_proxy.h" -#include "crimson/os/alienstore/alien_store.h" using crimson::common::local_conf; @@ -23,7 +22,6 @@ ThreadPool::ThreadPool(size_t n_threads, if (cpu_id >= 0) { pin(cpu_id); } - crimson::os::AlienStore::configure_thread_memory(); loop(queue_max_wait); }); } diff --git a/src/os/bluestore/BlueRocksEnv.cc b/src/os/bluestore/BlueRocksEnv.cc index 00df87a1450d0..71232b3f65f1e 100644 --- a/src/os/bluestore/BlueRocksEnv.cc +++ b/src/os/bluestore/BlueRocksEnv.cc @@ -1,10 +1,6 @@ // -*- 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" @@ -591,11 +587,3 @@ 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); -} diff --git a/src/os/bluestore/BlueRocksEnv.h b/src/os/bluestore/BlueRocksEnv.h index 652e90ab6d5d9..82cffcd809bdd 100644 --- a/src/os/bluestore/BlueRocksEnv.h +++ b/src/os/bluestore/BlueRocksEnv.h @@ -16,8 +16,6 @@ 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); @@ -158,9 +156,6 @@ 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; diff --git a/src/test/crimson/CMakeLists.txt b/src/test/crimson/CMakeLists.txt index 3775fc417d92a..86f76dee64e51 100644 --- a/src/test/crimson/CMakeLists.txt +++ b/src/test/crimson/CMakeLists.txt @@ -36,7 +36,6 @@ add_ceph_test(unittest-seastar-alienstore-thread-pool unittest-seastar-alienstore-thread-pool --memory 256M --smp 1) target_link_libraries(unittest-seastar-alienstore-thread-pool crimson-os - crimson-alienstore crimson) add_executable(unittest-seastar-config -- 2.39.5