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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 18, 2025 at 11:18:18AM +0200, Karel Zak wrote:
> On Wed, Jun 18, 2025 at 10:18:29AM +0200, Benno Schulenberg wrote:
> > 
> > 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):
>  
> Very good point. The priority policy (--{other,...}) should be
> required to ensure that the user wants to alter the setting rather
> than print the current situation. Madadi, what do you think?

Ah, I now read Benno's note more carefully. The code just silently ignores  
policy when priority is not specified.

$ chrt --fifo --pid $$  
pid 994013's current scheduling policy: SCHED_OTHER  
pid 994013's current scheduling priority: 0

This is ugly. The question is how important it is to support this for  
backward compatibility. I'd assume that users use "chrt --pid $$" to get  
the current setting.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux