[systemd-devel] Realtime scheduling with CONFIG_RT_GROUP_SCHED=y
Lars Kellogg-Stedman
lars at redhat.com
Thu Jul 20 14:42:42 UTC 2017
On Mon, Jul 17, 2017 at 4:14 AM, Lennart Poettering <lennart at poettering.net>
wrote:
> And I'd probably turn this into a proper shell script, that
> dynamically reads the path from /proc/self/cgroup and then propagates
> things up properly.
>
Lennart,
Thanks for the information. In case anyone comes across this thread and
wonders "what might that shell script look like?", the following seems to
work:
#!/bin/bash
desired_rt_runtime_us=$1
mygroup=${2:-$(awk -F: '$2 == "cpuacct,cpu" {print $3}' /proc/self/cgroup)}
[[ $desired_rt_runtime_us -gt 0 ]] || exit
[[ $mygroup ]] || exit
[[ $mygroup = / ]] && exit
echo "${0##*/}: setting cpu.rt_runtime_us for $mygroup" >&2
cgpath=
IFS=/ read -ra cgroups <<< "${mygroup:1}"
for cg in "${cgroups[@]}"; do
cgpath="${cgpath}/${cg}"
echo "${0##*/}: $desired_rt_runtime_us ->
/sys/fs/cgroup/cpu,cpuacct${cgpath}" >&2
echo "$desired_rt_runtime_us" >
/sys/fs/cgroup/cpu,cpuacct${cgpath}/cpu.rt_runtime_us
done
--
Lars Kellogg-Stedman <lars at redhat.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170720/2611a7a7/attachment.html>
More information about the systemd-devel
mailing list