]> git.ipfire.org Git - thirdparty/util-linux.git/commit
chrt: Add --sched_runtime support for SCHED_{OTHER,BATCH} policies
authorPetre Tudor <petre-ionut.tudor@arm.com>
Thu, 16 Jan 2025 15:13:22 +0000 (15:13 +0000)
committerPetre Tudor <petre-ionut.tudor@arm.com>
Wed, 12 Feb 2025 15:56:41 +0000 (15:56 +0000)
commit3055b8bf92c5f438275cfdbf8f32cb864b9f841d
treed7e50e142a15429cd7e18bbede0f5038651c52ef
parent8ec6a622bbf6877a1dbba8f899d30510922e1ba4
chrt: Add --sched_runtime support for SCHED_{OTHER,BATCH} policies

Apply --sched_runtime to SCHED_{OTHER,BATCH} in addition to
SCHED_DEADLINE, supporting Linux kernel patch:

commit 857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime to set request/slice suggestion")
(2024-08-17 Peter Zijlstra)

This patch is present in kernel versions starting with 6.12 and allows
setting custom slice length on fair tasks via the sched_runtime parameter.

Using this new feature:

/* change policy to SCHED_BATCH and set custom slice to 0.1ms */
chrt -v -b -T 100000 -p 0 $PID

pid $PID's current scheduling policy: SCHED_OTHER
pid $PID's current scheduling priority: 0
pid $PID's current runtime parameter: 2250000
pid $PID's new scheduling policy: SCHED_BATCH
pid $PID's new scheduling priority: 0
pid $PID's new runtime parameter: 100000

Signed-off-by: Petre Tudor <petre-ionut.tudor@arm.com>
schedutils/chrt.c