All of lore.kernel.org
 help / color / mirror / Atom feed
* Difference in priority
@ 2004-10-11 12:17 Ankit Jain
  2004-10-11 12:35 ` Con Kolivas
  0 siblings, 1 reply; 12+ messages in thread
From: Ankit Jain @ 2004-10-11 12:17 UTC (permalink / raw)
  To: linux

hi

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

thanks

ankit

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-11 12:17 Difference in priority Ankit Jain
@ 2004-10-11 12:35 ` Con Kolivas
  2004-10-11 12:43   ` Con Kolivas
  0 siblings, 1 reply; 12+ messages in thread
From: Con Kolivas @ 2004-10-11 12:35 UTC (permalink / raw)
  To: Ankit Jain; +Cc: linux

Ankit Jain wrote:
> hi
> 
> 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.

Con

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-11 12:35 ` Con Kolivas
@ 2004-10-11 12:43   ` Con Kolivas
  2004-10-12  9:28     ` Ankit Jain
  0 siblings, 1 reply; 12+ messages in thread
From: Con Kolivas @ 2004-10-11 12:43 UTC (permalink / raw)
  Cc: Ankit Jain, linux

Con Kolivas wrote:
> Ankit Jain wrote:
> 
>> hi
>>
>> 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.

That should read dynamic priority-60 in the PRI column.

Cheers,
Con

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-11 12:43   ` Con Kolivas
@ 2004-10-12  9:28     ` Ankit Jain
  2004-10-12 10:40       ` Con Kolivas
  0 siblings, 1 reply; 12+ messages in thread
From: Ankit Jain @ 2004-10-12  9:28 UTC (permalink / raw)
  To: Con Kolivas; +Cc: linux

Sorry but iu could not get why are you adding and
subtracting this 60 in priorities. that corelation i
had also got but could not understrand whats this 60?
and also what is this dynamic priority? hows different
from normal priority

thanks

ankit
 --- Con Kolivas <kernel@kolivas.org> wrote: 
> Con Kolivas wrote:
> > Ankit Jain wrote:
> > 
> >> hi
> >>
> >> 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.
> 
> That should read dynamic priority-60 in the PRI
> column.
> 
> Cheers,
> Con
>  

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-12  9:28     ` Ankit Jain
@ 2004-10-12 10:40       ` Con Kolivas
  0 siblings, 0 replies; 12+ messages in thread
From: Con Kolivas @ 2004-10-12 10:40 UTC (permalink / raw)
  To: Ankit Jain; +Cc: linux

[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]

Ankit Jain wrote:
> Sorry but iu could not get why are you adding and
> subtracting this 60 in priorities. that corelation i
> had also got but could not understrand whats this 60?
> and also what is this dynamic priority? hows different
> from normal priority

Dynamic priority is the current priority the scheduler has allocated to 
a task. It uses it to decide which task to go next; the lower the number 
the better it's priority so it goes first. The subtracting 100 and 60 is 
just what the userspace tools do to represent an obviously complicated 
value.

Please don't top post. It makes it hard to respond appropriately and 
follow email threads.

Cheers,
Con
> 
> thanks
> 
> ankit
>  --- Con Kolivas <kernel@kolivas.org> wrote: 
> 
>>Con Kolivas wrote:
>>
>>>Ankit Jain wrote:
>>>
>>>
>>>>hi
>>>>
>>>>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.
>>
>>That should read dynamic priority-60 in the PRI
>>column.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-13  5:08       ` Randy.Dunlap
@ 2004-10-13  5:39         ` Lee Revell
  0 siblings, 0 replies; 12+ messages in thread
From: Lee Revell @ 2004-10-13  5:39 UTC (permalink / raw)
  To: Randy.Dunlap
  Cc: Albert Cahalan, Con Kolivas, linux-kernel mailing list,
	ankitjain1580, Ingo Molnar, rml

On Wed, 2004-10-13 at 01:08, Randy.Dunlap wrote:
> Lee Revell wrote:
> > On Tue, 2004-10-12 at 21:17, Albert Cahalan wrote:
> > 
> >>I can't see why the RT priority range would be increased.
> >>It's overkill already, especially since Linux doesn't have
> >>priority inheritance. Since POSIX requires 32 levels, that
> >>is the right number. Actually using more than one level
> >>(remember: NO priority inheritance) might not be wise.
> > 
> > 
> > Linux will probably have priority inheritance soon.  See the "Real Time
> > Kernel" thread.
> 
> Is that opinion based any on this article and Linus's comments in it?
> 
> http://news.com.com/A+new+direction+for+Linux+for+gadgets/2100-7344_3-5406291.html?tag=cd.top
> 

No, but priority inheritance is not the same as making Linux an RTOS.

Lee


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-13  4:58     ` Lee Revell
@ 2004-10-13  5:08       ` Randy.Dunlap
  2004-10-13  5:39         ` Lee Revell
  0 siblings, 1 reply; 12+ messages in thread
From: Randy.Dunlap @ 2004-10-13  5:08 UTC (permalink / raw)
  To: Lee Revell
  Cc: Albert Cahalan, Con Kolivas, linux-kernel mailing list,
	ankitjain1580, Ingo Molnar, rml

Lee Revell wrote:
> On Tue, 2004-10-12 at 21:17, Albert Cahalan wrote:
> 
>>I can't see why the RT priority range would be increased.
>>It's overkill already, especially since Linux doesn't have
>>priority inheritance. Since POSIX requires 32 levels, that
>>is the right number. Actually using more than one level
>>(remember: NO priority inheritance) might not be wise.
> 
> 
> Linux will probably have priority inheritance soon.  See the "Real Time
> Kernel" thread.

