Skip to content

Commit

Permalink
Use 1st workload cpu as the cpu main thread
Browse files Browse the repository at this point in the history
cpu main thread must be an isolated cpu, otherwise it may spike
due to load pressure on the hk cores.
  • Loading branch information
rafaelfolco committed Oct 24, 2024
1 parent 53d3eed commit e2c5103
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions oslat-client
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ echo -e "${CMD_OUTPUT}"
HK_CPUS=$(echo -e "${CMD_OUTPUT}" | grep "final cpus:" | awk '{ print $3 }')
echo "HK_CPUS: ${HK_CPUS}"

# get the first CPU from HK_CPUS to use as the oslat main thread
cpu_main_thread=$(echo ${HK_CPUS} | awk -F, '{ print $1 }')
# get the first CPU from WORKLOAD_CPUS to use as the oslat main thread
cpu_main_thread=$(echo ${WORKLOAD_CPUS} | awk -F, '{ print $1 }')
echo "cpu-main-thread: ${cpu_main_thread}"

# LATENCY_CPUS are the WORKLOAD_CPUS less the cpu main thread
LATENCY_CPUS=$(echo ${WORKLOAD_CPUS} | cut -d ',' -f2-)
echo "LATENCY_CPUS: ${LATENCY_CPUS}"

echo
cmd="oslat --help"
Expand All @@ -130,7 +135,7 @@ if [ $? != 0 ]; then
exit_error "${output}"
fi

cmd="taskset -c ${HK_CPUS},${WORKLOAD_CPUS} oslat --duration ${duration} ${rtprio_opt} --cpu-list ${WORKLOAD_CPUS} --cpu-main-thread ${cpu_main_thread} ${trace_args}"
cmd="taskset -c ${WORKLOAD_CPUS} oslat --duration ${duration} ${rtprio_opt} --cpu-list ${LATENCY_CPUS} --cpu-main-thread ${cpu_main_thread} ${trace_args}"
echo "About to run: $cmd"
date +%s.%N >begin.txt
$cmd >oslat-bin-stderrout.txt 2>&1
Expand Down

0 comments on commit e2c5103

Please sign in to comment.