Date: Fri, 30 May 2014 12:32:31 -0500 From: Mark Felder <feld@freebsd.org> To: Jamie Landeg-Jones <jamie@dyslexicfish.net> Cc: freebsd-current@freebsd.org, emaste@freebsd.org Subject: Re: Change top's notion of idle processes / threads Message-ID: <919863EE-CE69-4C36-8F0E-EFDCC3DF9B3C@FreeBSD.org> In-Reply-To: <201405301724.s4UHOHQ0054918@catnip.dyslexicfish.net> References: <201405231605.26312.jhb@freebsd.org> <201405271637.23332.jhb@freebsd.org> <201405281220.s4SCKZcn023546@catnip.dyslexicfish.net> <201405281054.04691.jhb@freebsd.org> <201405301724.s4UHOHQ0054918@catnip.dyslexicfish.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On May 28, 2014, at 9:54, John Baldwin <jhb@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. >=20 > Ok, try people.freebsd.org/~jhb/patches/top_pctcpu2.patch >=20 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%)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?919863EE-CE69-4C36-8F0E-EFDCC3DF9B3C>