From owner-freebsd-current@FreeBSD.ORG Fri May 23 21:34:11 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFE74B33 for ; Fri, 23 May 2014 21:34:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0ACC28CA for ; Fri, 23 May 2014 21:34:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 64906B94B; Fri, 23 May 2014 17:34:09 -0400 (EDT) From: John Baldwin To: "Poul-Henning Kamp" Subject: Re: Change top's notion of idle processes / threads Date: Fri, 23 May 2014 17:32:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405231605.26312.jhb@freebsd.org> <9764.1400877579@critter.freebsd.dk> In-Reply-To: <9764.1400877579@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201405231732.16403.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 May 2014 17:34:09 -0400 (EDT) Cc: "current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 21:34:12 -0000 On Friday, May 23, 2014 4:39:39 pm Poul-Henning Kamp wrote: > In message <201405231605.26312.jhb@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 ? Hmmm, possibly. ki_runtime in the kernel is basically TSC counts and gets updated on each context switch. OTOH, I think the exported version only has microsecond granularity which is probably too small. :( I can try your suggestion. -- John Baldwin