From: Albert Cahalan <albert@users.sf.net>
To: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Cc: kernel@kolivas.org, ankitjain1580@yahoo.com, mingo@elte.hu,
rml@tech9.net
Subject: Re: Difference in priority
Date: 11 Oct 2004 20:57:31 -0400 [thread overview]
Message-ID: <1097542651.2666.7860.camel@cube> (raw)
Con Kolivas writes:
> Ankit Jain wrote:
>> if somebody knows the difference b/w /PRI of both
>> these commands because both give different results
>>
>> ps -Al
>> & top
>>
>> as per priority rule we can set priority upto 0-99
>> but top never shows this high priority
>
> Priority values 0-99 are real time ones and 100-139 are normal
> scheduling ones. RT scheduling does not change dynamic priority while
> running wheras normal scheduling does (between 100-139). top shows the
> value of the current dynamic priority in the PRI column as the current
> dynamic priority-100. If you have a real time task in top it shows as a
> -ve value. ps -Al seems to show the current dynamic priority+60.
What would you like to see? There are numerous
competing ideas of reality. There's also the matter
of history and standards. I'd gladly "fix" ps, if
people could agree on what "fix" would mean.
Various desirable but conflicting traits include:
a. for normal idle processes, PRI matches NI
b. for RT processes, PRI matches RT priority
c. for RT processes, PRI is negative of RT priority
d. PRI is the unmodified value seen in /proc
e. PRI is never negative
f. low PRI is low priority (SysV "pri" keyword)
g. low PRI is high priority (UNIX "PRI", SysV "opri")
h. PRI matches some kernel-internal value
i. PRI is in the range -99 to 999 (not too wide)
I had originally tried to match up with Solaris and
a few other systems, but that's looking hopeless.
I intend to change to something sane, perhaps even
making the PRI of "-o pri" be the same as that of "-l".
Currently I don't even try to document PRI.
It is good to keep the value narrow. I really wish
we didn't have so many RT levels; POSIX only requires
that there be 32. A simple 0..99 value would be great.
Here is what I have in my current code, with the
headers edited so they won't be confusing. Note
that the left two versions ("aaa" and "bbb") are
similar to the traditional SysV "pri", but the new
POSIX and UNIX standard makes them unsuitable for use
as the "PRI" displayed by "ps -l". It is common to
generate the "PRI" of "ps -l" via an "opri" keyword.
$ LD_LIBRARY_PATH=../../proc ../../ps/ps -t pts/8 --sort=-priority -o stat,pri,pri_api,rtprio,pri_bar,priority,pri_baz,opri,pri_foo,ni,cls,sched,comm
STAT aaa bbb RTPRIO ccc ddd eee fff ggg NI CLS SCH COMMAND
SN 0 -40 - 40 39 139 99 19 19 TS 0 setpriority19
Ss+ 23 -17 - 17 16 116 76 -4 0 TS 0 bash
S< 39 -1 - 1 0 100 60 -20 -20 TS 0 setpriority-20
S 41 1 1 -1 -2 98 58 -22 - RR 2 min_rr
S 139 99 99 -99 -100 0 -40 -120 - FF 1 max_fifo
next reply other threads:[~2004-10-12 1:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-12 0:57 Albert Cahalan [this message]
2004-10-13 0:15 ` Difference in priority Con Kolivas
2004-10-13 1:17 ` Albert Cahalan
2004-10-13 1:26 ` Con Kolivas
2004-10-13 4:58 ` Lee Revell
2004-10-13 5:08 ` Randy.Dunlap
2004-10-13 5:39 ` Lee Revell
-- strict thread matches above, loose matches on Subject: below --
2004-10-11 12:17 Ankit Jain
2004-10-11 12:35 ` Con Kolivas
2004-10-11 12:43 ` Con Kolivas
2004-10-12 9:28 ` Ankit Jain
2004-10-12 10:40 ` Con Kolivas
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=1097542651.2666.7860.camel@cube \
--to=albert@users.sf.net \
--cc=ankitjain1580@yahoo.com \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rml@tech9.net \
/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