Re: nice question (pun optional)

Brad Spencer <[email protected]> Thu, 09 Jun 2022 12:05:51 -0400
Newsgroups gmane.os.netbsd.ports.x86-64
Message-ID <[email protected]>
Andy Ruhl <[email protected]> writes:

> On Thu, Jun 9, 2022 at 5:04 AM Steve Blinkhorn <[email protected]> wrote:
>>
>> I have a process that I want to run at the highest possible priority.
>> Tt curr4ently runs with NICE set at 0 and PRI showing at 43.  Most
>> other swtuff shows up with a PRI at 85.  As I understand things, the
>> highest priority is 0.
>>
>> So I use renice(1) to set NICE to -20, which is the highest priority,
>> but the value of PRI goes from 43 to 63, i.e. a lower priority.
>>
>> This happens regardless of which shell I use, BTW.
>>
>> What's going on, or what am I misunderstanding?
>
> - is incrementing lower, + increments higher (higher priority). 0 is
> highest. Any process with a nice number larger than 0 is a lower
> priority. According to top, almost every process on my system is at
> nice 0.
>
> Andy


You can also change which scheduling algorithm a process uses with
schedctl.  I run some stuff with SCHED_FIFO and a priority of 63 which,
as I understand it, makes the process run "real time" (quoting the man
page for schedctl).




-- 
Brad Spencer - [email protected] - KC8VKS - http://anduin.eldar.org