'ps aux' odditiy

Garance A Drosihn drosih at rpi.edu
Wed Jun 9 02:21:26 GMT 2004


At 3:51 PM -0700 6/8/04, Kyle Mott wrote:
>I just finished doing a buildworld in multi-user mode (which seemed
>to work OK... though only time will tell :D) to RELENG_4. However,
>when I run 'ps aux', the output seems to be inverted... IE processes
>with lower PID's are on the bottom. Is this normal? Here's an example:
>
>
>USER     PID %CPU %MEM   VSZ  RSS
>root   33444 77.7  3.5 13640 ...
>root   33443  4.2  0.4  1696 ...
>root   33442  0.0  0.1   308 ...
>root   33440  0.0  0.1   664 ...
>root   33438  0.0  0.1   636 ...

 From the man page, `u' implies `-r', which means "sort by CPU time".

Processes with the exact same CPU time will be sorted by PID, as
you were expecting.  It used to be that processes with "close to
the same CPU time" were treated as being exactly the same (due to
round-off error), and thus it used be much more likely to see many
processes listed in PID order.

It's possible that there's some bug there, but the last time I
looked into this it seemed to be doing the right thing.  I plan
to look into it again, because someone else has reported that
there might be a bug in there.

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-stable mailing list