Change top's notion of idle processes / threads

Mark Felder feld at freebsd.org
Fri May 30 17:32:38 UTC 2014


On May 28, 2014, at 9:54, John Baldwin <jhb at freebsd.org> wrote:

> Yes, I actually started by sorting on the raw delta and ended up going back and fixing
> pctcpu instead.  However, there is a problem in this case which is that you
> still want to fall back to ki_pctcpu if you don't have a valid previous delta
> to compare against.  It's a lot simpler to just fixup ki_pctcpu and not have to go
> change the sorting code explicitly. :(  I actually started out having a function that
> returned a double for the pctcpu, but that would mean recalculating the raw pctcpu
> many, many times during the sort.  Just updating ki_pctcpu once per each process/thread
> per fetch scales a bit better.  I could perhaps use an array to cache raw percentages
> as doubles.
> 
> Ok, try people.freebsd.org/~jhb/patches/top_pctcpu2.patch
> 

Hey, all the 0.00% processes on my server now show up in top with measurable usage. Nice. (They're all between 0.3% and 0.9%)


More information about the freebsd-current mailing list