| # Copyright 2016 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "configure rt runtime limits" |
| author "chromium-os-dev@chromium.org" |
| |
| start on starting system-services |
| task |
| |
| script |
| write_log() { |
| logger -t "${UPSTART_JOB}" "failed to write $1" |
| } |
| |
| # set cgroup based limits. |
| echo 1000000 > /sys/fs/cgroup/cpu/cpu.rt_period_us || write_log cpu.rt_period_us |
| echo 800000 > /sys/fs/cgroup/cpu/cpu.rt_runtime_us || write_log cpu.rt_runtime_us |
| |
| # set system-wide limit |
| echo 1000000 > /proc/sys/kernel/sched_rt_period_us || write_log sched_rt_period_us |
| echo 800000 > /proc/sys/kernel/sched_rt_runtime_us || write_log sched_rt_runtime_us |
| end script |
| |