svn commit: r198848 - head/bin/ps

Peter Jeremy peterjeremy at acm.org
Thu Nov 12 05:06:04 UTC 2009


On 2009-Nov-11 23:22:36 +1100, Bruce Evans <brde at optusnet.com.au> wrote:
>On Fri, 6 Nov 2009, Xin LI wrote:
>> Will it sound reasonable to divide pcpu by ncpu and cap the number at 100?
>
>I don't like that.  It would break scripts even more than units changes.
>It is hard for users to interpret too.  Suddenly, processes taking
>100% of 1 CPU would take 12.5% of 8 CPUs on a system with 8 CPUs, and
>different %CPU on systems with a different number of CPUs.

Solaris does this.  I found it particularly annoying for identifying
spinning, single-threaded processes - it's not as immediately obvious
that 1.6% CPU means a spinning process on a T5000, and the granularity
gets worse.

>Just print %CPU in %4.0f format when it is >= 99.5 (or whatever rounds
>to 100.0).  This works up to 999.5 %CPU.

Actually, %4.0f works up to 9999.5 %CPU because there's no '.' in the
result.  I think this is an excellent solution.  And since FreeBSD
currently has a hard limit of 64 CPUs, it's unlikely to be exceeded
for a while.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20091112/58c98939/attachment.pgp


More information about the svn-src-all mailing list