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>