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)