Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update real-time capability check for multimacd #2386

Merged
merged 3 commits into from
Aug 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading