From: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] chrt: Make priority optional for policies that don't use it
Date: Tue, 17 Jun 2025 22:34:52 +0530 [thread overview]
Message-ID: <f56c22e3-c855-46ef-af98-befdbed34e7d@linux.ibm.com> (raw)
In-Reply-To: <4kuoetpvezrzurjsgbu37jngbu5qteqowcdvukhoh6jlz3rcso@jr2ofz4ddfwm>
Hi Karel,
On 17/06/25 17:35, Karel Zak wrote:
> On Mon, Jun 16, 2025 at 12:52:18AM +0530, Madadi Vineeth Reddy wrote:
>> 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 -v -o -T 1000000 -p 0 $PID
>>
>> Passing '0' after -p is not intutive and not required as priority is
>> not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
>> chrt -v -o -T 1000000 -p $PID
>>
>> Passing '0' still works ensuring ABI doesn't break.
>
> Looks good. It would be nice to update the man page and add a note
> that -p is not required since util-linux v2.42.
>
I believe you meant that the priority argument is not required for some
scheduling policies. The -p / --pid option is still required.
I’ll update the man page accordingly.
>> + bool policy_needs_priority = (ctl->policy == SCHED_FIFO || ctl->policy == SCHED_RR);
>
> Nitpicking... can't we use a shorter name, for example "need_prio"? ;-)
Sure, will update it in v2. Thanks for taking a look.
Thanks,
Madadi Vineeth Reddy
>
> Karel
>
prev parent reply other threads:[~2025-06-17 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-15 19:22 [PATCH] chrt: Make priority optional for policies that don't use it Madadi Vineeth Reddy
2025-06-17 12:05 ` Karel Zak
2025-06-17 17:04 ` Madadi Vineeth Reddy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f56c22e3-c855-46ef-af98-befdbed34e7d@linux.ibm.com \
--to=vineethr@linux.ibm.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).