Is that opinion based any on this article and Linus's comments in it?

http://news.com.com/A+new+direction+for+Linux+for+gadgets/2100-7344_3-5406291.html?tag=cd.top


-- 
~Randy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  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
  1 sibling, 1 reply; 12+ messages in thread
From: Lee Revell @ 2004-10-13  4:58 UTC (permalink / raw)
  To: Albert Cahalan
  Cc: Con Kolivas, Albert Cahalan, linux-kernel mailing list,
	ankitjain1580, Ingo Molnar, rml

On Tue, 2004-10-12 at 21:17, Albert Cahalan wrote:
> I can't see why the RT priority range would be increased.
> It's overkill already, especially since Linux doesn't have
> priority inheritance. Since POSIX requires 32 levels, that
> is the right number. Actually using more than one level
> (remember: NO priority inheritance) might not be wise.

Linux will probably have priority inheritance soon.  See the "Real Time
Kernel" thread.

Lee


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-13  1:17   ` Albert Cahalan
@ 2004-10-13  1:26     ` Con Kolivas
  2004-10-13  4:58     ` Lee Revell
  1 sibling, 0 replies; 12+ messages in thread
From: Con Kolivas @ 2004-10-13  1:26 UTC (permalink / raw)
  To: Albert Cahalan
  Cc: Con Kolivas, Albert Cahalan, linux-kernel mailing list,
	ankitjain1580, mingo, rml

Albert Cahalan writes:

> On Tue, 2004-10-12 at 20:15, Con Kolivas wrote:
>> Albert Cahalan writes:
>> 
>> > 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 can't say I've ever felt strongly about it. Wish I knew what was the best 
>> way. If we change the range of RT priority range by increasing it from 100 
>> to say 1000 then any arbitrary value to subtract will be wrong. How about 
>> just leaving the absolute dynamic priority value? Then we don't have any 
>> negative values confusing it, it isn't affected by increasing the range of 
>> RT priorities, and better priority values still are lower in value.
> 
> That's not convincing enough to overcome inertia.
> 
> I can't see why the RT priority range would be increased.
> It's overkill already, especially since Linux doesn't have
> priority inheritance. Since POSIX requires 32 levels, that
> is the right number. Actually using more than one level
> (remember: NO priority inheritance) might not be wise.
> If we stuck to 32 levels, RT and non-RT could both fit
> within a 2-digit positive number. Also, there'd be fewer
> bits for the scheduler to examine.

As I said; I don't feel strongly. There was an option to change the range of 
real time priorities in 2.4 which is why I mention it. Let others speak 
cause I care not what you do as long as we understand it. I'm not changing 
the scheduler to suit userspace tools.

Cheers,
Con

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-13  0:15 ` Con Kolivas
@ 2004-10-13  1:17   ` Albert Cahalan
  2004-10-13  1:26     ` Con Kolivas
  2004-10-13  4:58     ` Lee Revell
  0 siblings, 2 replies; 12+ messages in thread
From: Albert Cahalan @ 2004-10-13  1:17 UTC (permalink / raw)
  To: Con Kolivas
  Cc: Albert Cahalan, linux-kernel mailing list, ankitjain1580, mingo, rml

On Tue, 2004-10-12 at 20:15, Con Kolivas wrote:
> Albert Cahalan writes:
> 
> > 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 can't say I've ever felt strongly about it. Wish I knew what was the best 
> way. If we change the range of RT priority range by increasing it from 100 
> to say 1000 then any arbitrary value to subtract will be wrong. How about 
> just leaving the absolute dynamic priority value? Then we don't have any 
> negative values confusing it, it isn't affected by increasing the range of 
> RT priorities, and better priority values still are lower in value.

That's not convincing enough to overcome inertia.

I can't see why the RT priority range would be increased.
It's overkill already, especially since Linux doesn't have
priority inheritance. Since POSIX requires 32 levels, that
is the right number. Actually using more than one level
(remember: NO priority inheritance) might not be wise.
If we stuck to 32 levels, RT and non-RT could both fit
within a 2-digit positive number. Also, there'd be fewer
bits for the scheduler to examine.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
  2004-10-12  0:57 Albert Cahalan
@ 2004-10-13  0:15 ` Con Kolivas
  2004-10-13  1:17   ` Albert Cahalan
  0 siblings, 1 reply; 12+ messages in thread
From: Con Kolivas @ 2004-10-13  0:15 UTC (permalink / raw)
  To: Albert Cahalan
  Cc: linux-kernel mailing list, kernel, ankitjain1580, mingo, rml

Albert Cahalan writes:

> 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 can't say I've ever felt strongly about it. Wish I knew what was the best 
way. If we change the range of RT priority range by increasing it from 100 
to say 1000 then any arbitrary value to subtract will be wrong. How about 
just leaving the absolute dynamic priority value? Then we don't have any 
negative values confusing it, it isn't affected by increasing the range of 
RT priorities, and better priority values still are lower in value.

Cheers,
Con


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Difference in priority
@ 2004-10-12  0:57 Albert Cahalan
  2004-10-13  0:15 ` Con Kolivas
  0 siblings, 1 reply; 12+ messages in thread
From: Albert Cahalan @ 2004-10-12  0:57 UTC (permalink / raw)
  To: linux-kernel mailing list; +Cc: kernel, ankitjain1580, mingo, rml

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-10-13  5:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 12:17 Difference in priority 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
2004-10-12  0:57 Albert Cahalan
2004-10-13  0:15 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.