From 3c69808379a189b2c157d97d03d34a8af2b16820 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Tue, 23 Jan 2024 14:06:01 +0000 Subject: [PATCH] crimson/os/alienstore: cleanup N_CORES_FOR_SEASTAR constant No CPU pinning if crimson_alien_thread_cpu_cores is not set. Signed-off-by: Matan Breizman --- src/crimson/os/alienstore/alien_store.cc | 11 +++++------ src/crimson/os/alienstore/alien_store.h | 3 --- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index d53dacb182461..31dedbcf893fb 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -103,14 +103,13 @@ seastar::future<> AlienStore::start() } auto cpu_cores = seastar::resource::parse_cpuset( get_conf("crimson_alien_thread_cpu_cores")); - // cores except the first "N_CORES_FOR_SEASTAR" ones will - // be used for alien threads scheduling: - // [0, N_CORES_FOR_SEASTAR) are reserved for seastar reactors - // [N_CORES_FOR_SEASTAR, ..] are assigned to alien threads. + // crimson_alien_thread_cpu_cores are assigned to alien threads. if (!cpu_cores.has_value()) { + // no core isolation by default, cores [0, seastar::smp::count) + // will be shared between both alien and seastar reactor threads. seastar::resource::cpuset cpuset; - std::copy(boost::counting_iterator(N_CORES_FOR_SEASTAR), - boost::counting_iterator(sysconf(_SC_NPROCESSORS_ONLN)), + std::copy(boost::counting_iterator(0), + boost::counting_iterator(seastar::smp::count - 1), std::inserter(cpuset, cpuset.end())); if (cpuset.empty()) { logger().error("{}: unable to get nproc: {}", __func__, errno); diff --git a/src/crimson/os/alienstore/alien_store.h b/src/crimson/os/alienstore/alien_store.h index 79c19b29896cb..7138da955aa16 100644 --- a/src/crimson/os/alienstore/alien_store.h +++ b/src/crimson/os/alienstore/alien_store.h @@ -117,9 +117,6 @@ private: }); } - // number of cores that are PREVENTED from being scheduled - // to run alien store threads. - static constexpr int N_CORES_FOR_SEASTAR = 3; mutable std::unique_ptr tp; const std::string type; const std::string path; -- 2.39.5