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

Update real-time capability check for multimacd #2386

merged 3 commits into from
Aug 12, 2023

Conversation

honsma235
Copy link
Contributor

@honsma235 honsma235 commented Aug 11, 2023

Description

Use more generic way to test if we can change real-time scheduling attributes.

On a kernel compiled with CONFIG_RT_GROUP_SCHED=y each cgroup domain which wants to use real-time scheduling would need to allocate rt_runtime_us.

If you are stuck with such a kernel one can disable the limit altogether changing the kernel parameter with sudo sysctl -w kernel.sched_rt_runtime_us=-1 or
echo "kernel.sched_rt_runtime_us = -1" | sudo tee /etc/sysctl.d/10-disable-rt-group-limit.conf to make it permanent.

The previous check for real-time capability fails in this case, because it only checks for rt_runtime_us > 0 in the cgroup settings which don't reflect the kernel parameter.

Related Issue

home-assistant/operating-system#1235
home-assistant/operating-system#2168
#1191

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Alternate Designs

None considered

Possible Drawbacks

Not that I'm aware of

Verification Process

Implemented and tested locally on a Radxa 4SE with Debian Bullseye and Home Assistant supervised install

Release Notes

N/A

Contributing checklist

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING and LICENSE document.
  • I fully agree to distribute my changes under Apache 2.0 license.

Use more generic way to test if we can change real-time scheduling attributes
@jens-maus
Copy link
Owner

Thx for your contribution. I do have two small comments/requests before accepting this PR:

  1. Please check and elaborate that the chrt commands are available for all supported RaspberryMatic platforms.
  2. You changed the final ERROR output and do not provide some additional technical hint in how exactly a user could fix that issue or how the error could be interpreted correctly or actually googled. So please rephrase that final ERROR in case the cgroups feature/setting is missing so that user get some more technical hints what could actually be the reason or potential solution.

@jens-maus jens-maus self-requested a review August 11, 2023 19:43
Copy link
Owner

@jens-maus jens-maus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adapt as requested

@honsma235
Copy link
Contributor Author

As for the availability of chrt:
It is part of Busybox and enabled in Busybox.config

so I guess it should be available in all builds.

But not sure where the file comes from. The header says something about automatically generated.

@jens-maus jens-maus merged commit 560cfa1 into jens-maus:master Aug 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants