]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Second stage of unbreaking thr formatting of the NICE field: decode the
authorbde <bde@FreeBSD.org>
Tue, 7 Nov 2006 10:03:10 +0000 (10:03 +0000)
committerbde <bde@FreeBSD.org>
Tue, 7 Nov 2006 10:03:10 +0000 (10:03 +0000)
commit95c27ab84543d6ba156210ab6d05810088b45bdb
tree4d842ebe0e0758342d5076e14cf6e5969044db21
parentb9e58fd6df40d5bbf4849d4c63f24af7956796d5
Second stage of unbreaking thr formatting of the NICE field: decode the
priority class and use this to:

- print "-" instead of a garbage value for ithreads.  Print "-" instead
  of the unused nice value for kthreads which are (mis)classified as
  PRI_TIMESHARE.  For such threads, the nice value can be set to nonzero
  by root, but it is never used (at least by the 4bsd scheduler).  For
  ithreads, we didn't even print the unused value.

- print "i<priority>" and "r<priority>" instead of a biased "<priority>"
  for idletime and realtime threads,  Here <priority> is the priority
  parameter to idprio/rtprio(1).  Just add the prefix and remove the
  bias for now.  <priority> has been stored indirectly in the kernel
  since 2001/02/12, and even the kernel cannot recover the original
  value in all cases.  Here we need to handle more cases than pri_to_rtp(),
  but actually handle fewer cases, and end up printing garbage after
  a thread changes its current priority while in the kernel.

- for idletime and realtime threads, if they are kthreads then add a prefix
  of "k" to the previous string.

- for idletime and realtime threads, if they in the FIFO scheduling class
  then add a suffix of "F" to the previous string (if it fits; the other
  parts of the string are sure to fit unless <priority> is garbage).
usr.bin/top/machine.c