]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options/crimson: introduce crimson_poll_mode
authorMatan Breizman <mbreizma@redhat.com>
Sun, 18 May 2025 12:38:23 +0000 (12:38 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 18 May 2025 12:50:47 +0000 (12:50 +0000)
We shoudn't expect real deployments to enable this options (though
it might be useful for some). Enabling poll mode could provide further
insights on performance "potential" and help with discovering
bottlenecks.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/common/options/crimson.yaml.in
src/crimson/osd/main_config_bootstrap_helpers.cc

index f99ec372a61e89736257ea5bff8a9b0862011b66..70026505eb7d9f04d735dcc1dc059db4a09daa98 100644 (file)
@@ -85,6 +85,17 @@ options:
   level: advanced
   default: 0
   desc: Report OSD status periodically in seconds, 0 to disable
+
+- name: crimson_poll_mode
+  type: bool
+  level: advanced
+  default: false
+  desc: Let the seastar reactor poll continuously without sleeping at the expense of 100% cpu usage.
+  flags:
+  - startup
+
+# Seastore options
+
 - name: seastore_segment_size
   type: size
   desc: Segment size to use for SegmentManager
index d23cd808456157f976a795c9d645346d13073651..c4667dc9f09a7d56f69d2489f28f270ee8ad9591 100644 (file)
@@ -95,7 +95,8 @@ struct SeastarOption {
 const std::vector<SeastarOption> seastar_options = {
   {"--task-quota-ms", "crimson_reactor_task_quota_ms", Option::TYPE_FLOAT},
   {"--io-latency-goal-ms", "crimson_reactor_io_latency_goal_ms", Option::TYPE_FLOAT},
-  {"--idle-poll-time-us", "crimson_reactor_idle_poll_time_us", Option::TYPE_UINT}
+  {"--idle-poll-time-us", "crimson_reactor_idle_poll_time_us", Option::TYPE_UINT},
+  {"--poll-mode", "crimson_poll_mode", Option::TYPE_BOOL}
 };
 
 // Function to get the option value as a string
@@ -113,6 +114,12 @@ std::optional<std::string> get_option_value(const SeastarOption& option) {
       }
       break;
     }
+    case Option::TYPE_BOOL: {
+     if (crimson::common::get_conf<bool>(option.config_key)) {
+        return "true";
+      }
+      break;
+    }
     default:
       logger().warn("get_option_value --option_name {} encountered unknown type", option.config_key);
       return std::nullopt;
@@ -184,7 +191,9 @@ _get_early_config(int argc, const char *argv[])
           if (option_value) {
             logger().info("Configure option_name {} with value : {}", option.config_key, option_value);
             ret.early_args.emplace_back(option.option_name);
-            ret.early_args.emplace_back(*option_value);
+            if (option.value_type != Option::TYPE_BOOL) {
+              ret.early_args.emplace_back(*option_value);
+            }
           }
         }
        if (auto found = std::find_if(