Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 May 2014 10:43:56 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>, John Baldwin <jhb@freebsd.org>
Subject:   Re: Change top's notion of idle processes / threads
Message-ID:  <CAPyFy2B-C-Lm0EtvrHHVcgr_S-Q3oTEkPVVb1TjEuj21jkFg=Q@mail.gmail.com>
In-Reply-To: <CAPyFy2B1agRySh_ceqcaAM2SR=7LbVvscDQEe524HJeY2ha%2BNg@mail.gmail.com>
References:  <201405231605.26312.jhb@freebsd.org> <537FBC1F.6030408@freebsd.org> <53819789.8030304@FreeBSD.org> <CAPyFy2B1agRySh_ceqcaAM2SR=7LbVvscDQEe524HJeY2ha%2BNg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 26 May 2014 11:51, Ed Maste <emaste@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 said, I've discovered an issue with the change after using it a
bit more, when using -I on the command line.  (Previously I only tried
it by pressing I in interactive mode.)  With the change top -I lists
all processes at first (which is a little annoying), but it renders -I
ineffective when used with -b (batch mode).

What do you think about this additional change, so that we use the
previous 0% idleness test for the first iteration of the list:

 if (oldp == NULL)
- return (pp->ki_runtime != 0);
+ return (pp->ki_pctcpu != 0);

-Ed



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2B-C-Lm0EtvrHHVcgr_S-Q3oTEkPVVb1TjEuj21jkFg=Q>