Is it safe to set /proc/sys/kernel/sched_rt_runtime_us to -1?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9

Issue

  • Is it safe to set /proc/sys/kernel/sched_rt_runtime_us to -1?

Resolution

In short, setting sched_rt_runtime_us to -1 can be extremely dangerous. A value of -1 means no limit. In other words, a "run-away" real-time task will be permitted to monopolise a CPU which could (potentially) lock up a system. The default value for sched_rt_runtime_us is 950000 or 0.95 seconds. Broadly speaking, this allows 0.05 seconds to be used by other non-real-time tasks (i.e. SCHED_OTHER) - a small window at which to recover a system.

The kernel parameter namely /proc/sys/kernel/sched_rt_runtime_us can be set between -1 and (INT_MAX - 1).

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments