From c02273e4e34093edf2b757ebf74e3fa41fd089a5 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Thu, 14 Aug 2025 08:46:12 +0000 Subject: [PATCH] common/options/crimson.yaml.in: Rename crimson seastar num threads We want to avoid Ceph users using "seastar" term when possible. This is an internal detail. Signed-off-by: Matan Breizman Signed-off-by: Neha Ojha --- doc/dev/crimson/crimson.rst | 12 ++++++------ .../clusters/fixed-1-num-threads-3.yaml | 2 +- src/common/options/crimson.yaml.in | 4 ++-- src/crimson/osd/main_config_bootstrap_helpers.cc | 6 +++--- src/vstart.sh | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/dev/crimson/crimson.rst b/doc/dev/crimson/crimson.rst index 8316dbd2879..5cb2483056c 100644 --- a/doc/dev/crimson/crimson.rst +++ b/doc/dev/crimson/crimson.rst @@ -68,22 +68,22 @@ Crimson CPU allocation #. Allocation options **cannot** be changed after deployment. #. `vstart.sh`_ sets these options using the ``--crimson-smp`` flag. -The ``crimson_seastar_num_threads`` parameter defines the number of threads used to serve Seastar reactors. -Each thread is expected to run on a dedicated CPU core. +The ``crimson_cpu_num`` parameter defines the number of CPUs used to serve Seastar reactors. +Each reactor is expected to run on a dedicated CPU core. This parameter **does not have a default value**. Users must configure it at the OSD level based on system resources and cluster requirements **before** deploying the OSDs. -We recommend setting a value for ``crimson_seastar_num_threads`` that is less than the host's +We recommend setting a value for ``crimson_cpu_num`` that is less than the host's number of CPU cores (``nproc``) divided by the **number of OSDs on that host**. For example, for deploying a node with eight CPU cores per OSD: .. code-block:: bash # - ceph config set osd crimson_seastar_num_threads 8 + ceph config set osd crimson_cpu_num 8 -Note that ``crimson_seastar_num_threads`` does **not** pin threads to specific CPU cores. +Note that ``crimson_cpu_num`` does **not** pin threads to specific CPU cores. To explicitly assign CPU cores to Crimson OSDs, use the ``crimson_seastar_cpu_cores`` parameter. This enables CPU pinning, which *may* improve performance. However, using this option requires manually setting the CPU set for each OSD, @@ -149,7 +149,7 @@ These backends allow Crimson to interact with legacy or external object store im The ``crimson_alien_op_num_threads`` option needs to be set according to the cpu set available. This defines the number of threads dedicated to serving the BlueStore ObjectStore on each OSD. - If ``crimson_seastar_num_threads`` is used from `Crimson CPU allocation`_, + If ``crimson_cpu_num`` is used from `Crimson CPU allocation`_, The counterpart ``crimson_alien_thread_cpu_cores`` should also be used accordingly to allow the two sets to be mutually exclusive. diff --git a/qa/suites/crimson-rados/objectstore_tool/clusters/fixed-1-num-threads-3.yaml b/qa/suites/crimson-rados/objectstore_tool/clusters/fixed-1-num-threads-3.yaml index e370257d34b..2d23795c2d7 100644 --- a/qa/suites/crimson-rados/objectstore_tool/clusters/fixed-1-num-threads-3.yaml +++ b/qa/suites/crimson-rados/objectstore_tool/clusters/fixed-1-num-threads-3.yaml @@ -4,7 +4,7 @@ overrides: ceph: conf: osd: - crimson seastar num threads: 3 + crimson cpu num: 3 global: ms cluster mode: crc ms service mode: crc diff --git a/src/common/options/crimson.yaml.in b/src/common/options/crimson.yaml.in index 145ea0502fc..7a58336ae57 100644 --- a/src/common/options/crimson.yaml.in +++ b/src/common/options/crimson.yaml.in @@ -31,11 +31,11 @@ options: desc: CPU cores on which alienstore threads will run in cpuset(7) format flags: - startup -- name: crimson_seastar_num_threads +- name: crimson_cpu_num type: uint level: advanced default: 0 - desc: The number of threads for serving seastar reactors without CPU pinning, overridden if crimson_seastar_cpu_cores is set + desc: The number of seastar reactors, overridden if crimson_seastar_cpu_cores is set flags: - startup min: 0 diff --git a/src/crimson/osd/main_config_bootstrap_helpers.cc b/src/crimson/osd/main_config_bootstrap_helpers.cc index c4667dc9f09..ca2fcf66b2e 100644 --- a/src/crimson/osd/main_config_bootstrap_helpers.cc +++ b/src/crimson/osd/main_config_bootstrap_helpers.cc @@ -212,11 +212,11 @@ _get_early_config(int argc, const char *argv[]) logger().info("get_early_config: set --thread-affinity 1 --cpuset {}", cpu_cores); } else { - auto reactor_num = crimson::common::get_conf("crimson_seastar_num_threads"); + auto reactor_num = crimson::common::get_conf("crimson_cpu_num"); if (!reactor_num) { + // We would like to avoid seastar using all available cores. logger().error("get_early_config: crimson_seastar_cpu_cores" - " or crimson_seastar_num_threads" - " must be set"); + " or crimson_cpu_num must be set"); ceph_abort(); } std::string smp = fmt::format("{}", reactor_num); diff --git a/src/vstart.sh b/src/vstart.sh index 65a95b3e1e6..c03a7120543 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -1218,7 +1218,7 @@ do_balance_cpu() { $cmd else echo "No cpu_table entry for osd $osd, setting crimson_seastar_num_reactors" - local cmd="$CEPH_BIN/ceph -c $conf_fn config set osd.$osd crimson_seastar_num_threads $crimson_smp" + local cmd="$CEPH_BIN/ceph -c $conf_fn config set osd.$osd crimson_cpu_num $crimson_smp" echo $cmd $cmd return -- 2.39.5