]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/alienstore: cleanup N_CORES_FOR_SEASTAR constant
authorMatan Breizman <mbreizma@redhat.com>
Tue, 23 Jan 2024 14:06:01 +0000 (14:06 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 1 Feb 2024 09:18:23 +0000 (09:18 +0000)
No CPU pinning if crimson_alien_thread_cpu_cores is not set.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/os/alienstore/alien_store.cc
src/crimson/os/alienstore/alien_store.h

index d53dacb182461bee90f9306828fc2f12b2744053..31dedbcf893fbb9a514d3e10c36ebea02e1ffc04 100644 (file)
@@ -103,14 +103,13 @@ seastar::future<> AlienStore::start()
   }
   auto cpu_cores = seastar::resource::parse_cpuset(
     get_conf<std::string>("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<unsigned>(N_CORES_FOR_SEASTAR),
-             boost::counting_iterator<unsigned>(sysconf(_SC_NPROCESSORS_ONLN)),
+    std::copy(boost::counting_iterator<unsigned>(0),
+             boost::counting_iterator<unsigned>(seastar::smp::count - 1),
              std::inserter(cpuset, cpuset.end()));
     if (cpuset.empty()) {
       logger().error("{}: unable to get nproc: {}", __func__, errno);
index 79c19b29896cb36835f00c7d022d30617c6fb5c9..7138da955aa16065a49039ae7320d88d0d494568 100644 (file)
@@ -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<crimson::os::ThreadPool> tp;
   const std::string type;
   const std::string path;