Skip to content

Commit

Permalink
Update real-time capability check for multimacd (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
honsma235 authored Aug 12, 2023
1 parent c6a4faa commit 560cfa1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions buildroot-external/overlay/RFD/etc/init.d/S60multimacd
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ start() {
if [[ -n "${HM_HMIP_DEV}" ]] && [[ -n "${HM_HMRF_DEV}" ]] &&
( ( ! echo "${HM_HMIP_DEV}" | grep -q "HMIP-RFUSB" ) || [[ "${HM_HMRF_DEV}" != "HM-CFG-USB-2" ]] ); then

# we need to check if the system has CONFIG_RT_GROUP_SCHED enabled
# and enough cpu.rt_runtime_us shares assigned or otherwise
# we need to check if the system allows changing real-time scheduling attributes or otherwise
# multimacd startup will fail as it uses sched_setscheduler() to
# raise the real-time priority for processing things with low latency
if [[ ! -e /sys/fs/cgroup/cpu/cpu.rt_runtime_us ]] ||
[[ $(cat /sys/fs/cgroup/cpu/cpu.rt_runtime_us) -gt 0 ]]; then
if /usr/bin/chrt -f 10 echo >/dev/null 2>&1; then

# run init function
init
Expand All @@ -109,7 +107,7 @@ start() {
echo "ERROR: /dev/eq3loop missing"
fi
else
echo "ERROR: not enough real-time shares (cpu.rt_runtime_us == 0)"
echo "ERROR: real-time scheduling test failed. CONFIG_RT_GROUP_SCHED not set or host kernel unable to utilize sched_setscheduler()"
fi
else
echo "not required"
Expand Down

0 comments on commit 560cfa1

Please sign in to comment.