Re: [PATCH v2] chrt: Make priority optional for policies that don't use it

Benno Schulenberg <[email protected]>
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
Op 17-06-2025 om 20:24 schreef Madadi Vineeth Reddy:
> 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.

Doesn't this alter the "show-the-current-policy-and-priority" behavior
when no priority is given?  Currently `./chrt --help` says (trimmed):

   Set policy:
    chrt [options] --pid <priority> <pid>

   Get policy:
    chrt [options] -p <pid>


Without the proposed change, running `chrt --other --pid $$` says:

   pid 1427's current scheduling policy: SCHED_OTHER
   pid 1427's current scheduling priority: 0

After the change, that same command outputs nothing.  Maybe that is
fine, but it would require some adjustment of the docs.


Benno
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmhSdlUFAwAAAAAACgkQUUu+Lrjhlh9c
Gg/7BXKDK3J/fZDeicAkxWA9IMqOg8/ygG37Mo1Vi7rUiNGpmKKsfKQF4rnu3yP9oE3z270zeHD/
6IV5aDXpvX4qcO1rz6sL4KvL0GnGmcnTJSIHMqGxHvEZ5+TSogeJTqP+876F32jYhKTZ5iJn+8YF
gls9+J4ZwuZBVPkML1vRwWkHB548AmJdmQw1cP7Jxbahs0NY/HLGUKgHjisoWmFuJPKyL2LgQAGt
PxEZFnCC+4PJ/k+K3EvlSaN9Qm0eA09KhOIm9ujdYchz3RnNRE3GbcOxuo/xkBeKK0pLuGen8/Ck
x6iH25tK5UJv7WWVcCF5obpOCyQIHbS8u7olmlSECsZ22qAyUYUc2HKv2BYiEQnHGIhcUffHtp8l
Dxtvn1A9ZhfKRk4BXR0WNcEMNv/+j7gU8hrfHJnl6qXizZhM4o2aH5UEhZMHkblfecC6J6Ov4SuF
nk31xkZjtDnUxNj+HKCG7ST4fCpvlaXn6ol0JmxHNqzTw9CxLwqd/sPV3Q2TOoGBp5f9nA1N+6yD
tRTv4Gc7g/2KypvN8cKiXCWnTf5D79ZTHHwfKcF8ocCgJOAcVHi8nSbaZNblOoukKBer7iwP4nzA
cV+Er3+ePWJvlcw7Zft4obYaYaureA8M33vEQJO86dCoGnHbiGi5at32T+tpX5eashtGNN2IBUSO
yjM=
=BtJ6
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.