Skip to content

Commit 1ce1426

Browse files
committed
common/options/crimson: introduce crimson_poll_mode
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 <[email protected]>
1 parent 463a0ba commit 1ce1426

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/common/options/crimson.yaml.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ options:
8585
level: advanced
8686
default: 0
8787
desc: Report OSD status periodically in seconds, 0 to disable
88+
89+
- name: crimson_poll_mode
90+
type: bool
91+
level: advanced
92+
default: false
93+
desc: Let the seastar reactor poll continuously without sleeping at the expense of 100% cpu usage.
94+
flags:
95+
- startup
96+
97+
# Seastore options
98+
8899
- name: seastore_segment_size
89100
type: size
90101
desc: Segment size to use for SegmentManager

src/crimson/osd/main_config_bootstrap_helpers.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ struct SeastarOption {
9595
const std::vector<SeastarOption> seastar_options = {
9696
{"--task-quota-ms", "crimson_reactor_task_quota_ms", Option::TYPE_FLOAT},
9797
{"--io-latency-goal-ms", "crimson_reactor_io_latency_goal_ms", Option::TYPE_FLOAT},
98-
{"--idle-poll-time-us", "crimson_reactor_idle_poll_time_us", Option::TYPE_UINT}
98+
{"--idle-poll-time-us", "crimson_reactor_idle_poll_time_us", Option::TYPE_UINT},
99+
{"--poll-mode", "crimson_poll_mode", Option::TYPE_BOOL}
99100
};
100101

101102
// Function to get the option value as a string
@@ -113,6 +114,12 @@ std::optional<std::string> get_option_value(const SeastarOption& option) {
113114
}
114115
break;
115116
}
117+
case Option::TYPE_BOOL: {
118+
if (crimson::common::get_conf<bool>(option.config_key)) {
119+
return "true";
120+
}
121+
break;
122+
}
116123
default:
117124
logger().warn("get_option_value --option_name {} encountered unknown type", option.config_key);
118125
return std::nullopt;
@@ -184,7 +191,9 @@ _get_early_config(int argc, const char *argv[])
184191
if (option_value) {
185192
logger().info("Configure option_name {} with value : {}", option.config_key, option_value);
186193
ret.early_args.emplace_back(option.option_name);
187-
ret.early_args.emplace_back(*option_value);
194+
if (option.value_type != Option::TYPE_BOOL) {
195+
ret.early_args.emplace_back(*option_value);
196+
}
188197
}
189198
}
190199
if (auto found = std::find_if(

0 commit comments

Comments
 (0)