const auto num_threads =
cct->_conf.get_val<uint64_t>("crimson_alien_op_num_threads");
std::vector<uint64_t> cpu_cores = _parse_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.
+ if (cpu_cores.empty()) {
+ if (long nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ nr_cpus > N_CORES_FOR_SEASTAR ) {
+ for (int i = N_CORES_FOR_SEASTAR; i < nr_cpus; i++) {
+ cpu_cores.push_back(i);
+ }
+ } else {
+ logger().error("{}: unable to get nproc: {}", __func__, errno);
+ }
+ }
tp = std::make_unique<crimson::os::ThreadPool>(num_threads, 128, cpu_cores);
}
const ghobject_t& oid) final;
private:
+ // number of cores that are PREVENTED from being scheduled
+ // to run alien store threads.
+ static constexpr int N_CORES_FOR_SEASTAR = 3;
constexpr static unsigned MAX_KEYS_PER_OMAP_GET_CALL = 32;
mutable std::unique_ptr<crimson::os::ThreadPool> tp;
const std::string path;