-
Notifications
You must be signed in to change notification settings - Fork 601
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
Real-time fixes #2630
Real-time fixes #2630
Conversation
Fix detection of CPU bandwidth allocation (CONFIG_RT_GROUP_SCHED) option by checking the correct file location.
Set a soft limit of real-time priority 90 and hard limit of 99. The maximum is 99, to avoid add-ons using such a high priority without second thought set the soft limit to 90. This allows a process to higher the limit to 99, if really required. Also set max locked memory to 128MB. Locking memory from getting paged out is often used for the real-time process/thread to avoid delays due to swapping/pageing in. Ideally a real-time process should only do the real-time job, hence not need too much memory.
@jens-maus not sure what priority your add-on will use, but I'd recommend to use something lower than 90. it will still be the highest priority in the system (aside from some special kernel threads). |
@@ -265,8 +265,12 @@ def ulimits(self) -> Optional[List[docker.types.Ulimit]]: | |||
limits: List[docker.types.Ulimit] = [] | |||
|
|||
# Need schedule functions | |||
if self.addon.with_realtime and self.sys_docker.info.support_cpu_realtime: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agners Did you remove the self.sys_docker.info.support_cpu_realtime
on purpose? Because this seems to skip the check if the system (kernel) has CONFIG_RT_GROUP_SCHED
or not.
Fix detection of CPU bandwidth allocation (CONFIG_RT_GROUP_SCHED) option
by checking the correct file location.
Set a soft limit of real-time priority 90 and hard limit of 99. The
maximum is 99, to avoid add-ons using such a high priority without
second thought set the soft limit to 90. This allows a process to higher
the limit to 99, if really required.
Also set max locked memory to 128MB. Locking memory from getting paged
out is often used for the real-time process/thread to avoid delays due
to swapping/pageing in. Ideally a real-time process should only do the
real-time job, hence not need too much memory.
Proposed change
Type of change
Additional information
Checklist
black --fast supervisor tests
)If API endpoints of add-on configuration are added/changed: