From 4430cec592cfae30abd7a3d8098a0a203d4c661c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 9 Nov 2020 14:41:25 +0800 Subject: [PATCH 1/2] crimson/os: do not #include unused headers Signed-off-by: Kefu Chai --- src/crimson/os/futurized_store.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crimson/os/futurized_store.h b/src/crimson/os/futurized_store.h index 744ef356e35..e81bc8f175b 100644 --- a/src/crimson/os/futurized_store.h +++ b/src/crimson/os/futurized_store.h @@ -4,9 +4,8 @@ #pragma once #include -#include #include -#include +#include #include #include From cafc6f35758bb2cf04664fd6a7b66742ad50669b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 9 Nov 2020 14:34:00 +0800 Subject: [PATCH 2/2] 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 ca8d7a18272..aaee01aeff3 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 56bf63fb8f5..51548d874f5 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 9238c4df548..fde0c1757bc 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 488599e2748..e127d87d524 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 00df87a1450..71232b3f65f 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 652e90ab6d5..82cffcd809b 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 3775fc417d9..86f76dee64e 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