From owner-freebsd-current@FreeBSD.ORG Fri May 30 17:32:38 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 680DAA69; Fri, 30 May 2014 17:32:38 +0000 (UTC) Received: from mail.feld.me (mail.feld.me [66.170.3.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.feld.me", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEA692E00; Fri, 30 May 2014 17:32:37 +0000 (UTC) Received: from mail.feld.me (mail.feld.me [66.170.3.6]); by mail.feld.me (OpenSMTPD) with ESMTP id aa585e42; Fri, 30 May 2014 12:32:33 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=feld.me; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:sender; s= blargle2; bh=cqkmcfb/3HBqrYFeVT8dqX6tyoQ=; b=RBJzOYswl/Xfjzf5ECt vdPHzS/wbxgGD5LcyKLxv80xuNX8nLXibALECE2pebIyZj3cVsCd1t/S51ufThs1 JGVJFLHaBnPZ7V2I+qp+aYQMqtX+vVe/ZnvbHeLY609xNXVQ2DUPbs7oSCeDaXW/ L9viXoJmulbdXehujzxkxr6IGdVNUbLPSZKo61frnBA+qlOIjG7BlAqIBPk3PqGV odzh/fRgvEUg3Css/ZghTQiiQqYOP9Ds4RCok7YqAoWFi0EoV2YRot8fqbCzGRzl xIVbD7k/He6fI4dHJOv53FE+xDiMTPDfP0VCHfJ7ALlk1Pe2ybJdWGDcCAFGiNSp eUg== DomainKey-Signature: a=rsa-sha1; c=nofws; d=feld.me; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:sender; q= dns; s=blargle2; b=iCcKQD9QR9Gv7eI7N4nWpGTjbaivfGzphE8KIxT6vNkSP rBHuUeTzovf+3gdrG/kPW4kWPNDOPfv2UOcNo792Cv3snB2XvXaUHdb2EBZVHoeS 2ZJ0Von2M04sqA5ZcM3Dt0bFBr2sYrHXuT0x9Kh13h+z66vx1ng4HdljZykcrLMy M+IW7E+GpBPtlGNGAvuXPgsGpt1g+73rFPGCZotpiP5jwfl5dydP47bWwH60qPuD BBju9G8SP0LlymiWImBhy2iEN3t55Mscz4lJiWuFOFrcBvT80wU2wV8SnECneY8d 3Rit8gBldh9/DCkIlKiK8KVLywd8IwNv7R8w5OWhA== Received: from mail.feld.me (mail.feld.me [66.170.3.6]); by mail.feld.me (OpenSMTPD) with ESMTP id 9b151382; Fri, 30 May 2014 12:32:33 -0500 (CDT) Received: from feld@feld.me by mail.feld.me (Archiveopteryx 3.2.0) with esmtpa id 1401471152-323-320/5/20; Fri, 30 May 2014 17:32:32 +0000 Content-Type: text/plain Mime-Version: 1.0 Subject: Re: Change top's notion of idle processes / threads From: Mark Felder In-Reply-To: <201405301724.s4UHOHQ0054918@catnip.dyslexicfish.net> Date: Fri, 30 May 2014 12:32:31 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <919863EE-CE69-4C36-8F0E-EFDCC3DF9B3C@FreeBSD.org> 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> To: Jamie Landeg-Jones X-Mailer: Apple Mail (2.1878.2) Sender: feld@feld.me Cc: freebsd-current@freebsd.org, emaste@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, 30 May 2014 17:32:38 -0000 On May 28, 2014, at 9:54, John Baldwin 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%)