Skip to content

Commit ab9e2ef

Browse files
authored
Merge pull request ceph#63333 from Matan-B/wip-matanb-crimson-poll-mode
common/options/crimson: introduce crimson_poll_mode Reviewed-by: Yingxin Cheng <[email protected]>
2 parents fc3dd98 + 7f1f3f1 commit ab9e2ef

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-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(

src/vstart.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ options:
279279
--crimson-alien-num-cores: number of cpus to use for alien threads
280280
--crimson-alienstore-physical-only: use only one cpu per physical core for alienstore
281281
--crimson-balance-cpu: distribute the Seastar reactors uniformly across OSDs (osd) or NUMA (socket)
282+
--crimson-poll-mode: enable poll-mode (100% cpu usage)
282283
--osds-per-host: populate crush_location as each host holds the specified number of osds if set
283284
--require-osd-and-client-version: if supplied, do set-require-min-compat-client and require-osd-release to specified value
284285
--use-crush-tunables: if supplied, set tunables to specified value
@@ -385,6 +386,7 @@ crimson_reactor_physical_only=0
385386
crimson_alien_num_cores=0
386387
crimson_alienstore_physical_only=0
387388
crimson_balance_cpu="" # "osd", "socket"
389+
crimson_poll_mode=false
388390

389391
while [ $# -ge 1 ]; do
390392
case $1 in
@@ -634,6 +636,10 @@ case $1 in
634636
crimson_balance_cpu=$2
635637
shift
636638
;;
639+
--crimson-poll-mode)
640+
crimson_poll_mode=true
641+
shift
642+
;;
637643
--bluestore-spdk)
638644
[ -z "$2" ] && usage_exit
639645
IFS=',' read -r -a bluestore_spdk_dev <<< "$2"
@@ -1254,6 +1260,10 @@ start_osd() {
12541260
do
12551261
if [ "$ceph_osd" == "crimson-osd" ]; then
12561262
do_balance_cpu $osd
1263+
if $crimson_poll_mode; then
1264+
echo "$CEPH_BIN/ceph -c $conf_fn config set osd.$osd crimson_poll_mode true"
1265+
$CEPH_BIN/ceph -c $conf_fn config set "osd.$osd" crimson_poll_mode true
1266+
fi
12571267
fi
12581268
if [ "$new" -eq 1 -o $inc_osd_num -gt 0 ]; then
12591269
wconf <<EOF

0 commit comments

Comments
 (0)