]> git.ipfire.org Git - thirdparty/util-linux.git/commit
chrt: Make priority optional for policies that don't use it
authorMadadi Vineeth Reddy <vineethr@linux.ibm.com>
Sat, 21 Jun 2025 19:50:48 +0000 (01:20 +0530)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Jun 2025 11:22:25 +0000 (13:22 +0200)
commite7a2d62434c22e8de16dcbbeb7b57b0cdcf4bb9a
tree7b280c0a1ff38a5f5d0be86f15997e22b4b69b9d
parent13346d4d28cd4873e8aad991866e1d1e22861efc
chrt: Make priority optional for policies that don't use it

Currently, chrt requires a priority argument even for scheduling
policies like SCHED_OTHER and SCHED_BATCH, which ignore it.

This change relaxes that requirement. Now, priority is only expected
for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
is set internally and no argument is required on the command line.

This simplifies usage when modifying runtime parameters like
--sched-runtime for non-realtime tasks.

For example, to change the EEVDF tunable base_slice, one currently
needs to run:
chrt -o -T 1000000 --pid 0 $PID

Passing '0' after --pid is not intutive and not required as priority
is not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
chrt -o -T 1000000 --pid $PID

Passing '0' still works ensuring ABI doesn't break.

Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
schedutils/chrt.1.adoc
schedutils/chrt.c