Skip to content

Commit 80e6c3c

Browse files
authored
Merge pull request ceph#57359 from perezjosibm/wip-perezjos-vstart-alien
vstart.sh: add options to set number of alien threads, and number of cpu cores for alien threads Reviewed-by: Matan Breizman <[email protected]> Reviewed-by: Yingxin Cheng <[email protected]>
2 parents 438f57a + b1083a4 commit 80e6c3c

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

src/vstart.sh

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ options:
273273
--seastore-secondary-devs: comma-separated list of secondary blockdevs to use for seastore
274274
--seastore-secondary-devs-type: device type of all secondary blockdevs. HDD, SSD(default), ZNS or RANDOM_BLOCK_SSD
275275
--crimson-smp: number of cores to use for crimson
276+
--crimson-alien-num-threads: number of alien-tp threads
277+
--crimson-alien-num-cores: number of cores to use for alien-tp
276278
--osds-per-host: populate crush_location as each host holds the specified number of osds if set
277279
--require-osd-and-client-version: if supplied, do set-require-min-compat-client and require-osd-release to specified value
278280
--use-crush-tunables: if supplied, set tunables to specified value
@@ -344,7 +346,11 @@ parse_secondary_devs() {
344346
done
345347
}
346348

349+
# Default values for the crimson options
347350
crimson_smp=1
351+
crimson_alien_num_threads=0
352+
crimson_alien_num_cores=0
353+
348354
while [ $# -ge 1 ]; do
349355
case $1 in
350356
-d | --debug)
@@ -575,6 +581,14 @@ case $1 in
575581
crimson_smp=$2
576582
shift
577583
;;
584+
--crimson-alien-num-threads)
585+
crimson_alien_num_threads=$2
586+
shift
587+
;;
588+
--crimson-alien-num-cores)
589+
crimson_alien_num_cores=$2
590+
shift
591+
;;
578592
--bluestore-spdk)
579593
[ -z "$2" ] && usage_exit
580594
IFS=',' read -r -a bluestore_spdk_dev <<< "$2"
@@ -1698,8 +1712,25 @@ if [ "$ceph_osd" == "crimson-osd" ]; then
16981712
extra_seastar_args=" --trace"
16991713
fi
17001714
if [ "$(expr $(nproc) - 1)" -gt "$(($CEPH_NUM_OSD * crimson_smp))" ]; then
1701-
echo "crimson_alien_thread_cpu_cores:" $(($CEPH_NUM_OSD * crimson_smp))-"$(expr $(nproc) - 1)"
1702-
$CEPH_BIN/ceph -c $conf_fn config set osd crimson_alien_thread_cpu_cores $(($CEPH_NUM_OSD * crimson_smp))-"$(expr $(nproc) - 1)"
1715+
if [ $crimson_alien_num_cores -gt 0 ]; then
1716+
alien_bottom_cpu=$(($CEPH_NUM_OSD * crimson_smp))
1717+
alien_top_cpu=$(( alien_bottom_cpu + crimson_alien_num_cores - 1 ))
1718+
# Ensure top value within range:
1719+
if [ "$(($alien_top_cpu))" -gt "$(expr $(nproc) - 1)" ]; then
1720+
alien_top_cpu=$(expr $(nproc) - 1)
1721+
fi
1722+
echo "crimson_alien_thread_cpu_cores: $alien_bottom_cpu-$alien_top_cpu"
1723+
# This is a (logical) processor id range, it could be refined to encompass only physical processor ids
1724+
# (equivalently, ignore hyperthreading sibling processor ids)
1725+
$CEPH_BIN/ceph -c $conf_fn config set osd crimson_alien_thread_cpu_cores "$alien_bottom_cpu-$alien_top_cpu"
1726+
else
1727+
echo "crimson_alien_thread_cpu_cores:" $(($CEPH_NUM_OSD * crimson_smp))-"$(expr $(nproc) - 1)"
1728+
$CEPH_BIN/ceph -c $conf_fn config set osd crimson_alien_thread_cpu_cores $(($CEPH_NUM_OSD * crimson_smp))-"$(expr $(nproc) - 1)"
1729+
fi
1730+
if [ $crimson_alien_num_threads -gt 0 ]; then
1731+
echo "$CEPH_BIN/ceph -c $conf_fn config set osd crimson_alien_op_num_threads $crimson_alien_num_threads"
1732+
$CEPH_BIN/ceph -c $conf_fn config set osd crimson_alien_op_num_threads "$crimson_alien_num_threads"
1733+
fi
17031734
else
17041735
echo "No alien thread cpu core isolation"
17051736
fi

0 commit comments

Comments
 (0)