Re: Change top's notion of idle processes / threads

2014-05-30 Thread Jamie Landeg-Jones
John Baldwin j...@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

Re: Change top's notion of idle processes / threads

2014-05-30 Thread Mark Felder
On May 28, 2014, at 9:54, John Baldwin j...@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

Re: Change top's notion of idle processes / threads

2014-05-28 Thread Jamie Landeg-Jones
John, the changes are good. The 'trickling' but still not idle processes now show up as they should. However, it has exposed one quirk in the display: Sorting is done by WCPU followed by total processor time. Processes which aren't idle (but are using so little cpu it shows as 0.00%) show

Re: Change top's notion of idle processes / threads

2014-05-28 Thread John Baldwin
On Sunday, May 25, 2014 3:11:05 am Kubilay Kocak wrote: On 24/05/2014 7:22 AM, Allan Jude wrote: On 2014-05-23 16:05, John Baldwin wrote: Right now, when top is set to not display idle processes or threads, it only displays processes or threads that are currently in a runnable state or

Re: Change top's notion of idle processes / threads

2014-05-28 Thread John Baldwin
On Wednesday, May 28, 2014 8:20:35 am Jamie Landeg-Jones wrote: John, the changes are good. The 'trickling' but still not idle processes now show up as they should. However, it has exposed one quirk in the display: Sorting is done by WCPU followed by total processor time. Processes

Re: Change top's notion of idle processes / threads

2014-05-28 Thread John Baldwin
On Friday, May 23, 2014 4:39:39 pm Poul-Henning Kamp wrote: In message 201405231605.26312@freebsd.org, John Baldwin writes: In essence, top will consider any thread that has run on a CPU since the last update as non-idle. Sounds a lot more usable than the current heuristic.

Re: Change top's notion of idle processes / threads

2014-05-27 Thread Ed Maste
On 26 May 2014 11:51, Ed Maste ema...@freebsd.org wrote: The change in the patch is good, the new behaviour is much more usable. Note that we don't currently define idle in top(8); for this change maybe we should just state that non-idle processes may report 0% CPU due to rounding. That

Re: Change top's notion of idle processes / threads

2014-05-27 Thread John Baldwin
On Tuesday, May 27, 2014 10:43:56 am Ed Maste wrote: On 26 May 2014 11:51, Ed Maste ema...@freebsd.org wrote: The change in the patch is good, the new behaviour is much more usable. Note that we don't currently define idle in top(8); for this change maybe we should just state that

Re: Change top's notion of idle processes / threads

2014-05-26 Thread Ed Maste
On 25 May 2014 03:11, Kubilay Kocak ko...@freebsd.org wrote: On 24/05/2014 7:22 AM, Allan Jude wrote: I think this makes good sense. I would definitely prefer it. Would it make sense to maybe preserve the old behaviour behind a command line flag? And an update to top(8) reflecting the algo

Re: Change top's notion of idle processes / threads

2014-05-25 Thread Kubilay Kocak
On 24/05/2014 7:22 AM, Allan Jude wrote: On 2014-05-23 16:05, John Baldwin wrote: Right now, when top is set to not display idle processes or threads, it only displays processes or threads that are currently in a runnable state or have a non-zero %cpu. However, our %cpu is quite

Change top's notion of idle processes / threads

2014-05-23 Thread John Baldwin
Right now, when top is set to not display idle processes or threads, it only displays processes or threads that are currently in a runnable state or have a non-zero %cpu. However, our %cpu is quite imprecise. I have patch to change top to instead compare the thread or processes runtime

Re: Change top's notion of idle processes / threads

2014-05-23 Thread Eric van Gyzen
On 05/23/2014 15:05, John Baldwin wrote: Right now, when top is set to not display idle processes or threads, it only displays processes or threads that are currently in a runnable state or have a non-zero %cpu. However, our %cpu is quite imprecise. I have patch to change top to instead

Re: Change top's notion of idle processes / threads

2014-05-23 Thread Poul-Henning Kamp
In message 201405231605.26312@freebsd.org, John Baldwin writes: In essence, top will consider any thread that has run on a CPU since the last update as non-idle. Sounds a lot more usable than the current heuristic. Wouldn't ki_rusage.ru_n[i]vcsw be more correct than ki_runtime ? --

Re: Change top's notion of idle processes / threads

2014-05-23 Thread Allan Jude
On 2014-05-23 16:05, John Baldwin wrote: Right now, when top is set to not display idle processes or threads, it only displays processes or threads that are currently in a runnable state or have a non-zero %cpu. However, our %cpu is quite imprecise. I have patch to change top to instead

Re: Change top's notion of idle processes / threads

2014-05-23 Thread John Baldwin
On Friday, May 23, 2014 4:39:39 pm Poul-Henning Kamp wrote: In message 201405231605.26312@freebsd.org, John Baldwin writes: In essence, top will consider any thread that has run on a CPU since the last update as non-idle. Sounds a lot more usable than the current heuristic.